mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-04-16 06:19:11 +00:00
This is arguably more suitable for certain environment but Nix ecosystem is already largely Unix-adjacent anyways.
32 lines
571 B
Nix
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";
|
|
}
|