From a9da2ca46adfeaf8d321ecf34fd75262bd74d36d Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Wed, 28 Dec 2022 15:20:47 -0500 Subject: Remove dead code --- config/pjournal.nix | 58 ----------------------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 config/pjournal.nix (limited to 'config/pjournal.nix') diff --git a/config/pjournal.nix b/config/pjournal.nix deleted file mode 100644 index 06e93d0..0000000 --- a/config/pjournal.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ config, lib, pkgs, ... }: -with lib; -let cfg = config.services.pjournal; -in { - options = { - services.pjournal = { - enable = mkOption { - type = types.bool; - default = false; - }; - - package = mkOption { - type = types.package; - default = pkgs.callPackage ../pkgs/pjournal/default.nix { }; - }; - - base_url = mkOption { - type = types.str; - default = "http://localhost:8080"; - }; - - port = mkOption { - type = types.int; - default = 8080; - }; - }; - }; - - config = mkIf cfg.enable { - environment.systemPackages = [ cfg.package ]; - - services.postgresql = { - enable = true; - ensureDatabases = [ "pjournal" ]; - ensureUsers = [{ - name = "pjournal"; - ensurePermissions = { "DATABASE pjournal" = "ALL PRIVILEGES"; }; - }]; - }; - - systemd.services.pjournal = { - description = "pjournal instance"; - after = [ "multi-user.target" "postgresql.service" ]; - wantedBy = [ "multi-user.target" ]; - environment = { RUST_BACKTRACE = "1"; }; - script = '' - # This will fail the first time. Run pjournal init to initialize - # the database. - ${cfg.package}/bin/pjournal \ - --database-url postgres://pjournal@/pjournal \ - --port ${toString cfg.port} \ - --base-url ${cfg.base_url} - ''; - serviceConfig = { User = "pjournal"; }; - }; - - }; -} -- cgit v1.2.3