From f4691fa9c9400fce0ed4409af58c478668782e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Fri, 20 Sep 2024 09:24:25 +0200 Subject: [PATCH] feat: enable use-xdg-base-directories for nix --- flake.lock | 6 +++--- home/default.nix | 11 +++++++++++ system/default.nix | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 7526a9a..5fe9f0f 100644 --- a/flake.lock +++ b/flake.lock @@ -407,11 +407,11 @@ ] }, "locked": { - "lastModified": 1726487258, - "narHash": "sha256-Xc6ZorKUI+XxYHuV6QkFoem//yVNReD9feviXztN90A=", + "lastModified": 1726816132, + "narHash": "sha256-AbB0lgc0IbzLIxj1O3cosiMNAVQak4KJtvq9q8MjHhs=", "owner": "NuschtOS", "repo": "search", - "rev": "6ada92d0d1f0b671464920d817a228810a181971", + "rev": "7733a39a1321057172d87e6251ded7cdeb67171e", "type": "github" }, "original": { diff --git a/home/default.nix b/home/default.nix index a858796..a39d74a 100644 --- a/home/default.nix +++ b/home/default.nix @@ -6,11 +6,15 @@ config, pkgs, lib, + osConfig ? null, ... }: let cfg = config.jhome; devcfg = cfg.dev; + # Query the osConfig for a setting. Return the default value if missing or in standalone mode + fromOs = + path: default: if osConfig == null then default else lib.attrsets.attrByPath path default osConfig; in { imports = @@ -26,6 +30,13 @@ in ]; config = lib.mkMerge [ + { + nix.settings.use-xdg-base-directories = fromOs [ + "nix" + "settings" + "use-xdg-base-directories" + ] true; + } (lib.mkIf (cfg.enable && cfg.styling.enable) { stylix.enable = true; }) (lib.mkIf cfg.enable { programs = { diff --git a/system/default.nix b/system/default.nix index 64d30a4..9d168a1 100644 --- a/system/default.nix +++ b/system/default.nix @@ -100,6 +100,7 @@ in randomizedDelaySec = "45min"; }; settings = { + use-xdg-base-directories = true; auto-optimise-store = true; experimental-features = [ "nix-command"