8000 GitHub - mdaashir/NSM: NSM (Nix Shell Manager) A powerful and user-friendly command-line tool built in Go that simplifies the management of Nix development environments. NSM streamlines the process of creating, managing, and maintaining Nix shells through an intuitive command interface.
[go: up one dir, main page]

Skip to content
/ NSM Public

NSM (Nix Shell Manager) A powerful and user-friendly command-line tool built in Go that simplifies the management of Nix development environments. NSM streamlines the process of creating, managing, and maintaining Nix shells through an intuitive command interface.

License

Notifications You must be signed in to change notification settings

mdaashir/NSM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NSM (Nix Shell Manager)

Test Release Go Report Card Go Version License

A command-line tool to manage Nix development environments with ease.

Features

  • Initialize new Nix shell environments
  • Add/remove packages easily
  • List installed packages
  • Convert between shell.nix and flake.nix
  • Run Nix shells
  • Manage Nix channel versions
  • Clean up unused packages
  • Freeze package versions for reproducibility

Installation

Using Nix (recommended)

Using flake:

nix run github:mdaashir/NSM

Install globally:

nix profile install github:mdaashir/NSM

Package Managers

macOS

brew install mdaashir/tap/nsm

Linux

Debian/Ubuntu:

curl -LO https://github.com/mdaashir/NSM/releases/latest/download/nsm_*_linux_amd64.deb
sudo dpkg -i nsm_*_linux_amd64.deb

Red Hat/Fedora:

sudo rpm -i https://github.com/mdaashir/NSM/releases/latest/download/nsm_*_linux_amd64.rpm

Alpine:

curl -LO https://github.com/mdaashir/NSM/releases/latest/download/nsm_*_linux_amd64.apk
sudo apk add --allow-untrusted ./nsm_*_linux_amd64.apk

Arch Linux:

curl -LO https://github.com/mdaashir/NSM/releases/latest/download/nsm_*_linux_amd64.pkg.tar.zst
sudo pacman -U nsm_*_linux_amd64.pkg.tar.zst

Snap:

sudo snap install nsm --classic

Android (Termux)

pkg install nsm

Docker

docker run ghcr.io/mdaashir/nsm:latest

Binary Installation

Download the appropriate binary for your platform from the releases page.

Build from source

Requirements:

  • Go 1.24 or later
  • Make (optional)
git clone https://github.com/mdaashir/NSM.git
cd NSM
make build

Or using Go directly:

go install github.com/mdaashir/NSM@latest

Usage

Initialize a New Environment

nsm init              # Create new shell.nix

Manage Packages

nsm add gcc python3   # Add packages
nsm remove gcc        # Remove packages
nsm list              # List installed packages

Development Environment

nsm run              # Enter the Nix shell

Maintenance

nsm clean            # Clean up unused packages
nsm upgrade          # Update nixpkgs channel
nsm doctor           # Check installation health

Configuration

nsm config set default.packages "gcc python3"
nsm config get default.packages

Advanced Features

nsm convert          # Convert shell.nix to flake.nix
nsm freeze           # Pin nixpkgs version
nsm info             # Show system information

Configuration

Configuration file is stored in $HOME/.config/NSM/config.yaml

Available settings:

  • default.packages: Default packages for new environments
  • channel.url: Default Nixpkgs channel URL
  • shell.format: Preferred format (shell.nix/flake.nix)

Shell File Format

shell.nix

{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  packages = with pkgs; [
    # Your packages here
    gcc
    python3
  ];
}

flake.nix (after conversion)

{
  description = "Development environment";

  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

  outputs = { self, nixpkgs }: {
    devShell.x86_64-linux = nixpkgs.mkShell {
      buildInputs = [
        # Your packages here
      ];
    };
  };
}

License

MIT License - See LICENSE file for details

Author

Mohamed Aashir S s.mohamedaashir@gmail.com

About

NSM (Nix Shell Manager) A powerful and user-friendly command-line tool built in Go that simplifies the management of Nix development environments. NSM streamlines the process of creating, managing, and maintaining Nix shells through an intuitive command interface.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •  
0