A command-line tool to manage Nix development environments with ease.
- 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
Using flake:
nix run github:mdaashir/NSM
Install globally:
nix profile install github:mdaashir/NSM
brew install mdaashir/tap/nsm
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
pkg install nsm
docker run ghcr.io/mdaashir/nsm:latest
Download the appropriate binary for your platform from the releases page.
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
nsm init # Create new shell.nix
nsm add gcc python3 # Add packages
nsm remove gcc # Remove packages
nsm list # List installed packages
nsm run # Enter the Nix shell
nsm clean # Clean up unused packages
nsm upgrade # Update nixpkgs channel
nsm doctor # Check installation health
nsm config set default.packages "gcc python3"
nsm config get default.packages
nsm convert # Convert shell.nix to flake.nix
nsm freeze # Pin nixpkgs version
nsm info # Show system information
Configuration file is stored in $HOME/.config/NSM/config.yaml
Available settings:
default.packages
: Default packages for new environmentschannel.url
: Default Nixpkgs channel URLshell.format
: Preferred format (shell.nix/flake.nix)
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
packages = with pkgs; [
# Your packages here
gcc
python3
];
}
{
description = "Development environment";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }: {
devShell.x86_64-linux = nixpkgs.mkShell {
buildInputs = [
# Your packages here
];
};
};
}
MIT License - See LICENSE file for details
Mohamed Aashir S s.mohamedaashir@gmail.com