From 87929055aff6f92237765bf8b605851e7eb98c99 Mon Sep 17 00:00:00 2001 From: Timo Bingmann Date: Wed, 25 Jun 2025 23:35:24 -0700 Subject: [PATCH] Extract settings for Darwin --- flake.nix | 7 ++++++- system/default/nix.nix | 11 ++++------- system/default/packages.nix | 8 ++++---- system/{default => linux}/system.nix | 0 4 files changed, 14 insertions(+), 12 deletions(-) rename system/{default => linux}/system.nix (100%) diff --git a/flake.nix b/flake.nix index 8c80bb1..e1abb47 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,12 @@ ./system/default/editor.nix ./system/default/nix.nix ./system/default/packages.nix - ./system/default/system.nix + ]; + }; + + nixosModules.linux = { ... }: { + imports = [ + ./system/linux/system.nix ]; }; diff --git a/system/default/nix.nix b/system/default/nix.nix index 3c26eb4..469de3a 100644 --- a/system/default/nix.nix +++ b/system/default/nix.nix @@ -1,4 +1,4 @@ -{ ... }: +{ lib, ... }: { # Nix package manager configuration nix = { @@ -6,14 +6,14 @@ # Enable experimental features for modern Nix functionality # - "nix-command": Enables the new unified 'nix' command interface # - "flakes": Enables Nix flakes for reproducible and composable configurations - experimental-features = "nix-command flakes"; + experimental-features = [ "nix-command" "flakes" ]; # Specify which users are allowed to run nix commands - allowed-users = [ "tb" ]; + allowed-users = lib.mkDefault [ "tb" ]; # Users who can act as trusted users (can override settings) # Trusted users can use --option flags and import from derivations - trusted-users = [ "root" "tb" ]; + trusted-users = lib.mkDefault [ "root" "tb" ]; # Show more lines of build output on failure log-lines = 50; @@ -35,9 +35,6 @@ # Enable automatic store optimization # This deduplicates files to save disk space automatic = true; - - # Run optimization weekly - dates = [ "weekly" ]; }; }; diff --git a/system/default/packages.nix b/system/default/packages.nix index 19d96d4..8233e97 100644 --- a/system/default/packages.nix +++ b/system/default/packages.nix @@ -46,7 +46,6 @@ # === SYNC AND BACKUP === # File synchronization and backup tools - rclone # Cloud storage sync tool rsync # Fast, versatile file copying tool # === FILE UTILITIES === @@ -88,7 +87,6 @@ # === HARDWARE UTILITIES === # Hardware information and diagnostics - lshw # Hardware information tool pciutils # PCI bus utilities (lspci) smartmontools # Hard drive health monitoring @@ -112,9 +110,10 @@ # --- HARDWARE MANAGEMENT --- - hdparm # Hard disk parameter tuning - usbutils # USB device utilities (lsusb) dmidecode # DMI/SMBIOS information + hdparm # Hard disk parameter tuning + lshw # Hardware information tool + usbutils # USB device utilities (lsusb) # --- PROCESS AND SYSTEM MONITORING --- @@ -128,6 +127,7 @@ # --- FILE SYSTEM UTILITIES --- inotify-tools # File system event monitoring + rclone # Cloud storage sync tool sshfs # Mount remote filesystems over SSH ] else [ diff --git a/system/default/system.nix b/system/linux/system.nix similarity index 100% rename from system/default/system.nix rename to system/linux/system.nix