Skip Navigation
nixos @lemmy.ml gomp @lemmy.ml

How can I reference the escapeSystemdPath function (from nixpkgs' nixos/lib/utils.nix) in my config?

I want to call the escapeSystemdPath (defined in nixpgs at nixos/lib/utils.nix) to derive the name of a systemd mount unit from the target path (eg. srv-my-dir.mount from /srv/my/dir), but I can't figure out how I can reference it... any ideas?

2
2 comments
  • Probably nixpkgs.lib.escapeSystemdPath. If you are talking about a NixOS config you can request lib as an argument.

    (I haven't actually checked, but this is where most lib functions are)