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">
- +-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 theWLR_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.
-{ self, inputs, config, pkgs, lib, primaryUser, ... }:
@@ -2986,8 +2986,8 @@ in
_: @@ -2997,8 +2997,8 @@ in
_:
@@ -4779,8 +4779,8 @@ appimageTools.wrapType2 {
# heavily inspired from https://github.com/oddlama/nix-config/blob/d42cbde676001a7ad8a3cace156e050933a4dcc3/pkgs/deploy.nix
@@ -4912,8 +4912,8 @@ writeShellApplication {
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
{ lib, config, ... }:
@@ -5140,8 +5140,8 @@ in
{ lib, config, ... }:
@@ -5203,8 +5203,8 @@ in
{ lib, config, ... }:
@@ -5236,8 +5236,8 @@ in
{ lib, config, ... }:
@@ -5258,8 +5258,8 @@ in
{ lib, config, ... }:
@@ -5280,8 +5280,8 @@ in
{ lib, config, ... }:
@@ -5302,8 +5302,8 @@ in
{ lib, config, ... }:
@@ -5324,8 +5324,8 @@ in
{ lib, config, ... }:
@@ -5346,8 +5346,8 @@ in
{ lib, config, ... }:
@@ -5368,8 +5368,8 @@ in
{ lib, config, ... }:
@@ -5420,8 +5420,8 @@ in
{ lib, config, ... }:
@@ -5476,8 +5476,8 @@ in
{ lib, config, ... }:
@@ -5534,8 +5534,8 @@ in
{ lib, config, ... }:
@@ -5587,8 +5587,8 @@ in
{ lib, config, ... }:
@@ -5608,8 +5608,8 @@ in
{ lib, config, ... }:
@@ -5629,8 +5629,8 @@ in
{ lib, config, ... }:
@@ -5651,8 +5651,8 @@ in
{ lib, config, ... }:
@@ -5670,8 +5670,8 @@ in
{ lib, config, ... }:
@@ -5902,12 +5902,12 @@ in
@@ -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
- ]
- );
+ ];
}
#!/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
{ 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
{ lib, pkgs, config, ... }:
@@ -10170,8 +10147,8 @@ in
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.
This holds configuration that is specific to framework laptops. @@ -10771,8 +10748,8 @@ This holds configuration that is specific to framework laptops.
{ lib, config, ... }:
@@ -10788,8 +10765,8 @@ This holds configuration that is specific to framework laptops.
{ lib, config, ... }:
@@ -10811,8 +10788,8 @@ This holds configuration that is specific to framework laptops.
{ lib, config, ... }:
@@ -10843,8 +10820,8 @@ This holds configuration that is specific to framework laptops.
{ lib, config, ... }:
@@ -13796,8 +13773,8 @@ The `extraConfig` section here CANNOT be reindented. This has something to do wi
{ lib, config, ... }:
@@ -15046,8 +15023,8 @@ in
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
@@ -19385,7 +19362,7 @@ sync USER HOST: