feat(gnome): add gnome desktop

This commit is contained in:
514fpv 2024-01-28 16:51:53 +08:00
parent f054916ef0
commit c9d769b874
Signed by: koishi
SSH key fingerprint: SHA256:axz0uIzzY+5W19i7QOUuiw5LSqhKfCBKPf3L4xFRxLw
2 changed files with 40 additions and 0 deletions

15
home/gnome/impl.nix Normal file
View file

@ -0,0 +1,15 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.home.gnome;
in mkIf cfg.enable {
programs.regreet.enable = false;
services.xserver.enable = true;
services.xserver.displayManager.startx.enable = false;
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
users.home.persist.directories = [ ];
environment.persistence."/nix/persist/fhs".directories = [ ];
}

25
home/gnome/nixos.nix Normal file
View file

@ -0,0 +1,25 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.home.gnome;
in {
imports = [ ./impl.nix ];
options.home.gnome = {
enable = mkEnableOption "GNOME desktop environment";
};
config = {
users.homeModules = [
# this module passes gnome configuration to home-manager
{ passthrough.gnome= cfg; }
];
specialisation.nognome = with cfg; mkIf enable {
configuration = {
home.gnome.enable = mkForce false;
};
};
};
}