Allow dynamically loading user home configs
This commit is contained in:
parent
742b1d2029
commit
b0a08d549f
2 changed files with 13 additions and 7 deletions
|
@ -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, ... }: {
|
||||
|
|
11
lib/utils/user-config.nix
Normal file
11
lib/utils/user-config.nix
Normal file
|
@ -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
|
Loading…
Reference in a new issue