diff --git a/snowfall-lib/fs/default.nix b/snowfall-lib/fs/default.nix index bb1f082..ea74090 100644 --- a/snowfall-lib/fs/default.nix +++ b/snowfall-lib/fs/default.nix @@ -35,8 +35,8 @@ in { ## ```nix ## "/user-source/systems" ## ``` - #@ String -> String - get-file = path: "${user-inputs.src}/${path}"; + #@ String -> Path + get-file = path: user-inputs.src + "/${path}"; ## Get a file path relative to the user's snowfall directory. ## Example Usage: @@ -47,8 +47,8 @@ in { ## ```nix ## "/user-source/snowfall-dir/systems" ## ``` - #@ String -> String - get-snowfall-file = path: "${snowfall-config.root}/${path}"; + #@ String -> Path + get-snowfall-file = path: snowfall-config.root + "/${path}"; ## Get a file path relative to the this flake. ## Example Usage: @@ -59,8 +59,8 @@ in { ## ```nix ## "/user-source/systems" ## ``` - #@ String -> String - internal-get-file = path: "${core-inputs.src}/${path}"; + #@ String -> Path + internal-get-file = path: core-inputs.src + "/${path}"; ## Safely read from a directory if it exists. ## Example Usage: diff --git a/snowfall-lib/module/default.nix b/snowfall-lib/module/default.nix index 62408ad..57fc7a1 100644 --- a/snowfall-lib/module/default.nix +++ b/snowfall-lib/module/default.nix @@ -28,7 +28,7 @@ in { user-modules = snowfall-lib.fs.get-default-nix-files-recursive src; create-module-metadata = module: { name = let - path-name = builtins.replaceStrings [src "/default.nix"] ["" ""] (builtins.unsafeDiscardStringContext module); + path-name = builtins.replaceStrings [(builtins.toString src) "/default.nix"] ["" ""] (builtins.unsafeDiscardStringContext module); in if hasPrefix "/" path-name then builtins.substring 1 ((builtins.stringLength path-name) - 1) path-name