mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-23 22:48:02 +03:00
13 lines
289 B
Nix
13 lines
289 B
Nix
|
{lib, ...}: let
|
||
|
l = builtins // lib;
|
||
|
|
||
|
sanitizePath = path: let
|
||
|
absolute = (l.substring 0 1 path) == "/";
|
||
|
sanitizedRelPath = l.removePrefix "/" (l.toString (l.toPath "/${path}"));
|
||
|
in
|
||
|
if absolute
|
||
|
then "/${sanitizedRelPath}"
|
||
|
else sanitizedRelPath;
|
||
|
in
|
||
|
sanitizePath
|