diff --git a/flake.nix b/flake.nix index 23b28e1..96c8f7b 100644 --- a/flake.nix +++ b/flake.nix @@ -32,20 +32,25 @@ config.allowUnfree = true; 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 { homeConfigurations."julian" = home-manager.lib.homeManagerConfiguration { inherit pkgs; # Specify your home configuration modules here, for example, # the path to your home.nix. - modules = [ - ./home-manager/home.nix - ./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 - ]; + modules = [ ./home-manager/home.nix ] + ++ listNixFilesRec ./home-manager/modules; # Optionally use extraSpecialArgs # to pass through arguments to home.nix