From ec676fbfbefff2bdc9a7cfa73076e63b11e7e85a Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Fri, 8 Dec 2023 17:36:33 -0700 Subject: [PATCH] Simplify boardwise systemd config. --- flake.lock | 2 +- phobos/flake.nix | 40 ++++++++++++++-------------------------- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/flake.lock b/flake.lock index ef0f052..ba70e1b 100644 --- a/flake.lock +++ b/flake.lock @@ -208,7 +208,7 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-Gze86YwZxMbiW01weBEoPXyNEdAuj+hBTtT/shr/wSo=", + "narHash": "sha256-12GAm+zOFk5V1yHAV/LeBvV/kLqE9Cz9WeCSEZbimxQ=", "path": "./phobos", "type": "path" }, diff --git a/phobos/flake.nix b/phobos/flake.nix index 41ce1b0..985053f 100644 --- a/phobos/flake.nix +++ b/phobos/flake.nix @@ -38,32 +38,20 @@ ''; }; - systemd = { - services.boardwise = { - enable = true; - description = "BoardWise Server"; - after = [ "postgresql.service" ]; - requires = [ "postgresql.service" ]; - serviceConfig = { - Environment = [ - "PORT=80" - "DATABASE_URL=ecto://postgres:postgres@localhost/boardwise" - ]; - EnvironmentFile = "/run/secrets/SECRET_KEY_BASE"; - ExecStartPre = "${boardwise.packages.${system}.app}/bin/migrate"; - ExecStart = "${boardwise.packages.${system}.app}/bin/boardwise start"; - Restart = "on-failure"; - }; - unitConfig = { - ConditionPathExists = "/run/secrets/SECRET_KEY_BASE"; - }; - }; - paths.SECRET_KEY_BASE = { - enable = true; - pathConfig = { - PathExists = "/run/secrets/SECRET_KEY_BASE"; - Unit = "boardwise.service"; - }; + systemd.services.boardwise = { + enable = true; + description = "BoardWise Server"; + after = [ "postgresql.service" ]; + requires = [ "postgresql.service" ]; + serviceConfig = { + Environment = [ + "PORT=80" + "DATABASE_URL=ecto://postgres:postgres@localhost/boardwise" + ]; + EnvironmentFile = "/run/secrets/SECRET_KEY_BASE"; + ExecStartPre = "${boardwise.packages.${system}.app}/bin/migrate"; + ExecStart = "${boardwise.packages.${system}.app}/bin/boardwise start"; + Restart = "on-failure"; }; };