dotfiles.nix/nixos/nix.nix

41 lines
1.2 KiB
Nix
Raw Normal View History

2023-10-26 02:37:42 +00:00
{ flake, pkgs, lib, ... }: {
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 = {
package = pkgs.nixUnstable;
nixPath = {
nixpkgs = "${flake.inputs.nixpkgs}";
} // 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-10-26 02:37:42 +00:00
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
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
flake-registry = builtins.toFile "empty-flake-registry.json"
''{"flakes":[],"version":2}'';
trusted-users = [ flake.config.users.me "root" "@admin" "@wheel" ];
2023-10-26 02:37:42 +00:00
};
};
}