nixfiles/modules/machine-type/default.nix

45 lines
1,018 B
Nix
Raw Normal View History

2024-01-17 14:34:33 +01:00
{ config, lib, ...}: with lib; {
options.kyouma.machine-type = {
physical = mkOption {
type = types.bool;
default = false;
description = mdDoc "Mark machine as physical.";
};
virtual = mkOption {
type = types.bool;
default = false;
description = mdDoc "Mark machine as virtual.";
};
router = mkOption {
type = types.bool;
default = false;
description = mdDoc "Mark machine as router.";
};
headless = mkOption {
type = types.bool;
default = false;
description = mdDoc "Mark machine as headless.";
};
graphical = mkOption {
type = types.bool;
default = false;
description = mdDoc "Mark machine as graphical.";
};
portable = mkOption {
type = types.bool;
default = false;
description = mdDoc "Mark machine as portable.";
};
};
config = let
cfg = config.kyouma.machine-type;
in {
deployment.tags = mkIf cfg.router [ "router" ];
};
}