cleaned up nix settings

This commit is contained in:
Gerg-L 2023-08-05 22:27:20 -04:00
parent d6f391f766
commit 64c86bfe3c
2 changed files with 22 additions and 15 deletions

View file

@ -1,5 +1,24 @@
inputs: {pkgs, ...}: {
#other nix settings
inputs: {
pkgs,
lib,
...
}:
#
# Flake registry and $NIX_PATH pinning
#
let
alias = inputs // {nixpkgs = inputs.unstable;};
flakes = lib.filterAttrs (_: v: v._type == "flake") alias;
in {
nix.nixPath = lib.mapAttrsToList (x: _: "${x}=flake:${x}") flakes;
nix.registry = lib.mapAttrs (_: flake: {inherit flake;}) flakes;
#
# Ignore global registry
#
nix.settings.flake-registry = builtins.toFile "empty-flake-registry.json" ''{"flakes":[],"version":2}'';
#
# Other nix settings
#
nix = {
package = inputs.nix.packages.${pkgs.system}.default;
settings = {
@ -10,8 +29,6 @@ inputs: {pkgs, ...}: {
];
auto-optimise-store = true;
warn-dirty = false;
#ignore global registry
flake-registry = builtins.toFile "empty-flake-registry.json" ''{"flakes":[],"version":2}'';
#use for testing
#allow-import-from-derivation = false;
trusted-users = [
@ -22,6 +39,7 @@ inputs: {pkgs, ...}: {
use-xdg-base-directories = true;
};
};
#fix for use-xdg-base-directories
environment.profiles = [
"\${XDG_STATE_HOME:-$HOME/.local/state}/nix/profile"