diff --git a/lib/nkxpkgs.nix b/lib/nkxpkgs.nix new file mode 100644 index 00000000..cfb1a6bd --- /dev/null +++ b/lib/nkxpkgs.nix @@ -0,0 +1,8 @@ +# 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 +let lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked; +in +import (fetchTarball { + url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz"; + sha256 = lock.narHash; +}) \ No newline at end of file diff --git a/shell.nix b/shell.nix index bddd07a2..4aef60ac 100644 --- a/shell.nix +++ b/shell.nix @@ -1,5 +1,4 @@ # shell.nix -with import {}; let sops-nix = builtins.fetchTarball { url = "https://github.com/Mic92/sops-nix/archive/master.tar.gz"; @@ -8,10 +7,7 @@ let in # 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; - } ) { } }: { +{ pkgs ? (import ./lib/nixpkgs.nix) { } }: { default = pkgs.mkShell { NIX_CONFIG = "experimental-features = nix-command flakes"; # imports all files ending in .asc/.gpg