From 4d103c3fb5f865ea1c868b397deebe058b188236 Mon Sep 17 00:00:00 2001 From: NullBite Date: Thu, 1 Feb 2024 11:43:13 +0100 Subject: [PATCH] move _username out of flake's global scope --- flake.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 1cef3aa..3b20594 100644 --- a/flake.nix +++ b/flake.nix @@ -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 = [