fix profile recursion

This commit is contained in:
Sean Buckley 2021-06-10 01:13:32 -04:00
parent b35e7fbcd2
commit d74ba82a72

View file

@ -2,9 +2,26 @@
with lib;
let
cfg = config.sconfig.profile;
in
{
options.sconfig.profile = mkOption {
type = types.enum [ "server" "desktop" ];
};
config = mkMerge [
desktop-config = {
(mkIf (cfg == "server") {
services.openssh.enable = true;
documentation.nixos.enable = false;
nix.gc = {
automatic = true;
options = "--delete-older-than 30d";
};
})
(mkIf (cfg == "desktop") {
environment.systemPackages = with pkgs; [
brave
gimp
@ -61,24 +78,8 @@ let
boot.loader.timeout =
if config.boot.loader.systemd-boot.enable
then null else lib.mkOverride 9999 99;
};
})
server-config = {
services.openssh.enable = true;
documentation.nixos.enable = false;
nix.gc = {
automatic = true;
options = "--delete-older-than 30d";
};
};
in
{
options.sconfig.profile = mkOption {
type = types.enum [ "server" "desktop" ];
};
config = { inherit desktop server; }."${cfg}-config";
];
}