improve
This commit is contained in:
+10
-1
@@ -13,7 +13,16 @@ in
|
|||||||
{
|
{
|
||||||
imports = [ ./modules/autodeploy.nix ];
|
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 =
|
assertions =
|
||||||
let
|
let
|
||||||
|
|||||||
@@ -47,9 +47,10 @@
|
|||||||
mainGateway = "10.0.0.1";
|
mainGateway = "10.0.0.1";
|
||||||
isVm = false;
|
isVm = false;
|
||||||
paths = {
|
paths = {
|
||||||
server = "/persist/@containers";
|
server = "/persist/@containers/";
|
||||||
data = "/persist/@containers/data";
|
data = "/persist/@containers/data/";
|
||||||
secrets = "/persist/@secrets/";
|
secrets = "/persist/@secrets/";
|
||||||
|
config = "/persist/@config/";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
hostInfo,
|
|
||||||
customPkgs,
|
customPkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
@@ -25,27 +24,23 @@ in
|
|||||||
|
|
||||||
giteaUrl = lib.mkOption {
|
giteaUrl = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "https://git.floweytf.com";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
giteaRepo = lib.mkOption {
|
giteaRepo = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "server/server-config";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
tokenFile = lib.mkOption {
|
tokenFile = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "${hostInfo.paths.secrets}/gitea-autodeploy-token";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
allowedSignersFile = lib.mkOption {
|
allowedSigners = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
default = "${hostInfo.paths.secrets}/autodeploy-allowed-signers";
|
default = [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
stateDir = lib.mkOption {
|
stateDir = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "/persist/@autodeploy";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -59,7 +54,7 @@ in
|
|||||||
GITEA_URL = cfg.giteaUrl;
|
GITEA_URL = cfg.giteaUrl;
|
||||||
GITEA_REPO = cfg.giteaRepo;
|
GITEA_REPO = cfg.giteaRepo;
|
||||||
TOKEN_FILE = cfg.tokenFile;
|
TOKEN_FILE = cfg.tokenFile;
|
||||||
ALLOWED_SIGNERS = cfg.allowedSignersFile;
|
ALLOWED_SIGNERS = builtins.toFile "signers" (lib.join "\n" cfg.allowedSigners);
|
||||||
DEPLOY_BRANCH = cfg.branch;
|
DEPLOY_BRANCH = cfg.branch;
|
||||||
STATE_DIR = cfg.stateDir;
|
STATE_DIR = cfg.stateDir;
|
||||||
REPO_DIR = "/persist/@configuration";
|
REPO_DIR = "/persist/@configuration";
|
||||||
|
|||||||
Reference in New Issue
Block a user