chore: refactor system modules
This commit is contained in:
3
system/desktop/default.nix
Normal file
3
system/desktop/default.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
imports = [./hyprland.nix ./niri.nix ./xserver.nix];
|
||||
}
|
||||
14
system/desktop/hyprland.nix
Normal file
14
system/desktop/hyprland.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.system.desktop.hyprland;
|
||||
in {
|
||||
options.system.desktop.hyprland.enable = mkEnableOption "Enables Hyprland";
|
||||
config.programs.hyprland = mkIf cfg.enable {
|
||||
inherit (cfg) enable;
|
||||
withUWSM = true;
|
||||
};
|
||||
}
|
||||
13
system/desktop/niri.nix
Normal file
13
system/desktop/niri.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.system.desktop.niri;
|
||||
in {
|
||||
options.system.desktop.niri.enable = mkEnableOption "Enables Niri";
|
||||
config.programs.niri = mkIf cfg.enable {
|
||||
inherit (cfg) enable;
|
||||
};
|
||||
}
|
||||
45
system/desktop/xserver.nix
Normal file
45
system/desktop/xserver.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.system.desktop.xserver;
|
||||
in {
|
||||
options.system.desktop.xserver = {
|
||||
enable = mkEnableOption "Enables xserver";
|
||||
de = mkOption {
|
||||
type = types.enum ["gnome" "kde"];
|
||||
default = "gnome";
|
||||
example = "kde";
|
||||
description = "Which DE to enable";
|
||||
};
|
||||
};
|
||||
config.services = mkIf cfg.enable {
|
||||
displayManager = {
|
||||
sddm.enable = mkIf (cfg.de == "kde") true;
|
||||
gdm.enable = mkIf (cfg.de == "gnome") true;
|
||||
};
|
||||
desktopManager = {
|
||||
plasma6.enable = mkIf (cfg.de == "kde") true;
|
||||
gnome.enable = mkIf (cfg.de == "gnome") true;
|
||||
};
|
||||
|
||||
gnome = mkIf (cfg.de == "gnome") {
|
||||
gnome-browser-connector.enable = true;
|
||||
games.enable = false;
|
||||
gnome-remote-desktop.enable = true;
|
||||
gnome-online-accounts.enable = true;
|
||||
sushi.enable = true;
|
||||
};
|
||||
|
||||
xserver = {
|
||||
inherit (cfg) enable;
|
||||
videoDrivers = lists.optional config.system.hardware.amdgpu.enable "amdgpu";
|
||||
xkb = {
|
||||
layout = "fr";
|
||||
variant = "bepo_afnor";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user