Skip to content

Commit

Permalink
flood-for-transmission: add floodSettings parameter
Browse files Browse the repository at this point in the history
https://github.com/johman10/flood-for-transmission/xull/540 added
support for setting default values for the UI config options in
config.json. Add a `floodSettings` parameter to the derivation to
support generation of config.json in nixpkgs.
  • Loading branch information
al3xtjames committed Nov 17, 2024
1 parent 5035dfd commit deeeba3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkgs/by-name/fl/flood-for-transmission/package.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# To use this package, use: `services.transmission.webHome = pkgs.flood-for-transmission;`
# The configuration [1] can be modified by overriding floodSettings:
# pkgs.flood-for-transmission.override {
# floodSettings.SWITCH_COLORS = true;
# };
# [1]: https://github.com/johman10/flood-for-transmission?tab=readme-ov-file#beta-customization
{
lib,
buildNpmPackage,
fetchFromGitHub,
floodSettings ? null,
}:

buildNpmPackage rec {
Expand All @@ -24,10 +30,15 @@ buildNpmPackage rec {
runHook preInstall
cp -r public $out
rm $out/config.json.defaults
runHook postInstall
'';

postInstall = lib.optionalString (floodSettings != null) ''
echo '${builtins.toJSON floodSettings}' > $out/config.json
'';

meta = with lib; {
description = "Flood clone for Transmission";
homepage = "https://github.com/johman10/flood-for-transmission";
Expand Down

0 comments on commit deeeba3

Please sign in to comment.