diff --git a/flake.nix b/flake.nix index e5b0a02..1565fbb 100644 --- a/flake.nix +++ b/flake.nix @@ -35,7 +35,7 @@ # Library functions — use in nixos-config via: # m3ta-lib = inputs.m3ta-home.lib; # imports = [ (m3ta-lib.mkHome { ... }) ]; - lib = import ./lib {inherit inputs;}; + lib = import ./lib {inherit inputs; selfPath = self.outPath;}; # Overlays (re-exports from m3ta-nixpkgs) overlays = inputs.m3ta-nixpkgs.overlays; diff --git a/lib/default.nix b/lib/default.nix index fd042bc..91de253 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,5 +1,5 @@ # lib/default.nix — Entry point for m3ta-home library functions. # -# Called by flake.nix: import ./lib { inherit inputs; } +# Called by flake.nix: import ./lib { inherit inputs; selfPath = self.outPath; } # Re-exports mkHome and future library functions. -{inputs}: import ./mkHome.nix {inherit inputs;} +{inputs, selfPath}: import ./mkHome.nix {inherit inputs selfPath;} diff --git a/lib/mkHome.nix b/lib/mkHome.nix index b1e3cab..1325875 100644 --- a/lib/mkHome.nix +++ b/lib/mkHome.nix @@ -19,7 +19,7 @@ # m3ta.home.sets.coding.languages.python.extra = true; # wayland.windowManager.hyprland.settings.monitor = [ ... ]; # -{inputs}: let +{inputs, selfPath}: let lib = inputs.nixpkgs.lib; in { mkHome = { @@ -80,6 +80,8 @@ in { in { imports = [ + # Paths module — must be first, provides m3taHome.paths.srcRoot + ../modules/paths.nix baseModule preferencesPath identityPath @@ -87,6 +89,9 @@ in { ++ contextImport ++ setImports; + # Set the flake source root for asset path resolution + m3taHome.paths.srcRoot = selfPath; + assertions = [ {