ok, _module.args is not the solution I am looking for. still limited to a single user for now

This commit is contained in:
Chris Kruining 2025-03-18 23:05:20 +01:00
parent 34874dd592
commit 65e0b4932e
3 changed files with 6 additions and 16 deletions

View file

@ -1,9 +0,0 @@
{ ... }:
{
# full_name = "Kaas Mans";
# is_trusted = false;
shell = {
default = "fish";
};
}

View file

@ -6,7 +6,7 @@ args@{
...
}: let
inherit (inputs.nixpkgs.lib) nixosSystem;
inherit (builtins) baseNameOf elem map;
inherit (builtins) baseNameOf elem map mapAttrs;
inherit (lib) filterAttrs attrValues attrNames;
inherit (lib.modules) mkAliasOptionModule mkDefault mkIf;
inherit (lib.strings) removeSuffix;
@ -25,7 +25,7 @@ in rec
users = attrNames (mapModules "${path}/users" (p: p));
in [
inputs.nixos-boot.nixosModules.default
{
({ options, config, ...}: {
nixpkgs.pkgs = pkgs;
networking.hostName = mkDefault (removeSuffix ".nix" (baseNameOf path));
@ -52,9 +52,9 @@ in rec
inputs.plasma-manager.homeManagerModules.plasma-manager
];
users = mapModules "${path}/users" (p: mkHmUser p stateVersion);
users = mapModules "${path}/users" (p: mkHmUser p { inherit inputs lib options config system pkgs self stateVersion; });
};
}
})
(filterAttrs (n: v: !elem n ["system"]) attrs)
../. # ../default.nix
(import path)

View file

@ -22,12 +22,11 @@ in rec
group = "users";
};
mkHmUser = path: stateVersion: let
# user = import path {};
mkHmUser = path: args@{stateVersion, ...}: let
name = removeSuffix ".nix" (baseNameOf path);
in
{
# imports = (mapModulesRec' ../modules/home (file: file));
# imports = (mapModulesRec' ../modules/home (file: import file (args // { user = name; })));
home = {
inherit stateVersion;
sessionPath = [ "$SNEEUWVLOK_BIN" "$XDG_BIN_HOME" "$PATH" ]; # Pretty sure I don't need this.