This commit is contained in:
2025-12-25 14:27:20 +08:00
parent 880374e016
commit 1e3886b888
4 changed files with 16 additions and 41 deletions
+10 -10
View File
@@ -8,6 +8,7 @@
...
}: {
# Shared Nix configuration
# Note: On Darwin with Determinate Nix, set nix.enable = false in darwin/configuration.nix
nix = let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
@@ -25,18 +26,17 @@
nix-path = config.nix.nixPath;
};
# Deduplicate and optimize nix store
optimise.automatic = true;
# Garbage collection
gc = {
automatic = true;
options = "--delete-older-than 7d";
};
# Opinionated: make flake registry and nix path match flake inputs
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
# Platform-specific: These require nix.enable = true (conflicts with Determinate Nix on Darwin)
# Only enable on Linux where we manage Nix ourselves
optimise.automatic = lib.mkIf pkgs.stdenv.isLinux true;
gc = lib.mkIf pkgs.stdenv.isLinux {
automatic = true;
options = "--delete-older-than 7d";
};
};
# Shared nixpkgs configuration
@@ -60,7 +60,7 @@
# Shared environment packages
environment.systemPackages = with pkgs; [
vim
git
# git is managed by home-manager (programs.git)
curl
wget
];