better split also for desktop envs

This commit is contained in:
Vinzenz Schroeter 2023-09-24 13:20:34 +02:00
parent 44bbfc2fa0
commit adb51fd36e
6 changed files with 117 additions and 100 deletions

View file

@ -5,11 +5,11 @@ modulesCfg: {lib, ...}: {
./nixpkgs.nix ./nixpkgs.nix
./globalinstalls.nix ./globalinstalls.nix
./server.nix ./server.nix
./desktop
] ]
++ (map (path: (import path modulesCfg)) [ ++ (map (path: (import path modulesCfg)) [
./hardware ./hardware
./users ./users
./desktop
]); ]);
config = { config = {

View file

@ -1,16 +1,22 @@
{ modulesCfg: {
config, config,
pkgs, pkgs,
lib, lib,
... ...
}: let }: let
isEnabled = config.my.desktop.enable; isEnabled = config.my.desktop.enable;
isHomeManager = modulesCfg.enableHomeManager;
in { in {
imports = [ imports =
./gnome.nix [
./kde.nix ./gnome.nix
./gaming.nix ./kde.nix
]; ./gaming.nix
]
++ lib.optionals isHomeManager [
./gnome-home.nix
./kde-home.nix
];
options.my.desktop.enable = lib.mkEnableOption "desktop"; options.my.desktop.enable = lib.mkEnableOption "desktop";

View file

@ -0,0 +1,23 @@
{
lib,
config,
pkgs,
...
}: let
isEnabled = config.my.desktop.enableGnome;
in {
config = lib.mkIf isEnabled {
home-manager.sharedModules = [
{
home.packages = with pkgs; [
amberol
];
dconf.settings = {
"org/gnome/desktop/peripherals/keyboard" = {
numlock-state = true;
};
};
}
];
};
}

View file

@ -5,62 +5,45 @@
... ...
}: let }: let
isEnabled = config.my.desktop.enableGnome; isEnabled = config.my.desktop.enableGnome;
enableHomeManager = config.my.modulesCfg.enableHomeManager;
in { in {
options.my.desktop.enableGnome = lib.mkEnableOption "gnome desktop"; options.my.desktop.enableGnome = lib.mkEnableOption "gnome desktop";
config = lib.mkMerge [ config = lib.mkIf isEnabled {
(lib.mkIf isEnabled { my.desktop.enable = true;
my.desktop.enable = true;
services = { services = {
xserver = { xserver = {
# Enable the GNOME Desktop Environment. # Enable the GNOME Desktop Environment.
displayManager.gdm.enable = true; displayManager.gdm.enable = true;
desktopManager.gnome.enable = true; desktopManager.gnome.enable = true;
};
gnome = {
tracker-miners.enable = false;
tracker.enable = false;
};
}; };
programs.gpaste.enable = true; gnome = {
tracker-miners.enable = false;
environment = { tracker.enable = false;
systemPackages = with pkgs; [
gnomeExtensions.gsconnect
];
# remove some gnome default apps
gnome.excludePackages = with pkgs.gnome; [
cheese # photo booth
epiphany # web browser
evince # document viewer
geary # email client
seahorse # password manager
gnome-clocks
gnome-maps
gnome-weather
gnome-music
pkgs.gnome-connections
];
}; };
}) };
(lib.mkIf (isEnabled && enableHomeManager) {
home-manager.sharedModules = [ programs.gpaste.enable = true;
{
home.packages = with pkgs; [ environment = {
amberol systemPackages = with pkgs; [
]; gnomeExtensions.gsconnect
dconf.settings = {
"org/gnome/desktop/peripherals/keyboard" = {
numlock-state = true;
};
};
}
]; ];
})
]; # remove some gnome default apps
gnome.excludePackages = with pkgs.gnome; [
cheese # photo booth
epiphany # web browser
evince # document viewer
geary # email client
seahorse # password manager
gnome-clocks
gnome-maps
gnome-weather
gnome-music
pkgs.gnome-connections
];
};
};
} }

View file

@ -0,0 +1,18 @@
{
lib,
config,
...
}: let
isEnabled = config.my.desktop.enableKde;
in {
config = lib.mkIf isEnabled {
home-manager.sharedModules = [
{
services.kdeconnect = {
enable = true;
indicator = true;
};
}
];
};
}

View file

@ -5,57 +5,44 @@
... ...
}: let }: let
isEnabled = config.my.desktop.enableKde; isEnabled = config.my.desktop.enableKde;
enableHomeManager = config.my.modulesCfg.enableHomeManager;
in { in {
options.my.desktop.enableKde = lib.mkEnableOption "KDE desktop"; options.my.desktop.enableKde = lib.mkEnableOption "KDE desktop";
config = lib.mkMerge [ config = lib.mkIf isEnabled {
(lib.mkIf isEnabled { my.desktop.enable = true;
my.desktop.enable = true;
# flatpak xdg-portal-kde crashes, otherwise this would be global # flatpak xdg-portal-kde crashes, otherwise this would be global
services.flatpak.enable = false; services.flatpak.enable = false;
services = { services = {
# Enable the KDE Plasma Desktop Environment. # Enable the KDE Plasma Desktop Environment.
xserver = { xserver = {
desktopManager.plasma5.enable = true; desktopManager.plasma5.enable = true;
displayManager = { displayManager = {
sddm.enable = true; sddm.enable = true;
defaultSession = "plasmawayland"; defaultSession = "plasmawayland";
};
}; };
}; };
};
environment = { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [
libsForQt5.kate libsForQt5.kate
libsForQt5.kalk libsForQt5.kalk
];
plasma5.excludePackages = with pkgs.libsForQt5; [
elisa
gwenview
okular
khelpcenter
];
};
programs = {
dconf.enable = true;
partition-manager.enable = true;
};
})
(lib.mkIf (isEnabled && enableHomeManager) {
home-manager.sharedModules = [
{
services.kdeconnect = {
enable = true;
indicator = true;
};
}
]; ];
})
]; plasma5.excludePackages = with pkgs.libsForQt5; [
elisa
gwenview
okular
khelpcenter
];
};
programs = {
dconf.enable = true;
partition-manager.enable = true;
};
};
} }