mirror of
https://github.com/mjallen18/snowfall-lib.git
synced 2026-04-18 09:05:58 -05:00
Merge pull request #90 from snowfallorg/dev
fix: convert path to string in fs helpers
This commit is contained in:
@@ -35,8 +35,8 @@ in {
|
|||||||
## ```nix
|
## ```nix
|
||||||
## "/user-source/systems"
|
## "/user-source/systems"
|
||||||
## ```
|
## ```
|
||||||
#@ String -> String
|
#@ String -> Path
|
||||||
get-file = path: "${user-inputs.src}/${path}";
|
get-file = path: user-inputs.src + "/${path}";
|
||||||
|
|
||||||
## Get a file path relative to the user's snowfall directory.
|
## Get a file path relative to the user's snowfall directory.
|
||||||
## Example Usage:
|
## Example Usage:
|
||||||
@@ -47,8 +47,8 @@ in {
|
|||||||
## ```nix
|
## ```nix
|
||||||
## "/user-source/snowfall-dir/systems"
|
## "/user-source/snowfall-dir/systems"
|
||||||
## ```
|
## ```
|
||||||
#@ String -> String
|
#@ String -> Path
|
||||||
get-snowfall-file = path: "${snowfall-config.root}/${path}";
|
get-snowfall-file = path: snowfall-config.root + "/${path}";
|
||||||
|
|
||||||
## Get a file path relative to the this flake.
|
## Get a file path relative to the this flake.
|
||||||
## Example Usage:
|
## Example Usage:
|
||||||
@@ -59,8 +59,8 @@ in {
|
|||||||
## ```nix
|
## ```nix
|
||||||
## "/user-source/systems"
|
## "/user-source/systems"
|
||||||
## ```
|
## ```
|
||||||
#@ String -> String
|
#@ String -> Path
|
||||||
internal-get-file = path: "${core-inputs.src}/${path}";
|
internal-get-file = path: core-inputs.src + "/${path}";
|
||||||
|
|
||||||
## Safely read from a directory if it exists.
|
## Safely read from a directory if it exists.
|
||||||
## Example Usage:
|
## Example Usage:
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ in {
|
|||||||
user-modules = snowfall-lib.fs.get-default-nix-files-recursive src;
|
user-modules = snowfall-lib.fs.get-default-nix-files-recursive src;
|
||||||
create-module-metadata = module: {
|
create-module-metadata = module: {
|
||||||
name = let
|
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
|
in
|
||||||
if hasPrefix "/" path-name
|
if hasPrefix "/" path-name
|
||||||
then builtins.substring 1 ((builtins.stringLength path-name) - 1) path-name
|
then builtins.substring 1 ((builtins.stringLength path-name) - 1) path-name
|
||||||
|
|||||||
Reference in New Issue
Block a user