diff --git a/shell.nix b/shell.nix index a8d759ac..3eb6f2b0 100644 --- a/shell.nix +++ b/shell.nix @@ -6,21 +6,22 @@ let }; lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked; in -mkShell { - import (fetchTarball { - url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz"; - sha256 = lock.narHash; - }) - NIX_CONFIG = "experimental-features = nix-command flakes"; - # imports all files ending in .asc/.gpg - sopsPGPKeyDirs = [ - "${toString ./.}/keys/hosts" - "${toString ./.}/keys/users" - ]; - nativeBuildInputs = [ - pkgs.nix - pkgs.home-manager - pkgs.git - (pkgs.callPackage sops-nix {}).sops-import-keys-hook - ]; +# A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file +# Useful to avoid using channels when using legacy nix commands +{ pkgs ? import (fetchTarball {url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz"; sha256 = lock.narHash;}); +}: { + mkShell { + NIX_CONFIG = "experimental-features = nix-command flakes"; + # imports all files ending in .asc/.gpg + sopsPGPKeyDirs = [ + "${toString ./.}/keys/hosts" + "${toString ./.}/keys/users" + ]; + nativeBuildInputs = [ + pkgs.nix + pkgs.home-manager + pkgs.git + (pkgs.callPackage sops-nix {}).sops-import-keys-hook + ]; + } } \ No newline at end of file