feat: add 'hcloud' module

This commit is contained in:
2026-01-18 10:02:20 +01:00
parent 00e5c92c1e
commit d6459d0d84
3 changed files with 50 additions and 21 deletions

42
flake.lock generated
View File

@@ -29,11 +29,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1768622624, "lastModified": 1768709017,
"narHash": "sha256-Em6PP667PeXbEjidbV2LnNwmUYohbrSFvVPLYLUDHms=", "narHash": "sha256-/Xc5B/+6nbX24iSaPbN/+wiVqGS50/LS4y53tzTvN0o=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "8061c6d9199dc6cc0727d4241959eea28f2fa0a6", "rev": "5728e3d62c3af09445cb013e304d627f6589efc4",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@@ -90,11 +90,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1768598210, "lastModified": 1768707181,
"narHash": "sha256-kkgA32s/f4jaa4UG+2f8C225Qvclxnqs76mf8zvTVPg=", "narHash": "sha256-GdwFfnwdUgABFpc4sAmX7GYx8eQs6cEjOPo6nBJ0YaI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "c47b2cc64a629f8e075de52e4742de688f930dc6", "rev": "83bcb17377f0242376a327e742e9404e9a528647",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -125,10 +125,10 @@
"nix-secrets": { "nix-secrets": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1768414240, "lastModified": 1768726358,
"narHash": "sha256-M/MObXs5oHjUGnKYMwU6Lrl/CfA1RMLGqJYytkfPXjg=", "narHash": "sha256-OFD8qqNfGnLnL+15Hpzl6jhuzb4KVuVNz0zfPBz8lyo=",
"ref": "main", "ref": "main",
"rev": "601921b44c3794e899bd31c0f302e9a9f5e6c480", "rev": "84db870708bb281edf24f626d1e105e8a8ea0b3f",
"shallow": true, "shallow": true,
"type": "git", "type": "git",
"url": "ssh://git@github.com/hektor/nix-secrets" "url": "ssh://git@github.com/hektor/nix-secrets"
@@ -142,11 +142,11 @@
}, },
"nixCats": { "nixCats": {
"locked": { "locked": {
"lastModified": 1768594882, "lastModified": 1767604651,
"narHash": "sha256-KmVXwe4QDkcZlJbICj4FC83J+ZIT1r5t8nP+dCY/NDk=", "narHash": "sha256-itAnxzTpWpY1s3LA/oNngOuZDXT5U5JUZP5fApwx9gs=",
"owner": "BirdeeHub", "owner": "BirdeeHub",
"repo": "nixCats-nvim", "repo": "nixCats-nvim",
"rev": "6a04f1c7d741b1f084324159ab7c15bcedbb1e0a", "rev": "3c9bc4d7123e1b48d92f25ba505b889af541e897",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -268,11 +268,11 @@
"plugins-helm-ls-nvim": { "plugins-helm-ls-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1768584652, "lastModified": 1761915179,
"narHash": "sha256-jnMc87OjURNcqsva0npYgVyUrWc5C6L7yHpNvt9eSmg=", "narHash": "sha256-W9NRa84l5Cs62OsDeqb+LMxk8oYjhVBCB3o3UmE9a0I=",
"owner": "qvalentin", "owner": "qvalentin",
"repo": "helm-ls.nvim", "repo": "helm-ls.nvim",
"rev": "f0b9a1723890971a6d84890b50dbf5f40974ea1b", "rev": "d6f3a8d4ad59b4f54cd734267dfb5411679ea608",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -300,11 +300,11 @@
"plugins-mcphub-nvim": { "plugins-mcphub-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1768498135, "lastModified": 1765628564,
"narHash": "sha256-FPnN22K98+XtmQT/TxX+uImFjBrLGre2rUHkNyOl2Js=", "narHash": "sha256-nvWqCGRKhbUHsAM/zd+cwFdcoXXxf6EmcCkpN4mElf4=",
"owner": "ravitemer", "owner": "ravitemer",
"repo": "mcphub.nvim", "repo": "mcphub.nvim",
"rev": "415d9d0ea1db12eafc77c871f1ee07936f3b6e03", "rev": "5193329d510a68f1f5bf189960642c925c177a3a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -381,11 +381,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1768481291, "lastModified": 1768709255,
"narHash": "sha256-NjKtkJraCZEnLHAJxLTI+BfdU//9coAz9p5TqveZwPU=", "narHash": "sha256-aigyBfxI20FRtqajVMYXHtj5gHXENY2gLAXEhfJ8/WM=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "e085e303dfcce21adcb5fec535d65aacb066f101", "rev": "5e8fae80726b66e9fec023d21cd3b3e638597aa9",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -0,0 +1,16 @@
{
config,
lib,
osConfig ? null,
...
}:
let
isNixOS = osConfig != null;
in
{
config = {
warnings = lib.optional (!isNixOS)
"hcloud module requires NixOS host configuration. This module will not work with standalone home-manager.";
};
}

View File

@@ -28,6 +28,7 @@ in
"email_work".owner = config.users.users.${cfg.username}.name; "email_work".owner = config.users.users.${cfg.username}.name;
"anki_sync_user".owner = config.users.users.${cfg.username}.name; "anki_sync_user".owner = config.users.users.${cfg.username}.name;
"anki_sync_key".owner = config.users.users.${cfg.username}.name; "anki_sync_key".owner = config.users.users.${cfg.username}.name;
"hcloud".owner = config.users.users.${cfg.username}.name;
}; };
templates."taskrc.d/sync" = { templates."taskrc.d/sync" = {
@@ -56,6 +57,18 @@ in
email = ${config.sops.placeholder."email_work"} email = ${config.sops.placeholder."email_work"}
''; '';
}; };
templates."hcloud/cli.toml" = {
owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.config/hcloud/cli.toml";
content = ''
active_context = "server"
[[contexts]]
name = "server"
token = "${config.sops.placeholder."hcloud"}"
'';
};
}; };
}; };
} }