mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 12:29:19 -08:00
feat: interoperate [deploy-rs, colmena]
This commit is contained in:
parent
0fef01bfe6
commit
f108a20f26
15 changed files with 235 additions and 122 deletions
44
modules/system/colmena.nix
Normal file
44
modules/system/colmena.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
name,
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkOptionDefault mkDefault;
|
||||
in {
|
||||
options = let
|
||||
inherit (lib.types) nullOr;
|
||||
inherit (lib.options) mkOption;
|
||||
in {
|
||||
colmena = mkOption {
|
||||
type = nullOr inputs.arcexprs.lib.json.types.attrs;
|
||||
};
|
||||
};
|
||||
config = {
|
||||
colmena = {
|
||||
targetHost = mkDefault config.deploy.hostname;
|
||||
targetUser = mkDefault config.deploy.sshUser;
|
||||
tags = mkOptionDefault [
|
||||
"all"
|
||||
];
|
||||
};
|
||||
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}.devices.inskip.me";
|
||||
profiles.system = {
|
||||
user = "root";
|
||||
path = inputs.deploy-rs.lib.${config.system}.activate.nixos inputs.self.nixosConfigurations.${name};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -47,6 +47,10 @@ in {
|
|||
type = attrs;
|
||||
internal = true;
|
||||
};
|
||||
pkgs = mkOption {
|
||||
type = unspecified;
|
||||
internal = true;
|
||||
};
|
||||
builder = mkOption {
|
||||
type = unspecified;
|
||||
internal = true;
|
||||
|
|
@ -148,6 +152,7 @@ in {
|
|||
inherit (config) system modules specialArgs;
|
||||
})
|
||||
config.builder);
|
||||
pkgs = pkgs.${config.system};
|
||||
specialArgs = {
|
||||
inherit name inputs std tree;
|
||||
systemType = config.folder;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue