Wrapper for nix-shell which adds persistence(protection from nix gc)
You can install nip by adding nip flake to your nixos configuration
# flake.nix
{
inputs.nip.url = "github:tsalkenov/nip"; # Add flake as input
outputs = {nixpkgs, ...} @ inputs: {
nixosConfigurations.HOSTNAME = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; }; # This is the important part
modules = [
./configuration.nix
];
};
}
}
# configuration.nix
{inputs, pkgs, ...}: {
environment.systemPackages = with pkgs; [
inputs.nip.packages.${system}.default # Add nip to package list
# Other packages
]
}
Start nix-shell in current directory and save it:
nip # Yeah that's all
Running shell in another directory:
nip /directory/with/shell
First class support
Not supported yet