From fa6fd2d1c42cc7a7797c26284e7a61ddb1e4da8d Mon Sep 17 00:00:00 2001 From: iFargle Date: Tue, 19 Sep 2023 18:05:35 +0900 Subject: [PATCH] test --- lib/nkxpkgs.nix | 8 ++++++++ shell.nix | 6 +----- 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 lib/nkxpkgs.nix 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