home: automatically find and all all module files
This commit is contained in:
parent
900d07ae77
commit
fd6cd027fc
21
flake.nix
21
flake.nix
@ -32,20 +32,25 @@
|
|||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
overlays = [ unstable-overlay ];
|
overlays = [ unstable-overlay ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Does not follow symlinks
|
||||||
|
listNixFilesRec = dir:
|
||||||
|
pkgs.lib.lists.flatten (pkgs.lib.attrsets.mapAttrsToList (name: value:
|
||||||
|
let path = "${toString dir}/${name}";
|
||||||
|
in if value == "directory" && builtins.pathExists path then
|
||||||
|
listNixFilesRec path
|
||||||
|
else if value == "regular" && pkgs.lib.hasSuffix ".nix" name then
|
||||||
|
path
|
||||||
|
else
|
||||||
|
[ ]) (builtins.readDir dir));
|
||||||
in {
|
in {
|
||||||
homeConfigurations."julian" = home-manager.lib.homeManagerConfiguration {
|
homeConfigurations."julian" = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
|
|
||||||
# Specify your home configuration modules here, for example,
|
# Specify your home configuration modules here, for example,
|
||||||
# the path to your home.nix.
|
# the path to your home.nix.
|
||||||
modules = [
|
modules = [ ./home-manager/home.nix ]
|
||||||
./home-manager/home.nix
|
++ listNixFilesRec ./home-manager/modules;
|
||||||
./home-manager/modules/shell/zsh/default.nix
|
|
||||||
./home-manager/modules/shell/direnv.nix
|
|
||||||
./home-manager/modules/topgrade.nix
|
|
||||||
./home-manager/modules/neovim.nix
|
|
||||||
./home-manager/modules/alacritty.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# Optionally use extraSpecialArgs
|
# Optionally use extraSpecialArgs
|
||||||
# to pass through arguments to home.nix
|
# to pass through arguments to home.nix
|
||||||
|
Loading…
x
Reference in New Issue
Block a user