diff --git a/assets/icon.png b/assets/icon.png new file mode 100644 index 0000000..21c9924 Binary files /dev/null and b/assets/icon.png differ diff --git a/module.nix b/module.nix index c4dce6a..14359c4 100644 --- a/module.nix +++ b/module.nix @@ -34,6 +34,11 @@ let repo_name: ${cfg.repoName} repo_description: ${cfg.repoDescription} repo_keyalias: ${cfg.keyAlias} + # fdroidserver checks this path for existence relative to the cwd `fdroid + # update` runs in (stateDir), then copies it into repo/icons/ under its + # own basename — so this is deliberately already that destination path, + # which the sync script keeps populated before every run. + repo_icon: repo/icons/icon.png keystore: ${cfg.keystoreFile} keystorepass: {env: FDROID_KEYSTORE_PASS} keypass: {env: FDROID_KEY_PASS} @@ -69,6 +74,9 @@ let # every run. There is nothing secret in ours, but a warning that is always # printed is a warning nobody reads when it finally matters. install -m 0600 ${repoConfig} ${cfg.stateDir}/config.yml + # Kept populated every run rather than once, so an icon change here + # propagates on the next sync without anyone having to touch the server. + install -D -m 0644 ${cfg.repoIcon} ${cfg.stateDir}/repo/icons/icon.png exec ${pythonEnv}/bin/python3 ${./fdroid-sync.py} ${syncConfig} "$@" ''; @@ -211,6 +219,16 @@ in description = "Repo description shown in the F-Droid client."; }; + repoIcon = lib.mkOption { + type = lib.types.path; + default = ./assets/icon.png; + description = '' + Icon shown next to the repo in the F-Droid client. Must be a raster + image (PNG) — the client decodes it as a bitmap, so an SVG renders as + a broken icon rather than falling back to anything. + ''; + }; + keyAlias = lib.mkOption { type = lib.types.str; default = "nanuqsaurus";