Author SHA1 Message Date
andreas 3062ef1608 update millennium 2026-10-15 15:08:12 +02:00
andreas ac7a47c26a module for recovering shitty realtek controller when it gets stuck in bugged power state 2026-10-15 10:48:08 +02:00
andreas 74d3d6870d WIP 2026-10-15 08:52:31 +02:00
andreas ac9eeb1f1c enable millennium for steam 2026-09-30 19:54:22 +02:00
andreas 666b7ab737 move comment to appropriate block 2026-09-30 19:53:54 +02:00
andreas bcfada020b enable distrobox 2026-09-30 19:53:42 +02:00
andreas d79713972e don't disable power saving 2026-09-30 17:53:28 +02:00
andreas 441d029eb6 enable ptyxis terminal on gnome 2026-09-30 17:53:08 +02:00
andreas 17933af881 fix log spam 2026-09-30 15:40:46 +02:00
andreas c4693f0ee6 fix url handlers for steam 2026-09-30 02:27:58 +02:00
andreas 813e474bc1 add wp engine gui 2026-09-28 01:04:34 +02:00
andreas 333bed459d updated config for fresh install 2026-09-19 07:04:41 +02:00
andreas cd454434d7 add gnome compatible wallpaperengine 2026-09-18 12:25:28 +02:00
andreas e89ee3c559 patch low contrast icons 2026-09-18 12:24:49 +02:00
14 changed files with 653 additions and 39 deletions
Generated
+366 -4
View File
@@ -1,5 +1,56 @@
{ {
"nodes": { "nodes": {
"Catch2": {
"flake": false,
"locked": {
"lastModified": 1759222471,
"narHash": "sha256-7Dx7PhtRwkbo8vHF57sAns2fQZ442D3cMyCt25RvzJc=",
"owner": "catchorg",
"repo": "Catch2",
"rev": "b3fb4b9feafcd8d91c5cb510a4775143fdbef02f",
"type": "github"
},
"original": {
"owner": "catchorg",
"repo": "Catch2",
"rev": "b3fb4b9feafcd8d91c5cb510a4775143fdbef02f",
"type": "github"
}
},
"MimeTypes": {
"flake": false,
"locked": {
"lastModified": 1577040615,
"narHash": "sha256-biRcxbpRVnD3+VVo0fNrNGeAi1P7pSzkGKHZrTtGp7Q=",
"owner": "lasselukkari",
"repo": "MimeTypes",
"rev": "8990d6a796bd9904ec3d41e5c150a1ffb48fe32e",
"type": "github"
},
"original": {
"owner": "lasselukkari",
"repo": "MimeTypes",
"rev": "8990d6a796bd9904ec3d41e5c150a1ffb48fe32e",
"type": "github"
}
},
"SPIRV-Cross-WallpaperEngine": {
"flake": false,
"locked": {
"lastModified": 1745093314,
"narHash": "sha256-ou66paGlu3KXf8LL8zfTiE8wOf0nRBocDs1QvfRVs+k=",
"owner": "Almamu",
"repo": "SPIRV-Cross-WallpaperEngine",
"rev": "ad4d02220b01c1800e5a4e6671d6d8ca8ab07783",
"type": "github"
},
"original": {
"owner": "Almamu",
"repo": "SPIRV-Cross-WallpaperEngine",
"rev": "ad4d02220b01c1800e5a4e6671d6d8ca8ab07783",
"type": "github"
}
},
"aagl": { "aagl": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@@ -22,6 +73,44 @@
"type": "github" "type": "github"
} }
}, },
"argparse": {
"flake": false,
"locked": {
"lastModified": 1737934041,
"narHash": "sha256-gRLn4juxwde7ugvT/p4lx9ayDTm7o32NKaE/SEbnLHI=",
"owner": "p-ranav",
"repo": "argparse",
"rev": "d924b84eba1f0f0adf38b20b7b4829f6f65b6570",
"type": "github"
},
"original": {
"owner": "p-ranav",
"repo": "argparse",
"rev": "d924b84eba1f0f0adf38b20b7b4829f6f65b6570",
"type": "github"
}
},
"codex-desktop": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1791562553,
"narHash": "sha256-uyLpIxJv9lqy1pgGUd0C/RZvqWyFqbwR0Tq7E+UX0VM=",
"owner": "ilysenko",
"repo": "codex-desktop-linux",
"rev": "443cb5d52ed781cac6cc7083780abb058cf93678",
"type": "github"
},
"original": {
"owner": "ilysenko",
"repo": "codex-desktop-linux",
"type": "github"
}
},
"crane": { "crane": {
"locked": { "locked": {
"lastModified": 1781825982, "lastModified": 1781825982,
@@ -124,11 +213,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1694529238, "lastModified": 1731533236,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -139,7 +228,7 @@
}, },
"flake-utils-plus": { "flake-utils-plus": {
"inputs": { "inputs": {
"flake-utils": "flake-utils" "flake-utils": "flake-utils_2"
}, },
"locked": { "locked": {
"lastModified": 1715533576, "lastModified": 1715533576,
@@ -156,6 +245,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -178,6 +285,23 @@
"type": "github" "type": "github"
} }
}, },
"glslang-WallpaperEngine": {
"flake": false,
"locked": {
"lastModified": 1770589476,
"narHash": "sha256-auhYcTWdSERwujUqwfDbF61tncO18dwar3mMQ09VW1w=",
"owner": "Almamu",
"repo": "glslang-WallpaperEngine",
"rev": "b775500a153f5ceb0e4b6f366b79c4c57521bb62",
"type": "github"
},
"original": {
"owner": "Almamu",
"repo": "glslang-WallpaperEngine",
"rev": "b775500a153f5ceb0e4b6f366b79c4c57521bb62",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -219,6 +343,40 @@
"type": "github" "type": "github"
} }
}, },
"json": {
"flake": false,
"locked": {
"lastModified": 1743872075,
"narHash": "sha256-eSqi4dhFrUvjYN+jD8nGqj1FbzGA6I2+eSqzdCGOLH8=",
"owner": "nlohmann",
"repo": "json",
"rev": "4424a0fcc1c7fa640b5c87d26776d99150dacd10",
"type": "github"
},
"original": {
"owner": "nlohmann",
"repo": "json",
"rev": "4424a0fcc1c7fa640b5c87d26776d99150dacd10",
"type": "github"
}
},
"kissfft": {
"flake": false,
"locked": {
"lastModified": 1739194969,
"narHash": "sha256-DywClnx67EE+CnduSuZIIfaAKbBg1ebQ+JgwIpDsnGQ=",
"owner": "mborgerding",
"repo": "kissfft",
"rev": "febd4caeed32e33ad8b2e0bb5ea77542c40f18ec",
"type": "github"
},
"original": {
"owner": "mborgerding",
"repo": "kissfft",
"rev": "febd4caeed32e33ad8b2e0bb5ea77542c40f18ec",
"type": "github"
}
},
"lanzaboote": { "lanzaboote": {
"inputs": { "inputs": {
"crane": "crane", "crane": "crane",
@@ -243,6 +401,47 @@
"type": "github" "type": "github"
} }
}, },
"millennium": {
"inputs": {
"millennium-src": "millennium-src",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-bun": "nixpkgs-bun"
},
"locked": {
"dir": "packages/nix",
"lastModified": 1792022604,
"narHash": "sha256-xyl3KTB+j4W3dAxQVSolNJCQZOasDnCLB3Dr14adBmU=",
"owner": "SteamClientHomebrew",
"repo": "Millennium",
"rev": "22af2f453777a925fb398a3dab60a407e66aa83f",
"type": "github"
},
"original": {
"dir": "packages/nix",
"owner": "SteamClientHomebrew",
"repo": "Millennium",
"type": "github"
}
},
"millennium-src": {
"flake": false,
"locked": {
"lastModified": 1791947497,
"narHash": "sha256-sNpoyJ+IjrTiDGfX2QiKVg4jkrJR7n9PdBeOYJSS4n8=",
"owner": "SteamClientHomebrew",
"repo": "Millennium",
"rev": "401d532543a0fbff469653ccba802bdd7e45f861",
"type": "github"
},
"original": {
"owner": "SteamClientHomebrew",
"repo": "Millennium",
"rev": "401d532543a0fbff469653ccba802bdd7e45f861",
"type": "github"
}
},
"nix-cachyos-kernel": { "nix-cachyos-kernel": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_3",
@@ -280,6 +479,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-bun": {
"locked": {
"lastModified": 1790822859,
"narHash": "sha256-69xHQhAeMAD2wDXO7T2pcOZIF9Sga2W+JkmY2a11Ops=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c59305bab2065cfecc4944690d9eedbb56f3a9fa",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c59305bab2065cfecc4944690d9eedbb56f3a9fa",
"type": "github"
}
},
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": { "locked": {
"lastModified": 1788057806, "lastModified": 1788057806,
@@ -311,6 +526,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_3": {
"locked": {
"lastModified": 1789286504,
"narHash": "sha256-eiEK7cKZORNEvX0GeF3RtNEF/JXhgf2RqSp3230q13E=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ef34387ddd751e1ab8857adf4676492d32eb24ec",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit": { "pre-commit": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
@@ -334,15 +565,36 @@
"type": "github" "type": "github"
} }
}, },
"quickjs": {
"flake": false,
"locked": {
"lastModified": 1770976497,
"narHash": "sha256-odQznZ/Xc6IGh6JPM1RyyEn9HL/+/AFR99XcF+WHJDc=",
"owner": "quickjs-ng",
"repo": "quickjs",
"rev": "72ba50f63ee31202f8c18b8d07ab1e1c3486ee6f",
"type": "github"
},
"original": {
"owner": "quickjs-ng",
"repo": "quickjs",
"rev": "72ba50f63ee31202f8c18b8d07ab1e1c3486ee6f",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"aagl": "aagl", "aagl": "aagl",
"codex-desktop": "codex-desktop",
"home-manager": "home-manager", "home-manager": "home-manager",
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"millennium": "millennium",
"nix-cachyos-kernel": "nix-cachyos-kernel", "nix-cachyos-kernel": "nix-cachyos-kernel",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"simple-wallpaper-engine": "simple-wallpaper-engine",
"snowfall-lib": "snowfall-lib", "snowfall-lib": "snowfall-lib",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"wallpaperengine": "wallpaperengine",
"zen-browser": "zen-browser" "zen-browser": "zen-browser"
} }
}, },
@@ -388,6 +640,27 @@
"type": "github" "type": "github"
} }
}, },
"simple-wallpaper-engine": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1772136897,
"narHash": "sha256-2RBgZWq80zXVWyOswUlDaoRZtaeT6pBkbNCLdAzLYoY=",
"owner": "Maxnights",
"repo": "simple-linux-wallpaperengine-gui",
"rev": "43ae644754a0a5e96c8ddb9077843643b74f9acc",
"type": "github"
},
"original": {
"owner": "Maxnights",
"repo": "simple-linux-wallpaperengine-gui",
"type": "github"
}
},
"snowfall-lib": { "snowfall-lib": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_4", "flake-compat": "flake-compat_4",
@@ -430,6 +703,23 @@
"type": "github" "type": "github"
} }
}, },
"stb": {
"flake": false,
"locked": {
"lastModified": 1741976854,
"narHash": "sha256-FkTeRO/AC5itykH4uWNsE0UeQTS34VtGGoej5QJiBlg=",
"owner": "nothings",
"repo": "stb",
"rev": "f0569113c93ad095470c54bf34a17b36646bbbb5",
"type": "github"
},
"original": {
"owner": "nothings",
"repo": "stb",
"rev": "f0569113c93ad095470c54bf34a17b36646bbbb5",
"type": "github"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
@@ -445,6 +735,78 @@
"type": "github" "type": "github"
} }
}, },
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"wallpaperengine": {
"inputs": {
"Catch2": "Catch2",
"MimeTypes": "MimeTypes",
"SPIRV-Cross-WallpaperEngine": "SPIRV-Cross-WallpaperEngine",
"argparse": "argparse",
"glslang-WallpaperEngine": "glslang-WallpaperEngine",
"json": "json",
"kissfft": "kissfft",
"nixpkgs": "nixpkgs_3",
"quickjs": "quickjs",
"stb": "stb"
},
"locked": {
"lastModified": 1790172262,
"narHash": "sha256-gTnF4besYxSEFx0GTA35+/k81nE7WwvTIyJbIs1p20k=",
"path": "/home/andreas/Projects/linwallpaap/linux-wallpaperengine",
"type": "path"
},
"original": {
"path": "/home/andreas/Projects/linwallpaap/linux-wallpaperengine",
"type": "path"
}
},
"zen-browser": { "zen-browser": {
"inputs": { "inputs": {
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
+14
View File
@@ -47,6 +47,19 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nix-cachyos-kernel.url = "github:xddxdd/nix-cachyos-kernel/release"; nix-cachyos-kernel.url = "github:xddxdd/nix-cachyos-kernel/release";
wallpaperengine.url = "path:/home/andreas/Projects/linwallpaap/linux-wallpaperengine";
simple-wallpaper-engine = {
url = "github:Maxnights/simple-linux-wallpaperengine-gui";
inputs.nixpkgs.follows = "nixpkgs";
};
millennium = {
url = "github:SteamClientHomebrew/Millennium?dir=packages/nix";
inputs.nixpkgs.follows = "nixpkgs";
};
codex-desktop = {
url = "github:ilysenko/codex-desktop-linux";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = inputs: outputs = inputs:
@@ -90,6 +103,7 @@
# Use the exact kernel versions as defined in this repo. # Use the exact kernel versions as defined in this repo.
# Guarantees you have binary cache. # Guarantees you have binary cache.
nix-cachyos-kernel.overlays.pinned nix-cachyos-kernel.overlays.pinned
inputs.millennium.overlays.default
]; ];
nixos = with inputs; [ nixos = with inputs; [
@@ -6,6 +6,15 @@
}: }:
let let
inherit (lib.my-namespace) enabled; inherit (lib.my-namespace) enabled;
system = pkgs.stdenv.hostPlatform.system;
simpleWallpaperEngine =
inputs.simple-wallpaper-engine.packages.${system}.default.override {
# The upstream GUI package otherwise puts nixpkgs' unmodified
# linux-wallpaperengine in its wrapped PATH.
pkgs = pkgs // {
linux-wallpaperengine = inputs.wallpaperengine.packages.${system}.default;
};
};
in in
{ {
imports = [ imports = [
@@ -29,20 +38,26 @@ in
pkgs.hyfetch pkgs.hyfetch
pkgs.libreoffice pkgs.libreoffice
pkgs.localsend pkgs.localsend
simpleWallpaperEngine
# pkgs.vesktop # pkgs.vesktop
pkgs.obsidian pkgs.obsidian
inputs.zen-browser.packages.x86_64-linux.default inputs.zen-browser.packages.x86_64-linux.default
# inputs.kwin-effects-forceblur.packages.${pkgs.stdenv.hostPlatform.system}.default # Archived. # inputs.kwin-effects-forceblur.packages.${pkgs.stdenv.hostPlatform.system}.default # Archived.
]; ];
}; };
xdg.autostart = {
enable = true;
entries = [
"${simpleWallpaperEngine}/share/applications/simple-wallpaper-engine-autostart.desktop"
];
};
# Auto-start linux-wallpaperengine for dual monitors via XDG autostart # Auto-start linux-wallpaperengine for dual monitors via XDG autostart
xdg.configFile."autostart/linux-wallpaperengine.desktop".text = '' # xdg.configFile."autostart/linux-wallpaperengine.desktop".text = ''
[Desktop Entry] # [Desktop Entry]
Type=Application # Type=Application
Name=Wallpaper Engine # Name=Wallpaper Engine
Exec=${pkgs.my-namespace.linux-wallpaperengine}/bin/linux-wallpaperengine --screen-root DP-1 --bg 2935872330 --screen-root DP-2 --bg 2935872330 -f 12 # Exec=${pkgs.my-namespace.linux-wallpaperengine}/bin/linux-wallpaperengine --screen-root DP-1 --bg 2935872330 --screen-root DP-2 --bg 2935872330 -f 12
X-KDE-autostart-after=panel # X-KDE-autostart-after=panel
X-KDE-StartupNotify=false # X-KDE-StartupNotify=false
''; # '';
} }
@@ -83,9 +83,11 @@ in {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
gnome-tweaks gnome-tweaks
ptyxis
gnome-software gnome-software
gnomeExtensions.pop-shell gnomeExtensions.pop-shell
gnome-remote-desktop gnome-remote-desktop
dconf-editor
glib-networking # Required gnome-remote-desktop dependency glib-networking # Required gnome-remote-desktop dependency
]; ];
systemd.user.services.gnome-remote-desktop.environment = { systemd.user.services.gnome-remote-desktop.environment = {
+21
View File
@@ -0,0 +1,21 @@
{
config,
lib,
pkgs,
namespace,
...
}:
let
cfg = config.${namespace}.distrobox;
in
{
options.${namespace}.distrobox = {
enable = lib.mkEnableOption "Distrobox with a Podman container backend";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.distrobox ];
virtualisation.podman.enable = true;
};
}
+1 -1
View File
@@ -43,7 +43,7 @@ in
age age
wget wget
sops sops
# bitwarden-desktop #replaced bitwarden bitwarden-desktop #replaced bitwarden
bitwarden-cli bitwarden-cli
cowsay cowsay
remmina remmina
@@ -0,0 +1,58 @@
{ config, lib, pkgs, namespace, ... }:
let
cfg = config.${namespace}.rtl8125-recovery;
recovery = pkgs.writeShellApplication {
name = "rtl8125-recover";
runtimeInputs = with pkgs; [ coreutils gnugrep pciutils ethtool systemd ];
text = builtins.readFile ./recover.sh;
};
in {
options.${namespace}.rtl8125-recovery = {
enable = lib.mkEnableOption "RTL8125 PCI recovery after boot and resume";
pciAddress = lib.mkOption {
type = lib.types.str;
default = "0000:0a:00.0";
description = "PCI address of the onboard RTL8125 controller.";
};
bridgeAddress = lib.mkOption {
type = lib.types.str;
default = "0000:06:03.0";
description = "Immediate parent PCI bridge of the controller.";
};
};
config = lib.mkIf cfg.enable {
systemd.services.rtl8125-recovery = {
description = "Recover RTL8125 from failed PCI power restoration";
wantedBy = [ "multi-user.target" ];
after = [ "NetworkManager.service" ];
environment = {
NIC_PCI = cfg.pciAddress;
NIC_BRIDGE = cfg.bridgeAddress;
};
serviceConfig = {
Type = "oneshot";
ExecStart = lib.getExe recovery;
TimeoutStartSec = "90s";
StateDirectory = "rtl8125-recovery";
StateDirectoryMode = "0700";
UMask = "0077";
};
};
# sleep.target is stopped after resume. Queue recovery separately so its
# grace period does not hold up the sleep transaction or user sessions.
systemd.services.rtl8125-resume = {
description = "Queue RTL8125 recovery after waking";
wantedBy = [ "sleep.target" ];
before = [ "sleep.target" ];
unitConfig.StopWhenUnneeded = true;
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${pkgs.coreutils}/bin/true";
ExecStop = "${pkgs.systemd}/bin/systemctl --no-block start rtl8125-recovery.service";
};
};
};
}
+89
View File
@@ -0,0 +1,89 @@
# Called once after boot or resume. No network access is required.
set -euo pipefail
nic="/sys/bus/pci/devices/$NIC_PCI"
bridge="/sys/bus/pci/devices/$NIC_BRIDGE"
log() { echo "rtl8125-recovery: $*"; }
# Let normal PCI and network resume finish before diagnosing anything.
sleep 10
if [[ ! -d "$bridge" ]]; then
log "Parent bridge $NIC_BRIDGE is absent; refusing recovery."
exit 1
fi
if [[ $(cat "$bridge/vendor") != 0x1022 || $(cat "$bridge/device") != 0x43f5 ]]; then
log "Parent bridge identity changed; refusing recovery."
exit 1
fi
if [[ -d "$nic" ]]; then
if [[ $(cat "$nic/vendor") != 0x10ec || $(cat "$nic/device") != 0x8125 ]]; then
log "Device at $NIC_PCI is not an RTL8125; refusing recovery."
exit 1
fi
if [[ $(dirname "$(readlink -f "$nic")") != "$(readlink -f "$bridge")" ]]; then
log "NIC is no longer directly below the configured bridge; refusing recovery."
exit 1
fi
power=$(cat "$nic/power_state")
command=$(timeout 5 setpci -s "$NIC_PCI" COMMAND 2>/dev/null || true)
# Both memory decoding and bus mastering should be enabled on this host.
# Disconnected cables do not disable these PCI command bits.
if [[ "$power" != D3cold && "$command" =~ ^[[:xdigit:]]{4}$ ]] &&
(( (16#$command & 6) == 6 )); then
log "PCI state healthy ($power, COMMAND=$command); no recovery needed."
exit 0
fi
# An administratively disabled NIC should not be automatically reset.
netdirs=("$nic"/net/*)
if [[ -e "${netdirs[0]}/flags" ]]; then
flags=$(cat "${netdirs[0]}/flags")
if (( (flags & 1) == 0 )); then
log "Interface is administratively down; leaving it alone."
exit 0
fi
fi
log "Failed PCI state: power=$power COMMAND=$command."
else
log "NIC missing; attempting one rescan of its known bridge."
fi
# Retain evidence from the latest failure without accumulating unlimited logs.
evidence="${STATE_DIRECTORY:-/var/lib/rtl8125-recovery}/last-failure.log"
mkdir -p "$(dirname "$evidence")"
{
date -Is
timeout 5 lspci -s "$NIC_PCI" -vv || true
timeout 5 lspci -s "$NIC_BRIDGE" -vv || true
journalctl -b -k --since '10 minutes ago' -n 250 --no-pager || true
} > "$evidence" 2>&1
# This is the remove/rescan recovery that worked on this machine. Never reset
# or remove the parent bridge, which could affect other hardware.
if [[ -d "$nic" ]]; then
echo 1 > "$nic/remove"
fi
echo 1 > "$bridge/rescan"
for ((attempt=0; attempt<20; attempt++)); do
netdirs=("$nic"/net/*)
if [[ -e "${netdirs[0]}/ifindex" ]]; then
iface=$(basename "${netdirs[0]}")
power=$(cat "$nic/power_state")
command=$(timeout 5 setpci -s "$NIC_PCI" COMMAND 2>/dev/null || true)
if [[ "$power" == D0 && "$command" =~ ^[[:xdigit:]]{4}$ ]] &&
(( (16#$command & 6) == 6 )); then
# NetworkManager also reapplies the saved profile. Explicitly
# restore WoL here so recovery does not depend on its timing.
ethtool -s "$iface" wol g
if ! ethtool "$iface" | grep -Eq '^[[:space:]]*Wake-on: g$'; then
log "PCI recovered, but magic-packet WoL could not be confirmed."
exit 1
fi
log "Recovered $iface in D0; magic-packet WoL enabled. Evidence: $evidence"
exit 0
fi
fi
sleep 1
done
log "Recovery did not restore operational PCI state; no further attempt this invocation."
exit 1
+9 -2
View File
@@ -43,7 +43,14 @@
hardware.uinput.enable = true; hardware.uinput.enable = true;
users.users.andreas.extraGroups = [ "input" ]; users.users.andreas.extraGroups = [ "input" ];
# Explicitly register the desktop MIME scheme handler
xdg.mime = {
enable = true;
defaultApplications = {
"x-scheme-handler/steam" = [ "steam.desktop" ];
"x-scheme-handler/steamlink" = [ "steam.desktop" ];
};
};
programs.gamescope.enable = true; programs.gamescope.enable = true;
programs.steam.gamescopeSession = { programs.steam.gamescopeSession = {
enable = true; enable = true;
@@ -67,7 +74,7 @@
programs.steam = { programs.steam = {
enable = true; enable = true;
package = pkgs.steam.override { package = pkgs.millennium-steam.override {
extraPkgs = pkgs: with pkgs; [ extraPkgs = pkgs: with pkgs; [
gamemode gamemode
noto-fonts-color-emoji noto-fonts-color-emoji
+6 -1
View File
@@ -54,6 +54,11 @@ EOF
# Smoke-test styles. Remove later if you want. # Smoke-test styles. Remove later if you want.
cat >> /tmp/vscode-modernized-inline.css <<'EOF' cat >> /tmp/vscode-modernized-inline.css <<'EOF'
/* Modernized dims inactive icons to 20%; let the theme control contrast instead. */
.monaco-workbench .part.activitybar .monaco-action-bar .action-item.icon:not(.disabled) {
opacity: 1;
}
/* Nix smoke test: these should be very visible */ /* Nix smoke test: these should be very visible */
.monaco-workbench .part.sidebar, .monaco-workbench .part.sidebar,
.monaco-workbench .part.auxiliarybar, .monaco-workbench .part.auxiliarybar,
@@ -97,4 +102,4 @@ $css
in in
{ {
vscode-modernized = injectModernized prev.vscode; vscode-modernized = injectModernized prev.vscode;
} }
@@ -14,6 +14,7 @@
./hardware/hardware-configuration.nix ./hardware/hardware-configuration.nix
]; ];
# Bootloader. # Bootloader.
# boot.loader.systemd-boot.enable = true; # managed by lanzaboote # boot.loader.systemd-boot.enable = true; # managed by lanzaboote
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
@@ -45,7 +46,28 @@
LC_TELEPHONE = "nl_NL.UTF-8"; LC_TELEPHONE = "nl_NL.UTF-8";
LC_TIME = "nl_NL.UTF-8"; LC_TIME = "nl_NL.UTF-8";
}; };
system.activationScripts."stremio-mpv-flatpak-patch" = {
text = ''
# 1. Provide the symlink where Stremio's player engine queries
mkdir -p /usr/bin
ln -sf /run/current-system/sw/bin/mpv /usr/bin/mpv
# 2. Locate and patch the runtime server.js file inside the active Flatpak installation
TARGET_FILE="/var/lib/flatpak/app/com.stremio.Stremio/current/active/files/opt/stremio/server.js"
if [ -f "$TARGET_FILE" ]; then
# Make sure the file is writable momentarily for the patch
chmod +w "$TARGET_FILE"
# Inject the flatpak-spawn sequence into the linux player profile
sed -i 's|linux:{path:\["\/usr\/bin\/mpv"\]|linux:{path:["/usr/bin/flatpak-spawn"],args:["--host","/usr/bin/mpv"]|g' "$TARGET_FILE"
sed -i 's|linux:{path:\["mpv"\]|linux:{path:["/usr/bin/flatpak-spawn"],args:["--host","/usr/bin/mpv"]|g' "$TARGET_FILE"
# Restore permissions
chmod -w "$TARGET_FILE"
fi
'';
};
services = { services = {
# Enable Gnome Session # Enable Gnome Session
displayManager.gdm.enable = true; displayManager.gdm.enable = true;
@@ -58,6 +80,7 @@
displayManager.cosmic-greeter.enable = false; displayManager.cosmic-greeter.enable = false;
displayManager.defaultSession = "gnome"; displayManager.defaultSession = "gnome";
# Clear the sandbox restriction dynamically
xserver = { xserver = {
enable = true; # Enable the deprecated X11 teletype terminal connection system. enable = true; # Enable the deprecated X11 teletype terminal connection system.
@@ -288,6 +311,6 @@
# this value at the release version of the first install of this system. # this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment? system.stateVersion = "26.05"; # Did you read the comment?
} }
@@ -36,12 +36,15 @@ in
./configuration.nix ./configuration.nix
./mutter-tearing.nix ./mutter-tearing.nix
./video.nix ./video.nix
inputs.wallpaperengine.nixosModules.default
inputs.aagl.nixosModules.default inputs.aagl.nixosModules.default
]; ];
config = { config = {
system.stateVersion = "24.05"; programs.linux-wallpaperengine.enable = true;
system.stateVersion = "26.05";
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Define a user account. Don't forget to set a password with ‘passwd’. # Distrobox
my-namespace.distrobox.enable = true;
# Desktops # Desktops
my-namespace.desktop-environment.cinnamon.enable = true; my-namespace.desktop-environment.cinnamon.enable = true;
my-namespace.desktop-environment.xfce.enable = false; my-namespace.desktop-environment.xfce.enable = false;
@@ -50,12 +53,14 @@ in
my-namespace.desktop-environment.hyprland.enable = false; my-namespace.desktop-environment.hyprland.enable = false;
my-namespace.desktop-environment.cosmic.enable = false; my-namespace.desktop-environment.cosmic.enable = false;
my-namespace.performance-tuning.enable = true; my-namespace.performance-tuning.enable = true;
my-namespace.rtl8125-recovery.enable = true;
my-namespace.file-organization.enable = true; my-namespace.file-organization.enable = true;
# GNOME-keyring # GNOME-keyring
my-namespace.gnome-keyring.enable = true; my-namespace.gnome-keyring.enable = true;
# CS Tools # CS Tools
my-namespace.cs-tools.enable = true; my-namespace.cs-tools.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.andreas = { users.users.andreas = {
isNormalUser = true; isNormalUser = true;
description = "Andreas Schaafsma"; description = "Andreas Schaafsma";
@@ -87,11 +92,18 @@ in
virt-manager virt-manager
nil nil
codex codex
inputs.codex-desktop.packages.${pkgs.stdenv.hostPlatform.system}.codex-desktop
# thunderbird # thunderbird
]; ];
}; };
programs.appimage = {
enable = true;
binfmt = true;
};
programs.anime-game-launcher.enable = true; # Adds launcher and /etc/hosts rules programs.anime-game-launcher.enable = true; # Adds launcher and /etc/hosts rules
programs.anime-games-launcher.enable = true; programs.anime-games-launcher.enable = true;
@@ -157,6 +169,8 @@ in
my-namespace.rounded-windows-bms my-namespace.rounded-windows-bms
my-namespace.cs-demo-manager my-namespace.cs-demo-manager
vscode-modernized vscode-modernized
zed-editor
jetbrains-toolbox
(pkgs.writeShellScriptBin "switch-to-desktop" '' (pkgs.writeShellScriptBin "switch-to-desktop" ''
#!/bin/sh #!/bin/sh
@@ -218,9 +232,9 @@ in
# Disable the GNOME3/GDM auto-suspend feature that cannot be disabled in GUI! # Disable the GNOME3/GDM auto-suspend feature that cannot be disabled in GUI!
# If no user is logged in, the machine will power down after 20 minutes. # If no user is logged in, the machine will power down after 20 minutes.
systemd.targets.sleep.enable = false; # systemd.targets.sleep.enable = false;
systemd.targets.suspend.enable = false; # systemd.targets.suspend.enable = false;
systemd.targets.hibernate.enable = false; # systemd.targets.hibernate.enable = false;
systemd.targets.hybrid-sleep.enable = false; # systemd.targets.hybrid-sleep.enable = false;
}; };
} }
@@ -39,17 +39,21 @@
}; };
fileSystems."/" = { fileSystems."/" =
device = "/dev/disk/by-uuid/563805a1-5277-4488-bbdd-c1a7ed37be76"; { device = "/dev/disk/by-uuid/31fe479a-f4ef-4ee5-9cd9-d43ed1a3c88b";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = { fileSystems."/boot" =
#device = "/dev/disk/by-uuid/E846-D998"; { device = "/dev/disk/by-uuid/646A-D107";
device = "/dev/disk/by-uuid/19BE-8BAA"; fsType = "vfat";
fsType = "vfat"; options = [ "fmask=0077" "dmask=0077" ];
options = [ "fmask=0077" "dmask=0077" ]; };
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/6ac4f42b-09e3-43b3-8215-8ff9a3c0695e";
fsType = "ext4";
};
# Mount ntfs partition # Mount ntfs partition
# fileSystems."/run/media/627C3BDF7C3BAD23" = { # fileSystems."/run/media/627C3BDF7C3BAD23" = {
@@ -80,10 +84,10 @@
swapDevices = [ { swapDevices = [ {
device = "/var/lib/swapfile"; device = "/var/lib/swapfile";
size = 32*1024; size = 32*1024;
} ]; #resume-offset = 78399488 } ]; #resume-offset = 195323904
boot.resumeDevice = "/dev/disk/by-uuid/563805a1-5277-4488-bbdd-c1a7ed37be76"; # the unlocked drive mapping boot.resumeDevice = "/dev/disk/by-uuid/31fe479a-f4ef-4ee5-9cd9-d43ed1a3c88b"; # the unlocked drive mapping
boot.kernelParams = [ boot.kernelParams = [
"resume_offset=78399488" #sudo filefrag -v /var/lib/swapfile|awk 'NR==4{gsub(/\./,"");print $4;}' "resume_offset=195323904" #sudo filefrag -v /var/lib/swapfile|awk 'NR==4{gsub(/\./,"");print $4;}'
"r8125.aspm=0" # realtek network adapter fix "r8125.aspm=0" # realtek network adapter fix
]; ];
security.protectKernelImage = false; security.protectKernelImage = false;
@@ -54,6 +54,6 @@ in
# Temporarily expose whether async atomic commits reach KMS or fall back # Temporarily expose whether async atomic commits reach KMS or fall back
# to synchronized presentation. Remove this after collecting the log. # to synchronized presentation. Remove this after collecting the log.
MUTTER_DEBUG = lib.mkDefault "kms"; # MUTTER_DEBUG = lib.mkDefault "kms";
}; };
} }