nix-config/modules/cluster/deployment-options.nix

53 lines
1.3 KiB
Nix

{ zentralwerk, config, lib, ... }:
# our custom options
{
options.deployment = with lib; {
vcpu = mkOption {
type = types.int;
default = 4;
};
mem = mkOption {
type = types.int;
default = 512;
};
networks = mkOption {
type = with types; listOf str;
default = builtins.attrNames (
lib.filterAttrs (net: { hosts4, hosts6, ... }:
hosts4 ? ${config.networking.hostName} ||
lib.filterAttrs (ctx: hosts6:
hosts6 ? ${config.networking.hostName}
) hosts6 != {}
) zentralwerk.lib.config.site.net
);
};
persistedShares = mkOption {
type = with types; listOf str;
default = [ "/etc" "/home" "/var" ];
};
storage = mkOption {
type = types.enum [ "fast" "big" ];
default = "fast";
description = ''
Which glusterfs volume to use for persistedShares
'';
};
needForSpeed = mkOption {
type = types.bool;
default = false;
description = ''
Prefer deployment on Nomad clients with a higher c3d2.cpuSpeed
'';
};
};
config = {
# HACK: Avoid conflicts when building a NixOS configuration on Hydra
boot.loader.grub.enable = false;
fileSystems."/" = {
device = "rootfs";
fsType = "tmpfs";
};
};
}