Update configuration.nix

This commit is contained in:
ska
2025-12-21 13:56:04 +00:00
parent 580cc55dd3
commit 0dbf70531a

View File

@@ -1,26 +1,22 @@
{ config, pkgs, ... }:
{
########################################
# Core system
########################################
############################################################
# BOOTLOADER — GRUB (ROBUST FÜR USB + ECHTE HARDWARE)
############################################################
boot.loader.grub.enable = true;
boot.loader.grub.efiSupport = true;
boot.loader.grub.device = "nodev";
boot.loader.systemd-boot.enable = true;
boot.loader.efi = {
canTouchEfiVariables = false;
efiSysMountPoint = "/boot";
};
# EFI fallback loader for removable media (CRITICAL)
boot.loader.systemd-boot.extraInstallCommands = ''
mkdir -p /boot/EFI/BOOT
cp /boot/EFI/systemd/systemd-bootx64.efi \
/boot/EFI/BOOT/BOOTX64.EFI
'';
########################################
# Hardwareagnostic initrd
########################################
############################################################
# INITRD — HARDWARE-AGNOSTISCH (USB / SATA / NVMe)
############################################################
boot.initrd.availableKernelModules = [
"usb_storage"
@@ -34,9 +30,9 @@
boot.kernelModules = [];
########################################
# Filesystems by LABEL (clonesafe)
########################################
############################################################
# DATEISYSTEME — LABEL-BASIERT (CLONE-SAFE)
############################################################
fileSystems."/" = {
device = "/dev/disk/by-label/nixos-root";
@@ -48,28 +44,30 @@
fsType = "vfat";
};
########################################
# Networking / locale
########################################
############################################################
# NETZWERK / ZEIT / LOCALE
############################################################
networking.networkmanager.enable = true;
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "de_DE.UTF-8";
########################################
# Desktop
########################################
i18n.defaultLocale = "de_DE.UTF-8";
console.keyMap = "de";
############################################################
# DESKTOP — GNOME
############################################################
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
services.xserver.xkb.layout = "de";
console.keyMap = "de";
services.xserver.libinput.enable = true;
########################################
# Audio
########################################
############################################################
# AUDIO
############################################################
services.pulseaudio.enable = false;
security.rtkit.enable = true;
@@ -81,22 +79,29 @@
pulse.enable = true;
};
########################################
# User
########################################
############################################################
# DRUCKER
############################################################
services.printing.enable = true;
############################################################
# USER
############################################################
users.users.user = {
isNormalUser = true;
description = "user";
extraGroups = [ "wheel" "networkmanager" ];
shell = pkgs.bash;
# Forced password change strategy (safe)
initialPassword = "1312";
# Passwort MUSS beim ersten Login gesetzt werden
initialHashedPassword = "!";
};
########################################
# Packages
########################################
############################################################
# SOFTWARE
############################################################
nixpkgs.config.allowUnfree = true;
@@ -118,23 +123,23 @@
programs.firefox.enable = true;
########################################
# Gitbased autoupdate (your logic, cleaned)
########################################
############################################################
# AUTO-UPDATE AUS GIT (OPTIONAL)
############################################################
environment.etc."update-nixos-config.sh".text = ''
#!/run/current-system/sw/bin/bash
set -e
PATH="/run/current-system/sw/bin"
export PATH="/run/current-system/sw/bin"
LOCAL="/var/lib/nixos-config"
DIR="/var/lib/nixos-config"
REPO="https://git.skarockoi.de/ska/nixos-production.git"
if [ ! -d "$LOCAL/.git" ]; then
mkdir -p "$LOCAL"
git clone "$REPO" "$LOCAL"
if [ ! -d "$DIR/.git" ]; then
mkdir -p "$DIR"
git clone "$REPO" "$DIR"
else
cd "$LOCAL"
cd "$DIR"
git fetch origin
if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/main)" ]; then
git reset --hard origin/main
@@ -146,6 +151,7 @@
environment.etc."update-nixos-config.sh".mode = "0700";
systemd.services.nixos-git-update = {
description = "Update NixOS config from git";
script = "/etc/update-nixos-config.sh";
serviceConfig.Type = "oneshot";
};
@@ -158,15 +164,15 @@
};
};
########################################
# Reliability on lowRAM systems
########################################
############################################################
# STABILITÄT
############################################################
zramSwap.enable = true;
########################################
# Required
########################################
############################################################
# REQUIRED
############################################################
system.stateVersion = "25.11";
}