mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
cleaned up nix settings
This commit is contained in:
parent
d6f391f766
commit
64c86bfe3c
2 changed files with 22 additions and 15 deletions
|
|
@ -1,5 +1,24 @@
|
||||||
inputs: {pkgs, ...}: {
|
inputs: {
|
||||||
#other nix settings
|
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 = {
|
nix = {
|
||||||
package = inputs.nix.packages.${pkgs.system}.default;
|
package = inputs.nix.packages.${pkgs.system}.default;
|
||||||
settings = {
|
settings = {
|
||||||
|
|
@ -10,8 +29,6 @@ inputs: {pkgs, ...}: {
|
||||||
];
|
];
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
warn-dirty = false;
|
warn-dirty = false;
|
||||||
#ignore global registry
|
|
||||||
flake-registry = builtins.toFile "empty-flake-registry.json" ''{"flakes":[],"version":2}'';
|
|
||||||
#use for testing
|
#use for testing
|
||||||
#allow-import-from-derivation = false;
|
#allow-import-from-derivation = false;
|
||||||
trusted-users = [
|
trusted-users = [
|
||||||
|
|
@ -22,6 +39,7 @@ inputs: {pkgs, ...}: {
|
||||||
use-xdg-base-directories = true;
|
use-xdg-base-directories = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#fix for use-xdg-base-directories
|
#fix for use-xdg-base-directories
|
||||||
environment.profiles = [
|
environment.profiles = [
|
||||||
"\${XDG_STATE_HOME:-$HOME/.local/state}/nix/profile"
|
"\${XDG_STATE_HOME:-$HOME/.local/state}/nix/profile"
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
inputs: {lib, ...}: let
|
|
||||||
alias = inputs // {nixpkgs = inputs.unstable;};
|
|
||||||
in
|
|
||||||
lib.pipe alias [
|
|
||||||
(lib.filterAttrs (_: v: v._type == "flake"))
|
|
||||||
(lib.mapAttrsToList (n: input: {
|
|
||||||
nix.nixPath = ["${n}=flake:${n}"];
|
|
||||||
nix.registry.${n}.flake = input;
|
|
||||||
}))
|
|
||||||
lib.mkMerge
|
|
||||||
]
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue