diff --git a/.scripts/bin/tuirun-toggle.sh b/.scripts/bin/tuirun-toggle.sh index e8b4d859..c377e628 100755 --- a/.scripts/bin/tuirun-toggle.sh +++ b/.scripts/bin/tuirun-toggle.sh @@ -1,26 +1,36 @@ -#!/usr/bin/env bash +# Define TERMINAL if not set +TERMINAL="${TERMINAL:-foot}" # Path to the tuirun executable TUIRUN_PATH="/etc/profiles/per-user/$USER/bin/tuirun" -LOGFILE="$HOME/tuirun_debug.log" -echo "Launching tuirun..." >>"$LOGFILE" -date >>"$LOGFILE" +# Use absolute paths for commands +PGREP="/run/current-system/sw/bin/pgrep" +PKILL="/run/current-system/sw/bin/pkill" +HYPRCTL="/etc/profiles/per-user/$USER/bin/hyprctl" -if pgrep -f "alacritty --title tuirun" >/dev/null; then - echo "Terminating existing tuirun process" >>"$LOGFILE" - pkill -f "alacritty --title tuirun" +# Determine OPTIONS based on TERMINAL +if [ "$TERMINAL" = "foot" ]; then + OPTIONS="--override=main.pad=0x0" +elif [ "$TERMINAL" = "alacritty" ]; then + OPTIONS="--option window.padding.x=0 --option window.padding.y=0" else - echo "Starting new tuirun process" >>"$LOGFILE" - if ! hyprctl dispatch exec "alacritty --title tuirun -e sh -c '$TUIRUN_PATH'"; then - echo "Failed to launch tuirun in foot terminal" >>"$LOGFILE" - exit 1 - fi - sleep 1 # Give it a second to start - echo "Checking if tuirun process is still running..." >>"$LOGFILE" - if pgrep -f "$TUIRUN_PATH" >/dev/null; then - echo "tuirun is running" >>"$LOGFILE" - else - echo "tuirun exited prematurely" >>"$LOGFILE" - fi + OPTIONS="" +fi + +# Matching pattern for the process +MATCH_PATTERN="$TERMINAL --title tuirun" + +if "$PGREP" -f "$MATCH_PATTERN" >/dev/null; then + "$PKILL" -f "$MATCH_PATTERN" +else + # Construct the command + CMD="$TERMINAL --title tuirun" + if [ -n "$OPTIONS" ]; then + CMD="$CMD $OPTIONS" + fi + CMD="$CMD -e $TUIRUN_PATH" + + # Launch the terminal with OPTIONS + "$HYPRCTL" dispatch exec "$CMD" fi diff --git a/flake.lock b/flake.lock index cc1fe47d..af769e83 100644 --- a/flake.lock +++ b/flake.lock @@ -99,12 +99,12 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1726859881, - "narHash": "sha256-ZSgYPiOsa0RdaHOxBq19bqUglBv02Gt/O/Wbgkj5+vU=", - "rev": "404cdbe22e3b2c24df554bf835a866a2e6e41f83", - "revCount": 1418, + "lastModified": 1726952766, + "narHash": "sha256-w/1jB99f0eaQp5hVbJgkUl/PTrUN/XGxRVKBQZlZ43A=", + "rev": "a8b5d65ffe5c987dc7ab790588d011005e440d58", + "revCount": 1419, "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/chaotic-cx/nyx/0.1.1418%2Brev-404cdbe22e3b2c24df554bf835a866a2e6e41f83/019210e3-5112-74cb-9c12-5f42d274a50f/source.tar.gz?rev=404cdbe22e3b2c24df554bf835a866a2e6e41f83&revCount=1418" + "url": "https://api.flakehub.com/f/pinned/chaotic-cx/nyx/0.1.1419%2Brev-a8b5d65ffe5c987dc7ab790588d011005e440d58/0192167d-bd61-73b1-80b5-daa57fed5e16/source.tar.gz?rev=a8b5d65ffe5c987dc7ab790588d011005e440d58&revCount=1419" }, "original": { "type": "tarball", @@ -205,11 +205,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1726468443, - "narHash": "sha256-O1VcbVBrqIf58U05yFXl9+J7XM2qh0I+7vqMbNwZPq0=", + "lastModified": 1726900127, + "narHash": "sha256-v3r7yJY8YE4HAzD5DXOxLkzj8YZKQ0xuccp9yppGW1U=", "owner": "nix-community", "repo": "fenix", - "rev": "effac20e9560aab202e82b6d833f685163a9c138", + "rev": "18eefba7fd0bf03e115785948758a44125a9fd68", "type": "github" }, "original": { @@ -226,11 +226,11 @@ "rust-analyzer-src": "rust-analyzer-src_2" }, "locked": { - "lastModified": 1726900127, - "narHash": "sha256-v3r7yJY8YE4HAzD5DXOxLkzj8YZKQ0xuccp9yppGW1U=", + "lastModified": 1726986637, + "narHash": "sha256-webLScPFCax18Z2lQHhaWzqqQRvV2Y1lOADqUa7VQbU=", "owner": "nix-community", "repo": "fenix", - "rev": "18eefba7fd0bf03e115785948758a44125a9fd68", + "rev": "f5a9b01cd81b46228b3737669e8275b1f2da7d35", "type": "github" }, "original": { @@ -250,11 +250,11 @@ ] }, "locked": { - "lastModified": 1726921930, - "narHash": "sha256-ZkWbcsOlZYjTzgUjL5ac5qXidgb/s2hk++p1UsZUpSc=", + "lastModified": 1726960811, + "narHash": "sha256-dsXtISWmjHReplx9V18iCoEEKU9RcwmZJrIq0Jkzu3I=", "owner": "nix-community", "repo": "flake-firefox-nightly", - "rev": "c193460a0cc5ccee98a5d1e09b869ad3fd201bb9", + "rev": "e202a3f7dd9c9d1016e47124bea4f44e7a551284", "type": "github" }, "original": { @@ -644,11 +644,11 @@ ] }, "locked": { - "lastModified": 1726902823, - "narHash": "sha256-Gkc7pwTVLKj4HSvRt8tXNvosl8RS9hrBAEhOjAE0Tt4=", + "lastModified": 1726985855, + "narHash": "sha256-NJPGK030Y3qETpWBhj9oobDQRbXdXOPxtu+YgGvZ84o=", "owner": "nix-community", "repo": "home-manager", - "rev": "14929f7089268481d86b83ed31ffd88713dcd415", + "rev": "04213d1ce4221f5d9b40bcee30706ce9a91d148d", "type": "github" }, "original": { @@ -686,11 +686,11 @@ ] }, "locked": { - "lastModified": 1726440980, - "narHash": "sha256-ChhIrjtdu5d83W+YDRH+Ec5g1MmM0xk6hJnkz15Ot7M=", + "lastModified": 1726902823, + "narHash": "sha256-Gkc7pwTVLKj4HSvRt8tXNvosl8RS9hrBAEhOjAE0Tt4=", "owner": "nix-community", "repo": "home-manager", - "rev": "a9c9cc6e50f7cbd2d58ccb1cd46a1e06e9e445ff", + "rev": "14929f7089268481d86b83ed31ffd88713dcd415", "type": "github" }, "original": { @@ -773,11 +773,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1726918033, - "narHash": "sha256-I0U4OLssUlNd6/KXHwErmgmYZURTJYJNHbeoKaMH4iI=", + "lastModified": 1726995313, + "narHash": "sha256-HTbsXJDFugdQ794d1Bnh8eRSY7AlunIxd7jFW9kkKNM=", "ref": "refs/heads/main", - "rev": "8579066c7a1ceb745499ea4e11d5d420b1387ec0", - "revCount": 5246, + "rev": "e5ff19ac0f2c8d53a0c847d06a17676e636d6447", + "revCount": 5247, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -1016,11 +1016,11 @@ ] }, "locked": { - "lastModified": 1726115155, - "narHash": "sha256-VDylz5VX4JD4/TZv6xUJDwuvNdgLRGoOpue1dlZGdIQ=", + "lastModified": 1726902390, + "narHash": "sha256-ESAD6AkxsQdV/j5ZBcO4Vg94J7Xd0nfpiEZpJtwSEhg=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "02cf60ce20b6034fc0459e5116cec7016aaff6e4", + "rev": "faf4c746c068dd8e41b1fa5f18beeabd34d4064c", "type": "github" }, "original": { @@ -1133,11 +1133,11 @@ "umu": "umu" }, "locked": { - "lastModified": 1726853411, - "narHash": "sha256-+R8HmKGNV2PKUTmCyLKQeDCCpUqur23ucKR63M2SWAQ=", + "lastModified": 1726969451, + "narHash": "sha256-PuRj1ZoHkvUBak10HD55n7v3SDx5zCwn3av0JEoJteI=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "7ea77f2f1cd535c4d952128b349eca0b8a16d196", + "rev": "43a085bb0d25ec065838b3c5434627b87c686295", "type": "github" }, "original": { @@ -1226,11 +1226,11 @@ }, "nixpkgs-small": { "locked": { - "lastModified": 1726929174, - "narHash": "sha256-MbKM2df9xF9USr9uuOaB6p1s1ZzFzLZGIIifD3BTTWg=", + "lastModified": 1726972148, + "narHash": "sha256-LjqTgGAovaT9vcrQgZNjBO6fA4DdPfWSY1dcEn1f4cg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "eca2693230fe59318102f3726d2da305312c04a4", + "rev": "b8e6da32d920a9dec402390e08674f2b11427c24", "type": "github" }, "original": { @@ -1401,11 +1401,11 @@ }, "nur": { "locked": { - "lastModified": 1726950640, - "narHash": "sha256-VpU1v3QSxzwYLIQ9a9nRvSB1h3FlZzX7PYkgbQIacV0=", + "lastModified": 1726995785, + "narHash": "sha256-qpY9TCjtyhAeHa64NCyo3SoaHslxrrxQiMOPPY5lXEM=", "owner": "nix-community", "repo": "NUR", - "rev": "e0592ed4327a65f23f3d9ab73a08417ae5853747", + "rev": "474ea929fade537a0ba4f1e5b73abc0d157a293f", "type": "github" }, "original": { @@ -1740,11 +1740,11 @@ "systems": "systems_8" }, "locked": { - "lastModified": 1726953225, - "narHash": "sha256-Q9vQ+sEup4QbyoMYkz1hQ8Yti0nKZVPn+vVX0EpLoH0=", + "lastModified": 1726998061, + "narHash": "sha256-VgTXpSQuHQkSLvx3/lR8spnZK/iNniVoR3dcsQbEyQo=", "ref": "refs/heads/main", - "rev": "b283f82663e4a25d40da102481be7b1c9c88e354", - "revCount": 20, + "rev": "05f2efc7135167613ef4b190efd7ba4e01c424d6", + "revCount": 24, "type": "git", "url": "https://git.sr.ht/~canasta/tuirun" }, @@ -1792,11 +1792,11 @@ }, "locked": { "dir": "nix", - "lastModified": 1726951933, - "narHash": "sha256-YM4u7EPmcps3ObGTj7Qcfa6SNIGK7W3dFIBBtPMJ6SY=", + "lastModified": 1726976812, + "narHash": "sha256-7LHyNF/IATpeDg+fLH4LnwGbK3IymdNHTPRNLXnIoZs=", "owner": "wez", "repo": "wezterm", - "rev": "9d4a145303fe44d4ee49a330bdd053bf3fc1197d", + "rev": "1c4fdd3f7131785d0afaed08bed6cf1856f84328", "type": "github" }, "original": { @@ -1832,11 +1832,11 @@ ] }, "locked": { - "lastModified": 1726851729, - "narHash": "sha256-1z0esr5lBeUMlrPZ9gZmqZT8oTQekxJi53HAW4cH0Ms=", + "lastModified": 1726933538, + "narHash": "sha256-xTqnMoJsEojuvqJLuM+U7EZ7q71efaj3pbvjutq4TXc=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "73b8c4f1150040644cf678aa8bbf2cec48a433cf", + "rev": "4880c50146d0c2a3152d2b02f79253810c330c11", "type": "github" }, "original": { diff --git a/home/modules/terminal/foot/default.nix b/home/modules/terminal/foot/default.nix index 082f6aef..f8fd7765 100644 --- a/home/modules/terminal/foot/default.nix +++ b/home/modules/terminal/foot/default.nix @@ -1,13 +1,12 @@ -{ pkgs -, config -, lib -, ... -}: -let +{ + pkgs, + config, + lib, + ... +}: let inherit (lib) mkIf mkEnableOption; cfg = config.modules.terminal.foot; -in -{ +in { options = { modules.terminal.foot.enable = mkEnableOption "Enables foot terminal"; }; diff --git a/home/modules/terminal/kitty/default.nix b/home/modules/terminal/kitty/default.nix index 015dd4e4..7980507b 100644 --- a/home/modules/terminal/kitty/default.nix +++ b/home/modules/terminal/kitty/default.nix @@ -1,12 +1,11 @@ -{ config -, lib -, ... -}: -let +{ + config, + lib, + ... +}: let inherit (lib) mkIf mkEnableOption; cfg = config.modules.terminal.kitty; -in -{ +in { options = { modules.terminal.kitty.enable = mkEnableOption "Enables kitty terminal"; }; diff --git a/home/modules/wm/hyprland/cnst/keybinds.nix b/home/modules/wm/hyprland/cnst/keybinds.nix index fccc1be1..972dc10b 100644 --- a/home/modules/wm/hyprland/cnst/keybinds.nix +++ b/home/modules/wm/hyprland/cnst/keybinds.nix @@ -52,7 +52,7 @@ in { #bind = $mod, M, exec, hyprctl dispatch exit #bind = $mod, E, exec, $fileManager "$mod, E, exec, $fileManager" - "$mod, r, exec, $tuirun" + "$mod, R, exec, $tuirun" "$mod SHIFT, E, exec, $yazi" "$mod, F, fullscreen," "$mod SHIFT, F, togglefloating," diff --git a/home/modules/wm/hyprland/cnst/rules.nix b/home/modules/wm/hyprland/cnst/rules.nix index 9d173d40..7a1a4559 100644 --- a/home/modules/wm/hyprland/cnst/rules.nix +++ b/home/modules/wm/hyprland/cnst/rules.nix @@ -19,7 +19,7 @@ in { "float,initialTitle:(tuirun)" "size 600 300,initialTitle:(tuirun)" "center,initialTitle:(tuirun)" - # "workspace special:tuirun,initialTitle:(tuirun)" + "workspace special:tuirun,initialTitle:(tuirun)" "noborder,initialTitle:(tuirun)" #windowrulev2 = move 1708 32,class:(floatcal) "float,class:(org.keepassxc.KeePassXC)" diff --git a/hosts/cnix/default.nix b/hosts/cnix/default.nix index 4132809d..3d9074b6 100644 --- a/hosts/cnix/default.nix +++ b/hosts/cnix/default.nix @@ -36,15 +36,15 @@ in { ./modules.nix ]; - boot = { - consoleLogLevel = 3; - kernelPackages = lib.mkForce pkgs.linuxPackages_latest; - kernelParams = [ - "amd_pstate=active" - "quiet" - "splash" - ]; - }; + # boot = { + # consoleLogLevel = 3; + # kernelPackages = lib.mkForce pkgs.linuxPackages_latest; + # kernelParams = [ + # "amd_pstate=active" + # "quiet" + # "splash" + # ]; + # }; # environment.variables.COPILOT_API_KEY = config.age.secrets.cnstcopilot.path; diff --git a/hosts/cnix/modules.nix b/hosts/cnix/modules.nix index 7eccf160..47138e68 100644 --- a/hosts/cnix/modules.nix +++ b/hosts/cnix/modules.nix @@ -1,5 +1,17 @@ { modules = { + boot = { + loader = { + default.enable = false; + lanzaboote.enable = true; + }; + kernel = { + variant = "cachyos"; + hardware = "amd"; + extraKernelParams = []; + extraBlacklistedModules = []; + }; + }; gaming = { steam = { enable = true; @@ -154,6 +166,12 @@ anyrun = { enable = true; }; + chaotic = { + enable = true; + amd = { + enable = true; + }; + }; corectrl = { enable = true; }; diff --git a/hosts/cnixpad/default.nix b/hosts/cnixpad/default.nix index 02dd5022..40d0d5d0 100644 --- a/hosts/cnixpad/default.nix +++ b/hosts/cnixpad/default.nix @@ -35,16 +35,6 @@ in { ./modules.nix ]; - boot = { - consoleLogLevel = 3; - kernelPackages = lib.mkForce pkgs.linuxPackages_latest; - kernelParams = [ - "amd_pstate=active" - "quiet" - "splash" - ]; - }; - swapDevices = [ { device = "/var/lib/swapfile"; diff --git a/hosts/cnixpad/modules.nix b/hosts/cnixpad/modules.nix index a6672e1f..2b9ee5e2 100644 --- a/hosts/cnixpad/modules.nix +++ b/hosts/cnixpad/modules.nix @@ -1,5 +1,17 @@ { modules = { + boot = { + loader = { + default.enable = true; + lanzaboote.enable = false; + }; + kernel = { + variant = "latest"; + hardware = "amd"; + extraKernelParams = []; + extraBlacklistedModules = []; + }; + }; gaming = { steam = { enable = false; @@ -149,6 +161,12 @@ brightnessctl = { enable = true; }; + chaotic = { + enable = false; + amd = { + enable = false; + }; + }; corectrl = { enable = false; }; diff --git a/hosts/default.nix b/hosts/default.nix index ec85b940..4bec81b6 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -34,7 +34,6 @@ shared ++ [ ./cnix - "${mod}/boot/lanzaboote" "${mod}/nix/nh/cnst" "${mod}/dev" { @@ -53,7 +52,6 @@ shared ++ [ ./toothpc - "${mod}/boot/lanzaboote" "${mod}/nix/nh/toothpick" "${mod}/dev" { @@ -72,7 +70,6 @@ shared ++ [ ./cnixpad - "${mod}/boot" "${mod}/nix/nh/cnst" "${mod}/dev" { diff --git a/hosts/toothpc/default.nix b/hosts/toothpc/default.nix index e9345046..42da94c8 100644 --- a/hosts/toothpc/default.nix +++ b/hosts/toothpc/default.nix @@ -35,15 +35,6 @@ in { ./modules.nix ]; - boot = { - blacklistedKernelModules = [ - ]; - consoleLogLevel = 3; - kernelPackages = lib.mkForce pkgs.linuxPackages_latest; - kernelParams = [ - ]; - }; - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = lib.mkDefault "23.11"; } diff --git a/hosts/toothpc/modules.nix b/hosts/toothpc/modules.nix index 6b01a8a1..c459842d 100644 --- a/hosts/toothpc/modules.nix +++ b/hosts/toothpc/modules.nix @@ -1,5 +1,17 @@ { modules = { + boot = { + loader = { + default.enable = false; + lanzaboote.enable = true; + }; + kernel = { + variant = "cachyos"; + hardware = "nvidia"; + extraKernelParams = []; + extraBlacklistedModules = []; + }; + }; gaming = { steam = { enable = true; @@ -38,7 +50,7 @@ }; nvidia = { enable = true; - package = "beta"; # set to beta/stable/production depending on your needs + package = "latest"; # set to beta/latest/stable/production depending on your needs }; }; network = { @@ -150,6 +162,12 @@ corectrl = { enable = false; }; + chaotic = { + enable = true; + amd = { + enable = false; + }; + }; microfetch = { enable = true; }; diff --git a/system/modules/boot/kernel/default.nix b/system/modules/boot/kernel/default.nix new file mode 100644 index 00000000..3370adcc --- /dev/null +++ b/system/modules/boot/kernel/default.nix @@ -0,0 +1,72 @@ +# kernel.nix +{ + pkgs, + lib, + config, + ... +}: let + inherit (lib) mkOption; + cfg = config.modules.boot.kernel; +in { + options = { + modules.boot.kernel = { + variant = mkOption { + type = lib.types.enum ["latest" "cachyos"]; + default = "latest"; + description = "Kernel variant to use."; + }; + + hardware = mkOption { + type = lib.types.enum ["amd" "nvidia"]; + default = "amd"; + description = "Hardware type (GPU) configuration."; + }; + + extraKernelParams = mkOption { + type = lib.types.listOf lib.types.str; + default = []; + description = "Additional kernel parameters."; + }; + + extraBlacklistedModules = mkOption { + type = lib.types.listOf lib.types.str; + default = []; + description = "Additional kernel modules to blacklist."; + }; + }; + }; + + config = { + boot = { + consoleLogLevel = 3; + + kernelPackages = ( + if cfg.variant == "latest" + then pkgs.linuxPackages_latest + else if cfg.variant == "cachyos" + then pkgs.linuxPackages_cachyos + else pkgs.linuxPackages + ); + + kernelParams = + [ + "quiet" + "splash" + ] + ++ ( + if cfg.hardware == "amd" + then ["amd_pstate=active"] + else [] + ) + ++ cfg.extraKernelParams; + + blacklistedKernelModules = + ( + if cfg.hardware == "nvidia" + then ["nouveau"] + else [] + ) + ++ cfg.extraBlacklistedModules; + }; + }; +} diff --git a/system/modules/boot/loader/default.nix b/system/modules/boot/loader/default.nix new file mode 100644 index 00000000..f412c8d7 --- /dev/null +++ b/system/modules/boot/loader/default.nix @@ -0,0 +1,60 @@ +{ + pkgs, + lib, + config, + inputs, + ... +}: let + inherit (lib) mkIf mkEnableOption mkMerge mkForce; + cfg = config.modules.boot.loader; +in { + options = { + modules.boot.loader = { + default = { + enable = mkEnableOption "Enable default boot loader configuration."; + }; + lanzaboote = { + enable = mkEnableOption "Enable Lanzaboote boot loader configuration."; + }; + }; + }; + + imports = [ + inputs.lanzaboote.nixosModules.lanzaboote + ]; + + config = mkMerge [ + { + assertions = [ + { + assertion = !(cfg.default.enable && cfg.lanzaboote.enable); + message = "Only one of modules.boot.loader.default.enable and modules.boot.loader.lanzaboote.enable can be set to true."; + } + ]; + } + + (mkIf cfg.default.enable { + # Default boot loader configuration + boot.loader = { + systemd-boot.enable = true; + systemd-boot.graceful = true; + efi.canTouchEfiVariables = false; + }; + }) + + (mkIf cfg.lanzaboote.enable { + # Lanzaboote boot loader configuration + boot = { + lanzaboote = { + enable = true; + pkiBundle = "/etc/secureboot"; + }; + + # We let Lanzaboote install systemd-boot + loader.systemd-boot.enable = mkForce false; + }; + + environment.systemPackages = [pkgs.sbctl]; + }) + ]; +} diff --git a/system/modules/default.nix b/system/modules/default.nix index 5c5e7b59..df194bd0 100644 --- a/system/modules/default.nix +++ b/system/modules/default.nix @@ -1,5 +1,7 @@ {systemModules, ...}: { imports = [ + "${systemModules}/boot/loader" + "${systemModules}/boot/kernel" "${systemModules}/gaming/gamemode" "${systemModules}/gaming/gamescope" "${systemModules}/gaming/lutris" @@ -40,6 +42,7 @@ "${systemModules}/utils/android" "${systemModules}/utils/anyrun" "${systemModules}/utils/brightnessctl" + "${systemModules}/utils/chaotic" "${systemModules}/utils/corectrl" "${systemModules}/utils/microfetch" "${systemModules}/utils/misc" diff --git a/system/modules/hardware/graphics/amd/default.nix b/system/modules/hardware/graphics/amd/default.nix index 17d6537c..b303b487 100644 --- a/system/modules/hardware/graphics/amd/default.nix +++ b/system/modules/hardware/graphics/amd/default.nix @@ -20,15 +20,7 @@ in { vaapiVdpau libvdpau-va-gl amdvlk - - # mesa - mesa - - # vulkan vulkan-tools - # vulkan-loader - # vulkan-validation-layers - # vulkan-extension-layer ]; extraPackages32 = with pkgs.pkgsi686Linux; [ vaapiVdpau diff --git a/system/modules/hardware/graphics/nvidia/default.nix b/system/modules/hardware/graphics/nvidia/default.nix index 799d4752..69ca340d 100644 --- a/system/modules/hardware/graphics/nvidia/default.nix +++ b/system/modules/hardware/graphics/nvidia/default.nix @@ -18,9 +18,9 @@ in { modules.hardware.graphics.nvidia = { enable = mkEnableOption "Enables NVidia graphics"; package = mkOption { - type = types.enum ["stable" "beta" "production"]; # Added "production" here + type = types.enum ["stable" "beta" "production" "latest"]; default = "stable"; - description = "Choose between the stable, beta, or production NVidia driver package"; + description = "Choose between the stable, beta, latest, or production NVidia driver package"; }; }; }; @@ -49,15 +49,17 @@ in { package = if cfg.package == "beta" then config.boot.kernelPackages.nvidiaPackages.beta + else if cfg.package == "latest" + then config.boot.kernelPackages.nvidiaPackages.latest else if cfg.package == "production" - then config.boot.kernelPackages.nvidiaPackages.production + then config.boot.kernelPackages.nvidiaPackages.prodution else config.boot.kernelPackages.nvidiaPackages.stable; modesetting.enable = true; powerManagement = { enable = false; finegrained = false; }; - open = false; + open = true; nvidiaSettings = true; }; }; diff --git a/system/modules/utils/chaotic/default.nix b/system/modules/utils/chaotic/default.nix new file mode 100644 index 00000000..9c7c2992 --- /dev/null +++ b/system/modules/utils/chaotic/default.nix @@ -0,0 +1,44 @@ +{ + pkgs, + config, + lib, + ... +}: let + inherit (lib) mkIf mkEnableOption mkOption mkMerge; + cfg = config.modules.utils.chaotic; +in { + options = { + modules.utils.chaotic = { + enable = mkEnableOption "Enables Chaotic AUR packages"; + amd.enable = mkOption { + type = lib.types.bool; + default = false; + description = "Whether to install AMD-specific settings."; + }; + }; + }; + + config = mkIf cfg.enable (mkMerge [ + { + # Base configuration when Chaotic is enabled + chaotic.scx.enable = true; + } + (mkIf cfg.amd.enable { + # AMD-specific configuration + chaotic.mesa-git = { + enable = true; + extraPackages = with pkgs; [ + mesa_git.opencl + intel-media-driver + intel-ocl + vaapiIntel + ]; + extraPackages32 = with pkgs; [ + mesa32_git.opencl + intel-media-driver + vaapiIntel + ]; + }; + }) + ]); +} diff --git a/system/nix/default.nix b/system/nix/default.nix index 43708f50..59f2d72a 100644 --- a/system/nix/default.nix +++ b/system/nix/default.nix @@ -14,7 +14,6 @@ environment = { systemPackages = with pkgs; [ git - scx stow ]; localBinInPath = true;