From dbc57950e6e0c5f9dd2765ff8d5fb2ffe6ceb23d Mon Sep 17 00:00:00 2001 From: Antoine Viallon Date: Tue, 30 Jul 2024 22:50:52 +0200 Subject: [PATCH] [Nix/Builder] add option to specify builder private/public key --- nix/builder.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/nix/builder.nix b/nix/builder.nix index b3e3ea2..9742cfb 100644 --- a/nix/builder.nix +++ b/nix/builder.nix @@ -4,8 +4,8 @@ let cfg = config.aviallon.nix; generalCfg = config.aviallon.general; desktopCfg = config.aviallon.desktop; - buildUserPubKeyFile = ./id_builder.pub; - buildUserKeyFile = ./id_builder; + buildUserPubKeyFile = cfg.builder.publicKeyFile; + buildUserKeyFile = cfg.builder.privateKeyFile; buildUserKeyFilePath = "/var/lib/nixos/aviallon.id_builder"; getSpeed = cores: threads: cores + (threads - cores) / 2; @@ -46,6 +46,17 @@ in ]; 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 { type = types.attrsOf (types.submoduleWith {