nixos-config/modules/profiles.nix

25 lines
446 B
Nix
Raw Normal View History

2021-03-10 03:50:54 +00:00
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.sconfig.profile;
in
{
options.sconfig.profile = mkOption {
2021-03-30 01:16:19 +00:00
type = types.enum [ "server" "desktop" ];
2021-03-10 03:50:54 +00:00
};
config = mkMerge [
2021-03-30 00:21:02 +00:00
(mkIf (cfg == "server") {
services.openssh.enable = true;
nix.gc = {
automatic = true;
options = "--delete-older-than 30d";
};
})
2021-03-10 03:50:54 +00:00
2021-03-30 01:16:19 +00:00
(mkIf (cfg == "desktop") (import ./graphical.nix { inherit pkgs; }))
2021-03-10 03:50:54 +00:00
];
}