bunch of small changes

This commit is contained in:
Gerg-L 2023-10-08 21:04:23 -04:00
parent b99f465861
commit 75a4e0a52a
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI
5 changed files with 57 additions and 41 deletions

View file

@ -1,17 +1,28 @@
inputs:
{ pkgs, lib, ... }:
#
# Flake registry and $NIX_PATH pinning
#
let
alias = inputs // {
nixpkgs = inputs.unstable;
};
flakes = lib.filterAttrs (_: lib.isType "flake") alias;
in
{
nix.nixPath = lib.mapAttrsToList (x: _: "${x}=flake:${x}") flakes;
nix.registry = lib.mapAttrs (_: flake: { inherit flake; }) flakes;
pkgs,
lib,
config,
...
}:
{
#
# Flake registry and $NIX_PATH pinning
#
nix.registry = lib.pipe inputs [
(lib.filterAttrs (_: lib.isType "flake"))
(lib.mapAttrs (_: flake: { inherit flake; }))
(x: x // { nixpkgs.flake = inputs.unstable; })
];
environment.etc =
lib.mapAttrs'
(name: value: {
name = "nix/path/${name}";
value.source = value.flake;
})
config.nix.registry;
nix.nixPath = [ "/etc/nix/path" ];
#
# Ignore global registry
#
@ -32,7 +43,6 @@ in
"dynamic-derivations"
"fetch-closure"
"flakes"
"impure-derivations"
"nix-command"
"no-url-literals"
"parse-toml-timestamps"
@ -46,11 +56,8 @@ in
# Use for testing
#
#allow-import-from-derivation = false;
trusted-users = [
"root"
"@wheel"
];
allowed-users = [ ];
trusted-users = [ "root" ];
allowed-users = [ "@wheel" ];
use-xdg-base-directories = true;
auto-allocate-uids = true;
};