dotfiles/machines/common/shared/nix.nix
winston 457f70f404
build: the very cool new features commit
also need to remember to nixpkgs-unstable -> nixos-unstable at a later point
2023-12-24 04:18:10 +01:00

39 lines
932 B
Nix

{
lib,
inputs,
pkgs,
...
}: let
inherit (lib) filterAttrs;
inherit (pkgs.stdenv) isDarwin isLinux;
flakes = filterAttrs (name: value: value ? outputs) inputs;
in {
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"];
trusted-users = ["@sudo" "@wheel" "winston"];
use-xdg-base-directories = true;
warn-dirty = false;
}
// ((import ../../../flake.nix).nixConfig);
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 [];
};
}