From 7c3c15a9a2bc6efcb2c1653c900370d7a3b4f77b Mon Sep 17 00:00:00 2001 From: foglar Date: Sat, 23 Nov 2024 18:47:55 +0100 Subject: [PATCH] Modularization of configuration --- nixos/configuration.nix | 7 +- nixos/desktop/hyprland/hyprland.nix | 2 +- nixos/desktop/hyprland/packages.nix | 3 +- nixos/desktop/hyprland/rofi.nix | 4 +- nixos/home.nix | 37 +++++++++- nixos/packages/applications.nix | 2 +- nixos/packages/games.nix | 1 - nixos/packages/programming/code.nix | 1 + nixos/system/packages/docker.nix | 3 +- nixos/system/packages/steam.nix | 11 +++ nixos/system/sys/audio.nix | 37 ++++++---- nixos/system/sys/desktops.nix | 102 ++++++++++++++++------------ nixos/system/sys/fonts.nix | 25 +++++-- nixos/system/sys/locales.nix | 50 ++++++++------ nixos/system/sys/network.nix | 42 ++++++++---- nixos/system/sys/nvidia.nix | 88 +++++++++++++----------- nixos/system/sys/printing.nix | 55 +++++++++------ nixos/system/sys/sddm.nix | 49 +++++++------ nixos/system/sys/style.nix | 59 +++++++++------- nixos/system/system.nix | 19 +++++- 20 files changed, 377 insertions(+), 220 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index cc5fc80..3b4c8d9 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -2,6 +2,7 @@ inputs, pkgs, pkgs-stable, + username, ... }: { imports = [ @@ -28,14 +29,14 @@ WLR_NO_HARDWARE_CURSORS = "1"; NIXOS_OZONE_WL = "1"; EDITOR = "nvim"; - FLAKE = "/home/foglar/dotfiles"; + FLAKE = "/home/${username}/dotfiles"; DEFAULT_BROWSER = "${pkgs.librewolf}/bin/librewolf"; }; - users.users.foglar = { + users.users.${username} = { isNormalUser = true; - description = "foglar"; + description = "${username}"; extraGroups = ["wheel"]; }; diff --git a/nixos/desktop/hyprland/hyprland.nix b/nixos/desktop/hyprland/hyprland.nix index 08fd822..1d91bb3 100644 --- a/nixos/desktop/hyprland/hyprland.nix +++ b/nixos/desktop/hyprland/hyprland.nix @@ -148,7 +148,7 @@ "$mod" = "SUPER"; "$term" = "${pkgs.kitty}/bin/kitty"; "$editor" = "${pkgs.vscode}/bin/code"; - "$file" = "dolphin"; + "$file" = "nautilus"; "$browser" = "${pkgs.librewolf}/bin/librewolf"; animations = { diff --git a/nixos/desktop/hyprland/packages.nix b/nixos/desktop/hyprland/packages.nix index c4d3642..0b563b2 100644 --- a/nixos/desktop/hyprland/packages.nix +++ b/nixos/desktop/hyprland/packages.nix @@ -5,8 +5,6 @@ hypridle hyprpolkitagent - kdePackages.dolphin - dunst libnotify swayosd @@ -81,5 +79,6 @@ #(writeShellScriptBin "rofilaunch" '''') ]) ++ (with pkgs-stable; [ pavucontrol + gnome.nautilus ]); } diff --git a/nixos/desktop/hyprland/rofi.nix b/nixos/desktop/hyprland/rofi.nix index 545cbb7..54e5f7c 100644 --- a/nixos/desktop/hyprland/rofi.nix +++ b/nixos/desktop/hyprland/rofi.nix @@ -69,7 +69,7 @@ orientation = mkLiteral "vertical"; children = ["inputbar" "listbox"]; background-color = mkLiteral "transparent"; - background-image = mkLiteral "url(\"~/dotfiles/nixos/aurora_borealis.png\", height)"; + background-image = mkLiteral "url(\"~/dotfiles/config/backgrounds/aurora_borealis.png\", height)"; }; # Input bar settings @@ -79,7 +79,7 @@ padding = mkLiteral "5em"; children = ["entry"]; background-color = mkLiteral "transparent"; - background-image = mkLiteral "url(\"~/dotfiles/nixos/aurora_borealis.png\", width)"; + background-image = mkLiteral "url(\"~/dotfiles/config/backgrounds/aurora_borealis.png\", width)"; }; # Entry field settings diff --git a/nixos/home.nix b/nixos/home.nix index 4fd1405..e99f3eb 100644 --- a/nixos/home.nix +++ b/nixos/home.nix @@ -1,4 +1,7 @@ -{...}: { +{ + pkgs, + ... +}: { home.username = "foglar"; home.homeDirectory = "/home/foglar"; home.stateVersion = "24.05"; # Please read the comment before changing. @@ -66,6 +69,38 @@ XDG_PICTURES_DIR = "$HOME/Pictures/Screenshots/"; }; + home.packages = with pkgs; [ + (writeShellScriptBin "gs" '' + set -xeuo pipefail + + gamescopeArgs=( + --adaptive-sync # VRR support + --hdr-enabled + --mangoapp # performance overlay + --rt + --steam + ) + steamArgs=( + -pipewire-dmabuf + -tenfoot + ) + mangoConfig=( + cpu_temp + gpu_temp + ram + vram + ) + mangoVars=( + MANGOHUD=1 + MANGOHUD_CONFIG="$(IFS=,; echo "$mangoConfig[*]")" + ) + + export "$mangoVars[@]" + exec gamescope "$gamescopeArgs[@]" -- steam "$steamArgs[@]" + + '') + ]; + # Let Home Manager install and manage itself. programs.home-manager.enable = true; } diff --git a/nixos/packages/applications.nix b/nixos/packages/applications.nix index 19efea8..ad37495 100644 --- a/nixos/packages/applications.nix +++ b/nixos/packages/applications.nix @@ -23,13 +23,13 @@ libreoffice localsend plasma5Packages.kdeconnect-kde - qbittorrent vlc openrocket spotify spotube inkscape gnome-disk-utility + qbittorrent ]) ++ (with pkgs-stable; [ loupe diff --git a/nixos/packages/games.nix b/nixos/packages/games.nix index e60a019..b093103 100644 --- a/nixos/packages/games.nix +++ b/nixos/packages/games.nix @@ -13,7 +13,6 @@ vitetris steam heroic - gamescope wine (writeShellScriptBin "nvidia-offload" '' diff --git a/nixos/packages/programming/code.nix b/nixos/packages/programming/code.nix index d4b8483..dee6299 100644 --- a/nixos/packages/programming/code.nix +++ b/nixos/packages/programming/code.nix @@ -37,6 +37,7 @@ "security.workspace.trust.enabled" = false; "terminal.external.linuxExec" = "kitty"; "terminal.integrated.stickyScroll.enabled" = true; + "terminal.integrated.inheritEnv"= false; "telemetry.telemetryLevel" = "off"; "workbench.activityBar.location" = "hidden"; # bottom "workbench.iconTheme" = "material-icon-theme"; diff --git a/nixos/system/packages/docker.nix b/nixos/system/packages/docker.nix index 4b45b3f..cf513df 100644 --- a/nixos/system/packages/docker.nix +++ b/nixos/system/packages/docker.nix @@ -1,6 +1,7 @@ { lib, config, + username, ... }: { options = { @@ -16,6 +17,6 @@ }; }; - users.users.foglar.extraGroups = [ "docker" ]; + users.users.${username}.extraGroups = [ "docker" ]; }; } diff --git a/nixos/system/packages/steam.nix b/nixos/system/packages/steam.nix index 39aba2f..a7e13c5 100644 --- a/nixos/system/packages/steam.nix +++ b/nixos/system/packages/steam.nix @@ -1,6 +1,8 @@ { lib, config, + pkgs, + username, ... }: { options = { @@ -10,9 +12,18 @@ config = lib.mkIf config.package.steam.enable { programs.steam = { enable = true; + gamescopeSession.enable = true; remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers }; + + services.getty.autologinUser = "${username}"; + environment = { + systemPackages = [pkgs.mangohud]; + loginShellInit = '' + [[ "$(tty)" = "/dev/tty1" ]] && ./gs + ''; + }; }; } diff --git a/nixos/system/sys/audio.nix b/nixos/system/sys/audio.nix index 38167c8..accf161 100644 --- a/nixos/system/sys/audio.nix +++ b/nixos/system/sys/audio.nix @@ -1,18 +1,25 @@ -{...}: { - # Enable sound with pipewire. - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; + lib, + config, + ... +}: { + options.sys.audio.enable = lib.mkEnableOption "Enable audio support"; - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; + config = lib.mkIf config.sys.audio.enable { + # Enable sound with pipewire. + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; }; -} \ No newline at end of file +} diff --git a/nixos/system/sys/desktops.nix b/nixos/system/sys/desktops.nix index 03eb156..c1f39c4 100644 --- a/nixos/system/sys/desktops.nix +++ b/nixos/system/sys/desktops.nix @@ -1,48 +1,64 @@ { + lib, + config, inputs, pkgs, ... -}: -{ - services.desktopManager.plasma6.enable = true; - #services.xserver.desktopManager.gnome.enable = true; - - #environment.gnome.excludePackages = with pkgs; [ - # gnome-tour - # gnome-connections - # epiphany # web browser - # geary # email reader. Up to 24.05. Starting from 24.11 the package name is just geary. - # #evince # document viewer - # gnome-weather - # gnome-contacts - # gnome-maps - # gnome-logs - # gnome-music - # gnome-system-monitor - # gnome-text-editor - # yelp - # totem - # snapshot - # seahorse - #]; - - environment.plasma6.excludePackages = with pkgs.kdePackages; [ - ark - plasma-browser-integration - konsole - oxygen - gwenview - okular - elisa - kate - krdp - khelpcenter - ]; - - programs.hyprland = { - enable = true; - xwayland.enable = true; - package = inputs.hyprland.packages."${pkgs.system}".hyprland; - portalPackage = pkgs.xdg-desktop-portal-hyprland; +}: { + options = { + sys.desktop.plasma.enable = lib.mkEnableOption "Plasma Desktop"; + sys.desktop.gnome.enable = lib.mkEnableOption "GNOME Desktop"; + sys.desktop.hyprland.enable = lib.mkEnableOption "Hyprland Desktop"; }; -} \ No newline at end of file + + config = lib.mkMerge [ + (lib.mkIf config.sys.desktop.plasma.enable { + services.desktopManager.plasma6.enable = true; + + environment.plasma6.excludePackages = with pkgs.kdePackages; [ + ark + plasma-browser-integration + konsole + oxygen + gwenview + okular + elisa + kate + krdp + khelpcenter + ]; + }) + + (lib.mkIf config.sys.desktop.gnome.enable { + services.xserver.desktopManager.gnome.enable = true; + + environment.gnome.excludePackages = with pkgs; [ + gnome-tour + gnome-connections + epiphany # web browser + geary # email reader. Up to 24.05. Starting from 24.11 the package name is just geary. + #evince # document viewer + gnome-weather + gnome-contacts + gnome-maps + gnome-logs + gnome-music + gnome-system-monitor + gnome-text-editor + yelp + totem + snapshot + seahorse + ]; + }) + + (lib.mkIf config.sys.desktop.hyprland.enable { + programs.hyprland = { + enable = true; + xwayland.enable = true; + package = inputs.hyprland.packages."${pkgs.system}".hyprland; + portalPackage = pkgs.xdg-desktop-portal-hyprland; + }; + }) + ]; +} diff --git a/nixos/system/sys/fonts.nix b/nixos/system/sys/fonts.nix index f570783..ad7106b 100644 --- a/nixos/system/sys/fonts.nix +++ b/nixos/system/sys/fonts.nix @@ -1,8 +1,19 @@ -{pkgs, ...}: { - fonts.packages = with pkgs; [ - noto-fonts - noto-fonts-emoji - (nerdfonts.override {fonts = ["JetBrainsMono"];}) - monaspace - ]; +{ + config, + lib, + pkgs, + ... +}: { + options = { + sys.fonts.packages = pkgs.lib.mkEnableOption "Install fonts"; + }; + + config = lib.mkIf config.sys.fonts.packages { + fonts.packages = with pkgs; [ + noto-fonts + noto-fonts-emoji + (nerdfonts.override {fonts = ["JetBrainsMono"];}) + monaspace + ]; + }; } diff --git a/nixos/system/sys/locales.nix b/nixos/system/sys/locales.nix index 5bf5be9..8b3cf3b 100644 --- a/nixos/system/sys/locales.nix +++ b/nixos/system/sys/locales.nix @@ -1,23 +1,35 @@ -{...}: { - # Set your time zone. - time.timeZone = "Europe/Prague"; - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "cs_CZ.UTF-8"; - LC_IDENTIFICATION = "cs_CZ.UTF-8"; - LC_MEASUREMENT = "cs_CZ.UTF-8"; - LC_MONETARY = "cs_CZ.UTF-8"; - LC_NAME = "cs_CZ.UTF-8"; - LC_NUMERIC = "cs_CZ.UTF-8"; - LC_PAPER = "cs_CZ.UTF-8"; - LC_TELEPHONE = "cs_CZ.UTF-8"; - LC_TIME = "cs_CZ.UTF-8"; +{ + lib, + config, + ... +}: { + options = { + sys.locales = { + enable = lib.mkEnableOption "Enable locales configuration"; + }; }; - services.xserver = { - xkb.layout = "us,cz"; - xkb.options = "grp:win_space_toggle"; + config = lib.mkIf config.sys.locales.enable { + # Set your time zone. + time.timeZone = "Europe/Prague"; + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "cs_CZ.UTF-8"; + LC_IDENTIFICATION = "cs_CZ.UTF-8"; + LC_MEASUREMENT = "cs_CZ.UTF-8"; + LC_MONETARY = "cs_CZ.UTF-8"; + LC_NAME = "cs_CZ.UTF-8"; + LC_NUMERIC = "cs_CZ.UTF-8"; + LC_PAPER = "cs_CZ.UTF-8"; + LC_TELEPHONE = "cs_CZ.UTF-8"; + LC_TIME = "cs_CZ.UTF-8"; + }; + + services.xserver = { + xkb.layout = "us,cz"; + xkb.options = "grp:win_space_toggle"; + }; }; } diff --git a/nixos/system/sys/network.nix b/nixos/system/sys/network.nix index a0296db..dd8ce29 100644 --- a/nixos/system/sys/network.nix +++ b/nixos/system/sys/network.nix @@ -1,16 +1,34 @@ -{...}: { - networking.hostName = "laptop"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. +{ + lib, + config, + hostname, + username, + ... +}: { + options = { + sys.network.enable = lib.mkEnableOption "Enable networking"; + sys.bluetooth.enable = lib.mkEnableOption "Enable Bluetooth support"; + }; - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + config = lib.mkMerge [ + (lib.mkIf config.sys.network.enable { + networking.hostName = "${hostname}"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # Enable networking - networking.networkmanager.enable = true; - hardware.bluetooth.enable = true; # enables support for Bluetooth - hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot - services.blueman.enable = true; + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - users.users.foglar.extraGroups = [ "networkmanager" ]; + # Enable networking + networking.networkmanager.enable = true; + users.users.${username}.extraGroups = ["networkmanager"]; + }) + ( + lib.mkIf config.sys.bluetooth.enable { + hardware.bluetooth.enable = true; # enables support for Bluetooth + hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot + services.blueman.enable = true; + } + ) + ]; } diff --git a/nixos/system/sys/nvidia.nix b/nixos/system/sys/nvidia.nix index 70c74cc..1878a64 100644 --- a/nixos/system/sys/nvidia.nix +++ b/nixos/system/sys/nvidia.nix @@ -1,45 +1,55 @@ -{config, ...}: { - hardware = { - graphics.enable = true; +{ + lib, + config, + ... +}: { + options = { + sys.nvidia.enable = lib.mkEnableOption "Enable Nvidia graphics support"; }; - - services.xserver.videoDrivers = ["nvidia"]; - hardware.nvidia = { - # Modesetting is required. - modesetting.enable = true; - - # Nvidia power management. Experimental, and can cause sleep/suspend to fail. - # Enable this if you have graphical corruption issues or application crashes after waking - # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead - # of just the bare essentials. - powerManagement.enable = false; - - # Fine-grained power management. Turns off GPU when not in use. - # Experimental and only works on modern Nvidia GPUs (Turing or newer). - powerManagement.finegrained = false; - - # Use the NVidia open source kernel module (not to be confused with the - # independent third-party "nouveau" open source driver). - # Support is limited to the Turing and later architectures. Full list of - # supported GPUs is at: - # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus - # Only available from driver 515.43.04+ - # Currently alpha-quality/buggy, so false is currently the recommended setting. - open = false; - - # Enable the Nvidia settings menu, - # accessible via `nvidia-settings`. - nvidiaSettings = true; - prime.amdgpuBusId = "pci@000:04:0"; - prime.nvidiaBusId = "pci@000:01:0"; - - prime.offload = { - enable = true; - enableOffloadCmd = true; + config = lib.mkIf config.sys.nvidia.enable { + hardware = { + graphics.enable = true; }; - # Optionally, you may need to select the appropriate driver version for your specific GPU. - package = config.boot.kernelPackages.nvidiaPackages.stable; + services.xserver.videoDrivers = ["nvidia"]; + + hardware.nvidia = { + # Modesetting is required. + modesetting.enable = true; + + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + # Enable this if you have graphical corruption issues or application crashes after waking + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # of just the bare essentials. + powerManagement.enable = false; + + # Fine-grained power management. Turns off GPU when not in use. + # Experimental and only works on modern Nvidia GPUs (Turing or newer). + powerManagement.finegrained = false; + + # Use the NVidia open source kernel module (not to be confused with the + # independent third-party "nouveau" open source driver). + # Support is limited to the Turing and later architectures. Full list of + # supported GPUs is at: + # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus + # Only available from driver 515.43.04+ + # Currently alpha-quality/buggy, so false is currently the recommended setting. + open = false; + + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = true; + prime.amdgpuBusId = "pci@000:04:0"; + prime.nvidiaBusId = "pci@000:01:0"; + + prime.offload = { + enable = true; + enableOffloadCmd = true; + }; + + # Optionally, you may need to select the appropriate driver version for your specific GPU. + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; }; } diff --git a/nixos/system/sys/printing.nix b/nixos/system/sys/printing.nix index 549c74e..5ef8fea 100644 --- a/nixos/system/sys/printing.nix +++ b/nixos/system/sys/printing.nix @@ -1,26 +1,37 @@ -{pkgs, ...}: { - # Printing - services.printing.enable = true; - services.printing.drivers = with pkgs; [gutenprint hplip splix]; - hardware.printers = { - #ensurePrinters = [ - # { - # name = "HP_psc_1200_series"; - # location = "Home"; - # deviceUri = "usb://HP/psc%201200%20series?serial=UA51SGB35WT0&interface=1"; - # model = "HP_psc_1200_series.ppd"; - # ppdOptions = { - # PageSize = "A4"; - # }; - # } - #]; - #ensureDefaultPrinter = "HP_psc_1200_series"; +{ + lib, + config, + pkgs, + username, + ... +}: { + options = { + sys.printing.enable = lib.mkEnableOption "Enable printing support"; }; - # Scanning - hardware.sane.enable = true; - services.ipp-usb.enable = true; - hardware.sane.extraBackends = [pkgs.hplipWithPlugin]; + config = lib.mkIf config.sys.printing.enable { + services.printing.enable = true; + services.printing.drivers = with pkgs; [gutenprint hplip splix]; + hardware.printers = { + #ensurePrinters = [ + # { + # name = "HP_psc_1200_series"; + # location = "Home"; + # deviceUri = "usb://HP/psc%201200%20series?serial=UA51SGB35WT0&interface=1"; + # model = "HP_psc_1200_series.ppd"; + # ppdOptions = { + # PageSize = "A4"; + # }; + # } + #]; + #ensureDefaultPrinter = "HP_psc_1200_series"; + }; - users.users.foglar.extraGroups = ["lp" "scanner"]; + # Scanning + hardware.sane.enable = true; + services.ipp-usb.enable = true; + hardware.sane.extraBackends = [pkgs.hplipWithPlugin]; + + users.users.${username}.extraGroups = ["lp" "scanner"]; + }; } diff --git a/nixos/system/sys/sddm.nix b/nixos/system/sys/sddm.nix index fc7ba3f..2cb1b1d 100644 --- a/nixos/system/sys/sddm.nix +++ b/nixos/system/sys/sddm.nix @@ -1,28 +1,33 @@ { - pkgs, lib, + config, + pkgs, ... -}: -{ - - services.displayManager = { - defaultSession = "hyprland"; - sddm = { - enable = true; - wayland.enable = true; - theme = "sddm-astronaut-theme"; - package = lib.mkDefault pkgs.kdePackages.sddm; - extraPackages = [pkgs.sddm-astronaut pkgs.kdePackages.qtvirtualkeyboard]; - }; +}: { + options = { + sys.sddm.enable = lib.mkEnableOption "Enable SDDM login"; }; - environment.systemPackages = with pkgs; [ - (sddm-astronaut.override { - themeConfig = { - ScreenWidth = 1920; - ScreenHeight = 1080; - PartialBlur = false; + config = lib.mkIf config.sys.sddm.enable { + services.displayManager = { + defaultSession = "hyprland"; + sddm = { + enable = true; + wayland.enable = true; + theme = "sddm-astronaut-theme"; + package = lib.mkDefault pkgs.kdePackages.sddm; + extraPackages = [pkgs.sddm-astronaut pkgs.kdePackages.qtvirtualkeyboard]; }; - }) - ]; -} \ No newline at end of file + }; + + environment.systemPackages = with pkgs; [ + (sddm-astronaut.override { + themeConfig = { + ScreenWidth = 1920; + ScreenHeight = 1080; + PartialBlur = false; + }; + }) + ]; + }; +} diff --git a/nixos/system/sys/style.nix b/nixos/system/sys/style.nix index 62e8e5e..0d10028 100644 --- a/nixos/system/sys/style.nix +++ b/nixos/system/sys/style.nix @@ -1,36 +1,43 @@ { + lib, + config, pkgs, ... -}: -{ - stylix = { - enable = true; - image = ../../../config/backgrounds/aurora_borealis.png; - base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; - #base16Scheme = "${pkgs.base16-schemes}/share/themes/onedark.yaml"; - #base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyo-night-dark.yaml"; - polarity = "dark"; - autoEnable = true; +}: { + options = { + sys.style.enable = lib.mkEnableOption "Enable the Stylix theme manager."; + }; - # Set the cursor theme. - cursor = { - package = pkgs.bibata-cursors; - name = "Bibata-Modern-Ice"; - size = 24; - }; + config = lib.mkIf config.sys.style.enable { + stylix = { + enable = true; + image = ../../../config/backgrounds/aurora_borealis.png; + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; + #base16Scheme = "${pkgs.base16-schemes}/share/themes/onedark.yaml"; + #base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyo-night-dark.yaml"; + polarity = "dark"; + autoEnable = true; - fonts = { - sizes = { - desktop = 8; - applications = 10; - popups = 10; - terminal = 12; + # Set the cursor theme. + cursor = { + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Ice"; + size = 24; }; - monospace = { - name = "JetBrainsMono Nerd Font"; - package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}; + fonts = { + sizes = { + desktop = 8; + applications = 10; + popups = 10; + terminal = 12; + }; + + monospace = { + name = "JetBrainsMono Nerd Font"; + package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}; + }; }; }; }; -} \ No newline at end of file +} diff --git a/nixos/system/system.nix b/nixos/system/system.nix index bc6e8bd..f65d360 100644 --- a/nixos/system/system.nix +++ b/nixos/system/system.nix @@ -1,5 +1,4 @@ -{...}: -{ +{lib, ...}: { imports = [ ./sys/audio.nix ./sys/desktops.nix @@ -11,4 +10,18 @@ ./sys/sddm.nix ./sys/style.nix ]; -} \ No newline at end of file + + sys.audio.enable = lib.mkDefault true; + sys.desktop.plasma.enable = lib.mkDefault true; + sys.desktop.gnome.enable = lib.mkDefault false; + sys.desktop.hyprland.enable = lib.mkDefault true; + sys.fonts.packages = lib.mkDefault true; + sys.locales.enable = lib.mkDefault true; + sys.network.enable = lib.mkDefault true; + sys.bluetooth.enable = lib.mkDefault true; + sys.nvidia.enable = lib.mkDefault true; + sys.printing.enable = lib.mkDefault true; + sys.sddm.enable = lib.mkDefault true; + sys.style.enable = lib.mkDefault true; + +}