From 6b33a182d818ff064055e99b4e736efba8937620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20Schwarz=C3=A4ugl?= Date: Wed, 11 Jun 2025 02:30:20 +0200 Subject: [PATCH] feat: update nix config module --- SwarselSystems.org | 75 ++----- hosts/nixos/nbl-imba-2/default.nix | 2 +- index.html | 275 +++++++++++------------- modules/nixos/common/gc.nix | 12 -- modules/nixos/common/settings.nix | 22 +- modules/nixos/common/store.nix | 10 - modules/nixos/server/default.nix | 2 - profiles/nixos/chaostheatre/default.nix | 2 - profiles/nixos/localserver/default.nix | 2 - profiles/nixos/personal/default.nix | 2 - profiles/nixos/syncserver/default.nix | 2 - 11 files changed, 167 insertions(+), 239 deletions(-) delete mode 100644 modules/nixos/common/gc.nix delete mode 100644 modules/nixos/common/store.nix diff --git a/SwarselSystems.org b/SwarselSystems.org index 6ab6a75..e48c727 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -3983,8 +3983,6 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a users = lib.mkDefault true; env = lib.mkDefault true; security = lib.mkDefault true; - gc = lib.mkDefault true; - storeOptimize = lib.mkDefault true; systemdTimeout = lib.mkDefault true; hardware = lib.mkDefault true; pulseaudio = lib.mkDefault true; @@ -4052,8 +4050,6 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a users = lib.mkDefault true; env = lib.mkDefault true; security = lib.mkDefault true; - gc = lib.mkDefault true; - storeOptimize = lib.mkDefault true; systemdTimeout = lib.mkDefault true; hardware = lib.mkDefault true; pulseaudio = lib.mkDefault true; @@ -4256,8 +4252,6 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a home-manager = lib.mkDefault true; home-managerExtra = lib.mkDefault true; xserver = lib.mkDefault true; - gc = lib.mkDefault true; - storeOptimize = lib.mkDefault true; time = lib.mkDefault true; users = lib.mkDefault true; server = { @@ -4306,8 +4300,6 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a home-manager = lib.mkDefault true; home-managerExtra = lib.mkDefault true; xserver = lib.mkDefault true; - gc = lib.mkDefault true; - storeOptimize = lib.mkDefault true; time = lib.mkDefault true; users = lib.mkDefault true; server = { @@ -4919,7 +4911,7 @@ A breakdown of the flags being set: - nix.nixPath: Basically the same as =nix.registry=, but for the legacy nix commands #+begin_src nix :tangle modules/nixos/common/settings.nix - { lib, config, outputs, inputs, ... }: + { lib, pkgs, config, outputs, inputs, ... }: { options.swarselsystems.modules.general = lib.mkEnableOption "general nix settings"; config = lib.mkIf config.swarselsystems.modules.general { @@ -4930,6 +4922,11 @@ A breakdown of the flags being set: }; }; + environment.etc."nixos/configuration.nix".source = pkgs.writeText "configuration.nix" '' + assert builtins.trace "This location is not used. The config is found in ${config.swarselsystems.flakePath}!" false; + { } + ''; + nix = let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; @@ -4956,11 +4953,24 @@ A breakdown of the flags being set: max-jobs = 1; use-cgroups = lib.mkIf config.swarselsystems.isLinux true; }; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 10d"; + }; + optimise = { + automatic = true; + dates = "weekly"; + }; channel.enable = false; - registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; + registry = rec { + nixpkgs.flake = inputs.nixpkgs; + p = nixpkgs; + }; nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; }; + services.dbus.implementation = "broker"; system.stateVersion = lib.mkDefault "23.05"; }; } @@ -5222,49 +5232,6 @@ Needed for control over system-wide privileges etc. Also I make sure that the ro } #+end_src -**** Enable automatic garbage collection -:PROPERTIES: -:CUSTOM_ID: h:9a3b7f1f-d0c3-417e-a262-c920fb25f3ee -:END: - -The nix store fills up over time, until =/boot/efi= is filled. This snippet cleans it automatically on a weekly basis. - -#+begin_src nix :tangle modules/nixos/common/gc.nix - { lib, config, ... }: - { - options.swarselsystems.modules.gc = lib.mkEnableOption "garbage collection config"; - config = lib.mkIf config.swarselsystems.modules.gc { - nix.gc = { - automatic = true; - randomizedDelaySec = "14m"; - dates = "weekly"; - options = "--delete-older-than 10d"; - }; - }; - } -#+end_src - -**** Enable automatic store optimisation -:PROPERTIES: -:CUSTOM_ID: h:97a2b9f7-c835-4db8-a0e9-e923bab69ee8 -:END: - -This enables hardlinking identical files in the nix store, to save on disk space. I have read this incurs a significant I/O overhead, I need to keep an eye on this. - -#+begin_src nix :tangle modules/nixos/common/store.nix - { lib, config, ... }: - { - options.swarselsystems.modules.storeOptimize = lib.mkEnableOption "store optimization config"; - config = lib.mkIf config.swarselsystems.modules.storeOptimize { - nix.optimise = { - automatic = true; - dates = [ "weekly" ]; - }; - }; - } - -#+end_src - **** Reduce systemd timeouts :PROPERTIES: :CUSTOM_ID: h:12858442-c129-4aa1-9c9c-a0916e36b302 @@ -6709,8 +6676,6 @@ Also, the system state version is set here. No need to touch it. "${modulesPath}/nixos/common/home-manager.nix" "${modulesPath}/nixos/common/home-manager-extra.nix" "${modulesPath}/nixos/common/xserver.nix" - "${modulesPath}/nixos/common/gc.nix" - "${modulesPath}/nixos/common/store.nix" "${modulesPath}/nixos/common/time.nix" "${modulesPath}/nixos/common/users.nix" "${modulesPath}/nixos/common/nix-ld.nix" diff --git a/hosts/nixos/nbl-imba-2/default.nix b/hosts/nixos/nbl-imba-2/default.nix index 060f47c..b15a730 100644 --- a/hosts/nixos/nbl-imba-2/default.nix +++ b/hosts/nixos/nbl-imba-2/default.nix @@ -46,7 +46,7 @@ in sharedOptions; home-manager.users."${primaryUser}" = { - home.stateVersion = lib.mkForce "23.05"; + # home.stateVersion = lib.mkForce "23.05"; swarselsystems = lib.recursiveUpdate { isLaptop = true; diff --git a/index.html b/index.html index 6132682..07d4104 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + SwarselSystems: NixOS + Emacs Configuration @@ -263,9 +263,9 @@
  • 3.1.4.3. Home-manager only (default non-NixOS)
  • 3.1.4.4. ChaosTheatre (Demo Physical/VM)
  • @@ -305,8 +305,8 @@
  • 3.2.1.27. fhs
  • 3.2.1.28. swarsel-displaypower
  • 3.2.1.29. swarsel-mgba
  • -
  • 3.2.1.30. swarsel-deploy
  • -
  • 3.2.1.31. sshrm
  • +
  • 3.2.1.30. swarsel-deploy
  • +
  • 3.2.1.31. sshrm
  • 3.2.2. Overlays (additions, overrides, nixpkgs-stable)
  • @@ -314,37 +314,37 @@
  • 3.2.4. Library functions
  • -
  • 3.2.5. Auxiliary files +
  • 3.2.5. Auxiliary files
  • @@ -384,7 +384,7 @@
  • 3.3.1.20.3. enable GVfs
  • 3.3.1.20.4. interception-tools: Make CAPS work as ESC/CTRL
  • 3.3.1.20.5. power-profiles-daemon
  • -
  • 3.3.1.20.6. SwayOSD
  • +
  • 3.3.1.20.6. SwayOSD
  • 3.3.1.21. Hardware compatibility settings (Yubikey, Ledger, Keyboards) - udev rules @@ -436,7 +436,7 @@
  • 3.3.2.24. FreshRSS
  • 3.3.2.25. forgejo (git server)
  • 3.3.2.26. Anki Sync Server
  • -
  • 3.3.2.27. IDM (kanidm + oauth2-proxy)
  • +
  • 3.3.2.27. IDM (kanidm + oauth2-proxy)
  • 3.3.3. Darwin @@ -451,11 +451,11 @@
  • 3.3.4.3. VmWare
  • 3.3.4.4. Auto-login
  • 3.3.4.5. nswitch-rcm
  • -
  • 3.3.4.6. Framework
  • -
  • 3.3.4.7. AMD CPU
  • -
  • 3.3.4.8. AMD GPU
  • -
  • 3.3.4.9. Hibernation
  • -
  • 3.3.4.10. BTRFS
  • +
  • 3.3.4.6. Framework
  • +
  • 3.3.4.7. AMD CPU
  • +
  • 3.3.4.8. AMD GPU
  • +
  • 3.3.4.9. Hibernation
  • +
  • 3.3.4.10. BTRFS
  • 3.3.4.11. work
  • 3.3.4.12. Minimal Install
  • @@ -504,7 +504,7 @@
  • 3.4.1.29.1. gnome-keyring
  • 3.4.1.29.2. KDE Connect
  • 3.4.1.29.3. Mako
  • -
  • 3.4.1.29.4. SwayOSD
  • +
  • 3.4.1.29.4. SwayOSD
  • 3.4.1.29.5. yubikey-touch-detector
  • @@ -529,7 +529,7 @@ @@ -707,7 +707,7 @@ @@ -716,7 +716,7 @@

    -This file has 66261 words spanning 17435 lines and was last revised on 2025-06-11 02:13:52 +0200. +This file has 66145 words spanning 17412 lines and was last revised on 2025-06-11 02:27:48 +0200.

    @@ -769,7 +769,7 @@ This section defines my Emacs configuration. For a while, I considered to use ry

    -My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2025-06-11 02:13:52 +0200) +My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2025-06-11 02:27:48 +0200)

    @@ -2906,8 +2906,8 @@ This is just a demo host. It applies all the configuration found in the common p I also set the WLR_RENDERER_ALLOW_SOFTWARE=1 to allow this configuration to run in a virtualized environment. I also enable qemuGuest for a smoother experience when testing on QEMU.

    -
    -
    3.1.4.4.1. Main configuration
    +
    +
    3.1.4.4.1. Main configuration
    { self, inputs, config, pkgs, lib, primaryUser, ... }:
    @@ -2986,8 +2986,8 @@ in
     
    -
    -
    3.1.4.4.2. NixOS dummy options configuration
    +
    +
    3.1.4.4.2. NixOS dummy options configuration
    _:
    @@ -2997,8 +2997,8 @@ in
     
    -
    -
    3.1.4.4.3. home-manager dummy options configuration
    +
    +
    3.1.4.4.3. home-manager dummy options configuration
    _:
    @@ -4779,8 +4779,8 @@ appimageTools.wrapType2 {
     
    -
    -
    3.2.1.30. swarsel-deploy
    +
    +
    3.2.1.30. swarsel-deploy
    # heavily inspired from https://github.com/oddlama/nix-config/blob/d42cbde676001a7ad8a3cace156e050933a4dcc3/pkgs/deploy.nix
    @@ -4912,8 +4912,8 @@ writeShellApplication {
     
    -
    -
    3.2.1.31. sshrm
    +
    +
    3.2.1.31. sshrm

    This programs simply runs ssh-keygen on the last host that I tried to ssh into. I need this frequently when working with cloud-init usually. @@ -5070,8 +5070,8 @@ in

    -
    -
    3.2.3.1.1. Personal
    +
    +
    3.2.3.1.1. Personal
    { lib, config, ... }:
    @@ -5140,8 +5140,8 @@ in
     
    -
    -
    3.2.3.1.2. Chaostheatre
    +
    +
    3.2.3.1.2. Chaostheatre
    { lib, config, ... }:
    @@ -5203,8 +5203,8 @@ in
     
    -
    -
    3.2.3.1.3. toto
    +
    +
    3.2.3.1.3. toto
    { lib, config, ... }:
    @@ -5236,8 +5236,8 @@ in
     
    -
    -
    3.2.3.1.4. Work
    +
    +
    3.2.3.1.4. Work
    { lib, config, ... }:
    @@ -5258,8 +5258,8 @@ in
     
    -
    -
    3.2.3.1.5. Framework
    +
    +
    3.2.3.1.5. Framework
    { lib, config, ... }:
    @@ -5280,8 +5280,8 @@ in
     
    -
    -
    3.2.3.1.6. AMD CPU
    +
    +
    3.2.3.1.6. AMD CPU
    { lib, config, ... }:
    @@ -5302,8 +5302,8 @@ in
     
    -
    -
    3.2.3.1.7. AMD GPU
    +
    +
    3.2.3.1.7. AMD GPU
    { lib, config, ... }:
    @@ -5324,8 +5324,8 @@ in
     
    -
    -
    3.2.3.1.8. Hibernation
    +
    +
    3.2.3.1.8. Hibernation
    { lib, config, ... }:
    @@ -5346,8 +5346,8 @@ in
     
    -
    -
    3.2.3.1.9. BTRFS
    +
    +
    3.2.3.1.9. BTRFS
    { lib, config, ... }:
    @@ -5368,8 +5368,8 @@ in
     
    -
    -
    3.2.3.1.10. Local Server
    +
    +
    3.2.3.1.10. Local Server
    { lib, config, ... }:
    @@ -5420,8 +5420,8 @@ in
     
    -
    -
    3.2.3.1.11. OCI Sync Server
    +
    +
    3.2.3.1.11. OCI Sync Server
    { lib, config, ... }:
    @@ -5476,8 +5476,8 @@ in
     
    -
    -
    3.2.3.2.1. Personal
    +
    +
    3.2.3.2.1. Personal
    { lib, config, ... }:
    @@ -5534,8 +5534,8 @@ in
     
    -
    -
    3.2.3.2.2. Chaostheatre
    +
    +
    3.2.3.2.2. Chaostheatre
    { lib, config, ... }:
    @@ -5587,8 +5587,8 @@ in
     
    -
    -
    3.2.3.2.3. toto
    +
    +
    3.2.3.2.3. toto
    { lib, config, ... }:
    @@ -5608,8 +5608,8 @@ in
     
    -
    -
    3.2.3.2.4. Work
    +
    +
    3.2.3.2.4. Work
    { lib, config, ... }:
    @@ -5629,8 +5629,8 @@ in
     
    -
    -
    3.2.3.2.5. Framework
    +
    +
    3.2.3.2.5. Framework
    { lib, config, ... }:
    @@ -5651,8 +5651,8 @@ in
     
    -
    -
    3.2.3.2.6. Darwin
    +
    +
    3.2.3.2.6. Darwin
    { lib, config, ... }:
    @@ -5670,8 +5670,8 @@ in
     
    -
    -
    3.2.3.2.7. Local Server
    +
    +
    3.2.3.2.7. Local Server
    { lib, config, ... }:
    @@ -5902,12 +5902,12 @@ in
     
    -
    -

    3.2.5. Auxiliary files

    +
    +

    3.2.5. Auxiliary files

    -
    -
    3.2.5.1. extra-builtins
    +
    +
    3.2.5.1. extra-builtins
    @@ -5932,20 +5932,18 @@ in
           "The file to decrypt must be given as a path to prevent impurity.";
         assert assertMsg (hasSuffix ".nix.age" nixFile)
           "The content of the decrypted file must be a nix expression and should therefore end in .nix.age";
    -    exec (
    -      [
    +    exec [
             ./sops-decrypt-and-cache.sh
             nixFile
    -      ]
    -    );
    +      ];
     }
     
     
    -
    -
    3.2.5.2. sops-decrypt-and-cache
    +
    +
    3.2.5.2. sops-decrypt-and-cache
    #!/usr/bin/env bash
    @@ -5953,9 +5951,9 @@ in
     set -euo pipefail
     
     print_out_path=false
    -if [[ "$1" == "--print-out-path" ]]; then
    -  print_out_path=true
    -  shift
    +if [[ $1 == "--print-out-path" ]]; then
    +    print_out_path=true
    +    shift
     fi
     
     file="$1"
    @@ -5963,8 +5961,8 @@ shift
     
     basename="$file"
     # store path prefix or ./ if applicable
    -[[ "$file" == "/nix/store/"* ]] && basename="${basename#*"-"}"
    -[[ "$file" == "./"* ]] && basename="${basename#"./"}"
    +[[ $file == "/nix/store/"* ]] && basename="${basename#*"-"}"
    +[[ $file == "./"* ]] && basename="${basename#"./"}"
     
     # Calculate a unique content-based identifier (relocations of
     # the source file in the nix store should not affect caching)
    @@ -5977,16 +5975,16 @@ umask 077
     mkdir -p "$(dirname "$out")"
     
     # Decrypt only if necessary
    -if [[ ! -e "$out" ]]; then
    -  agekey=$(sudo ssh-to-age -private-key -i /etc/ssh/sops || sudo ssh-to-age -private-key -i /etc/ssh/ssh_host_ed25519_key)
    -  SOPS_AGE_KEY="$agekey" sops decrypt "${args[@]}" --output "$out" "$file"
    +if [[ ! -e $out ]]; then
    +    agekey=$(sudo ssh-to-age -private-key -i /etc/ssh/sops || sudo ssh-to-age -private-key -i /etc/ssh/ssh_host_ed25519_key)
    +    SOPS_AGE_KEY="$agekey" sops decrypt --output "$out" "$file"
     fi
     
     # Print out path or decrypted content
    -if [[ "$print_out_path" == true ]]; then
    -  echo "$out"
    +if [[ $print_out_path == true ]]; then
    +    echo "$out"
     else
    -  cat "$out"
    +    cat "$out"
     fi
     
    @@ -6193,19 +6191,11 @@ A breakdown of the flags being set: dates = "weekly"; }; channel.enable = false; - # registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; registry = rec { nixpkgs.flake = inputs.nixpkgs; p = nixpkgs; }; nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; - # extraOptions = '' - # plugin-files = ${pkgs.nix-plugins.overrideAttrs (o: { - # buildInputs = [pkgs.nixVersions.latest pkgs.boost]; - # patches = (o.patches or []) ++ [ "${self}/nix/nix-plugins.patch" ]; - # })}/lib/nix/plugins - # extra-builtins-file = ${self + /nix/extra-builtins.nix} - # ''; }; services.dbus.implementation = "broker"; @@ -6224,21 +6214,8 @@ Mostly used to install some compilers and lsp's that I want to have available wh

    -
    { self, lib, config, pkgs, ... }:
    -# let
    -  # Try to access the extra builtin we loaded via nix-plugins.
    -  # Throw an error if that doesn't exist.
    -  # sopsImportEncrypted =
    -  #   assert lib.assertMsg (builtins ? extraBuiltins.sopsImportEncrypted)
    -  #     "The extra builtin sopsImportEncrypted' is not available, so repo.secrets cannot be decrypted. Did you forget to add nix-plugins and point it to `./nix/extra-builtins.nix` ?";
    -  #   builtins.extraBuiltins.sopsImportEncrypted;
    -  # secretFile = ../../../secrets/repo/packages.nix.age;
    -# in
    +
    { lib, config, pkgs, ... }:
     {
    -  # imports = [
    -  #   (sopsImportEncrypted secretFile)
    -  # ];
    -
       options.swarselsystems.modules.packages = lib.mkEnableOption "install packages";
       config = lib.mkIf config.swarselsystems.modules.packages {
         environment.systemPackages = with pkgs; [
    @@ -7324,8 +7301,8 @@ Most of the time I am using power-saver, however, it is good to be
     
    -
    -
    3.3.1.20.6. SwayOSD
    +
    +
    3.3.1.20.6. SwayOSD
    { lib, pkgs, config, ... }:
    @@ -10170,8 +10147,8 @@ in
     
    -
    -
    3.3.2.27. IDM (kanidm + oauth2-proxy)
    +
    +
    3.3.2.27. IDM (kanidm + oauth2-proxy)

    The forgejo configuration is a little broken and will show a 500 error when signing in through kanidm. However, when pressing back and refreshing the page, I am logged in. Currently I cannot be bothered to fix this. @@ -10732,8 +10709,8 @@ This smashes Atmosphere 1.3.2 on the switch, which is what I am currenty using.

    -
    -
    3.3.4.6. Framework
    +
    +
    3.3.4.6. Framework

    This holds configuration that is specific to framework laptops. @@ -10771,8 +10748,8 @@ This holds configuration that is specific to framework laptops.

    -
    -
    3.3.4.7. AMD CPU
    +
    +
    3.3.4.7. AMD CPU
    { lib, config, ... }:
    @@ -10788,8 +10765,8 @@ This holds configuration that is specific to framework laptops.
     
    -
    -
    3.3.4.8. AMD GPU
    +
    +
    3.3.4.8. AMD GPU
    { lib, config, ... }:
    @@ -10811,8 +10788,8 @@ This holds configuration that is specific to framework laptops.
     
    -
    -
    3.3.4.9. Hibernation
    +
    +
    3.3.4.9. Hibernation
    { lib, config, ... }:
    @@ -10843,8 +10820,8 @@ This holds configuration that is specific to framework laptops.
     
    -
    -
    3.3.4.10. BTRFS
    +
    +
    3.3.4.10. BTRFS
    { lib, config, ... }:
    @@ -13796,8 +13773,8 @@ The `extraConfig` section here CANNOT be reindented. This has something to do wi
     
    -
    -
    3.4.1.29.4. SwayOSD
    +
    +
    3.4.1.29.4. SwayOSD
    { lib, config, ... }:
    @@ -15046,8 +15023,8 @@ in
     
    -
    -
    3.4.4.3. Framework
    +
    +
    3.4.4.3. Framework

    This holds configuration that is specific to framework laptops. @@ -18887,8 +18864,8 @@ autocmd DocStart vc-impimba-1.m.imp.ac.at/ui/webconsole mode ignore

    -
    -

    6.3. tridactyl theme

    +
    +

    6.3. tridactyl theme

    @@ -19385,7 +19362,7 @@ sync USER HOST:
     

    Author: Leon Schwarzäugl

    -

    Created: 2025-06-11 Mi 02:13

    +

    Created: 2025-06-11 Mi 02:27

    Validate

    diff --git a/modules/nixos/common/gc.nix b/modules/nixos/common/gc.nix deleted file mode 100644 index d7c7482..0000000 --- a/modules/nixos/common/gc.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ lib, config, ... }: -{ - options.swarselsystems.modules.gc = lib.mkEnableOption "garbage collection config"; - config = lib.mkIf config.swarselsystems.modules.gc { - nix.gc = { - automatic = true; - randomizedDelaySec = "14m"; - dates = "weekly"; - options = "--delete-older-than 10d"; - }; - }; -} diff --git a/modules/nixos/common/settings.nix b/modules/nixos/common/settings.nix index 7ab39f8..e613993 100644 --- a/modules/nixos/common/settings.nix +++ b/modules/nixos/common/settings.nix @@ -1,4 +1,4 @@ -{ lib, config, outputs, inputs, ... }: +{ lib, pkgs, config, outputs, inputs, ... }: { options.swarselsystems.modules.general = lib.mkEnableOption "general nix settings"; config = lib.mkIf config.swarselsystems.modules.general { @@ -9,6 +9,11 @@ }; }; + environment.etc."nixos/configuration.nix".source = pkgs.writeText "configuration.nix" '' + assert builtins.trace "This location is not used. The config is found in ${config.swarselsystems.flakePath}!" false; + { } + ''; + nix = let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; @@ -35,11 +40,24 @@ max-jobs = 1; use-cgroups = lib.mkIf config.swarselsystems.isLinux true; }; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 10d"; + }; + optimise = { + automatic = true; + dates = "weekly"; + }; channel.enable = false; - registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; + registry = rec { + nixpkgs.flake = inputs.nixpkgs; + p = nixpkgs; + }; nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; }; + services.dbus.implementation = "broker"; system.stateVersion = lib.mkDefault "23.05"; }; } diff --git a/modules/nixos/common/store.nix b/modules/nixos/common/store.nix deleted file mode 100644 index e122ac0..0000000 --- a/modules/nixos/common/store.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ lib, config, ... }: -{ - options.swarselsystems.modules.storeOptimize = lib.mkEnableOption "store optimization config"; - config = lib.mkIf config.swarselsystems.modules.storeOptimize { - nix.optimise = { - automatic = true; - dates = [ "weekly" ]; - }; - }; -} diff --git a/modules/nixos/server/default.nix b/modules/nixos/server/default.nix index 6829f0f..43ca29d 100644 --- a/modules/nixos/server/default.nix +++ b/modules/nixos/server/default.nix @@ -9,8 +9,6 @@ in "${modulesPath}/nixos/common/home-manager.nix" "${modulesPath}/nixos/common/home-manager-extra.nix" "${modulesPath}/nixos/common/xserver.nix" - "${modulesPath}/nixos/common/gc.nix" - "${modulesPath}/nixos/common/store.nix" "${modulesPath}/nixos/common/time.nix" "${modulesPath}/nixos/common/users.nix" "${modulesPath}/nixos/common/nix-ld.nix" diff --git a/profiles/nixos/chaostheatre/default.nix b/profiles/nixos/chaostheatre/default.nix index f7bdd1c..39f63f2 100644 --- a/profiles/nixos/chaostheatre/default.nix +++ b/profiles/nixos/chaostheatre/default.nix @@ -11,8 +11,6 @@ users = lib.mkDefault true; env = lib.mkDefault true; security = lib.mkDefault true; - gc = lib.mkDefault true; - storeOptimize = lib.mkDefault true; systemdTimeout = lib.mkDefault true; hardware = lib.mkDefault true; pulseaudio = lib.mkDefault true; diff --git a/profiles/nixos/localserver/default.nix b/profiles/nixos/localserver/default.nix index 544b53d..204cb59 100644 --- a/profiles/nixos/localserver/default.nix +++ b/profiles/nixos/localserver/default.nix @@ -9,8 +9,6 @@ home-manager = lib.mkDefault true; home-managerExtra = lib.mkDefault true; xserver = lib.mkDefault true; - gc = lib.mkDefault true; - storeOptimize = lib.mkDefault true; time = lib.mkDefault true; users = lib.mkDefault true; server = { diff --git a/profiles/nixos/personal/default.nix b/profiles/nixos/personal/default.nix index b8e83c7..4d327cc 100644 --- a/profiles/nixos/personal/default.nix +++ b/profiles/nixos/personal/default.nix @@ -11,8 +11,6 @@ users = lib.mkDefault true; env = lib.mkDefault true; security = lib.mkDefault true; - gc = lib.mkDefault true; - storeOptimize = lib.mkDefault true; systemdTimeout = lib.mkDefault true; hardware = lib.mkDefault true; pulseaudio = lib.mkDefault true; diff --git a/profiles/nixos/syncserver/default.nix b/profiles/nixos/syncserver/default.nix index 93ab5a7..a5ffc8d 100644 --- a/profiles/nixos/syncserver/default.nix +++ b/profiles/nixos/syncserver/default.nix @@ -9,8 +9,6 @@ home-manager = lib.mkDefault true; home-managerExtra = lib.mkDefault true; xserver = lib.mkDefault true; - gc = lib.mkDefault true; - storeOptimize = lib.mkDefault true; time = lib.mkDefault true; users = lib.mkDefault true; server = {