diff --git a/modules/home-manager/programs/gpxsee.nix b/modules/home-manager/programs/gpxsee.nix
index 88ab4a754d0a980cc1a11461ace2234f50676c5c..7b10748445155fdd5d51034049a7387c8e397087 100644
--- a/modules/home-manager/programs/gpxsee.nix
+++ b/modules/home-manager/programs/gpxsee.nix
@@ -3,6 +3,9 @@
with lib;
let
cfg = config.programs.gpxsee;
appDataLocation =
if pkgs.stdenv.isDarwin then
@@ -23,88 +26,105 @@
package = mkOption {
default = pkgs.gpxsee;
defaultText = literalExample "pkgs.gpxsee";
example = "pkgs.nur.repos.sikmir.gpxsee-bin";
description = "GPXSee package to install.";
type = types.package;
};
demPackage = mkOption {
default = null;
description = "GPXSee DEM package to install.";
example = "pkgs.nur.repos.sikmir.dem";
description = "DEM package to install.";
type = types.nullOr types.package;
};
default = null;
description = "GPXSee maps package to install.";
type = types.nullOr types.package;
default = [ ];
example = [
"pkgs.nur.repos.sikmir.gpxsee-maps"
"pkgs.nur.repos.sikmir.maptourist"
];
description = "Map packages to install.";
type = types.listOf types.package;
};
poiPackages = mkOption {
default = [ ];
description = "GPXSee POI packages to install.";
example = [
"pkgs.nur.repos.sikmir.gpxsee-poi.geocachingSu"
"pkgs.nur.repos.sikmir.gpxsee-poi.westra"
];
description = "POI packages to install.";
type = types.listOf types.package;
};
default = null;
description = "QtPBFImagePlugin styles package to install.";
example = "pkgs.nur.repos.sikmir.qtpbfimageplugin-styles";
description = "QtPBFImagePlugin style package to install.";
type = types.nullOr types.package;
};
default = [ ];
description = "";
type = types.listOf types.str;
default = "";
description = "Style for MVT usable with QtPBFImagePlugin";
type = types.str;
};
config = mkIf cfg.enable (
mkMerge [
{
home.packages = [ cfg.package pkgs.qtpbfimageplugin ];
home.activation.hideToolbar =
config.lib.dag.entryAfter [ "writeBoundary" ]
(
if pkgs.stdenv.isDarwin then
"$DRY_RUN_CMD /usr/bin/defaults write ${domain} Settings.toolbar -bool false"
else
"$DRY_RUN_CMD ${pkgs.crudini}/bin/crudini $VERBOSE_ARG --set ${configFile} Settings toolbar 0"
);
}
(
mkIf pkgs.stdenv.isLinux {
home.activation.createConfigFile = config.lib.dag.entryBefore [ "writeBoundary" ] ''
$DRY_RUN_CMD mkdir -p ${configDir}
$DRY_RUN_CMD touch ${configFile}
'';
}
)
(
mkIf (cfg.demPackage != null) {
home.file."${demDir}".source =
"${cfg.demPackage}/share/gpxsee/DEM";
home.file."${demDir}".source = "${cfg.demPackage}";
}
)
(
let
mapXml = map: {
name = "${mapDir}/${map}";
value.source = "${cfg.mapsPackage}/share/gpxsee/maps/${map}";
};
in
mkIf (cfg.mapsPackage != null && cfg.maps != [ ]) {
home.file = listToAttrs (map mapXml cfg.maps);
mkIf (length cfg.mapPackages > 0) {
home.file = listToAttrs (
map
(m: {
name = "${mapDir}/${m.name}";
value.source = "${m}";
})
cfg.mapPackages
);
}
)
(
let
mapPoi = poi: {
name = "${poiDir}/${poi.name}";
value.source = "${poi}/share/gpxsee/POI";
};
in
mkIf (cfg.poiPackages != [ ]) {
home.file = listToAttrs (map mapPoi cfg.poiPackages);
mkIf (length cfg.poiPackages > 0) {
home.file = listToAttrs (
map
(p: {
name = "${poiDir}/${p.name}";
value.source = "${p}";
})
cfg.poiPackages
);
}
)
(
mkIf (cfg.stylesPackage != null && cfg.style != "") {
home.file."${styleDir}".source =
"${cfg.stylesPackage}/share/gpxsee/style/${cfg.style}";
mkIf (cfg.stylePackage != null) {
home.file."${styleDir}".source = "${cfg.stylePackage}";
}
)
]
application/octet-stream
This content has been proxied by September (3851b).