feat: add 'azure' cloud option (and generalized module)

This commit is contained in:
2026-01-30 15:19:11 +01:00
parent a78af6529c
commit a64d153004
7 changed files with 41 additions and 12 deletions

View File

@@ -0,0 +1,12 @@
{
config,
lib,
pkgs,
...
}:
{
config = lib.mkIf config.cloud.azure.enable {
home.packages = with pkgs; [ azure-cli ];
};
}

View File

@@ -0,0 +1,17 @@
{ lib, ... }:
{
options.cloud = {
azure = {
enable = lib.mkEnableOption "azure CLI";
};
hetzner = {
enable = lib.mkEnableOption "hetzner CLI";
};
};
imports = [
./azure.nix
./hetzner.nix
];
}

View File

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