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

54 lines
1.4 KiB
Nix

{ zentralwerk, config, lib, ... }:
# our custom options
#
# IF ANYBODY changes anything in this customization for skyflake
# please give notice in the admins chat prior to doing so
{
options.deployment = with lib; {
vcpu = mkOption {
default = 4;
};
mem = mkOption {
default = 512;
};
hypervisor = mkOption {
default = "cloud-hypervisor";
};
networks = mkOption {
default = builtins.attrNames (
lib.filterAttrs (_: { hosts4, hosts6, ... }:
hosts4 ? ${config.networking.hostName} ||
lib.filterAttrs (_: hosts6:
hosts6 ? ${config.networking.hostName}
) hosts6 != {}
) zentralwerk.lib.config.site.net
);
};
persistedShares = mkOption {
default = [ "/etc" "/home" "/var" ];
};
extraShares = mkOption {
default = [];
description = ''
Extra shares. THESE MUST BE AVAILABLE ON ALL MICROVM HOSTS!
'';
};
needForSpeed = mkOption {
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."/" = lib.mkDefault {
device = "rootfs";
fsType = "tmpfs";
options = [ "size=50%,mode=0755" ];
};
};
}