Compare commits

..

21 Commits

Author SHA1 Message Date
Lumpiasty b15c6850c3 exclude audiotube app from building 2026-05-19 03:43:33 +02:00
Lumpiasty b38e5db90b switch linux to current and zfs 2.4 2026-05-19 03:08:21 +02:00
Lumpiasty e3a9a4bd1a update nixos 2026-05-19 03:06:13 +02:00
Lumpiasty 65fc3e47b4 update opencode-claude-auth plugin 2026-05-19 03:05:32 +02:00
Lumpiasty c9e6ec7b23 add audio-rt module to fight xruns under cpu load
EasyEffects DSP plugins (rnnoise, deepfilternet, crystalizer) drop audio
when the system is under load. Layered workaround with per-optimization
toggles for bisecting impact:

- cgroup-based CPU partitioning: dedicated audio.slice with AllowedCPUs
  pinning, restricted app/session/background slices for everything else
- rlimits so PipeWire's module-rt sets SCHED_FIFO 88 directly instead of
  going through RTKit's priority-10 ceiling
- persistent watcher that re-applies performance governor on audio cores
  (gamemoded/PPD keep resetting it)
- ananicy rule pinning easyeffects to nice -12 for non-RT DSP threads
- znver4-tuned rebuilds of easyeffects and its DSP deps

