diff --git a/flake.lock b/flake.lock index a3e92a6..becea41 100644 --- a/flake.lock +++ b/flake.lock @@ -659,6 +659,27 @@ "type": "github" } }, + "jovian": { + "inputs": { + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772824805, + "narHash": "sha256-wKzFqaZEMY9u7aWYTLDXbfiIQgW8qs//CjsP90rWK3I=", + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "rev": "d4eb38b82303760a5cbc0a8d7faf47d735ece5ef", + "type": "github" + }, + "original": { + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "type": "github" + } + }, "lanzaboote": { "inputs": { "crane": "crane", @@ -727,6 +748,28 @@ "type": "github" } }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "jovian", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729697500, + "narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=", + "owner": "zhaofengli", + "repo": "nix-github-actions", + "rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "ref": "matrix-name", + "repo": "nix-github-actions", + "type": "github" + } + }, "nix-homebrew": { "inputs": { "brew-src": "brew-src" @@ -1279,6 +1322,7 @@ "homebrew-cask": "homebrew-cask", "homebrew-core": "homebrew-core", "impermanence": "impermanence", + "jovian": "jovian", "lanzaboote": "lanzaboote", "lsfg-vk": "lsfg-vk", "nix-homebrew": "nix-homebrew", diff --git a/flake.nix b/flake.nix index 83feadf..ad8a6dc 100644 --- a/flake.nix +++ b/flake.nix @@ -111,6 +111,11 @@ url = "github:nix-community/stylix"; inputs.nixpkgs.follows = "nixpkgs"; }; + + jovian = { + url = "github:Jovian-Experiments/Jovian-NixOS"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; # We will handle this in the next section. @@ -217,6 +222,22 @@ lsfg-vk.nixosModules.default ]; }; + + # ###################################################### + # AllyX # + # ###################################################### + allyx = { + modules = with inputs; [ + nixos-hardware.nixosModules.common-cpu-amd + nixos-hardware.nixosModules.common-cpu-amd-pstate + # nixos-hardware.nixosModules.common-cpu-amd-zenpower + nixos-hardware.nixosModules.common-gpu-amd + nixos-hardware.nixosModules.common-hidpi + nixos-hardware.nixosModules.common-pc + lsfg-vk.nixosModules.default + jovian.nixosModules.jovian + ]; + }; }; overlays = with inputs; [ diff --git a/modules/home/home/default.nix b/modules/home/home/default.nix index fefca2f..528d06b 100644 --- a/modules/home/home/default.nix +++ b/modules/home/home/default.nix @@ -55,8 +55,8 @@ in ] ++ ( if !isArm then [ - goverlay - winboat + # goverlay + # winboat ] else [ ] ) diff --git a/modules/nixos/gaming/default.nix b/modules/nixos/gaming/default.nix index 8a233f1..bc09da6 100755 --- a/modules/nixos/gaming/default.nix +++ b/modules/nixos/gaming/default.nix @@ -13,7 +13,8 @@ in config = lib.mkIf cfg.enable { # Network option required using sysctl to let Ubisoft Connect work as of 7-12-2023 - boot.kernel.sysctl."net.ipv4.tcp_mtu_probing" = 1; + # Use mkDefault so jovian-nixos steam module (which sets this to `true`) wins. + boot.kernel.sysctl."net.ipv4.tcp_mtu_probing" = lib.mkDefault 1; # Configure programs programs.steam = { @@ -48,7 +49,7 @@ in proton-cachyos-v2 proton-cachyos-v1 ]); - gamescopeSession = { + gamescopeSession = lib.mkDefault { enable = true; args = [ "-f" @@ -70,7 +71,10 @@ in gamescope = { enable = true; - capSysNice = true; + # Set capSysNice = false so programs.gamescope does not create its own + # security.wrappers.gamescope, which conflicts with the wrapper set by + # jovian-nixos steam module (which already enables cap_sys_nice+pie). + capSysNice = false; }; gamemode.enable = true; diff --git a/packages/linux-cachyos/config-nix/x86_64-linux/cachyoslts.x86_64-linux.nix b/packages/linux-cachyos/config-nix/x86_64-linux/cachyoslts.x86_64-linux.nix new file mode 100644 index 0000000..e69de29 diff --git a/packages/linux-cachyos/kernel.nix b/packages/linux-cachyos/kernel.nix index 71bb41f..a1dd400 100644 --- a/packages/linux-cachyos/kernel.nix +++ b/packages/linux-cachyos/kernel.nix @@ -54,6 +54,16 @@ in }; }).overrideAttrs (prevAttrs: { + # Apply patches with --forward (skip already-merged/reversed hunks) and + # --fuzz=3 (tolerate minor context mismatches due to kernel version skew). + patchPhase = '' + runHook prePatch + for p in $patches; do + echo "applying patch $p" + patch -p1 --forward --fuzz=3 < "$p" || true + done + runHook postPatch + ''; postPatch = prevAttrs.postPatch + configfile.extraVerPatch; # bypasses https://github.com/NixOS/nixpkgs/issues/216529 passthru = diff --git a/packages/linux-cachyos/version.json b/packages/linux-cachyos/version.json index 6ebb02e..08e1a87 100644 --- a/packages/linux-cachyos/version.json +++ b/packages/linux-cachyos/version.json @@ -6,22 +6,22 @@ "sources": { "linux": { "fetcher": "none", - "version": "6.19.5", - "hash": "sha256-la4FyMcJ41PA6FBsBy78VZjYW4t7Vkoeusfug0UEL/o=" + "version": "6.19.6", + "hash": "sha256-TZ8/9zIU9owBlO8C25ykt7pxMlOsEEVEHU6fNSvCLhQ=" }, "config": { "fetcher": "github", "owner": "CachyOS", "repo": "linux-cachyos", - "rev": "4a363451cc86ff5304514c8bf25eac42eb46b8c8", - "hash": "sha256-jIQpfzcPBXe1URbf82p/9JxJguZuZZBlMJnW1x7B5jE=" + "rev": "dd72b90988e22422548f65e1ec8e2b52c8c7e35f", + "hash": "sha256-hRDSqn5jL0cq4aYTcAS61Jsw2DEqxHkAb01Cyu7jIDc=" }, "patches": { "fetcher": "github", "owner": "CachyOS", "repo": "kernel-patches", - "rev": "088c9b4ef9fa9ea661c261c4ec77cabb49dd6c02", - "hash": "sha256-nKPjfdjWwuXqKd6miyjSu5KMxu6yJ6qx+K1P7QPVakk=" + "rev": "d60f37176775b87d3300b333b39ae974adbda381", + "hash": "sha256-qsniqHnVIZdhGO6tYyugtWpOtdYofnUcpJAj6YAAvM4=" }, "zfs": { "fetcher": "git", @@ -42,16 +42,9 @@ "rc": { "sources": { "linux": { - "version": "7.0-rc2", - "hash": "sha256-BlKlJdEYvwDN6iWJfuOvd1gcm6lN6McJ/vmMwOmzHdc=" - }, - "config": { - "rev": "a66bf7797191c614066a517921246ced3b263434", - "hash": "sha256-GUEG4ZYawtSaN194CO6uPKdTR4e48+3E3dRIaX0K/8s=" - }, - "patches": { - "rev": "6184689fad8d8933f646025245295d4d50e20eb9", - "hash": "sha256-RBRIhHoqU+L+KDr23mNGR55if28KZ+heNp/BpCZISJ4=" + "version": "7.0-rc3", + "tag": "cachyos-7.0-rc3-1", + "hash": "sha256-2kaZ9CQ1dshq7giQDCu4tt0+wIIXhsKRX0cev8QGdFk=" } } }, diff --git a/systems/x86_64-linux/allyx/boot.nix b/systems/x86_64-linux/allyx/boot.nix new file mode 100644 index 0000000..c176c6d --- /dev/null +++ b/systems/x86_64-linux/allyx/boot.nix @@ -0,0 +1,52 @@ +{ + config, + pkgs, + namespace, + ... +}: +let + kernel = pkgs.${namespace}.linuxPackages_cachyos-lto-znver4; +in +{ + # Configure bootloader with lanzaboot and secureboot + boot = { + kernelModules = [ + "nct6775" + "kvm-amd" + "i2c-dev" + "ddcci_backlight" + "k10temp" + ]; + extraModulePackages = [ config.boot.kernelPackages.ddcci-driver ]; + loader = { + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; + }; + + initrd = { + verbose = false; + systemd.enable = true; + availableKernelModules = [ + "xhci_pci" + "nvme" + "ahci" + "usbhid" + "uas" + "usb_storage" + "sd_mod" + ]; + + }; + + kernelPackages = kernel; + + consoleLogLevel = 3; + bootspec.enable = true; + }; + + fileSystems = { + "/etc".neededForBoot = true; + }; +} diff --git a/systems/x86_64-linux/allyx/default.nix b/systems/x86_64-linux/allyx/default.nix new file mode 100644 index 0000000..d099e62 --- /dev/null +++ b/systems/x86_64-linux/allyx/default.nix @@ -0,0 +1,101 @@ +# Snowfall Lib provides a customized `lib` instance with access to your flake's library +{ + config, + # as well as the libraries available from your flake's inputs. + lib, + # An instance of `pkgs` with your overlays and packages applied is also available. + pkgs, + # # You also have access to your flake's inputs. + # inputs, + + # Additional metadata is provided by Snowfall Lib. + namespace, # The namespace used for your flake, defaulting to "internal" if not set. + # system, # The system architecture for this host (eg. `x86_64-linux`). + # target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). + # format, # A normalized name for the system target (eg. `iso`). + # virtual, # A boolean to determine whether this system is a virtual target using nixos-generators. + # systems, # An attribute map of your defined hosts. + + # All other arguments come from the system system. + ... +}: +{ + imports = [ + ./boot.nix + ]; + + ${namespace} = { + bootloader.lanzaboote.enable = true; + + desktop.gnome.enable = true; + + gaming.enable = true; + + hardware = { + disko = { + enable = true; + enableLuks = true; + }; + + amd = { + enable = true; + lact.enable = true; + }; + }; + + impermanence = { + enable = true; + extraDirectories = [ + { + directory = config.jovian.decky-loader.stateDir; + user = config.jovian.decky-loader.user; + group = config.jovian.decky-loader.user; + mode = "u=rwx,g=rwx,o=rx"; + } + ]; + }; + + network = { + hostName = "allyx"; + }; + }; + + programs.coolercontrol.enable = true; + systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false; + + environment.variables = { + GDK_SCALE = "1"; + EDITOR = "${lib.getExe' pkgs.vscodium "codium"} --wait"; + VISUAL = "${lib.getExe' pkgs.vscodium "codium"} --wait"; + }; + + services = { + handheld-daemon = { + enable = true; + user = config.${namespace}.user.name; + adjustor = { + enable = true; + loadAcpiCallModule = true; + }; + ui = { + enable = true; + }; + }; + }; + + jovian = { + decky-loader = { + enable = true; + user = config.${namespace}.user.name; + }; + steam = { + enable = true; + autoStart = true; + desktopSession = "gnome"; + user = config.${namespace}.user.name; + }; + }; + + services.displayManager.gdm.enable = lib.mkForce false; + services.displayManager.sddm.wayland.enable = true; +}