nix: use home-manager to generate nixConf

This commit is contained in:
Primrose 2024-06-24 10:13:37 +02:00
parent 61337c950a
commit ff0025f604
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
4 changed files with 9 additions and 3 deletions

View file

@ -10,6 +10,8 @@ let
nix.registry.nixpkgs.flake = inputs.nixpkgs;
};
substituters = import ./substituters.nix;
mkNixOS =
name: sys: hmOpts:
withSystem sys (
@ -27,6 +29,7 @@ let
"${self}/nix/hosts/${name}"
"${self}/nix/layouts"
inputs.agenix.nixosModules.default
substituters
inputs.home-manager.nixosModules.home-manager
{
home-manager = {
@ -38,6 +41,7 @@ let
"${self}/nix/home/${name}"
nixpkgsRegistry
hmOpts
substituters
];
};
}
@ -62,6 +66,7 @@ let
"${self}/nix/hosts/_"
"${self}/nix/hosts/_darwin"
"${self}/nix/hosts/${name}"
substituters
inputs.home-manager.darwinModules.home-manager
{
home-manager = {
@ -72,6 +77,7 @@ let
"${self}/nix/home/_"
"${self}/nix/home/${name}"
nixpkgsRegistry
substituters
hmOpts
];
};
@ -97,6 +103,7 @@ let
"${self}/nix/home/_"
"${self}/nix/home/${name}"
nixpkgsRegistry
substituters
hmOpts
];
}

View file

@ -0,0 +1,27 @@
{ pkgs, ... }:
{
nix.package = pkgs.nixVersions.nix_2_21;
nix.settings = {
/*
substituters can only be used by users that are trusted by nix -> nix trusts the user to do it right
trusted-substituters can be used by any user -> nix trusts everything the substituter provides
"In addition, each store path should be trusted as described in trusted-public-keys"
-> keys for everything
*/
substituters = [
"https://nix-community.cachix.org"
"https://leana8959.cachix.org"
];
trusted-substituters = [
"https://leana8959.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"leana8959.cachix.org-1:CxQSAp8lcgMv8Me459of0jdXRW2tcyeYRKTiiUq8z0M="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
}