Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f59308dc2a74
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dcf6e71d7309
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Dec 16, 2019

  1. makeDesktopItem: add desktop file validation

    This uses desktop-file-validate in desktop-file-utils.
    It can be turned off if wanted.
    worldofpeace committed Dec 16, 2019
    Copy the full SHA
    9665977 View commit details

Commits on Mar 30, 2020

  1. Merge pull request #75729 from worldofpeace/validate-makeDesktopItem

    makeDesktopItem: add desktop file validation
    worldofpeace authored Mar 30, 2020
    Copy the full SHA
    dcf6e71 View commit details
Showing with 10 additions and 3 deletions.
  1. +10 −3 pkgs/build-support/make-desktopitem/default.nix
13 changes: 10 additions & 3 deletions pkgs/build-support/make-desktopitem/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ lib, runCommandLocal }:
{ lib, runCommandLocal, desktop-file-utils }:

{ name
, type ? "Application"
, exec
@@ -11,6 +12,7 @@
, categories ? "Application;Other;"
, startupNotify ? null
, extraEntries ? null
, fileValidation ? true # whether to validate resulting desktop file.
}:

let
@@ -28,8 +30,8 @@ let
in
runCommandLocal "${name}.desktop" {}
''
mkdir -p $out/share/applications
cat > $out/share/applications/${name}.desktop <<EOF
mkdir -p "$out/share/applications"
cat > "$out/share/applications/${name}.desktop" <<EOF
[Desktop Entry]
Type=${type}
Exec=${exec}
@@ -40,4 +42,9 @@ runCommandLocal "${name}.desktop" {}
${if extraEntries == null then ''EOF'' else ''
${extraEntries}
EOF''}
${lib.optionalString fileValidation ''
echo "Running desktop-file validation"
${desktop-file-utils}/bin/desktop-file-validate "$out/share/applications/${name}.desktop"
''}
''