Skip to content

Commit

Permalink
Move the icon path exists check to checkPhase
Browse files Browse the repository at this point in the history
Move the icon path exists check to checkPhase of makeDesktopItem, to
remove the IFD.

Signed-off-by: Mika Tammi <[email protected]>
  • Loading branch information
Mika Tammi authored and brianmcgillion committed Apr 4, 2024
1 parent 8b5b12c commit 2f39e0e
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions modules/desktop/graphics/launchers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,22 @@
...
}: let
toDesktop = elem:
if !builtins.pathExists elem.icon
then throw "The icon's path ${elem.icon} doesn't exist"
else
makeDesktopItem {
inherit (elem) name icon;
genericName = elem.name;
desktopName = elem.name;
comment = "Secured Ghaf Application";
exec = elem.path;
};
(makeDesktopItem {
inherit (elem) name icon;
genericName = elem.name;
desktopName = elem.name;
comment = "Secured Ghaf Application";
exec = elem.path;
})
.overrideAttrs (prevAttrs: {
checkPhase =
prevAttrs.checkPhase
+ ''
# Check that the icon's path exists
[[ -f "${elem.icon}" ]] || (echo "The icon's path ${elem.icon} doesn't exist" && exit 1)
'';
});
in
pkgs.symlinkJoin {
name = "ghaf-desktop-entries";
Expand Down

0 comments on commit 2f39e0e

Please sign in to comment.