Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3062ef1608 | ||
|
|
ac7a47c26a | ||
|
|
74d3d6870d | ||
|
|
ac9eeb1f1c | ||
|
|
666b7ab737 | ||
|
|
bcfada020b | ||
|
|
d79713972e | ||
|
|
441d029eb6 | ||
|
|
17933af881 | ||
|
|
c4693f0ee6 | ||
|
|
813e474bc1 |
Generated
+174
-6
@@ -90,6 +90,27 @@
|
|||||||
"type": "github"
|
"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,
|
||||||
@@ -192,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": {
|
||||||
@@ -207,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,
|
||||||
@@ -224,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": [
|
||||||
@@ -362,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",
|
||||||
@@ -399,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,
|
||||||
@@ -489,10 +585,13 @@
|
|||||||
"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",
|
"wallpaperengine": "wallpaperengine",
|
||||||
@@ -541,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",
|
||||||
@@ -615,6 +735,54 @@
|
|||||||
"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": {
|
"wallpaperengine": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"Catch2": "Catch2",
|
"Catch2": "Catch2",
|
||||||
@@ -629,8 +797,8 @@
|
|||||||
"stb": "stb"
|
"stb": "stb"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1789783126,
|
"lastModified": 1790172262,
|
||||||
"narHash": "sha256-z6rSxx9Hz68EEJ1suug52MO/PQhMGPamSwX0FmMDgx4=",
|
"narHash": "sha256-gTnF4besYxSEFx0GTA35+/k81nE7WwvTIyJbIs1p20k=",
|
||||||
"path": "/home/andreas/Projects/linwallpaap/linux-wallpaperengine",
|
"path": "/home/andreas/Projects/linwallpaap/linux-wallpaperengine",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -48,6 +48,18 @@
|
|||||||
};
|
};
|
||||||
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";
|
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:
|
||||||
@@ -91,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,13 +38,19 @@ 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]
|
||||||
|
|||||||
@@ -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 = {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -46,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;
|
||||||
@@ -59,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.
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ in
|
|||||||
programs.linux-wallpaperengine.enable = true;
|
programs.linux-wallpaperengine.enable = true;
|
||||||
system.stateVersion = "26.05";
|
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;
|
||||||
@@ -52,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";
|
||||||
@@ -89,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;
|
||||||
|
|
||||||
@@ -159,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
|
||||||
@@ -220,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;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user