Update configuration.nix

This commit is contained in:
ska
2025-12-23 12:17:06 +00:00
parent 7bff1a4cc7
commit f1f452aea4

View File

@@ -2,7 +2,7 @@
{
############################################################
# BOOTLOADER GRUB
# BOOTLOADER GRUB
############################################################
boot.loader.grub = {
@@ -19,11 +19,9 @@
};
############################################################
# INITRD HARD FAIL, NO RESCUE
# INITRD HARDWAREAGNOSTIC + LUKS
############################################################
boot.initrd.systemd.enable = true;
boot.initrd.availableKernelModules = [
"usb_storage"
"xhci_hcd"
@@ -42,16 +40,6 @@
allowDiscards = true;
};
############################################################
# KERNEL FAIL DEAD ON I/O LOSS
############################################################
boot.kernelParams = [
"panic=1"
"oops=panic"
"panic_on_warn=1"
];
############################################################
# FIRMWARE WIDE HARDWARE SUPPORT
############################################################
@@ -63,7 +51,7 @@
hardware.cpu.amd.updateMicrocode = true;
############################################################
# FILESYSTEMS USB ONLY
# FILESYSTEMS BASED ON LABELS
############################################################
fileSystems."/" = {
@@ -76,29 +64,6 @@
fsType = "vfat";
};
fileSystems."/tmp" = {
fsType = "tmpfs";
options = [ "mode=1777" "nosuid" "nodev" ];
};
############################################################
# MEMORY SAFETY NO SWAP ANYWHERE
############################################################
swapDevices = [ ];
zramSwap.enable = false;
############################################################
# POWER MANAGEMENT DISABLED (CRITICAL)
############################################################
services.logind.lidSwitch = "ignore";
systemd.targets.sleep.enable = false;
systemd.targets.suspend.enable = false;
systemd.targets.hibernate.enable = false;
systemd.targets.hybrid-sleep.enable = false;
############################################################
# NETWORKING
############################################################
@@ -173,7 +138,7 @@
gnomeExtensions.window-list
gnomeExtensions.dock-from-dash
gnomeExtensions.places-status-indicator
obsidian
libreoffice
keepassxc
@@ -194,6 +159,7 @@
#!/run/current-system/sw/bin/bash
set -e
# Ensure all system tools are available
export PATH="/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin"
export NIX_PATH="nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos"
@@ -203,31 +169,50 @@
if [ ! -d "$LOCAL_PATH/.git" ]; then
mkdir -p "$LOCAL_PATH"
chmod 700 "$LOCAL_PATH"
echo "Cloning config from $REPO_URL..."
git clone "$REPO_URL" "$LOCAL_PATH"
else
cd "$LOCAL_PATH"
echo "Fetching updates..."
git fetch origin
LOCAL_HEAD=$(git rev-parse HEAD)
REMOTE_HEAD=$(git rev-parse origin/main)
if [ "$LOCAL_HEAD" != "$REMOTE_HEAD" ]; then
echo "New config available. Updating..."
git reset --hard origin/main
nixos-rebuild switch -I nixos-config="$LOCAL_PATH/configuration.nix"
echo "System updated successfully."
else
echo "Config is already up to date."
fi
fi
'';
environment.etc."update-nixos-config.sh".mode = "0700";
systemd.services.nixos-git-update = {
description = "Update NixOS from Git config";
description = "Update NixOS from public Git config";
script = "/etc/update-nixos-config.sh";
serviceConfig.Type = "oneshot";
serviceConfig = {
Type = "oneshot";
User = "root";
Group = "root";
};
};
systemd.timers.nixos-git-update = {
description = "Check for config updates at startup";
wantedBy = [ "timers.target" ];
timerConfig.OnBootSec = "60s";
timerConfig = {
OnBootSec = "60s";
};
};
############################################################
# USB OPTIMIZATIONS
############################################################
zramSwap.enable = true;
############################################################
# NIXOS VERSION
############################################################