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?
Probably
nixpkgs.lib.escapeSystemdPath
. If you are talking about a NixOS config you can requestlib
as an argument.(I haven’t actually checked, but this is where most lib functions are)
It’s not on
lib
, it’s onutils
, which is not necessarily exposed all that well. You should be able to just get it passed into your module config, eg.{config, pkgs, lib, utils, ...}: { # do your thing }
That’s it! I love you, thanks!