nixos-config/modules/profiles.nix
2021-03-29 21:16:19 -04:00

28 lines
535 B
Nix

{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.sconfig.profile;
in
{
options.sconfig.profile = mkOption {
type = types.enum [ "server" "desktop" ];
};
config = mkMerge [
(mkIf (cfg == "server") {
services.openssh.enable = true;
system.autoUpgrade = {
enable = true;
allowReboot = true;
};
nix.gc = {
automatic = true;
options = "--delete-older-than 30d";
};
})
(mkIf (cfg == "desktop") (import ./graphical.nix { inherit pkgs; }))
];
}