Created
December 19, 2020 15:19
-
-
Save lheckemann/a3b300cacf5f8633c3a54ee9e3281b92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ...}: { | |
systemd.services.generate-nix-cache-key = { | |
wantedBy = [ "multi-user.target" ]; | |
serviceConfig.Type = "oneshot"; | |
path = [ pkgs.nix ]; | |
script = '' | |
[[ -f /etc/nix/private-key ]] && exit | |
nix-store --generate-binary-cache-key ${config.networking.hostName}-1 /etc/nix/private-key /etc/nix/public-key | |
''; | |
}; | |
nix.extraOptions = '' | |
secret-key-files = /etc/nix/private-key | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment