move desktop environments into modules

This commit is contained in:
Sean Buckley 2021-03-29 21:16:19 -04:00
parent 5cc282d784
commit 47278f895a
5 changed files with 71 additions and 62 deletions

View file

@ -7,11 +7,14 @@
./modules/cli.nix
./modules/fix-gnome-mouse-lag.nix
./modules/flakes.nix
./modules/gnome.nix
./modules/phpipam.nix
./modules/plasma.nix
./modules/profiles.nix
./modules/scansnap_s1300.nix
./modules/scroll-boost
./modules/security-tools.nix
./modules/status-on-console.nix
./modules/sway.nix
];
}

View file

@ -1,9 +1,24 @@
{ pkgs, ... }:
{ config, pkgs, lib, ... }:
let
cfg = config.sconfig.gnome;
in
{
environment = {
systemPackages = with pkgs; [
numix-icon-theme
options.sconfig.gnome = lib.mkEnableOption "Enable Gnome Desktop";
config = lib.mkIf cfg {
services.xserver = {
enable = true;
libinput.enable = true;
displayManager.gdm.enable = true;
displayManager.gdm.autoSuspend = false;
desktopManager.gnome3.enable = true;
};
environment.systemPackages = with pkgs; [
gnome3.gnome-tweaks
gnomeExtensions.appindicator
numix-icon-theme
qemu_kvm
(writeShellScriptBin "red" ''
@ -39,21 +54,7 @@
gsettings set org.gnome.desktop.interface icon-theme 'Numix'; sleep 1
gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark'
'')
];
] ++ (with pkgs.gnomeExtensions; [
appindicator
dash-to-panel
drop-down-terminal
sound-output-device-chooser
no-title-bar
]);
};
services.xserver = {
enable = true;
libinput.enable = true;
displayManager.gdm.enable = true;
displayManager.gdm.autoSuspend = false;
desktopManager.gnome3.enable = true;
};
}

View file

@ -1,9 +1,16 @@
{ ... }:
{ config, pkgs, lib, ... }:
let
cfg = config.sconfig.plasma;
in
{
services.xserver = {
enable = true;
libinput.enable = true;
displayManager.sddm.enable = true;
desktopManager.plasma5.enable = true;
options.sconfig.plasma = lib.mkEnableOption "Enable Plasma Desktop";
config = lib.mkIf cfg {
services.xserver = {
enable = true;
libinput.enable = true;
displayManager.sddm.enable = true;
desktopManager.plasma5.enable = true;
};
};
}

View file

@ -5,7 +5,7 @@ let
in
{
options.sconfig.profile = mkOption {
type = types.enum [ "server" "desktop-gnome" "desktop-sway" "desktop-plasma" ];
type = types.enum [ "server" "desktop" ];
};
config = mkMerge [
@ -22,13 +22,7 @@ in
};
})
(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; })
]))
(mkIf (cfg == "desktop") (import ./graphical.nix { inherit pkgs; }))
];
}

View file

@ -1,35 +1,39 @@
{ pkgs, ... }:
{ config, pkgs, lib, ... }:
let
cfg = config.sconfig.sway;
in
{
programs.sway.enable = true;
options.sconfig.sway = lib.mkEnableOption "Enable Sway Window Manager";
config = lib.mkIf cfg {
programs.sway.enable = true;
programs.bash.interactiveShellInit = '' [ "$(tty)" = "/dev/tty1" ] && exec sway '';
environment.variables.GTK_THEME = "Yaru-dark";
environment.variables.MOZ_ENABLE_WAYLAND = "1";
environment.variables.GTK_THEME = "Yaru-dark";
environment.variables.MOZ_ENABLE_WAYLAND = "1";
environment.etc."xdg/gtk-3.0/settings.ini".text = ''
[Settings]
gtk-theme-name=Yaru-dark
gtk-icon-theme-name=Numix
'';
environment.etc."xdg/gtk-3.0/settings.ini".text = ''
[Settings]
gtk-theme-name=Yaru-dark
gtk-icon-theme-name=Numix
'';
services.gvfs.enable = true;
programs.dconf.enable = true;
networking.networkmanager.enable = true;
services.gvfs.enable = true;
programs.dconf.enable = true;
networking.networkmanager.enable = true;
environment.systemPackages = with pkgs; [
numix-icon-theme
yaru-theme
gnome3.networkmanagerapplet
gnome3.file-roller
gnome3.adwaita-icon-theme
mate.mate-terminal
xfce.thunar
i3status
xfce.thunar-archive-plugin
caffeine-ng
wf-recorder
xdg_utils
];
programs.bash.interactiveShellInit = '' [ "$(tty)" = "/dev/tty1" ] && exec sway '';
environment.systemPackages = with pkgs; [
numix-icon-theme
yaru-theme
gnome3.networkmanagerapplet
gnome3.file-roller
gnome3.adwaita-icon-theme
mate.mate-terminal
xfce.thunar
i3status
xfce.thunar-archive-plugin
caffeine-ng
wf-recorder
xdg_utils
];
};
}