nixos-config/modules/profiles.nix
2021-03-28 02:51:59 -04:00

27 lines
712 B
Nix

{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.sconfig.profile;
in
{
options.sconfig.profile = mkOption {
type = types.enum [ "server" "desktop-gnome" "desktop-sway" "desktop-plasma" ];
};
config = mkMerge [
(mkIf (cfg == "server") (mkMerge [
{ services.openssh.enable = true; }
(import ./auto-update.nix { })
]))
(mkIf (cfg == "desktop-sway") (import ./sway.nix { inherit pkgs; }))
(mkIf (cfg == "desktop-gnome") (import ./gnome.nix { inherit pkgs; }))
(mkIf (cfg == "desktop-plasma") (import ./plasma.nix { inherit pkgs; }))
(mkIf ("desktop-" == builtins.substring 0 8 cfg) (mkMerge [
(import ./graphical.nix { inherit pkgs; })
]))
];
}