xdg-desktop-entries: make exec default to null (#3827)

The [specification](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html)
does not require those keys to be set, and the type reflects that, so
they should default to null.
This commit is contained in:
Naïm Favier 2023-04-04 10:41:46 +02:00 committed by GitHub
parent eefb379386
commit ec06f419af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 6 deletions

View file

@ -34,6 +34,7 @@ let
exec = mkOption { exec = mkOption {
description = "Program to execute, possibly with arguments."; description = "Program to execute, possibly with arguments.";
type = types.nullOr types.str; type = types.nullOr types.str;
default = null;
}; };
icon = mkOption { icon = mkOption {
@ -131,6 +132,7 @@ let
options.exec = mkOption { options.exec = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
description = "Program to execute, possibly with arguments."; description = "Program to execute, possibly with arguments.";
default = null;
}; };
options.icon = mkOption { options.icon = mkOption {
type = with types; nullOr (either str path); type = with types; nullOr (either str path);
@ -162,10 +164,6 @@ let
}; };
}; };
#formatting helpers
semicolonList = list:
(concatStringsSep ";" list) + ";"; # requires trailing semicolon
#passes config options to makeDesktopItem in expected format #passes config options to makeDesktopItem in expected format
makeFile = name: config: makeFile = name: config:
pkgs.makeDesktopItem { pkgs.makeDesktopItem {

View file

@ -32,7 +32,6 @@ with lib;
}; };
}; };
min = { # minimal definition min = { # minimal definition
exec = "test --option";
name = "Test"; name = "Test";
}; };
deprecated = { deprecated = {

View file

@ -1,5 +1,4 @@
[Desktop Entry] [Desktop Entry]
Exec=test --option
Name=Test Name=Test
Terminal=false Terminal=false
Type=Application Type=Application