This commit is contained in:
2026-06-16 21:49:01 +02:00
parent 65a547ad1a
commit 956889173a
15 changed files with 326 additions and 154 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
xdg.portal.enable = true;
environment.systemPackages = with pkgs; [
# Schlanke COSMIC-Basis fuer den Alltag
# Schlanke COSMIC-Basis für den Alltag
gnome-keyring
networkmanagerapplet
seahorse
+1 -1
View File
@@ -8,7 +8,7 @@
# für extrem aggressive Gaming-Performance
boot.kernelParams = [
# ⚠️ WARNUNG: Deaktiviert Spectre/Meltdown-Mitigations!
# WARNUNG: Deaktiviert Spectre/Meltdown-Mitigations!
# Sicherheitsrisiko, aber +20-30% Performance
# Nur für Offline-Gaming PCs empfohlen!
# "mitigations=off"
+1 -3
View File
@@ -18,7 +18,7 @@
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "$HOME/.steam/root/compatibilitytools.d";
};
# PROTON-GE & PROTON-CACHYOS sind NICHT in nixpkgs!
# PROTON-GE & PROTON-CACHYOS sind NICHT in nixpkgs!
#
# Warum nicht?
# - Community-Builds mit häufigen Updates (täglich/wöchentlich)
@@ -39,5 +39,3 @@
# LÖSUNG 3: Chaotic-Nyx (bereits im Repo!)
# Chaotic-Nyx hat viele Gaming-Tools, aber nicht Proton-GE/CachyOS
}
+4
View File
@@ -1,6 +1,9 @@
{ pkgs, ... }:
{
# Aktiviert die erweiterten AMDGPU-Features, damit LACT auch OC/UV setzen kann.
boot.kernelParams = [ "amdgpu.ppfeaturemask=0xffffffff" ];
hardware.graphics = {
enable = true;
enable32Bit = true;
@@ -15,6 +18,7 @@
};
services.xserver.videoDrivers = [ "amdgpu" ];
services.lact.enable = true;
hardware.amdgpu = {
initrd.enable = true;
+4 -1
View File
@@ -1,6 +1,9 @@
{ pkgs, ... }:
{
# Aktiviert die erweiterten AMDGPU-Features, damit LACT auch OC/UV setzen kann.
boot.kernelParams = [ "amdgpu.ppfeaturemask=0xffffffff" ];
hardware.graphics = {
enable = true;
enable32Bit = true;
@@ -17,4 +20,4 @@
mesa-demos
vulkan-tools
];
}
}
+159
View File
@@ -0,0 +1,159 @@
{ pkgs, ... }:
let
script = ''
set -euo pipefail
# Wenn dein NixOS-Repo nicht in /etc/nixos liegt, diesen Pfad hier anpassen.
repo_root="/etc/nixos"
# Das muss zum Namen in flake.nix unter nixosConfigurations.<name> passen.
flake_target="template"
rebuild_mode="switch"
update_inputs=false
dry_run=false
needs_sudo=false
usage() {
cat <<'EOF'
Usage: nixos-update [switch|boot] [update-inputs] [dry-run]
Syncs this repo and rebuilds NixOS from the local flake config.
Arguments:
switch Build and activate the new system immediately
boot Build and activate for next boot instead of switching now
update-inputs Run `nix flake update` before rebuilding
dry-run Show commands without executing them
help Show this help
EOF
}
while [[ $# -gt 0 ]]; do
case "$1" in
update-inputs)
update_inputs=true
;;
switch)
rebuild_mode="switch"
;;
boot)
rebuild_mode="boot"
;;
dry-run)
dry_run=true
;;
help|-h|--help)
usage
exit 0
;;
*)
echo "Unknown option: $1" >&2
usage >&2
exit 1
;;
esac
shift
done
step() {
printf '\n==> %s\n' "$1"
}
print_command() {
printf ' $'
printf ' %q' "$@"
printf '\n'
}
run() {
print_command "$@"
if [[ "$dry_run" == true ]]; then
return 0
fi
"$@"
}
run_repo() {
if [[ "$needs_sudo" == true ]]; then
run sudo "$@"
else
run "$@"
fi
}
echo "Repo: $repo_root"
echo "Flake target: $flake_target"
echo "Rebuild mode: $rebuild_mode"
if [[ ! -d "$repo_root" ]]; then
echo "Repo path does not exist: $repo_root" >&2
echo "Adjust repo_root in modules/updater.nix or move the repo to that path." >&2
exit 1
fi
if [[ ! -w "$repo_root" ]]; then
needs_sudo=true
fi
if [[ "$needs_sudo" == true ]]; then
echo "Repo ist nicht als normaler Benutzer beschreibbar. Git- und Flake-Befehle laufen mit sudo."
step "Prüfe sudo"
run sudo -v
fi
step "Wechsle ins Repo"
print_command cd "$repo_root"
cd "$repo_root"
if [[ "$needs_sudo" == true ]]; then
git_check=(sudo git rev-parse --is-inside-work-tree)
else
git_check=(git rev-parse --is-inside-work-tree)
fi
if ! "''${git_check[@]}" >/dev/null 2>&1; then
echo "Repo path is not a Git repository: $repo_root" >&2
echo "Clone your config repo there or adjust repo_root in modules/updater.nix." >&2
exit 1
fi
if ! run_repo git diff --quiet || ! run_repo git diff --cached --quiet; then
echo "Working tree has local changes. git pull may fail if upstream changed the same files."
fi
step "Aktualisiere Git-Repo"
run_repo git pull --ff-only
if [[ "$update_inputs" == true ]]; then
step "Aktualisiere Flake-Inputs"
run_repo nix flake update
fi
step "Prüfe sudo für den NixOS-Rebuild"
run sudo -v
step "Starte nixos-rebuild"
run sudo nixos-rebuild "$rebuild_mode" --flake "$repo_root#$flake_target"
'';
nixosUpdate = pkgs.writeShellScriptBin "nixos-update" script;
updateNixosCompat = pkgs.writeShellScriptBin "update-nixos" ''
exec ${nixosUpdate}/bin/nixos-update "$@"
'';
nixosSyncCompat = pkgs.writeShellScriptBin "nixos-sync" ''
exec ${nixosUpdate}/bin/nixos-update "$@"
'';
in
{
environment.systemPackages = [
nixosUpdate
nixosSyncCompat
updateNixosCompat
];
}