nixos-config/lib/xdg.nix

32 lines
571 B
Nix
Raw Normal View History

{ pkgs, lib, self }:
rec {
/**
Naively get the absolute path of a `.desktop` file given a derivation and a
name.
# Arguments
drv
: The derivation.
name
: The name of the `.desktop` file (without the `.desktop` extension).
# Type
```
getXdgDesktop :: Derivation -> String -> Path
```
# Example
```nix
getXdgDesktop pkgs.wezterm "org.wezfurlong.wezterm"
=> /nix/store/$HASH-wezterm-org.wezterm.wezterm.desktop
```
*/
getXdgDesktop = drv: name:
"${drv}/share/applications/${name}.desktop";
}