feat: add 'azure' cloud option (and generalized module)
This commit is contained in:
12
home/modules/cloud/azure.nix
Normal file
12
home/modules/cloud/azure.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.cloud.azure.enable {
|
||||
home.packages = with pkgs; [ azure-cli ];
|
||||
};
|
||||
}
|
||||
17
home/modules/cloud/default.nix
Normal file
17
home/modules/cloud/default.nix
Normal 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
|
||||
];
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
osConfig ? null,
|
||||
...
|
||||
}:
|
||||
@@ -8,9 +10,12 @@ let
|
||||
isNixOS = osConfig != null;
|
||||
in
|
||||
{
|
||||
config = {
|
||||
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 ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
home = {
|
||||
packages = with pkgs; [ hcloud ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user