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
|
@ -5,6 +5,8 @@
|
||||||
let
|
let
|
||||||
inherit (builtins) attrNames readDir;
|
inherit (builtins) attrNames readDir;
|
||||||
|
|
||||||
|
nixpkgs = toString (import ./nixpkgs-compat.nix);
|
||||||
|
|
||||||
hostname = lib.fileContents /etc/hostname;
|
hostname = lib.fileContents /etc/hostname;
|
||||||
host = "/etc/nixos/hosts/${hostname}.nix";
|
host = "/etc/nixos/hosts/${hostname}.nix";
|
||||||
config =
|
config =
|
||||||
|
@ -24,7 +26,7 @@ in
|
||||||
|
|
||||||
networking.hostName = hostname;
|
networking.hostName = hostname;
|
||||||
nix.nixPath = [
|
nix.nixPath = [
|
||||||
"nixpkgs=${<nixpkgs>}"
|
"nixpkgs=${nixpkgs}"
|
||||||
"nixos-config=/etc/nixos/configuration.nix"
|
"nixos-config=/etc/nixos/configuration.nix"
|
||||||
"nixpkgs-overlays=/etc/nixos/overlays"
|
"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> {
|
{ pkgs ? import (import ./nixpkgs-compat.nix) { } }:
|
||||||
overlays = [ (import ./overlays/nix-zsh-completions.nix) ];
|
|
||||||
}
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
configs = "${toString ./.}#nixosConfigurations";
|
configs = "${toString ./.}#nixosConfigurations";
|
||||||
build = "config.system.build";
|
build = "config.system.build";
|
||||||
|
|
Loading…
Reference in a new issue