diff --git a/flake.nix b/flake.nix index 27bbe08..a208145 100644 --- a/flake.nix +++ b/flake.nix @@ -112,13 +112,8 @@ "${username}@${hostname}" = { modules = let - userConfigPath = ( - tryFiles [ - ./lib/users/${username}/${hostname}.nix - ./lib/users/${username}/common.nix - ./lib/users/${username}.nix - ] - null); + getUserConfig = import ./lib/utils/user-config.nix { inherit lib; }; + userConfigPath = getUserConfig { inherit hostname username; }; in [ ( { pkgs, ... }: { diff --git a/lib/utils/user-config.nix b/lib/utils/user-config.nix new file mode 100644 index 0000000..d63b3ff --- /dev/null +++ b/lib/utils/user-config.nix @@ -0,0 +1,11 @@ +{ lib, ... }: + let + tryFiles = import ./try-files.nix { inherit lib; }; + in + { hostname, username, ... }: + tryFiles [ + ../users/${username}/${hostname}.nix + ../users${username}/common.nix + ../users/${username}.nix + ] + null \ No newline at end of file