dotfiles.nix/nixos/nix.nix

53 lines
1.3 KiB
Nix
Raw Normal View History

2024-07-18 14:16:04 +00:00
{
flake,
pkgs,
lib,
...
}:
{
2023-10-26 02:37:42 +00:00
nixpkgs = {
config = {
allowBroken = true;
allowUnfree = true;
allowUnsupportedSystem = true;
};
overlays = [
flake.inputs.helix.overlays.default
flake.inputs.nixd.overlays.default
flake.inputs.nil.overlays.nil
(import ../pkgs flake.inputs)
];
};
nix = {
nixPath = {
nixpkgs = "${flake.inputs.nixpkgs}";
2024-07-18 14:16:04 +00:00
} // lib.optionalAttrs pkgs.stdenv.isDarwin { darwin = "${flake.inputs.nix-darwin}"; };
2023-10-26 02:37:42 +00:00
registry = {
nixpkgs.flake = flake.inputs.nixpkgs;
self.flake = flake.inputs.self;
2023-10-26 02:37:42 +00:00
};
settings = {
# TODO: automatic optimizing and gc
2023-11-04 01:31:47 +00:00
# https://github.com/montchr/dotfield/blob/main/profiles/darwinProfiles/core/nix-optimizations-darwin.nix
2024-07-18 14:16:04 +00:00
experimental-features = [
"nix-command"
"flakes"
"repl-flake"
];
2023-10-26 02:37:42 +00:00
extra-platforms = lib.mkIf (pkgs.system == "aarch64-darwin") [
"x86_64-darwin"
"aarch64-darwin"
];
# wipe out the registry for purity, cf. https://github.com/MatthewCroughan/nixcfg/commit/ce86bee2755127a4fdaca91e5e037d3fe625cba9
2024-07-18 14:16:04 +00:00
flake-registry = builtins.toFile "empty-flake-registry.json" ''{"flakes":[],"version":2}'';
trusted-users = [
2024-07-20 00:59:11 +00:00
flake.config.me.username
2024-07-18 14:16:04 +00:00
"root"
"@admin"
"@wheel"
];
2023-10-26 02:37:42 +00:00
};
};
}