Skip to content

Commit

Permalink
croodle: init at 0.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jboynyc committed Jul 8, 2023
1 parent 7076a89 commit b9fda7d
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
66 changes: 66 additions & 0 deletions pkgs/servers/web-apps/croodle/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{ lib
, stdenvNoCC
, writeText
, nixosTests
, dataDir ? "/var/lib/croodle"
, debug ? false
}:

let
configFile = writeText "croodle-config.php" ''
<?php
return array(
/*
* dataDir (String)
* relative or absolute path to folder where polls are stored
*/
'dataDir' => getenv('CROODLE__DATA_DIR') ?: '${dataDir}/',
/*
* debug (Boolean)
* controls Slim debug mode
*/
'debug' => getenv('CROODLE__DEBUG') ?: ${lib.boolToString debug}
);
'';

in

stdenvNoCC.mkDerivation rec {
pname = "croodle";
version = "0.6.2";

src = builtins.fetchurl {
url = "https://github.com/jelhan/${pname}/releases/download/v${version}/${pname}-v${version}.tar.gz";
};

sourceRoot = ".";

postPatch = ''
rm -rf data
'';

installPhase = ''
runHook preInstall
rm env-vars
mkdir -p $out/share/croodle
cp -r * $out/share/croodle
cp ${configFile} $out/share/croodle/api/config.php
runHook postInstall
'';

passthru.tests = {
inherit (nixosTests) croodle;
};

meta = with lib; {
description = "A web application to schedule a date or to do a poll on a general topics.";
homepage = "https://github.com/jelhan/croodle";
license = licenses.mit;
maintainers = with maintainers; [ jboy ];
platforms = platforms.all;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18414,6 +18414,8 @@ with pkgs;

confluent-platform = callPackage ../servers/confluent-platform { };

croodle = callPackage ../servers/web-apps/croodle { };

ctags = callPackage ../development/tools/misc/ctags { };

ctagsWrapped = callPackage ../development/tools/misc/ctags/wrapped.nix { };
Expand Down

0 comments on commit b9fda7d

Please sign in to comment.