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/NSMInstall globally:
nix profile install github:mdaashir/NSMbrew install mdaashir/tap/nsmDebian/Ubuntu:
curl -LO https://github.com/mdaashir/NSM/releases/latest/download/nsm_*_linux_amd64.deb
sudo dpkg -i nsm_*_linux_amd64.debRed Hat/Fedora:
sudo rpm -i https://github.com/mdaashir/NSM/releases/latest/download/nsm_*_linux_amd64.rpmAlpine:
curl -LO https://github.com/mdaashir/NSM/releases/latest/download/nsm_*_linux_amd64.apk
sudo apk add --allow-untrusted ./nsm_*_linux_amd64.apkArch 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.zstSnap:
sudo snap install nsm --classicpkg install nsmdocker run ghcr.io/mdaashir/nsm:latestDownload 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 buildOr using Go directly:
go install github.com/mdaashir/NSM@latestnsm init # Create new shell.nixnsm add gcc python3 # Add packages
nsm remove gcc # Remove packages
nsm list # List installed packagesnsm run # Enter the Nix shellnsm clean # Clean up unused packages
nsm upgrade # Update nixpkgs channel
nsm doctor # Check installation healthnsm config set default.packages "gcc python3"
nsm config get default.packagesnsm convert # Convert shell.nix to flake.nix
nsm freeze # Pin nixpkgs version
nsm info # Show system informationConfiguration 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