mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 04:19:19 -08:00
feat: migrate to Gensokyo-zone/infrastructure systems modules
This commit is contained in:
parent
d021ec2e15
commit
c5e8103b6b
6 changed files with 196 additions and 174 deletions
37
modules/system/deploy.nix
Normal file
37
modules/system/deploy.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
name,
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkOptionDefault;
|
||||
in {
|
||||
options = let
|
||||
inherit (lib.types) nullOr;
|
||||
inherit (lib.options) mkOption;
|
||||
in {
|
||||
deploy = mkOption {
|
||||
type = nullOr inputs.arcexprs.lib.json.types.attrs;
|
||||
};
|
||||
};
|
||||
config = {
|
||||
deploy = let
|
||||
nixos = config.built;
|
||||
in {
|
||||
sshUser = mkOptionDefault "deploy";
|
||||
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}.inskip.me";
|
||||
profiles.system = {
|
||||
user = "root";
|
||||
path = inputs.deploy-rs.lib.${config.system}.activate.nixos inputs.self.nixosConfigurations.${name};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue