nixos-config/config/common.nix

27 lines
669 B
Nix
Raw Normal View History

2021-02-25 12:45:50 -08:00
{ config, lib, pkgs, ... }:
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
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 {
nix.nixPath = lib.mkBefore [ "/nix/var/nix/profiles/per-user/$USER/channels" ];
environment.etc = {
build-timestamp.text = toString config.instance.build-timestamp;
2021-11-30 15:35:46 -08:00
"build-seed.sha1sum".source = "${hashed-build-seed}";
};
2021-02-25 12:45:50 -08:00
};
2021-09-07 15:39:45 -07:00
}