This commit is contained in:
iFargle 2023-09-19 18:05:35 +09:00
parent bb7d1a0253
commit fa6fd2d1c4
2 changed files with 9 additions and 5 deletions

8
lib/nkxpkgs.nix Normal file
View file

@ -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;
})

View file

@ -1,5 +1,4 @@
# shell.nix # shell.nix
with import <nixpkgs> {};
let let
sops-nix = builtins.fetchTarball { sops-nix = builtins.fetchTarball {
url = "https://github.com/Mic92/sops-nix/archive/master.tar.gz"; url = "https://github.com/Mic92/sops-nix/archive/master.tar.gz";
@ -8,10 +7,7 @@ let
in in
# A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file # 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 # Useful to avoid using channels when using legacy nix commands
{ pkgs ? import ( fetchTarball { { pkgs ? (import ./lib/nixpkgs.nix) { } }: {
url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
sha256 = lock.narHash;
} ) { } }: {
default = pkgs.mkShell { default = pkgs.mkShell {
NIX_CONFIG = "experimental-features = nix-command flakes"; NIX_CONFIG = "experimental-features = nix-command flakes";
# imports all files ending in .asc/.gpg # imports all files ending in .asc/.gpg