nixos-config/lib/xdg.nix
Gabriel Arazas 48949336ff
lib: init XDG-specific subset
This is arguably more suitable for certain environment but Nix ecosystem
is already largely Unix-adjacent anyways.
2025-03-20 08:55:05 +08:00

32 lines
571 B
Nix

{ 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";
}