dotfiles/machines/common/shared/nix.nix

40 lines
932 B
Nix
Raw Normal View History

{
lib,
inputs,
pkgs,
...
2023-08-31 00:03:07 +02:00
}: let
inherit (lib) filterAttrs;
inherit (pkgs.stdenv) isDarwin isLinux;
2023-08-31 00:03:07 +02:00
flakes = filterAttrs (name: value: value ? outputs) inputs;
in {
2023-03-02 07:30:03 +01:00
nixpkgs.config.allowUnfree = true;
nix = {
gc.automatic = true;
package = pkgs.nixVersions.nix_2_19;
settings =
{
auto-optimise-store = pkgs.stdenv.isLinux;
experimental-features = ["auto-allocate-uids" "flakes" "nix-command" "repl-flake"];
2023-11-06 07:28:26 +01:00
trusted-users = ["@sudo" "@wheel" "winston"];
use-xdg-base-directories = true;
warn-dirty = false;
}
// ((import ../../../flake.nix).nixConfig);
2023-08-31 00:03:07 +02:00
registry =
builtins.mapAttrs
(name: v: {flake = v;})
flakes;
nixPath =
if isDarwin
then [
{nixpkgs = "${inputs.nixpkgs.outPath}";}
]
else if isLinux
then [
"nixpkgs=${inputs.nixpkgs.outPath}"
]
else [];
2023-02-13 23:33:09 +01:00
};
}