mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
feat(system): ci options
This commit is contained in:
parent
a1e7a31caa
commit
743593452d
9 changed files with 139 additions and 28 deletions
43
modules/system/ci.nix
Normal file
43
modules/system/ci.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
name,
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (inputs.self.lib.lib) domain;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.modules) mkIf mkOptionDefault;
|
||||
in {
|
||||
options.ci = with lib.types; {
|
||||
enable = mkEnableOption "build via CI" // {
|
||||
default = config.type == "NixOS";
|
||||
};
|
||||
allowFailure = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
config = {
|
||||
deploy = let
|
||||
nixos = config.built;
|
||||
in {
|
||||
sshUser = mkOptionDefault "root";
|
||||
user = mkOptionDefault "root";
|
||||
sshOpts = mkIf (config.type == "NixOS") (
|
||||
mkOptionDefault ["-p" "${builtins.toString (builtins.head nixos.config.services.openssh.ports)}"]
|
||||
);
|
||||
autoRollback = mkOptionDefault true;
|
||||
magicRollback = mkOptionDefault true;
|
||||
fastConnection = mkOptionDefault false;
|
||||
hostname = mkOptionDefault "${name}.local.${domain}";
|
||||
profiles.system = {
|
||||
user = "root";
|
||||
path = let
|
||||
inherit (inputs.self.legacyPackages.${config.system}.deploy-rs) activate;
|
||||
in
|
||||
activate.nixos nixos;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue