NixOS system configuration: Difference between revisions
m removed the carets in nixosConifgurations."hostname" because they were breaking and showing nonsense characters. |
m Right, that also needs buildPackages |
||
| (One intermediate revision by the same user not shown) | |||
| Line 257: | Line 257: | ||
path = pkgs.path; | path = pkgs.path; | ||
narHash = builtins.readFile | narHash = builtins.readFile | ||
(pkgs.runCommandLocal "get-nixpkgs-hash" | (pkgs.buildPackages.runCommandLocal "get-nixpkgs-hash" | ||
{ nativeBuildInputs = [ pkgs.nix ]; } | { nativeBuildInputs = [ pkgs.buildPackages.nix ]; } | ||
"nix-hash --type sha256 --sri ${pkgs.path} > $out"); | "nix-hash --type sha256 --sri ${pkgs.path} > $out"); | ||
}; | }; | ||
}; | }; | ||
</nowiki> | </nowiki> | ||
}} | |name=|lang=}} | ||
This has the unfortunate side-effect of requiring import-from-derivation and slowing down build times, however it may greatly speed up almost every eval. Full-time flakes users may be able to just use <code>narHash = pkgs.narHash</code>. | This has the unfortunate side-effect of requiring import-from-derivation and slowing down build times, however it may greatly speed up almost every eval. Full-time flakes users may be able to just use <code>narHash = pkgs.narHash</code>. | ||