nixos-config/modules/profiles.nix
2021-04-12 22:34:54 -04:00

24 lines
446 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;
nix.gc = {
automatic = true;
options = "--delete-older-than 30d";
};
})
(mkIf (cfg == "desktop") (import ./graphical.nix { inherit pkgs; }))
];
}