From 1a518fa79a5b1cdfe7b6cf267e9e4eefe57ab613 Mon Sep 17 00:00:00 2001 From: DashieTM Date: Fri, 9 May 2025 12:02:51 +0200 Subject: [PATCH] Add lib.mkDefault for non configurable defaults --- base/common_hardware.nix | 18 ++++++++++-------- base/env.nix | 1 + home/common.nix | 4 ++-- home/default.nix | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/base/common_hardware.nix b/base/common_hardware.nix index 8eb4e78..115295c 100644 --- a/base/common_hardware.nix +++ b/base/common_hardware.nix @@ -50,13 +50,14 @@ in { "sd_mod" ]; }; - kernelParams = + kernelParams = lib.mkDefault ( [ ''resume="PARTLABEL=SWAP"'' ''quiet'' ''udev.log_level=3'' ] - ++ config.conf.bootParams; + ++ config.conf.bootParams + ); }; networking = { @@ -101,7 +102,7 @@ in { builders-use-substitutes = mkDashDefault true; - substituters = [ + substituters = lib.mkDefault [ "https://hyprland.cachix.org" "https://anyrun.cachix.org" "https://cache.garnix.io" @@ -115,7 +116,7 @@ in { "https://chaotic-nyx.cachix.org/" ]; - trusted-public-keys = [ + trusted-public-keys = lib.mkDefault [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" @@ -162,10 +163,11 @@ in { "video" "audio" ]; - packages = with pkgs; [ - home-manager - xdg-desktop-portal-gtk - ]; + packages = with pkgs; + lib.mkDefault [ + home-manager + xdg-desktop-portal-gtk + ]; # this password will only last for the first login # e.g. login, then change to whatever else, this also ensures no public hash is available password = mkDashDefault "firstlogin"; diff --git a/base/env.nix b/base/env.nix index 95248dc..0eaf068 100644 --- a/base/env.nix +++ b/base/env.nix @@ -2,6 +2,7 @@ mkDashDefault, pkgs, config, + lib, ... }: { environment = { diff --git a/home/common.nix b/home/common.nix index 1a3ccf3..be7deaf 100644 --- a/home/common.nix +++ b/home/common.nix @@ -34,8 +34,8 @@ in { }; nix = { - extraOptions = lib.mkIf (config ? sops.secrets && config.sops.secrets ? access.path) '' + extraOptions = lib.mkDefault (lib.mkIf (config ? sops.secrets && config.sops.secrets ? access.path) '' !include ${config.sops.secrets.access.path} - ''; + ''); }; } diff --git a/home/default.nix b/home/default.nix index c459466..f7b2fd5 100644 --- a/home/default.nix +++ b/home/default.nix @@ -32,7 +32,7 @@ }; users.${config.conf.username} = { - disabledModules = ["programs/anyrun.nix"]; + disabledModules = lib.mkDefault ["programs/anyrun.nix"]; imports = [ ./common.nix