diff --git a/common.nix b/common.nix index ae566df..0bd5471 100644 --- a/common.nix +++ b/common.nix @@ -34,28 +34,6 @@ _: { "kmsconvt@tty1".enable = false; }; - #hardware stuff - hardware = { - enableRedistributableFirmware = true; - opengl = { - enable = true; - driSupport = true; - driSupport32Bit = true; - }; - }; - #sound settings - security.rtkit.enable = true; - sound.enable = lib.mkForce false; #disable alsa - hardware.pulseaudio.enable = lib.mkForce false; #disable pulseAudio - services.pipewire = { - enable = true; - audio.enable = true; - wireplumber.enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; networking = { firewall = { enable = true; @@ -91,5 +69,4 @@ _: { }; }; i18n.defaultLocale = "en_US.UTF-8"; - services.gvfs.enable = true; #gvfs for pcmanfm } diff --git a/flake.nix b/flake.nix index e91507e..8f19947 100644 --- a/flake.nix +++ b/flake.nix @@ -58,7 +58,6 @@ modules = [ (import ./modules inputs) (import ./common.nix inputs) - (import ./nix.nix inputs) (import ./systems/gerg-desktop inputs) { nixpkgs.overlays = [ @@ -80,7 +79,6 @@ modules = [ (import ./modules inputs) (import ./common.nix inputs) - (import ./nix.nix inputs) (import ./systems/game-laptop inputs) ]; }; @@ -96,7 +94,6 @@ modules = [ (import ./modules inputs) (import ./common.nix inputs) - (import ./nix.nix inputs) (import ./systems/mom-laptop inputs) ]; }; diff --git a/imports/dwm.nix b/imports/dwm.nix deleted file mode 100644 index e9aa6f7..0000000 --- a/imports/dwm.nix +++ /dev/null @@ -1,60 +0,0 @@ -{suckless, ...}: { - pkgs, - settings, - ... -}: { - environment.systemPackages = [suckless.packages.${pkgs.system}.dmenu]; - services.xserver = { - enable = true; - exportConfiguration = true; #make config debuggable - layout = "us"; - libinput.enable = true; - xautolock.enable = false; - desktopManager.xterm.enable = false; - excludePackages = [pkgs.xterm]; - windowManager.dwm = { - enable = true; - package = suckless.packages.${pkgs.system}.dwm; - }; - displayManager = { - sessionCommands = '' - feh --bg-scale ${../misc/recursion.png} - ''; - defaultSession = "none+dwm"; - lightdm = { - enable = true; - background = ../misc/recursion.png; - extraConfig = "minimum-vt=1"; - greeters.mini = { - enable = true; - user = settings.username; - extraConfig = '' - [greeter] - show-password-label = false - password-label-text = - invalid-password-text = - show-input-cursor = false - password-alignment = center - password-input-width = 19 - show-image-on-all-monitors = true - - - [greeter-theme] - font = "OverpassMono Nerd Font" - font-size = 1.1em - text-color = "#7AA2F7" - error-color = "#DB4B4B" - background-color = "#000000" - window-color = "#000000" - border-color = "#000000" - password-character = -1 - password-color = "#7AA2F7" - password-background-color = "#24283B" - password-border-color = "#000000" - password-border-radius = 0.341125em - ''; - }; - }; - }; - }; -} diff --git a/imports/gnome.nix b/imports/gnome.nix deleted file mode 100644 index 28a25b8..0000000 --- a/imports/gnome.nix +++ /dev/null @@ -1,89 +0,0 @@ -_: { - pkgs, - settings, - ... -}: { - environment.gnome.excludePackages = - (with pkgs; [ - gnome-photos - gnome-tour - gnome-console - gnome-text-editor - gnome-online-accounts - ]) - ++ (with pkgs.gnome; [ - gnome-terminal - gnome-weather - gnome-shell - gnome-calculator - gnome-disk-utility - gnome-maps - gnome-clocks - gnome-remote-desktop - gnome-calendar - gnome-music - simple-scan - cheese # webcam tool - gedit # text editor - epiphany # web browser - geary # email reader - evince # document viewer - gnome-characters - totem # video player - tali # poker game - iagno # go game - hitori # sudoku game - atomix # puzzle game - ]); - services.xserver = { - enable = true; - exportConfiguration = true; #make config debuggable - layout = "us"; - libinput.enable = true; - xautolock.enable = false; - desktopManager.xterm.enable = false; - excludePackages = [pkgs.xterm]; - desktopManager.gnome.enable = true; - displayManager = { - autoLogin = { - enable = true; - user = settings.username; - }; - defaultSession = "gnome"; - lightdm = { - enable = true; - extraConfig = "minimum-vt=1"; - background = ../misc/recursion.png; - greeters.mini = { - enable = true; - user = settings.username; - extraConfig = '' - [greeter] - show-password-label = false - password-label-text = - invalid-password-text = - show-input-cursor = false - password-alignment = center - password-input-width = 19 - show-image-on-all-monitors = true - - - [greeter-theme] - font = "OverpassMono Nerd Font" - font-size = 1.1em - text-color = "#7AA2F7" - error-color = "#DB4B4B" - background-color = "#000000" - window-color = "#000000" - border-color = "#000000" - password-character = -1 - password-color = "#7AA2F7" - password-background-color = "#24283B" - password-border-color = "#000000" - password-border-radius = 0.341125em - ''; - }; - }; - }; - }; -} diff --git a/imports/xfce.nix b/imports/xfce.nix deleted file mode 100644 index bd6a39c..0000000 --- a/imports/xfce.nix +++ /dev/null @@ -1,61 +0,0 @@ -_: { - pkgs, - settings, - ... -}: { - services.xserver = { - enable = true; - exportConfiguration = true; #make config debuggable - layout = "us"; - libinput.enable = true; - xautolock.enable = false; - desktopManager.xterm.enable = false; - excludePackages = [pkgs.xterm]; - desktopManager.gnome.enable = true; - displayManager = { - autoLogin = { - enable = true; - user = settings.username; - }; - defaultSession = "xfce"; - lightdm = { - enable = true; - extraConfig = "minimum-vt=1"; - background = ../misc/recursion.png; - greeters.mini = { - enable = true; - user = settings.username; - extraConfig = '' - [greeter] - show-password-label = false - password-label-text = - invalid-password-text = - show-input-cursor = false - password-alignment = center - password-input-width = 19 - show-image-on-all-monitors = true - - - [greeter-theme] - font = "OverpassMono Nerd Font" - font-size = 1.1em - text-color = "#7AA2F7" - error-color = "#DB4B4B" - background-color = "#000000" - window-color = "#000000" - border-color = "#000000" - password-character = -1 - password-color = "#7AA2F7" - password-background-color = "#24283B" - password-border-color = "#000000" - password-border-radius = 0.341125em - ''; - }; - }; - }; - desktopManager.xfce = { - enable = true; - enableScreensaver = true; - }; - }; -} diff --git a/modules/DE-WM/default.nix b/modules/DE-WM/default.nix new file mode 100644 index 0000000..d10f5cf --- /dev/null +++ b/modules/DE-WM/default.nix @@ -0,0 +1,7 @@ +inputs: { + imports = [ + (import ./gnome.nix inputs) + (import ./xfce.nix inputs) + (import ./dwm.nix inputs) + ]; +} diff --git a/modules/DE-WM/dwm.nix b/modules/DE-WM/dwm.nix new file mode 100644 index 0000000..c584b86 --- /dev/null +++ b/modules/DE-WM/dwm.nix @@ -0,0 +1,32 @@ +{suckless, ...}: { + pkgs, + config, + options, + lib, + self, + ... +}: +with lib; let + cfg = config.localModules.dwm; +in { + options.localModules.dwm = { + enable = mkEnableOption ""; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [suckless.packages.${pkgs.system}.dmenu]; + services.xserver = { + enable = true; + windowManager.dwm = { + enable = true; + package = suckless.packages.${pkgs.system}.dwm; + }; + displayManager = { + sessionCommands = '' + feh --bg-scale ${self + /misc/recursion.png} + ''; + defaultSession = "none+dwm"; + }; + }; + }; +} diff --git a/modules/DE-WM/gnome.nix b/modules/DE-WM/gnome.nix new file mode 100644 index 0000000..cf8564f --- /dev/null +++ b/modules/DE-WM/gnome.nix @@ -0,0 +1,53 @@ +_: { + config, + lib, + options, + pkgs, + ... +}: +with lib; let + cfg = config.localModules.gnome; +in { + options.localModules.gnome = { + enable = mkEnableOption ""; + }; + config = mkIf cfg.enable { + environment.gnome.excludePackages = + (with pkgs; [ + gnome-photos + gnome-tour + gnome-console + gnome-text-editor + gnome-online-accounts + ]) + ++ (with pkgs.gnome; [ + gnome-terminal + gnome-weather + gnome-shell + gnome-calculator + gnome-disk-utility + gnome-maps + gnome-clocks + gnome-remote-desktop + gnome-calendar + gnome-music + simple-scan + cheese # webcam tool + gedit # text editor + epiphany # web browser + geary # email reader + evince # document viewer + gnome-characters + totem # video player + tali # poker game + iagno # go game + hitori # sudoku game + atomix # puzzle game + ]); + services.xserver = { + enable = true; + desktopManager.gnome.enable = true; + displayManager.defaultSession = "gnome"; + }; + }; +} diff --git a/modules/DE-WM/xfce.nix b/modules/DE-WM/xfce.nix new file mode 100644 index 0000000..a42d9e9 --- /dev/null +++ b/modules/DE-WM/xfce.nix @@ -0,0 +1,23 @@ +_: { + config, + lib, + options, + ... +}: +with lib; let + cfg = config.localModules.xfce; +in { + options.localModules.xfce = { + enable = mkEnableOption ""; + }; + config = mkIf cfg.enable { + services.xserver = { + enable = true; + desktopManager.xfce = { + enable = true; + enableScreensaver = true; + }; + displayManager.defaultSession = "xfce"; + }; + }; +} diff --git a/modules/DM/autoLogin.nix b/modules/DM/autoLogin.nix new file mode 100644 index 0000000..0973e66 --- /dev/null +++ b/modules/DM/autoLogin.nix @@ -0,0 +1,22 @@ +_: { + config, + lib, + options, + settings, + ... +}: +with lib; let + cfg = config.localModules.autoLogin; +in { + options.localModules.autoLogin = { + enable = mkEnableOption ""; + }; + config = mkIf cfg.enable { + services.xserver.displayManager = { + autoLogin = { + enable = true; + user = settings.username; + }; + }; + }; +} diff --git a/modules/DM/default.nix b/modules/DM/default.nix new file mode 100644 index 0000000..b9528e8 --- /dev/null +++ b/modules/DM/default.nix @@ -0,0 +1,6 @@ +inputs: { + imports = [ + (import ./lightDM.nix inputs) + (import ./autoLogin.nix inputs) + ]; +} diff --git a/modules/DM/lightDM.nix b/modules/DM/lightDM.nix new file mode 100644 index 0000000..1a06a94 --- /dev/null +++ b/modules/DM/lightDM.nix @@ -0,0 +1,55 @@ +_: { + config, + lib, + options, + settings, + self, + ... +}: +with lib; let + cfg = config.localModules.lightdm; +in { + options.localModules.lightdm = { + enable = mkEnableOption ""; + }; + config = mkIf cfg.enable { + services.xserver = { + displayManager = { + lightdm = { + enable = true; + background = self + /misc/recursion.png; + extraConfig = "minimum-vt=1"; + greeters.mini = { + enable = true; + user = settings.username; + extraConfig = '' + [greeter] + show-password-label = false + password-label-text = + invalid-password-text = + show-input-cursor = false + password-alignment = center + password-input-width = 19 + show-image-on-all-monitors = true + + + [greeter-theme] + font = "OverpassMono Nerd Font" + font-size = 1.1em + text-color = "#7AA2F7" + error-color = "#DB4B4B" + background-color = "#000000" + window-color = "#000000" + border-color = "#000000" + password-character = -1 + password-color = "#7AA2F7" + password-background-color = "#24283B" + password-border-color = "#000000" + password-border-radius = 0.341125em + ''; + }; + }; + }; + }; + }; +} diff --git a/modules/common/default.nix b/modules/common/default.nix new file mode 100644 index 0000000..7097285 --- /dev/null +++ b/modules/common/default.nix @@ -0,0 +1,6 @@ +inputs: { + imports = [ + (import ./nix.nix inputs) + (import ./x.nix inputs) + ]; +} diff --git a/nix.nix b/modules/common/nix.nix similarity index 100% rename from nix.nix rename to modules/common/nix.nix diff --git a/modules/common/x.nix b/modules/common/x.nix new file mode 100644 index 0000000..c72d600 --- /dev/null +++ b/modules/common/x.nix @@ -0,0 +1,15 @@ +_: { + lib, + pkgs, + ... +}: +with lib; { + services.xserver = { + exportConfiguration = mkDefault true; + layout = mkDefault "us"; + libinput.enable = mkDefault true; + xautolock.enable = mkDefault false; + desktopManager.xterm.enable = mkDefault false; + excludePackages = mkDefault [pkgs.xterm]; + }; +} diff --git a/modules/default.nix b/modules/default.nix index e1ed271..01403a0 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,6 +1,10 @@ inputs: { imports = [ (import ./sxhkd.nix inputs) + (import ./common inputs) (import ./unfree.nix inputs) + (import ./DE-WM inputs) + (import ./DM inputs) + (import ./hardware.nix inputs) ]; } diff --git a/modules/hardware.nix b/modules/hardware.nix new file mode 100644 index 0000000..31660bd --- /dev/null +++ b/modules/hardware.nix @@ -0,0 +1,59 @@ +_: { + config, + options, + ... +}: let + cfg = config.localModules.hardware; +in { + options.localModules.hardware = { + gpuAcceleration = { + disable = mkOption { + type = types.bool; + default = false; + }; + }; + sound = { + disable = mkOption { + type = types.bool; + default = false; + }; + }; + }; + config = + mkMerge [ + ( + mkIf (! cfg.gpuAcceleration.disable) { + hardware = { + opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + }; + } + ) + (mkIf (! cfg.sound.disable) { + security.rtkit.enable = true; + sound.enable = lib.mkForce false; #disable alsa + hardware.pulseaudio.enable = lib.mkForce false; #disable pulseAudio + services.pipewire = { + enable = true; + audio.enable = true; + wireplumber.enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + }) + ] + ++ { + hardware = { + cpu = { + intel.updateMicrocode = true; + amd.updateMicrocode = true; + enableRedistributableFirmware = true; + }; + }; + }; +} diff --git a/systems/gerg-desktop/default.nix b/systems/gerg-desktop/default.nix index 44cbb5e..f07f3ec 100644 --- a/systems/gerg-desktop/default.nix +++ b/systems/gerg-desktop/default.nix @@ -6,7 +6,7 @@ inputs: { }: { imports = [ # (import ../imports/boot.nix inputs) - (import ../../imports/dwm.nix inputs) + #(import ../../imports/dwm.nix inputs) (import ../../imports/fonts.nix inputs) (import ../../imports/git.nix inputs) (import ../../imports/packages.nix inputs) @@ -23,8 +23,13 @@ inputs: { localModules = { sxhkd.enable = true; + dwm.enable = true; + lightdm.enable = true; + autoLogin.enable = true; }; + services.gvfs.enable = true; #gvfs for pcmanfm + environment.systemPackages = with pkgs; [ webcord # talk to people (gross) bitwarden #store stuff