summaryrefslogtreecommitdiffstats
path: root/nixos/modules
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2020-12-10 22:19:06 +0100
committerJörg Thalheim <joerg@thalheim.io>2020-12-10 22:24:11 +0100
commit6fa3728805f04ec367b8f42ba3d3fc77e3d96513 (patch)
tree485ef06e3df2c2f509384781e09abf549759cae0 /nixos/modules
parentd25e1ac42605ad063b895d3c8cead3b5a5ae428e (diff)
frab: remove package
broken since 2018
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/rename.nix1
-rw-r--r--nixos/modules/services/web-apps/frab.nix222
3 files changed, 1 insertions, 223 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 33d2bc3decc6..d3f6e85327bc 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -860,7 +860,6 @@
./services/web-apps/documize.nix
./services/web-apps/dokuwiki.nix
./services/web-apps/engelsystem.nix
- ./services/web-apps/frab.nix
./services/web-apps/gerrit.nix
./services/web-apps/gotify-server.nix
./services/web-apps/grocy.nix
diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix
index a87db475e012..c6f705bb2d6c 100644
--- a/nixos/modules/rename.nix
+++ b/nixos/modules/rename.nix
@@ -32,6 +32,7 @@ with lib;
(mkRemovedOptionModule ["services" "cgmanager" "enable"] "cgmanager was deprecated by lxc and therefore removed from nixpkgs.")
(mkRemovedOptionModule [ "services" "osquery" ] "The osquery module has been removed")
(mkRemovedOptionModule [ "services" "fourStore" ] "The fourStore module has been removed")
+ (mkRemovedOptionModule [ "services" "frab" ] "The frab module has been removed")
(mkRemovedOptionModule [ "services" "fourStoreEndpoint" ] "The fourStoreEndpoint module has been removed")
(mkRemovedOptionModule [ "services" "mathics" ] "The Mathics module has been removed")
(mkRemovedOptionModule [ "programs" "way-cooler" ] ("way-cooler is abandoned by its author: " +
diff --git a/nixos/modules/services/web-apps/frab.nix b/nixos/modules/services/web-apps/frab.nix
deleted file mode 100644
index 1b5890d6b0c7..000000000000
--- a/nixos/modules/services/web-apps/frab.nix
+++ /dev/null
@@ -1,222 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-
-let
- cfg = config.services.frab;
-
- package = pkgs.frab;
-
- databaseConfig = builtins.toJSON { production = cfg.database; };
-
- frabEnv = {
- RAILS_ENV = "production";
- RACK_ENV = "production";
- SECRET_KEY_BASE = cfg.secretKeyBase;
- FRAB_HOST = cfg.host;
- FRAB_PROTOCOL = cfg.protocol;
- FROM_EMAIL = cfg.fromEmail;
- RAILS_SERVE_STATIC_FILES = "1";
- } // cfg.extraEnvironment;
-
- frab-rake = pkgs.stdenv.mkDerivation {
- name = "frab-rake";
- buildInputs = [ package.env pkgs.makeWrapper ];
- phases = "installPhase fixupPhase";
- installPhase = ''
- mkdir -p $out/bin
- makeWrapper ${package.env}/bin/bundle $out/bin/frab-bundle \
- ${concatStrings (mapAttrsToList (name: value: "--set ${name} '${value}' ") frabEnv)} \
- --set PATH '${lib.makeBinPath (with pkgs; [ nodejs file imagemagick ])}:$PATH' \
- --set RAKEOPT '-f ${package}/share/frab/Rakefile' \
- --run 'cd ${package}/share/frab'
- makeWrapper $out/bin/frab-bundle $out/bin/frab-rake \
- --add-flags "exec rake"
- '';
- };
-
-in
-
-{
- options = {
- services.frab = {
- enable = mkOption {
- type = types.bool;
- default = false;
- description = ''
- Enable the frab service.
- '';
- };
-
- host = mkOption {
- type = types.str;
- example = "frab.example.com";
- description = ''
- Hostname under which this frab instance can be reached.
- '';
- };
-
- protocol = mkOption {
- type = types.str;
- default = "https";
- example = "http";
- description = ''
- Either http or https, depending on how your Frab instance
- will be exposed to the public.
- '';
- };
-
- fromEmail = mkOption {
- type = types.str;
- default = "frab@localhost";
- description = ''
- Email address used by frab.
- '';
- };
-
- listenAddress = mkOption {
- type = types.str;
- default = "localhost";
- description = ''
- Address or hostname frab should listen on.
- '';
- };
-
- listenPort = mkOption {
- type = types.int;
- default = 3000;
- description = ''
- Port frab should listen on.
- '';
- };
-
- statePath = mkOption {
- type = types.str;
- default = "/var/lib/frab";
- description = ''
- Directory where frab keeps its state.
- '';
- };
-
- user = mkOption {
- type = types.str;
- default = "frab";
- description = ''
- User to run frab.
- '';
- };
-
- group = mkOption {
- type = types.str;
- default = "frab";
- description = ''
- Group to run frab.
- '';
- };
-
- secretKeyBase = mkOption {
- type = types.str;
- description = ''
- Your secret key is used for verifying the integrity of signed cookies.
- If you change this key, all old signed cookies will become invalid!
-
- Make sure the secret is at least 30 characters and all random,
- no regular words or you'll be exposed to dictionary attacks.
- '';
- };
-
- database = mkOption {
- type = types.attrs;
- default = {
- adapter = "sqlite3";
- database = "/var/lib/frab/db.sqlite3";
- pool = 5;
- timeout = 5000;
- };
- example = {
- adapter = "postgresql";
- database = "frab";
- host = "localhost";
- username = "frabuser";
- password = "supersecret";
- encoding = "utf8";
- pool = 5;
- };
- description = ''
- Rails database configuration for Frab as Nix attribute set.
- '';
- };
-
- extraEnvironment = mkOption {
- type = types.attrs;
- default = {};
- example = {
- FRAB_CURRENCY_UNIT = "€";
- FRAB_CURRENCY_FORMAT = "%n%u";
- EXCEPTION_EMAIL = "frab-owner@example.com";
- SMTP_ADDRESS = "localhost";
- SMTP_PORT = "587";
- SMTP_DOMAIN = "localdomain";
- SMTP_USER_NAME = "root";
- SMTP_PASSWORD = "toor";
- SMTP_AUTHENTICATION = "1";
- SMTP_NOTLS = "1";
- };
- description = ''
- Additional environment variables to set for frab for further
- configuration. See the frab documentation for more information.
- '';
- };
- };
- };
-
- config = mkIf cfg.enable {
- environment.systemPackages = [ frab-rake ];
-
- users.users.${cfg.user} =
- { group = cfg.group;
- home = "${cfg.statePath}";
- isSystemUser = true;
- };
-
- users.groups.${cfg.group} = { };
-
- systemd.tmpfiles.rules = [
- "d '${cfg.statePath}/system/attachments' - ${cfg.user} ${cfg.group} - -"
- ];
-
- systemd.services.frab = {
- after = [ "network.target" "gitlab.service" ];
- wantedBy = [ "multi-user.target" ];
- environment = frabEnv;
-
- preStart = ''
- ln -sf ${pkgs.writeText "frab-database.yml" databaseConfig} /run/frab/database.yml
- ln -sf ${cfg.statePath}/system /run/frab/system
-
- if ! test -e "${cfg.statePath}/db-setup-done"; then
- ${frab-rake}/bin/frab-rake db:setup
- touch ${cfg.statePath}/db-setup-done
- else
- ${frab-rake}/bin/frab-rake db:migrate
- fi
- '';
-
- serviceConfig = {
- PrivateTmp = true;
- PrivateDevices = true;
- Type = "simple";
- User = cfg.user;
- Group = cfg.group;
- TimeoutSec = "300s";
- Restart = "on-failure";
- RestartSec = "10s";
- RuntimeDirectory = "frab";
- WorkingDirectory = "${package}/share/frab";
- ExecStart = "${frab-rake}/bin/frab-bundle exec rails server " +
- "--binding=${cfg.listenAddress} --port=${toString cfg.listenPort}";
- };
- };
-
- };
-}