From d35b19f5c0d8cce6dc82fa36b5b4b374ed29f922 Mon Sep 17 00:00:00 2001 From: Chris Dombroski Date: Fri, 3 May 2024 00:26:20 -0400 Subject: [PATCH] tweaks --- modules/common/nix.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/common/nix.nix b/modules/common/nix.nix index 37955d8..0963114 100644 --- a/modules/common/nix.nix +++ b/modules/common/nix.nix @@ -1,16 +1,24 @@ -{pkgs, ...}: { +{pkgs, lib, inputs, config, ...}: { environment.systemPackages = with pkgs; [ - git nix-output-monitor ]; - nix = { - settings.experimental-features = [ "nix-command" "flakes" ]; + programs.git.enable = true; + nix = let + flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; + in { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + flake-registry = ""; + nix-path = config.nix.nixPath; + }; gc = { automatic = true; options = "--delete-older-than 30d"; dates = "weekly"; }; optimise.automatic = true; + registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs; + nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; }; system.autoUpgrade = { enable = true;