64 lines
1.5 KiB
Nix
64 lines
1.5 KiB
Nix
# Shared system-level configuration for both NixOS and nix-darwin
|
|
# Import this in both nixos/configuration.nix and darwin/configuration.nix
|
|
{
|
|
inputs,
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}: {
|
|
# Shared Nix configuration
|
|
nix = let
|
|
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
|
|
in {
|
|
settings = {
|
|
# Enable flakes and new 'nix' command
|
|
experimental-features = "nix-command flakes";
|
|
|
|
# Opinionated: disable global registry
|
|
flake-registry = "";
|
|
|
|
# Deduplicate and optimize nix store
|
|
auto-optimise-store = true;
|
|
|
|
# Trusted users (useful for remote builds)
|
|
# trusted-users = [ "root" "@wheel" ];
|
|
|
|
# Workaround for https://github.com/NixOS/nix/issues/9574
|
|
nix-path = config.nix.nixPath;
|
|
};
|
|
|
|
# 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;
|
|
};
|
|
|
|
# Shared nixpkgs configuration
|
|
nixpkgs = {
|
|
overlays = [
|
|
inputs.self.overlays.additions
|
|
inputs.self.overlays.modifications
|
|
inputs.self.overlays.unstable-packages
|
|
];
|
|
|
|
config = {
|
|
allowUnfree = true;
|
|
};
|
|
};
|
|
|
|
# Shared environment packages
|
|
environment.systemPackages = with pkgs; [
|
|
vim
|
|
git
|
|
curl
|
|
wget
|
|
];
|
|
}
|
|
|