This commit is contained in:
2025-12-17 15:47:55 -05:00
parent 36dcf08e32
commit 5c574b447c
3 changed files with 15 additions and 10 deletions

View File

@@ -20,7 +20,8 @@ let
accounts = usersData.ugaif.users or { }; accounts = usersData.ugaif.users or { };
# Helper: Resolve external module path from fetchGit/fetchTarball/path # Helper: Resolve external module path from fetchGit/fetchTarball/path
resolveExternalPath = external: resolveExternalPath =
external:
if external == null then if external == null then
null null
else if builtins.isAttrs external && external ? outPath then else if builtins.isAttrs external && external ? outPath then
@@ -29,7 +30,8 @@ let
external; external;
# Helper: Check if path exists and is valid # Helper: Check if path exists and is valid
isValidPath = path: isValidPath =
path:
path != null path != null
&& (builtins.isPath path || (builtins.isString path && lib.hasPrefix "/" path)) && (builtins.isPath path || (builtins.isString path && lib.hasPrefix "/" path))
&& builtins.pathExists path; && builtins.pathExists path;
@@ -176,7 +178,6 @@ in
} }
// (externalUserOptions.${name} or { }) // (externalUserOptions.${name} or { })
) accounts; ) accounts;
# Generate NixOS users # Generate NixOS users
users.users = users.users =
@@ -236,7 +237,14 @@ in
... ...
}: }:
let let
evaluated = fullModule { inherit config lib pkgs osConfig; }; evaluated = fullModule {
inherit
config
lib
pkgs
osConfig
;
};
in in
lib.filterAttrs (name: _: name != "ugaif") evaluated lib.filterAttrs (name: _: name != "ugaif") evaluated
else else
@@ -248,10 +256,7 @@ in
]; ];
# Build imports list # Build imports list
allImports = allImports = user.extraImports ++ commonImports ++ lib.optional hasExternalUser externalUserModule;
user.extraImports
++ commonImports
++ lib.optional hasExternalUser externalUserModule;
in in
lib.mkMerge [ lib.mkMerge [
{ {

View File

@@ -15,7 +15,7 @@
# description = "My Name"; # description = "My Name";
# shell = pkgs.zsh; # shell = pkgs.zsh;
# extraGroups = [ "wheel" "networkmanager" ]; # extraGroups = [ "wheel" "networkmanager" ];
# #
# external = builtins.fetchGit { # external = builtins.fetchGit {
# url = "https://github.com/username/dotfiles"; # url = "https://github.com/username/dotfiles";
# rev = "commit-hash"; # rev = "commit-hash";

View File

@@ -26,7 +26,7 @@
# ========== User Account Configuration ========== # ========== User Account Configuration ==========
# These are imported as a NixOS module to set ugaif.users options # These are imported as a NixOS module to set ugaif.users options
# Replace "myusername" with your actual username # Replace "myusername" with your actual username
ugaif.users.myusername = { ugaif.users.myusername = {
description = "Your Full Name"; description = "Your Full Name";