Master switch + per-feature toggles via lumpiasty.audioRt.*; all enabled
by default on acer host. None of this fully eliminates dropouts on this
thermally constrained laptop but each layer is independently testable.
2026-05-18 17:20:21 +02:00
Lumpiasty 9ea6bac4af add workaround for vscode freezing acer 2026-05-08 15:53:25 +02:00
Lumpiasty 47169bbd0c workaround for openldap failure 2026-05-08 00:37:44 +02:00
Lumpiasty 232b90f974 update ventoy ver in permittedInsecurePackages 2026-05-07 23:57:20 +02:00
Lumpiasty 87703ec951 linux_6_19 form last nixpkgs rev before removal 2026-05-07 23:50:15 +02:00
Lumpiasty bb95cc11a8 update nixos 2026-05-07 23:29:11 +02:00
Lumpiasty 087225be45 Add caveman skill globally 2026-05-07 22:52:11 +02:00
Lumpiasty 25c32cb65d Change ARC limit to 20% 2026-05-07 21:51:46 +02:00
Lumpiasty 4fc2befee5 add nix-skills flake input 2026-05-07 21:36:19 +02:00
Lumpiasty 33723a5315 use home manager opencode module 2026-05-07 21:15:29 +02:00
Lumpiasty 235e6c8e2d use plasma-login-manager instead of sddm 2026-05-07 20:13:21 +02:00
Lumpiasty 0450cf56f4 use my fork with fix for ntfs driver 2026-05-07 02:04:56 +02:00
Lumpiasty 177c6245ee use ntfs-plus driver for /var/games 2026-05-07 01:04:04 +02:00
Lumpiasty 79f40c37df Revert "switch /var/games to ntfs3 driver"
This reverts commit 6fe528e509.
2026-05-07 00:34:15 +02:00
Lumpiasty 6fe528e509 switch /var/games to ntfs3 driver 2026-05-07 00:33:42 +02:00
Lumpiasty 7a05c3221f Manual update of spotify 2026-05-05 22:18:17 +02:00
Lumpiasty 14088dfd01 add vscode wrapper workaround 2026-05-04 19:54:58 +02:00
18 changed files with 413 additions and 336 deletions
Generated
+68 -179
View File
@@ -44,11 +44,11 @@
]
},
"locked": {
"lastModified": 1776913134,
"narHash": "sha256-/9vfRJTDh9Y4Duo862rzDqBIN7cEFTsAffVZ/UvxVas=",
"lastModified": 1778887053,
"narHash": "sha256-0tSElqIlp+tbsMrbxVwzKlF3wrRO2GPGHmDqrMbaphs=",
"owner": "sadjow",
"repo": "claude-code-nix",
"rev": "20e4b82d08d97bf45d78f32c31eb3509db1c2f2a",
"rev": "faa8786775fa232366f95a6f8dc2de67a1fea0e5",
"type": "github"
},
"original": {
@@ -58,33 +58,6 @@
"type": "github"
}
},
"cppnix": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-parts": "flake-parts",
"git-hooks-nix": "git-hooks-nix",
"nixpkgs": [
"nixbsd",
"nixpkgs"
],
"nixpkgs-23-11": "nixpkgs-23-11",
"nixpkgs-regression": "nixpkgs-regression"
},
"locked": {
"lastModified": 1771531533,
"narHash": "sha256-E6uWPzQoMpzUb+2kcrxaYsfhUXjyIAoTpI6DPtbe1Y0=",
"owner": "rhelmot",
"repo": "nix",
"rev": "d623444c12428e69a3269d3b4b40200f2b4618fc",
"type": "github"
},
"original": {
"owner": "rhelmot",
"ref": "freebsd-safe",
"repo": "nix",
"type": "github"
}
},
"crane": {
"locked": {
"lastModified": 1765145449,
@@ -132,36 +105,6 @@
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_3": {
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"revCount": 69,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1627913399,
@@ -177,28 +120,6 @@
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixbsd",
"cppnix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@@ -232,41 +153,6 @@
"type": "github"
}
},
"git-hooks-nix": {
"inputs": {
"flake-compat": [
"nixbsd",
"cppnix"
],
"gitignore": [
"nixbsd",
"cppnix"
],
"nixpkgs": [
"nixbsd",
"cppnix",
"nixpkgs"
],
"nixpkgs-stable": [
"nixbsd",
"cppnix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1734279981,
"narHash": "sha256-NdaCraHPp8iYMWzdXAt5Nv6sA3MUzlCiGiR586TCwo0=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "aa9f40c906904ebd83da78e7f328cd8aeaeae785",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
@@ -296,11 +182,11 @@
]
},
"locked": {
"lastModified": 1776964438,
"narHash": "sha256-AF0cby9Xuijr5qaFpYKbm1mExV956Hk233bel6QxpFw=",
"lastModified": 1779143091,
"narHash": "sha256-qxiUVquHM09KOV1aD4We9q0ooPWO4qOc0v9J9NDWSAo=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "e09259dd2e147d35ef889784b51e89b0a10ffe15",
"rev": "736c2084ea750a049ecdbdd7ff5817d2eeeef444",
"type": "github"
},
"original": {
@@ -334,24 +220,20 @@
"type": "github"
}
},
"mini-tmpfiles": {
"inputs": {
"nixpkgs": [
"nixbsd",
"nixpkgs"
]
},
"linux-ntfs": {
"flake": false,
"locked": {
"lastModified": 1742754557,
"narHash": "sha256-nGxgiNhA94eSl8jcQwCboJ5Ed132z8yrFdOoT+rf8bE=",
"owner": "nixos-bsd",
"repo": "mini-tmpfiles",
"rev": "534ee577692c7092fdcd035f89bc29b663c6f9ca",
"lastModified": 1778111793,
"narHash": "sha256-E+f1utc2Az4ZmqvkZ8lDgHpXsheJobUMbLff1vdpQHE=",
"owner": "Lumpiasty",
"repo": "linux-ntfs",
"rev": "7fbf82056e26d99bfa4d5aab87ce287cd8c8cbef",
"type": "github"
},
"original": {
"owner": "nixos-bsd",
"repo": "mini-tmpfiles",
"owner": "Lumpiasty",
"ref": "main",
"repo": "linux-ntfs",
"type": "github"
}
},
@@ -371,6 +253,26 @@
"type": "github"
}
},
"nix-skills": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1775452536,
"narHash": "sha256-1MjzL/U5OtALBmsel4YHVSK9jr2c/YP4eXfi7lA5C+o=",
"owner": "sudosubin",
"repo": "nix-skills",
"rev": "c2d1958a5cdd7ee83f552c046fbc7cb43e8171e4",
"type": "github"
},
"original": {
"owner": "sudosubin",
"repo": "nix-skills",
"type": "github"
}
},
"nix-sweep": {
"inputs": {
"cf": "cf",
@@ -380,11 +282,11 @@
]
},
"locked": {
"lastModified": 1776294562,
"narHash": "sha256-3i0WOmrYlRoAyjPpdyV2jiuUQhL8+NkSBvcdDwHt+ds=",
"lastModified": 1777567981,
"narHash": "sha256-8ZVUoerhitQdBRtQalX0US1Nmc4c9cRGDhBpfAPH51w=",
"owner": "jzbor",
"repo": "nix-sweep",
"rev": "908c739dad8ab5c6ab737cf417efcbbec126987a",
"rev": "b3f71b38917ec9701a505ae3caa6907ccc6b5380",
"type": "github"
},
"original": {
@@ -394,33 +296,13 @@
"type": "github"
}
},
"nixbsd": {
"inputs": {
"cppnix": "cppnix",
"flake-compat": "flake-compat_3",
"mini-tmpfiles": "mini-tmpfiles",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1777600581,
"narHash": "sha256-DbKmDIFNLqR8xXnSepJPr29FngkiPDa8+vAErZRrQUA=",
"path": "/home/user/Projects/nixbsd",
"type": "path"
},
"original": {
"path": "/home/user/Projects/nixbsd",
"type": "path"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1776830795,
"narHash": "sha256-PAfvLwuHc1VOvsLcpk6+HDKgMEibvZjCNvbM1BJOA7o=",
"lastModified": 1779099457,
"narHash": "sha256-u73aVD/lUmmT3JV+kPDztl7zPwQKd0eobD1AbJltaGs=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "72674a6b5599e844c045ae7449ba91f803d44ebc",
"rev": "8792fab9d4a6454a9201675f01326f827ce35ead",
"type": "github"
},
"original": {
@@ -432,11 +314,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1776548001,
"narHash": "sha256-ZSK0NL4a1BwVbbTBoSnWgbJy9HeZFXLYQizjb2DPF24=",
"lastModified": 1778869304,
"narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b12141ef619e0a9c1c84dc8c684040326f27cdcc",
"rev": "d233902339c02a9c334e7e593de68855ad26c4cb",
"type": "github"
},
"original": {
@@ -446,41 +328,46 @@
"type": "github"
}
},
"nixpkgs-23-11": {
"nixpkgs-linuxeol": {
"locked": {
"lastModified": 1717159533,
"narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=",
"lastModified": 1776914381,
"narHash": "sha256-F4YjgKNs1kEIfTsinPDusep2Y+GDFK+3R2AujSZQ18M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446",
"rev": "162f04bf3dd222187388bc990a8678170d594419",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446",
"rev": "162f04bf3dd222187388bc990a8678170d594419",
"type": "github"
}
},
"nixpkgs-regression": {
"ntfsplus": {
"inputs": {
"linux-ntfs": "linux-ntfs",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"lastModified": 1774317576,
"narHash": "sha256-HSDFaDLvfS/NqJlXbHh9135DEpqH6JrNuWqbu3YPcTg=",
"owner": "cmspam",
"repo": "ntfsplus-flake",
"rev": "e22d1bcbac31b4e6484d32c503396e8184650215",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"owner": "cmspam",
"repo": "ntfsplus-flake",
"type": "github"
}
},
"peerix": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
@@ -553,10 +440,12 @@
"home-manager": "home-manager",
"lanzaboote": "lanzaboote",
"nix-flatpak": "nix-flatpak",
"nix-skills": "nix-skills",
"nix-sweep": "nix-sweep",
"nixbsd": "nixbsd",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs-linuxeol": "nixpkgs-linuxeol",
"ntfsplus": "ntfsplus",
"peerix": "peerix",
"plasma-manager": "plasma-manager"
}
+8 -4
View File
@@ -3,6 +3,7 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-linuxeol.url = "github:NixOS/nixpkgs/162f04bf3dd222187388bc990a8678170d594419";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager/master";
@@ -34,8 +35,13 @@
url = "github:Lumpiasty/acer-wmi-ext/main";
inputs.nixpkgs.follows = "nixpkgs";
};
nixbsd = {
url = "path:/home/user/Projects/nixbsd";
ntfsplus = {
url = "github:cmspam/ntfsplus-flake";
inputs.nixpkgs.follows = "nixpkgs";
inputs.linux-ntfs.url = "github:Lumpiasty/linux-ntfs/main";
};
nix-skills = {
url = "github:sudosubin/nix-skills";
inputs.nixpkgs.follows = "nixpkgs";
};
};
@@ -45,13 +51,11 @@
nixosConfigurations =
let
mkNixosSystem = import lib/mkNixosSystem.nix inputs;
mkNixbsdSystem = import lib/mkNixbsdSystem.nix inputs;
in
with nixos-hardware.nixosModules; {
x260 = mkNixosSystem lenovo-thinkpad-x260 hosts/x260.nix;
acer = mkNixosSystem {} hosts/acer.nix;
gaming-pc = mkNixosSystem {} hosts/gaming-pc.nix;
bestieTest = mkNixbsdSystem hosts/bestieTest.nix;
};
};
}
+37 -10
View File
@@ -21,6 +21,26 @@
pkgs.vscode-extensions.arrterian.nix-env-selector
pkgs.vscode-extensions.jnoortheen.nix-ide
];
# profiles.default.userSettings = {
# "claudeCode.claudeProcessWrapper" = "${pkgs.claude-code}/bin/claude-code";
# };
argvSettings = {
# https://github.com/microsoft/vscode/issues/262065#issue-3328712020
disable-hardware-acceleration = osConfig.networking.hostName == "acer";
# If not set, vscode errors out when starting with "argv.json incorrect"
enable-crash-reporter = false;
};
};
# Just a fixed-location executable that launches claude code
# so we can point vscode's extenstion at it, not the nix store path
# remove it once we configure vscode using nix
home.file.".config/claude-code-wrapper" = {
text = ''
#!${pkgs.stdenv.shell}
exec ${pkgs.claude-code}/bin/claude "$@"
'';
executable = true;
};
home.packages = with pkgs; [
@@ -46,16 +66,6 @@
nodejs_24
codex
claude-code
(
# Wrapping opencode to set the OPENCODE_ENABLE_EXA environment variable
runCommand "opencode" {
buildInputs = [ makeWrapper ];
} ''
mkdir -p $out/bin
makeWrapper ${pkgs.opencode}/bin/opencode $out/bin/opencode \
--set OPENCODE_ENABLE_EXA "1"
''
)
winbox4
amdgpu_top
dua
@@ -114,5 +124,22 @@
fi
''
);
programs.opencode = {
enable = true;
package = (
# Wrapping opencode to set the OPENCODE_ENABLE_EXA environment variable
pkgs.runCommand "opencode" {
buildInputs = [ pkgs.makeWrapper ];
} ''
mkdir -p $out/bin
makeWrapper ${pkgs.opencode}/bin/opencode $out/bin/opencode \
--set OPENCODE_ENABLE_EXA "1"
''
);
skills = with pkgs.skills; {
caveman = majiayu000."claude-skill-registry".caveman + "/";
};
};
};
}
+15 -1
View File
@@ -6,7 +6,16 @@
config = lib.mkIf (config.lumpiastyHome.enablePcApps && osConfig.lumpiasty.pc) {
home.packages = with pkgs; [
vesktop
spotify
# Manual update, not yet in nixpkgs as for now
(spotify.overrideAttrs (old: rec {
version = "1.2.86.502.g8cd7fb22";
rev = "94";
src = fetchurl {
name = "spotify-${version}-${rev}.snap";
url = "https://api.snapcraft.io/api/v1/snaps/download/pOBIoZ2LrCB3rDohMxoYGnbN14EHOgD7_${rev}.snap";
hash = "sha256-XhwyaObck6viIvDRXEztlSLja5fsfw5HgHUUQzMehLI=";
};
}))
pass-wayland
teamspeak6-client
easyeffects
@@ -32,6 +41,11 @@
];
programs.librewolf.enable = true;
services.easyeffects.enable = true;
systemd.user.services.easyeffects.Service = lib.mkIf osConfig.lumpiasty.audioRt.cpuPartitioning {
# Move easyeffects into audio.slice (defined in modules/desktop/audio-rt.nix)
# which has AllowedCPUs=<audioCpus> — pins all DSP work to the reserved cores.
Slice = "audio.slice";
};
programs.chromium.enable = true;
programs.chromium.package = pkgs.ungoogled-chromium;
+4 -3
View File
@@ -1,4 +1,4 @@
{ lib, pkgs, ... }:
{ lib, pkgs, nixpkgs-linuxeol, ... }:
rec {
# Identity
@@ -23,8 +23,8 @@ rec {
# Kernel
# boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_19;
boot.zfs.package = pkgs.zfs_unstable;
boot.kernelPackages = pkgs.linuxKernel.packages.linux_7_0;
boot.zfs.package = pkgs.zfs_2_4;
# Swap
swapDevices = [
@@ -71,6 +71,7 @@ rec {
amdCpu = true;
noMitigations = false;
enablePulseaudio = true;
audioRt.enable = true;
sshd = true;
users.user = true;
# users.drugi = true;
-30
View File
@@ -1,30 +0,0 @@
{ config, pkgs, lib, ... }: {
nixpkgs.hostPlatform = "x86_64-freebsd";
nixpkgs.config.allowUnsupportedSystem = true;
users.users.root.initialPassword = "toor";
networking.dhcpcd.wait = "background";
users.users.bestie = {
isNormalUser = true;
description = "your bestie";
extraGroups = [ "wheel" ];
inherit (config.users.users.root) initialPassword;
};
services.sshd.enable = true;
boot.loader.stand-freebsd.enable = true;
fileSystems."/" = {
device = "/dev/gpt/nixos";
fsType = "ufs";
};
fileSystems."/boot" = {
device = "/dev/msdosfs/ESP";
fsType = "msdosfs";
};
virtualisation.vmVariant.virtualisation.diskImage = "./${config.system.name}.qcow2";
}
+14 -3
View File
@@ -1,4 +1,4 @@
{ lib, pkgs, ... }:
{ lib, pkgs, nixpkgs-linuxeol, ... }:
{
# Identity
@@ -53,7 +53,7 @@
# Kernel
# boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_19;
boot.kernelPackages = pkgs.linuxKernel.packages.linux_7_0;
# Swap
zramSwap = {
@@ -94,7 +94,7 @@
"/var/games" =
{
device = "/dev/disk/by-uuid/8A3094A230949733"; # "Shared" NTFS partition
fsType = "ntfs-3g";
fsType = "ntfs";
options = [
"uid=1000" "gid=100" # My user account
"nofail" # Don't fail boot if failed to mount because windows left it dirty
@@ -102,6 +102,11 @@
};
};
# Use ntfs-plus instead driver
services.ntfsplus.enable = true;
# Force disable ntfs-3g driver
boot.supportedFilesystems.ntfs = lib.mkForce false;
# Config modules
lumpiasty = {
pc = true;
@@ -124,8 +129,14 @@
};
services.transmission.enable = lib.mkForce false;
# programs.steam.enable = true;
# programs.steam.gamescopeSession.enable = true;
nix.settings.system-features = [ "gccarch-haswell" ];
# Local LLaMA.cpp server
networking.firewall.allowedTCPPorts = [ 8080 ];
# nixpkgs.hostPlatform = {
# system = "x86_64-linux";
# gcc.arch = "haswell";
-60
View File
@@ -1,60 +0,0 @@
{
self,
nixpkgs,
nixbsd,
home-manager,
nix-flatpak,
plasma-manager,
lanzaboote,
claude-code,
nix-sweep,
peerix,
acer-wmi-ext,
...
}:
hostConfig:
nixbsd.lib.nixbsdSystem {
modules = [
# Cross-compile FreeBSD from Linux, builds dispatched to remote builder
{
nixpkgs.buildPlatform = "x86_64-linux";
nixpkgs.config.allowUnsupportedSystem = true;
nixpkgs.overlays = [
(final: prev: {
# No-op emulator for FreeBSD - builds happen on remote builder where binaries run natively
freebsdEmulator = prev.runCommand "freebsd-emulator" { } ''
mkdir -p $out/bin
cat > $out/bin/freebsd-exec << 'SCRIPT'
#!/bin/sh
exec "$@"
SCRIPT
chmod +x $out/bin/freebsd-exec
'';
# Override mesonEmulatorHook to not require a real emulator for FreeBSD
mesonEmulatorHook =
let
canExec = prev.stdenv.hostPlatform.canExecute prev.stdenv.targetPlatform;
emulatorPath = "${final.freebsdEmulator}/bin/freebsd-exec";
in
if canExec then
prev.mesonEmulatorHook
else
prev.makeSetupHook
{
name = "mesonEmulatorHook";
substitutions = {
crossFile = prev.writeText "cross-file.conf" ''
[binaries]
exe_wrapper = '${prev.lib.escape [ "'" "\\" ] emulatorPath}'
'';
};
}
"${nixpkgs.outPath}/pkgs/build-support/setup-hooks/meson/emulator-hook.sh";
})
];
}
hostConfig
];
}
+6
View File
@@ -9,6 +9,9 @@
nix-sweep,
peerix,
acer-wmi-ext,
ntfsplus,
nix-skills,
nixpkgs-linuxeol,
...
}:
hardwareConfig: hostConfig:
@@ -19,12 +22,14 @@ nixpkgs.lib.nixosSystem {
inherit nix-flatpak;
inherit plasma-manager;
inherit acer-wmi-ext;
inherit nixpkgs-linuxeol;
};
modules = [
{
nixpkgs.overlays = [
claude-code.overlays.default
acer-wmi-ext.overlays.default
nix-skills.overlays.default
];
nix.settings = {
substituters = [ "https://claude-code.cachix.org" ];
@@ -36,6 +41,7 @@ nixpkgs.lib.nixosSystem {
home-manager.nixosModules.home-manager
nix-sweep.nixosModules.default
peerix.nixosModules.peerix
ntfsplus.nixosModules.default
../modules
hostConfig
];
+1
View File
@@ -20,6 +20,7 @@
desktop/plasma.nix
desktop/touchpad.nix
desktop/pulseaudio.nix
desktop/audio-rt.nix
desktop/tailscale.nix
];
}
+233
View File
@@ -0,0 +1,233 @@
{ config, lib, pkgs, ... }:
# Workarounds for audio xruns under CPU load.
#
# Each optimization is independently toggleable so behavior can be bisected.
# `lumpiasty.audioRt.enable` is the master switch; individual sub-flags default
# to `true` when the master is on and can be flipped per-host to test impact.
let
cfg = config.lumpiasty.audioRt;
marchFlags = " -march=znver4 -O3";
# ---------------------------------------------------------------------------
# Per-build-system helpers (see commit history for rationale on LTO choices).
# ---------------------------------------------------------------------------
withMarch = pkg: pkg.overrideAttrs (old: {
env = (old.env or {}) // {
NIX_CFLAGS_COMPILE =
((old.env or {}).NIX_CFLAGS_COMPILE or old.NIX_CFLAGS_COMPILE or "")
+ marchFlags;
};
});
cmakePkg = pkg: pkg.overrideAttrs (old: {
env = (old.env or {}) // {
NIX_CFLAGS_COMPILE =
((old.env or {}).NIX_CFLAGS_COMPILE or old.NIX_CFLAGS_COMPILE or "")
+ marchFlags;
};
cmakeFlags = (old.cmakeFlags or []) ++ [ "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON" ];
preConfigure = (old.preConfigure or "") + "\nexport AR=gcc-ar\n";
});
rustPkg = pkg: pkg.overrideAttrs (old: {
RUSTFLAGS = (old.RUSTFLAGS or "") + " -C target-cpu=znver4";
});
in
{
options.lumpiasty.audioRt = {
enable = lib.mkEnableOption "Audio RT scheduling and CPU isolation";
audioCpus = lib.mkOption {
type = lib.types.str;
default = "12-15";
description = "CPU list reserved for audio services (systemd cpuset syntax).";
};
nonAudioCpus = lib.mkOption {
type = lib.types.str;
default = "0-11";
description = "CPU list for everything else.";
};
# ------ Individual optimization toggles ------
cpuPartitioning = lib.mkOption {
type = lib.types.bool;
default = cfg.enable;
description = ''
Cgroup-based CPU partitioning via dedicated audio.slice and
restricted app/session/background slices.
'';
};
rtLimits = lib.mkOption {
type = lib.types.bool;
default = cfg.enable;
description = ''
Raise rlimits (RTPRIO=95, MEMLOCK=infinity) for the audio group
so PipeWire's module-rt can set SCHED_FIFO 88 directly instead
of going through RTKit's priority-10 ceiling.
'';
};
performanceGovernor = lib.mkOption {
type = lib.types.bool;
default = cfg.enable;
description = ''
Keep cpufreq governor `performance` on the audio cores so they
stay boosted regardless of measured utilization.
'';
};
ananicy = lib.mkOption {
type = lib.types.bool;
default = cfg.enable;
description = ''
Run ananicy-cpp with a rule that pins easyeffects to nice -12 so
its non-RT DSP threads get scheduler preference under load.
'';
};
optimisedBinaries = lib.mkOption {
type = lib.types.bool;
default = cfg.enable;
description = ''
Rebuild easyeffects and its DSP dependencies with -march=znver4 -O3
(and LTO for cmake builds, target-cpu for rust builds).
'';
};
};
config = lib.mkMerge [
# --- Optimised binary builds ---------------------------------------------
(lib.mkIf (cfg.enable && cfg.optimisedBinaries) {
nixpkgs.overlays = [
(final: prev: {
easyeffects = cmakePkg (prev.easyeffects.override {
fftw = withMarch prev.fftw;
fftwFloat = withMarch prev.fftwFloat;
speexdsp = withMarch prev.speexdsp;
rubberband = withMarch prev.rubberband;
soundtouch = withMarch prev.soundtouch;
zita-convolver = withMarch prev.zita-convolver;
webrtc-audio-processing = withMarch prev.webrtc-audio-processing;
rnnoise = withMarch prev.rnnoise;
libebur128 = cmakePkg prev.libebur128;
libbs2b = withMarch prev.libbs2b;
lilv = withMarch prev.lilv;
onetbb = cmakePkg prev.onetbb;
calf = cmakePkg prev.calf;
lsp-plugins = withMarch prev.lsp-plugins;
zam-plugins = withMarch prev.zam-plugins;
mda_lv2 = withMarch prev.mda_lv2;
deepfilternet = rustPkg prev.deepfilternet;
});
})
];
})
# --- RT scheduling rlimits ----------------------------------------------
(lib.mkIf (cfg.enable && cfg.rtLimits) {
security.pam.loginLimits = [
{ domain = "@audio"; type = "-"; item = "rtprio"; value = "95"; }
{ domain = "@audio"; type = "-"; item = "memlock"; value = "unlimited"; }
{ domain = "@audio"; type = "-"; item = "nice"; value = "-20"; }
];
systemd.user.extraConfig = ''
DefaultLimitRTPRIO=95
DefaultLimitMEMLOCK=infinity
'';
})
# --- CPU partitioning (cgroup-based) ------------------------------------
#
# Cgroup hierarchy under user@.service:
# ├── app.slice AllowedCPUs=<nonAudioCpus> (Steam-launched apps)
# ├── session.slice AllowedCPUs=<nonAudioCpus> (kwin, plasmashell, kded)
# ├── background.slice AllowedCPUs=<nonAudioCpus> (akonadi, polkit)
# └── audio.slice AllowedCPUs=<audioCpus> (pipewire, easyeffects)
#
# Reasoning:
# - No isolcpus= : breaks scheduler load balancing on the rest of the system.
# - No nohz_full= : amd-pstate can't sample utilization in tickless mode
# so cores get clamped at minimum frequency.
# - No rcu_nocbs= : microsecond-scale jitter is irrelevant at 21ms quantum.
(lib.mkIf (cfg.enable && cfg.cpuPartitioning) {
systemd.user.extraConfig = ''
CPUAffinity=${cfg.nonAudioCpus}
'';
systemd.settings.Manager.CPUAffinity = cfg.nonAudioCpus;
# Delegate the cpuset controller to user managers so user-level slices
# can use AllowedCPUs=.
systemd.services."user@".serviceConfig.Delegate = "cpu cpuset io memory pids";
systemd.user.slices = {
app.sliceConfig.AllowedCPUs = cfg.nonAudioCpus;
session.sliceConfig.AllowedCPUs = cfg.nonAudioCpus;
background.sliceConfig.AllowedCPUs = cfg.nonAudioCpus;
audio = {
description = "Audio services pinned to reserved CPU cores";
sliceConfig.AllowedCPUs = cfg.audioCpus;
};
};
# easyeffects.service Slice= is set in home-modules/pc.nix.
systemd.user.services.pipewire.serviceConfig.Slice = "audio.slice";
systemd.user.services.pipewire-pulse.serviceConfig.Slice = "audio.slice";
systemd.user.services.wireplumber.serviceConfig.Slice = "audio.slice";
})
# --- Performance governor on audio cores --------------------------------
(lib.mkIf (cfg.enable && cfg.performanceGovernor) {
systemd.services.audio-cores-performance = {
description = "Keep performance governor on audio cores";
wantedBy = [ "multi-user.target" ];
after = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
Restart = "always";
RestartSec = "5s";
# Expand systemd CPU list ("12-15" / "12,13,14,15") into a flat list.
ExecStart = pkgs.writeShellScript "audio-cores-performance" ''
cpus=$(echo "${cfg.audioCpus}" | ${pkgs.coreutils}/bin/tr ',' ' ' | \
${pkgs.gawk}/bin/awk '{
for (i=1; i<=NF; i++) {
if (match($i, /^([0-9]+)-([0-9]+)$/, m))
for (j=m[1]; j<=m[2]; j++) print j
else print $i
}
}')
while true; do
for cpu in $cpus; do
cur=$(cat /sys/devices/system/cpu/cpu$cpu/cpufreq/scaling_governor)
if [ "$cur" != "performance" ]; then
echo performance > /sys/devices/system/cpu/cpu$cpu/cpufreq/scaling_governor
fi
done
sleep 2
done
'';
};
};
})
# --- Ananicy rule for easyeffects ---------------------------------------
(lib.mkIf (cfg.enable && cfg.ananicy) {
services.ananicy = {
enable = true;
package = pkgs.ananicy-cpp;
extraRules = [
{ name = "easyeffects"; type = "Audio"; nice = -12; }
];
};
})
];
}
+4 -1
View File
@@ -8,7 +8,7 @@
services.xserver.enable = true;
# Enable the KDE Plasma Desktop Environment.
services.displayManager.sddm.enable = true;
services.displayManager.plasma-login-manager.enable = true;
services.desktopManager.plasma6.enable = true;
# Configure keymap in X11
@@ -58,6 +58,9 @@
# Exclude audiocd-kio due to build failure
(builtins.filter (pkg: pkg.pname != "audiocd-kio"))
# Exclude audiotube due to build failure
(builtins.filter (pkg: pkg.pname != "audiotube"))
# Exclude plasma-mobile
(builtins.filter (pkg: pkg.pname != "plasma-mobile"))
]) ++ [
+10 -2
View File
@@ -20,13 +20,21 @@
# no need to redefine it in your config for now)
#media-session.enable = true;
extraConfig.pipewire."99-quantum" = {
"context.properties" = {
"default.clock.quantum" = 1024;
"default.clock.min-quantum" = 1024;
"default.clock.max-quantum" = 8192;
};
};
wireplumber.configPackages = [
(pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/99-alsa-nova-3.conf" ''
monitor.alsa.rules = [
{
matches = [
{
node.name = "alsa_output.usb-SteelSeries_Arctis_Nova_3-00.analog-stereo"
node.name = "alsa_output.usb-SteelSeries_Arctis_Nova_7-00.analog-stereo"
}
]
actions = {
@@ -34,7 +42,7 @@
audio.format = "S24LE"
audio.rate = 96000
api.alsa.period-size = 1024
api.alsa.period-num = 4
api.alsa.period-num = 8
api.alsa.disable-batch = false
}
}
-34
View File
@@ -6,48 +6,14 @@ let
else if config.boot.loader.systemd-boot.enable then
config.boot.loader.systemd-boot.configurationLimit
else null;
# NixBSD builder VM SSH key (needs to be readable by root/nix-daemon)
builderKeyDir = "/etc/nix/builder-keys";
in
{
nix = {
daemonIOSchedClass = "idle";
daemonCPUSchedPolicy = "idle";
settings.trusted-users = [ "root" "user" ];
# FreeBSD remote builder VM (NixBSD)
distributedBuilds = true;
buildMachines = [
{
hostName = "192.168.122.100";
system = "x86_64-freebsd";
sshUser = "root";
sshKey = "${builderKeyDir}/nixbsd-builder";
maxJobs = 8;
speedFactor = 1;
supportedFeatures = [ "big-parallel" ];
}
];
settings.builders-use-substitutes = true;
};
# Install the builder SSH key where root/nix-daemon can read it
system.activationScripts.nixbsd-builder-key = ''
mkdir -p ${builderKeyDir}
cp /home/user/Projects/nixbsd-flake/keys/builder ${builderKeyDir}/nixbsd-builder
chmod 600 ${builderKeyDir}/nixbsd-builder
chown root:root ${builderKeyDir}/nixbsd-builder
'';
# Skip host key checking for the local builder VM (keys change on rebuild)
programs.ssh.extraConfig = ''
Host 192.168.122.100
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
LogLevel ERROR
'';
# Clean up nix store from old configurations usinx nix-sweep
services.nix-sweep = {
enable = true;
+1 -1
View File
@@ -11,6 +11,6 @@
# Ventoy has some blobs making it insecure
nixpkgs.config.permittedInsecurePackages = [
"ventoy-qt5-1.1.10"
"ventoy-qt5-1.1.12"
];
}
+3 -4
View File
@@ -2,9 +2,8 @@
{
config = lib.mkIf config.boot.zfs.enabled {
# Set ARC max to 5% of physical RAM at boot
systemd.services."zfs-arc-limit" = {
description = "Set ZFS ARC max to 5% of physical RAM";
description = "Set ZFS ARC max to 20% of physical RAM";
# Ensure the module is loaded before we write to /sys
after = [ "systemd-modules-load.service" ];
# Run early, but its fine if ZFS has already imported; the limit still applies
@@ -15,8 +14,8 @@
# Total RAM in kB
mem_kb=$(awk '/MemTotal:/ {print $2}' /proc/meminfo)
echo "DEBUG: Total RAM: $mem_kb kB"
# 5%, in bytes
arc_max_bytes=$(( mem_kb * 1024 / 100 * 5 ))
# 20%, in bytes
arc_max_bytes=$(( mem_kb * 1024 / 100 * 20 ))
echo "DEBUG: Setting ZFS ARC max to: $arc_max_bytes bytes"
param="/sys/module/zfs/parameters/zfs_arc_max"
if [ -w "$param" ]; then
+5
View File
@@ -1,4 +1,9 @@
self: super:
{
opencode-claude-auth = super.callPackage ../pkgs/opencode-claude-auth {};
# Build failure 08.05.2026
# https://github.com/NixOS/nixpkgs/issues/513245#issuecomment-4320293674
openldap = super.openldap.overrideAttrs {
doCheck = !super.stdenv.hostPlatform.isi686;
};
}
+3 -3
View File
@@ -2,11 +2,11 @@
stdenv.mkDerivation {
pname = "opencode-claude-auth";
version = "1.5.0";
version = "1.5.4";
src = fetchurl {
url = "https://registry.npmjs.org/opencode-claude-auth/-/opencode-claude-auth-1.5.0.tgz";
hash = "sha512-5NSL+x++VTe2ZrFSznXKv7imiKObIBz0QXPuL+g1NAXAcdTGcbEbQBvvHZeIaSBNjmwpY2MR67Yez1f3LlPl7w==";
url = "https://registry.npmjs.org/opencode-claude-auth/-/opencode-claude-auth-1.5.4.tgz";
hash = "sha256-9iByuNTg/MTD3VGeqpBaBCBaooXm97BuvP0fPXDoPGc=";
};
dontBuild = true;