add the ttrss service that copies files
This commit is contained in:
parent
e88b3e1413
commit
addd852c9b
2 changed files with 90 additions and 0 deletions
88
Ttrss/default.nix
Normal file
88
Ttrss/default.nix
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
{ stdenv
|
||||||
|
, pkgs
|
||||||
|
, lib
|
||||||
|
}:
|
||||||
|
{ TtrssPostgresDB
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
asTtrssConfig = attrs: builtins.concatStringsSep "\n" (["<php"] ++ lib.attrsets.mapAttrsToList wrapPutenv attrs);
|
||||||
|
wrapPutenv = key: value: "putenv('TTRSS_${lib.toUpper key}=${value}')";
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "ttrss";
|
||||||
|
src = pkgs.tt-rss;
|
||||||
|
buildCommand =
|
||||||
|
let
|
||||||
|
configFile = pkgs.writeText "config.php" (asTtrssConfig {
|
||||||
|
db_type = "pgsql";
|
||||||
|
db_host = TtrssPostgresDB.target.properties.hostname;
|
||||||
|
db_user = TtrssPostgresDB.postgresUsername;
|
||||||
|
db_name = TtrssPostgresDB.postgresDatabase;
|
||||||
|
db_pass = TtrssPostgresDB.postgresPassword;
|
||||||
|
db_port = builtins.toString TtrssPostgresDB.postgresPort;
|
||||||
|
|
||||||
|
self_url_path = "https://tt-rss.tiserbox.com/";
|
||||||
|
single_user_mode = "true";
|
||||||
|
simple_update_mode = "false";
|
||||||
|
php_executable = pkgs.php;
|
||||||
|
|
||||||
|
lock_directory = "/usr/share/webapps/tt-rss/lock";
|
||||||
|
cache_dir = "/var/cache/tt-rss";
|
||||||
|
icons_dir = "feed-icons";
|
||||||
|
icons_url = "feed-icons";
|
||||||
|
|
||||||
|
auth_auto_create = "true";
|
||||||
|
auth_auto_login = "true";
|
||||||
|
|
||||||
|
force_article_purge = "0";
|
||||||
|
sphinx_server = "localhost:9312";
|
||||||
|
sphinx_index = "ttrss, delta";
|
||||||
|
|
||||||
|
enable_registration = "false";
|
||||||
|
reg_notify_address = "user@your.domain.dom";
|
||||||
|
reg_max_users = "10";
|
||||||
|
|
||||||
|
session_cookie_lifetime = "86400";
|
||||||
|
smtp_from_name = "Tiny Tiny RSS";
|
||||||
|
smtp_from_address = "noreply@tiserbox.com";
|
||||||
|
digest_subject = "[tt-rss] New headlines for last 24 hours";
|
||||||
|
|
||||||
|
check_for_updates = "true";
|
||||||
|
plugins = "auth_internal, note";
|
||||||
|
|
||||||
|
log_destination = "syslog";
|
||||||
|
});
|
||||||
|
in
|
||||||
|
''
|
||||||
|
mkdir -p $out/webapps/${name}
|
||||||
|
cp -ra $src/* $out/webapps/${name}
|
||||||
|
|
||||||
|
mkdir -p $out/etc/ttrss
|
||||||
|
cp ${configFile} $out/etc/ttrss/config.php
|
||||||
|
|
||||||
|
echo "/usr/share/webapps" > $out/.dysnomia-targetdir
|
||||||
|
# echo "http:http" > $out/.dysnomia-filesetowner
|
||||||
|
|
||||||
|
cat > $out/.dysnomia-fileset <<FILESET
|
||||||
|
mkdir /etc/ttrss
|
||||||
|
|
||||||
|
symlink $out/etc/ttrss/config.php
|
||||||
|
target /etc/ttrss
|
||||||
|
|
||||||
|
mkdir /usr/share/webapps
|
||||||
|
|
||||||
|
symlink $out/webapps/ttrss
|
||||||
|
target /usr/share/webapps
|
||||||
|
FILESET
|
||||||
|
|
||||||
|
# mkdir -p $out/webapps/${name}
|
||||||
|
# cp -ra $src/* $out/webapps/${name}
|
||||||
|
|
||||||
|
# mkdir -p $out/etc/tt-rss/
|
||||||
|
# cp ${configFile} $out/etc/tt-rss/config.php
|
||||||
|
|
||||||
|
# mkdir -p $out/usr/share/webapps/tt-rss/
|
||||||
|
# cp -ra $src/* $out/usr/share/webapps/tt-rss/
|
||||||
|
'';
|
||||||
|
}
|
|
@ -9,6 +9,8 @@ let
|
||||||
|
|
||||||
self = {
|
self = {
|
||||||
PostgresDB = callPackage ./PostgresDB {};
|
PostgresDB = callPackage ./PostgresDB {};
|
||||||
|
|
||||||
|
TtrssService = callPackage ./Ttrss {};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
self
|
self
|
||||||
|
|
Loading…
Reference in a new issue