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