diff --git a/extras/gaming.nix b/extras/gaming.nix index 2c69b34..52ce2e4 100644 --- a/extras/gaming.nix +++ b/extras/gaming.nix @@ -1,7 +1,7 @@ { - pkgs, - lib, - ... + pkgs, + lib, + ... }: # let # if_desktop = @@ -10,96 +10,96 @@ # else false; # in { - # aagl.url = "github:ezKEa/aagl-gtk-on-nix"; - # aagl.inputs.nixpkgs.follows = "nixpkgs"; + # aagl.url = "github:ezKEa/aagl-gtk-on-nix"; + # aagl.inputs.nixpkgs.follows = "nixpkgs"; - environment.systemPackages = with pkgs; [ - # parsec-bin - # yuzu # nintendo can suck the shit out of my asshole - gamemode - heroic - lutris - mangohud - prismlauncher - protonup-qt - r2modman - wine - temurin-jre-bin-17 - ]; + environment.systemPackages = with pkgs; [ + # parsec-bin + # yuzu # nintendo can suck the shit out of my asshole + gamemode + heroic + lutris + mangohud + prismlauncher + protonup-qt + r2modman + wine + temurin-jre-bin-17 + ]; - networking.firewall.allowedTCPPorts = [25565]; + networking.firewall.allowedTCPPorts = [25565]; - programs.steam = { - enable = true; - # remotePlay.openFirewall = true; - # gamescopeSession.enable = false; - }; - programs.gamemode.enable = true; - programs.gamescope.enable = true; + programs.steam = { + enable = true; + # remotePlay.openFirewall = true; + # gamescopeSession.enable = false; + }; + programs.gamemode.enable = true; + programs.gamescope.enable = true; - security.pam.loginLimits = [ - { - domain = "@game"; - type = "-"; - item = "nice"; - value = -20; - } - ]; - security.sudo-rs.extraRules = [ - { - commands = [ + security.pam.loginLimits = [ { - command = "${pkgs.systemd}/bin/bootctl set-oneshot auto-windows"; - options = ["NOPASSWD"]; + domain = "@game"; + type = "-"; + item = "nice"; + value = -20; } - ]; - groups = ["wheel"]; - } - ]; + ]; + security.sudo-rs.extraRules = [ + { + commands = [ + { + command = "${pkgs.systemd}/bin/bootctl set-oneshot auto-windows"; + options = ["NOPASSWD"]; + } + ]; + groups = ["wheel"]; + } + ]; - # THE FINALS audio borked - # services.pipewire.enable = !if_desktop; - # hardware.pulseaudio.enable = if_desktop; - # hardware.pulseaudio.support32Bit = if_desktop; - # services.pipewire.extraConfig = { - # pipewire."99-low-latency" = { - # context.properties = { - # default.allowed-rates = [44100 48000 96000 192000]; - # default.clock.rate = 192000; - # default.clock.quantum = 32; - # default.clock.min-quantum = 32; - # default.clock.max-quantum = 32; - # }; - # context.modules = [ - # { - # name = "libpipewire-module-rt"; - # args = { - # nice.level = -12; - # rt.prio = 89; - # rt.time.soft = 200000; - # rt.time.hard = 200000; - # }; - # flags = ["ifexists nofail"]; - # } - # ]; - # }; - # pipewire-pulse."99-low-latency" = { - # context.modules = [ - # { - # name = "libpipewire-module-protocol-pulse"; - # args = { - # pulse.min.req = "32/192000"; - # pulse.default.req = "32/192000"; - # pulse.max.req = "32/192000"; - # pulse.min.quantum = "32/192000"; - # pulse.max.quantum = "32/192000"; - # }; - # } - # ]; - # stream.properties = { - # node.latency = "32/192000"; - # resample.quality = 1; - # }; - # }; - # }; + # THE FINALS audio borked + # services.pipewire.enable = !if_desktop; + # hardware.pulseaudio.enable = if_desktop; + # hardware.pulseaudio.support32Bit = if_desktop; + # services.pipewire.extraConfig = { + # pipewire."99-low-latency" = { + # context.properties = { + # default.allowed-rates = [44100 48000 96000 192000]; + # default.clock.rate = 192000; + # default.clock.quantum = 32; + # default.clock.min-quantum = 32; + # default.clock.max-quantum = 32; + # }; + # context.modules = [ + # { + # name = "libpipewire-module-rt"; + # args = { + # nice.level = -12; + # rt.prio = 89; + # rt.time.soft = 200000; + # rt.time.hard = 200000; + # }; + # flags = ["ifexists nofail"]; + # } + # ]; + # }; + # pipewire-pulse."99-low-latency" = { + # context.modules = [ + # { + # name = "libpipewire-module-protocol-pulse"; + # args = { + # pulse.min.req = "32/192000"; + # pulse.default.req = "32/192000"; + # pulse.max.req = "32/192000"; + # pulse.min.quantum = "32/192000"; + # pulse.max.quantum = "32/192000"; + # }; + # } + # ]; + # stream.properties = { + # node.latency = "32/192000"; + # resample.quality = 1; + # }; + # }; + # }; } diff --git a/flake.lock b/flake.lock index 39352df..c43c972 100644 --- a/flake.lock +++ b/flake.lock @@ -121,11 +121,11 @@ "flake-compat_2": { "flake": false, "locked": { - "lastModified": 1717312683, - "narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=", + "lastModified": 1746162366, + "narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=", "owner": "nix-community", "repo": "flake-compat", - "rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea", + "rev": "0f158086a2ecdbb138cd0429410e44994f1b7e4b", "type": "github" }, "original": { @@ -285,9 +285,10 @@ "type": "github" }, "original": { - "id": "nixpkgs", + "owner": "NixOS", "ref": "nixos-24.05", - "type": "indirect" + "repo": "nixpkgs", + "type": "github" } }, "nixos-cosmic": { @@ -300,11 +301,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1745752145, - "narHash": "sha256-SRvolJBy9oRUdfik/xtcsguQtcDHrkzq1yf5NbsLBhY=", + "lastModified": 1746529785, + "narHash": "sha256-gfBL3G+hepeQzg+vtLF0nd9DB4IggfDuCYUGJaO1Jp0=", "owner": "lilyinstarlight", "repo": "nixos-cosmic", - "rev": "0ba6c63681ae317d122a5e76bc2bf556737a53d0", + "rev": "3779328f563511c7e163d3206142dc409eab1988", "type": "github" }, "original": { @@ -330,17 +331,18 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1745503349, - "narHash": "sha256-bUGjvaPVsOfQeTz9/rLTNLDyqbzhl0CQtJJlhFPhIYw=", + "lastModified": 1746468201, + "narHash": "sha256-hSOSlrvMJwGr8hX/gc0mnhUf5UIClMDUAadfXlSXzfc=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "f7bee55a5e551bd8e7b5b82c9bc559bc50d868d1", + "rev": "6aabf68429c0a414221d1790945babfb6a0bd068", "type": "github" }, "original": { - "id": "nixos-hardware", + "owner": "NixOS", "ref": "master", - "type": "indirect" + "repo": "nixos-hardware", + "type": "github" } }, "nixpkgs": { @@ -393,11 +395,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1745487689, - "narHash": "sha256-FQoi3R0NjQeBAsEOo49b5tbDPcJSMWc3QhhaIi9eddw=", + "lastModified": 1746422338, + "narHash": "sha256-NTtKOTLQv6dPfRe00OGSywg37A1FYqldS6xiNmqBUYc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5630cf13cceac06cefe9fc607e8dfa8fb342dde3", + "rev": "5b35d248e9206c1f3baf8de6a7683fee126364aa", "type": "github" }, "original": { @@ -439,17 +441,18 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1745526057, - "narHash": "sha256-ITSpPDwvLBZBnPRS2bUcHY3gZSwis/uTe255QgMtTLA=", + "lastModified": 1746461020, + "narHash": "sha256-7+pG1I9jvxNlmln4YgnlW4o+w0TZX24k688mibiFDUE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f771eb401a46846c1aebd20552521b233dd7e18b", + "rev": "3730d8a308f94996a9ba7c7138ede69c1b9ac4ae", "type": "github" }, "original": { - "id": "nixpkgs", + "owner": "NixOS", "ref": "nixos-unstable", - "type": "indirect" + "repo": "nixpkgs", + "type": "github" } }, "root": { @@ -474,11 +477,11 @@ ] }, "locked": { - "lastModified": 1745721366, - "narHash": "sha256-dm93104HXjKWzkrr7yAPtxpbllOSzrwFFruc+rKQHSg=", + "lastModified": 1746498961, + "narHash": "sha256-rp+oh/N88JKHu7ySPuGiA3lBUVIsrOtHbN2eWJdYCgk=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "621131c9e281d1047bf8937547ed77e97c464aba", + "rev": "24b00064cdd1d7ba25200c4a8565dc455dc732ba", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 6ba13d8..0bd31bc 100644 --- a/flake.nix +++ b/flake.nix @@ -2,10 +2,10 @@ description = "we say NO to shitty OSes"; inputs = { - nixos.url = "nixpkgs/nixos-24.05"; - nixpkgs.url = "nixpkgs/nixos-unstable"; + nixos.url = "github:NixOS/nixpkgs/nixos-24.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixos-facter-modules.url = "github:numtide/nixos-facter-modules"; - nixos-hardware.url = "nixos-hardware/master"; + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/0.1"; agenix = { url = "github:ryantm/agenix"; @@ -23,10 +23,10 @@ # url = "github:mattwparas/helix/steel-event-system"; # inputs.nixpkgs.follows = "nixpkgs"; # }; - # nixos-cosmic = { - # url = "github:lilyinstarlight/nixos-cosmic"; - # inputs.nixpkgs.follows = "nixpkgs"; - # }; + nixos-cosmic = { + url = "github:lilyinstarlight/nixos-cosmic"; + inputs.nixpkgs.follows = "nixpkgs"; + }; zen-browser = { url = "github:0xc000022070/zen-browser-flake"; inputs.nixpkgs.follows = "nixpkgs"; @@ -35,12 +35,12 @@ nixConfig = { extra-substituters = [ - # "https://cosmic.cachix.org/" + "https://cosmic.cachix.org/" # "https://helix.cachix.org/" "https://devenv.cachix.org" ]; extra-trusted-public-keys = [ - # "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" + "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" # "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" ]; @@ -56,7 +56,7 @@ agenix, disko, home-manager, - # nixos-cosmic, + nixos-cosmic, zen-browser, ... } @ inputs: { @@ -79,7 +79,7 @@ ./extras/dev.nix ./extras/gaming.nix ./extras/folding.nix - # nixos-cosmic.nixosModules.default + nixos-cosmic.nixosModules.default ./extras/cosmic.nix ]; }; @@ -106,7 +106,7 @@ ./extras/uwuraid.nix ./extras/dev.nix ./extras/gaming.nix - # nixos-cosmic.nixosModules.default + nixos-cosmic.nixosModules.default ./extras/cosmic.nix ]; }; diff --git a/systems/NOlaptop.nix b/systems/NOlaptop.nix index 8dd9dea..d9137fa 100644 --- a/systems/NOlaptop.nix +++ b/systems/NOlaptop.nix @@ -1,103 +1,107 @@ { - lib, - config, - pkgs, - ... + lib, + config, + pkgs, + ... }: { - # services.pipewire.wireplumber.extraConfig = { - # "wireplumber.settings" = { - # "device.routes.default-source-volume" = 0.42; - # }; - # }; + # services.pipewire.wireplumber.extraConfig = { + # "wireplumber.settings" = { + # "device.routes.default-source-volume" = 0.42; + # }; + # }; - services.rsyslogd = { - enable = true; - extraConfig = '' - module(load="imudp") - input(type="imudp" port="514") + services.rsyslogd = { + enable = true; + extraConfig = '' + module(load="imudp") + input(type="imudp" port="514") - THENAS.* -/var/log/THENAS - ''; - }; - - # boot.kernelPatches = [ - # (lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.11") - # { - # name = "cros_ec_lpc"; - # patch = pkgs.fetchpatch { - # url = "https://patchwork.kernel.org/series/840830/mbox/"; - # sha256 = "sha256-7jSEAGInFC+a+ozCyD4dFz3Qgh2JrHskwz7UfswizFw="; - # }; - # }) - # ]; - # nixpkgs.overlays = [ - # (final: prev: { - # libinput = prev.libinput.overrideAttrs (old: { - # patches = - # (old.patches or []) - # ++ [ - # ../extras/libinput-delay.patch - # ]; - # }); - # }) - # ]; - - environment.systemPackages = with pkgs; [ - fw-ectool - framework-tool - nvtopPackages.amd - ]; - - services.fwupd.enable = true; - services.tailscale.useRoutingFeatures = "client"; - systemd.services."backlight@backlight:amdgpu_bl2".enable = false; - - nix.buildMachines = [ - { - hostName = "nocomputer"; - systems = ["x86_64-linux" "i686-linux"]; - supportedFeatures = [ - "benchmark" - "big-parallel" - "gccarch-znver4" - "kvm" - "nixos-test" - ]; - } - ]; - nix.extraOptions = '' - builders-use-substitutes = true + THENAS.* -/var/log/THENAS ''; - nix.distributedBuilds = true; + }; - services.udev.extraRules = '' - # ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness" - # ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness" + # boot.kernelPatches = [ + # (lib.mkIf (lib.versionOlder config.boot.kernelPackages.kernel.version "6.11") + # { + # name = "cros_ec_lpc"; + # patch = pkgs.fetchpatch { + # url = "https://patchwork.kernel.org/series/840830/mbox/"; + # sha256 = "sha256-7jSEAGInFC+a+ozCyD4dFz3Qgh2JrHskwz7UfswizFw="; + # }; + # }) + # ]; + # nixpkgs.overlays = [ + # (final: prev: { + # libinput = prev.libinput.overrideAttrs (old: { + # patches = + # (old.patches or []) + # ++ [ + # ../extras/libinput-delay.patch + # ]; + # }); + # }) + # ]; - # ACTION=="add|change", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0012", ATTR{power/wakeup}="disabled" - # ACTION=="add|change", KERNEL=="i2c", SUBSYSTEM=="i2c", DEVPATH=="/sys/devices/platform/AMDI0010:03/i2c-1/i2c-PIXA3854:00", ATTR{power/wakeup}="disabled" - ''; + environment.systemPackages = with pkgs; [ + fw-ectool + framework-tool + nvtopPackages.amd + ]; - services.fprintd.enable = true; + services.fwupd.enable = true; + services.tailscale.useRoutingFeatures = "client"; + systemd.services."backlight@backlight:amdgpu_bl2".enable = false; - boot.kernelPackages = pkgs.linuxPackages_latest; - # boot.initrd.availableKernelModules = [ - # "nvme" - # "sd_mod" - # "thunderbolt" - # "usb_storage" - # "xhci_pci" - # "usbhid" - # "uas" - # ]; - boot.kernelParams = [ - "amdgpu.abmlevel=1" - # "amdgpu.dcdebugmask=0x400" - # "mem_sleep_default=deep" - ]; - # boot.kernelModules = ["kvm-amd"]; - powerManagement.cpuFreqGovernor = "powersave"; - systemd.sleep.extraConfig = "HibernateDelaySec=360m"; + nix.buildMachines = [ + { + hostName = "nocomputer"; + systems = ["x86_64-linux" "i686-linux"]; + supportedFeatures = [ + "benchmark" + "big-parallel" + "gccarch-znver4" + "kvm" + "nixos-test" + ]; + } + ]; + nix.extraOptions = '' + builders-use-substitutes = true + ''; + nix.distributedBuilds = true; - networking.hostName = "NOlaptop"; + services.udev.extraRules = '' + # ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness" + # ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness" + + ACTION=="add|change", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0012", ATTR{power/wakeup}="disabled" + ACTION=="add|change", KERNEL=="i2c", SUBSYSTEM=="i2c", DEVPATH=="/sys/devices/platform/AMDI0010:03/i2c-1/i2c-PIXA3854:00", ATTR{power/wakeup}="disabled" + + # ACTION=="add", SUBSYSTEM=="acpi", DRIVERS=="button", ATTRS{hid}=="PNP0C0D", ATTR{power/wakeup}="disabled" + # ACTION=="add", SUBSYSTEM=="serio", DRIVERS=="atkbd", ATTR{power/wakeup}="disabled" + # ACTION=="add", SUBSYSTEM=="i2c", DRIVERS=="i2c_hid_acpi", ATTRS{name}=="PIXA3854:00", ATTR{power/wakeup}="disabled" + ''; + + services.fprintd.enable = true; + + boot.kernelPackages = pkgs.linuxPackages_latest; + # boot.initrd.availableKernelModules = [ + # "nvme" + # "sd_mod" + # "thunderbolt" + # "usb_storage" + # "xhci_pci" + # "usbhid" + # "uas" + # ]; + boot.kernelParams = [ + "amdgpu.abmlevel=1" + # "amdgpu.dcdebugmask=0x400" + # "mem_sleep_default=deep" + ]; + # boot.kernelModules = ["kvm-amd"]; + powerManagement.cpuFreqGovernor = "powersave"; + systemd.sleep.extraConfig = "HibernateDelaySec=360m"; + + networking.hostName = "NOlaptop"; }