2021-02-25 12:45:50 -08:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2021-09-22 18:43:23 -07:00
|
|
|
with lib;
|
2021-02-25 12:45:50 -08:00
|
|
|
# Config common to all hosts, which don't belong anywhere else
|
|
|
|
{
|
2021-09-07 15:39:45 -07:00
|
|
|
config = let
|
2021-11-30 15:30:32 -08:00
|
|
|
hashed-build-seed = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "build-seed-hash";
|
|
|
|
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
|
|
|
|
buildInputs = with pkgs; [ coreutils ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
echo "${config.instance.build-seed}" | sha1sum | grep -o "^[^ ]*" > $out
|
|
|
|
'';
|
|
|
|
};
|
2021-09-07 15:39:45 -07:00
|
|
|
in {
|
2021-09-22 18:43:23 -07:00
|
|
|
nix.nixPath = lib.mkBefore [ "/nix/var/nix/profiles/per-user/$USER/channels" ];
|
|
|
|
|
2021-11-30 15:30:32 -08:00
|
|
|
environment.etc = {
|
|
|
|
build-timestamp.text = toString config.instance.build-timestamp;
|
|
|
|
"build-seed.sha1sum".text = "${hashed-build-seed}";
|
|
|
|
};
|
2021-02-25 12:45:50 -08:00
|
|
|
};
|
2021-09-07 15:39:45 -07:00
|
|
|
}
|