[Nix/Builder] add option to specify builder private/public key

This commit is contained in:
Antoine Viallon 2024-07-30 22:50:52 +02:00
parent 5877f589ba
commit dbc57950e6
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -4,8 +4,8 @@ let
cfg = config.aviallon.nix; cfg = config.aviallon.nix;
generalCfg = config.aviallon.general; generalCfg = config.aviallon.general;
desktopCfg = config.aviallon.desktop; desktopCfg = config.aviallon.desktop;
buildUserPubKeyFile = ./id_builder.pub; buildUserPubKeyFile = cfg.builder.publicKeyFile;
buildUserKeyFile = ./id_builder; buildUserKeyFile = cfg.builder.privateKeyFile;
buildUserKeyFilePath = "/var/lib/nixos/aviallon.id_builder"; buildUserKeyFilePath = "/var/lib/nixos/aviallon.id_builder";
getSpeed = cores: threads: cores + (threads - cores) / 2; getSpeed = cores: threads: cores + (threads - cores) / 2;
@ -46,6 +46,17 @@ in
]; ];
options.aviallon.nix.builder = { options.aviallon.nix.builder = {
publicKeyFile = mkOption {
type = types.path;
example = "/path/to/id_builder.pub";
description = "Path to the public key nix will use to connect to builder";
};
privateKeyFile = mkOption {
type = types.path;
example = "/path/to/id_builder";
description = "Path to the private key nix builder user will use";
};
buildMachines = mkOption { buildMachines = mkOption {
type = types.attrsOf (types.submoduleWith { type = types.attrsOf (types.submoduleWith {