diff --git a/configuration.nix b/configuration.nix index b6737b5..97e6f37 100644 --- a/configuration.nix +++ b/configuration.nix @@ -13,7 +13,16 @@ in { imports = [ ./modules/autodeploy.nix ]; - services.server-autodeploy.enable = true; + services.server-autodeploy = { + enable = true; + giteaUrl = "https://git.floweytf.com/"; + giteaRepo = "server/server-config"; + tokenFile = "${hostInfo.paths.secrets}/gitea-autodeploy-token"; + allowedSigners = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPaGpTX3EzfezVc2nl3MgsKVamYYP2h2VJaRny8pZkvi flowey@arch" + ]; + stateDir = hostInfo.paths.config; + }; assertions = let diff --git a/flake.nix b/flake.nix index f3b804d..9529686 100644 --- a/flake.nix +++ b/flake.nix @@ -47,9 +47,10 @@ mainGateway = "10.0.0.1"; isVm = false; paths = { - server = "/persist/@containers"; - data = "/persist/@containers/data"; + server = "/persist/@containers/"; + data = "/persist/@containers/data/"; secrets = "/persist/@secrets/"; + config = "/persist/@config/"; }; }; diff --git a/modules/autodeploy.nix b/modules/autodeploy.nix index fb9e439..4ed0af1 100644 --- a/modules/autodeploy.nix +++ b/modules/autodeploy.nix @@ -2,7 +2,6 @@ config, lib, pkgs, - hostInfo, customPkgs, ... }: @@ -25,27 +24,23 @@ in giteaUrl = lib.mkOption { type = lib.types.str; - default = "https://git.floweytf.com"; }; giteaRepo = lib.mkOption { type = lib.types.str; - default = "server/server-config"; }; tokenFile = lib.mkOption { type = lib.types.str; - default = "${hostInfo.paths.secrets}/gitea-autodeploy-token"; }; - allowedSignersFile = lib.mkOption { - type = lib.types.str; - default = "${hostInfo.paths.secrets}/autodeploy-allowed-signers"; + allowedSigners = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; }; stateDir = lib.mkOption { type = lib.types.str; - default = "/persist/@autodeploy"; }; }; @@ -59,7 +54,7 @@ in GITEA_URL = cfg.giteaUrl; GITEA_REPO = cfg.giteaRepo; TOKEN_FILE = cfg.tokenFile; - ALLOWED_SIGNERS = cfg.allowedSignersFile; + ALLOWED_SIGNERS = builtins.toFile "signers" (lib.join "\n" cfg.allowedSigners); DEPLOY_BRANCH = cfg.branch; STATE_DIR = cfg.stateDir; REPO_DIR = "/persist/@configuration";