move _username out of flake's global scope

This commit is contained in:
NullBite 2024-02-01 11:43:13 +01:00
parent 86bc20fca0
commit 4d103c3fb5
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -47,13 +47,11 @@
};
# this is needed to work around an infinite recursion (it probably isn't
# but i'm stupid)
_username=username;
# This function produces a module that adds the home-manager module to the
# system and configures the given module to the user's Home Manager
# configuration
homeManagerInit = {system, username ? _username , module ? _ : {}, rootModule ? (import ./home/root.nix), userModules ? { ${username} = [ module ] ; root = [ rootModule ]; }, stateVersion }:
homeManagerInit = let _username=username;
in {system, username ? _username , module ? _ : {}, rootModule ? (import ./home/root.nix), userModules ? { ${username} = [ module ] ; root = [ rootModule ]; }, stateVersion }:
{ config, lib, pkgs, ... }:
let
mapUserModules = lib.attrsets.mapAttrs (user: modules: {...}:
@ -83,7 +81,8 @@
# This function produces a nixosSystem which imports configuration.nix and
# a Home Manager home.nix for the given user from ./hosts/${hostname}/
mkSystem = {system, hostname, username ? _username, stateVersion, extraModules ? [] }:
mkSystem = let _username=username;
in {system, hostname, username ? _username, stateVersion, extraModules ? [] }:
lib.nixosSystem {
inherit system;
modules = [