wip: faulty first attempt at home-manager integration

This commit is contained in:
Jake Hamilton 2023-04-10 15:59:57 -07:00
parent b428b981b9
commit 17ef1c563d
No known key found for this signature in database
GPG key ID: 9762169A1B35EA68
8 changed files with 400 additions and 28 deletions

View file

@ -16,7 +16,7 @@ in
# Usage: create-modules { src = ./my-modules; overrides = { inherit another-module; }; alias = { default = "another-module" }; }
# result: { another-module = ...; my-module = ...; default = ...; }
create-modules =
{ src ? user-modules-root
{ src ? "${user-modules-root}/nixos"
, overrides ? { }
, alias ? { }
}:
@ -36,7 +36,9 @@ in
modules-metadata = builtins.map create-module-metadata user-modules;
merge-modules = modules: metadata:
modules // {
${metadata.name} = args:
# @NOTE(jakehamilton): home-manager *requires* modules to specify named arguments or it will not
# pass values in. For this reason we must specify things like `pkgs` as a named attribute.
${metadata.name} = args@{ pkgs, ... }:
let
system = args.system or args.pkgs.system;
target = args.target or system;