shell: add a nixpkgs-compat file
We are now able to pull in the same revision of nixpkgs as listed in the lock file.
This commit is contained in:
parent
94de0921e6
commit
5f7af10bae
3 changed files with 17 additions and 5 deletions
|
@ -5,6 +5,8 @@
|
|||
let
|
||||
inherit (builtins) attrNames readDir;
|
||||
|
||||
nixpkgs = toString (import ./nixpkgs-compat.nix);
|
||||
|
||||
hostname = lib.fileContents /etc/hostname;
|
||||
host = "/etc/nixos/hosts/${hostname}.nix";
|
||||
config =
|
||||
|
@ -24,7 +26,7 @@ in
|
|||
|
||||
networking.hostName = hostname;
|
||||
nix.nixPath = [
|
||||
"nixpkgs=${<nixpkgs>}"
|
||||
"nixpkgs=${nixpkgs}"
|
||||
"nixos-config=/etc/nixos/configuration.nix"
|
||||
"nixpkgs-overlays=/etc/nixos/overlays"
|
||||
];
|
||||
|
|
13
nixpkgs-compat.nix
Normal file
13
nixpkgs-compat.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
let
|
||||
inherit (builtins)
|
||||
fetchTarball
|
||||
fromJSON
|
||||
readFile
|
||||
;
|
||||
nixos = (fromJSON (readFile ./flake.lock)).nodes.nixos.locked;
|
||||
nixpkgs = fetchTarball {
|
||||
url = "https://github.com/NixOS/nixpkgs/archive/${nixos.rev}.tar.gz";
|
||||
sha256 = nixos.narHash;
|
||||
};
|
||||
in
|
||||
nixpkgs
|
|
@ -1,7 +1,4 @@
|
|||
{ pkgs ? import <nixpkgs> {
|
||||
overlays = [ (import ./overlays/nix-zsh-completions.nix) ];
|
||||
}
|
||||
}:
|
||||
{ pkgs ? import (import ./nixpkgs-compat.nix) { } }:
|
||||
let
|
||||
configs = "${toString ./.}#nixosConfigurations";
|
||||
build = "config.system.build";
|
||||
|
|
Loading…
Reference in a new issue