about summary refs log tree commit diff
path: root/nix
diff options
context:
space:
mode:
authorEmile <git@emile.space>2024-10-29 22:44:08 +0100
committerEmile <git@emile.space>2024-10-29 22:44:08 +0100
commit37d8c4d2633fea252a44eb2024799bd15d896387 (patch)
treeb48e7a0099db9b242029ffa37124ca9c6e1da43d /nix
parenta7a14fde7cde4612347f83ec37585cf4268072e6 (diff)
marvin pkg + module
Diffstat (limited to 'nix')
-rw-r--r--nix/modules/remarvin/default.nix28
-rw-r--r--nix/modules/x86_64-linux.nix1
-rw-r--r--nix/pkgs/aarch64-darwin.nix1
-rw-r--r--nix/pkgs/overlay.nix1
-rw-r--r--nix/pkgs/remarvin/default.nix4
-rw-r--r--nix/pkgs/x86_64-linux.nix1
6 files changed, 9 insertions, 27 deletions
diff --git a/nix/modules/remarvin/default.nix b/nix/modules/remarvin/default.nix
index d95e3f2..d9e449a 100644
--- a/nix/modules/remarvin/default.nix
+++ b/nix/modules/remarvin/default.nix
@@ -13,21 +13,6 @@ with lib;
   options.services.emile.remarvin = {
     enable = mkEnableOption "Enable remarvin";
 
-    # ip and port to listen on
-    host = mkOption {
-      type = types.str;
-      default = "127.0.0.1";
-      example = "0.0.0.0";
-      description = "The host the service listens on";
-    };
-
-    port = mkOption {
-      type = types.int;
-      default = 8080;
-      example = 8080;
-      description = "The port the service listens on";
-    };
-
     # env vars with secrets to set
     username = mkOption {
       type = types.str;
@@ -43,11 +28,11 @@ with lib;
       description = "The homeserver to use";
     };
 
-    accesstoken = mkOption {
+    accesstokenpath = mkOption {
       type = types.str;
       default = "";
-      example = "syt_bWFy2mluX34lc3Qx_VARzpUOQIzyzCHunCDnd_1hbPka";
-      description = "The accesstoken used to authenticat (element web > settings > help & about > advanced > access token)";
+      example = "/secret/remarvin_accesstoken";
+      description = "The path to the accesstoken used (element web > settings > help & about > advanced > access token)";
     };
   };
 
@@ -58,13 +43,8 @@ with lib;
         RestartSec = 5;
         Restart = "always";
       };
-      environment = {
-        SESSION_KEY = cfg.sessionKey;
-        SALT = cfg.salt;
-        VERSION = pkgs.r2wars-web.version;
-      };
       path = [ pkgs.remarvin ];
-      serviceConfig.ExecStart = "${pkgs.remarvin}/bin/remarvin -homeserver ${cfg.homeserver} -username ${cfg.username} -accesstoken ${cfg.accesstoken}";
+      serviceConfig.ExecStart = "${pkgs.remarvin}/bin/remarvin -homeserver ${cfg.homeserver} -username ${cfg.username} -accesstokenpath ${cfg.accesstokenpath}";
     };
   };
 }
diff --git a/nix/modules/x86_64-linux.nix b/nix/modules/x86_64-linux.nix
index 9f81e10..8737083 100644
--- a/nix/modules/x86_64-linux.nix
+++ b/nix/modules/x86_64-linux.nix
@@ -2,5 +2,6 @@
   imports = [
     ./ports
     ./r2wars-web
+    ./remarvin
   ];
 }
diff --git a/nix/pkgs/aarch64-darwin.nix b/nix/pkgs/aarch64-darwin.nix
index c5ecaa7..081eb59 100644
--- a/nix/pkgs/aarch64-darwin.nix
+++ b/nix/pkgs/aarch64-darwin.nix
@@ -1,4 +1,5 @@
 final: prev: {
   vokobe = final.callPackage ./vokobe { inherit (final) naersk; };
   r2wars-web = final.callPackage ./r2wars-web { };
+  remarvin = final.callPackage ./remarvin { };
 }
diff --git a/nix/pkgs/overlay.nix b/nix/pkgs/overlay.nix
index c5ecaa7..081eb59 100644
--- a/nix/pkgs/overlay.nix
+++ b/nix/pkgs/overlay.nix
@@ -1,4 +1,5 @@
 final: prev: {
   vokobe = final.callPackage ./vokobe { inherit (final) naersk; };
   r2wars-web = final.callPackage ./r2wars-web { };
+  remarvin = final.callPackage ./remarvin { };
 }
diff --git a/nix/pkgs/remarvin/default.nix b/nix/pkgs/remarvin/default.nix
index 1da157f..a45bad2 100644
--- a/nix/pkgs/remarvin/default.nix
+++ b/nix/pkgs/remarvin/default.nix
@@ -10,7 +10,7 @@ pkgs.buildGoModule rec {
 
   src = fetchgit {
     url = "git://git.emile.space/remarvin.git";
-    hash = "sha256-UahNwhsxFGSpaVTk2EFtjt/MCB4Ec/08QStylL2QPUM=";
+    hash = "sha256-jgV5bzQQ4n9v7PgFQ5n0yFTPcjgHNQ/BYPxzTp1Os4w=";
   };
 
   vendorHash = null;
@@ -19,8 +19,6 @@ pkgs.buildGoModule rec {
 
   postInstall = ''
     mkdir -p $out
-    cp -r templates $out
-
     mv $out/bin/src $out/bin/remarvin
   '';
 
diff --git a/nix/pkgs/x86_64-linux.nix b/nix/pkgs/x86_64-linux.nix
index c5ecaa7..081eb59 100644
--- a/nix/pkgs/x86_64-linux.nix
+++ b/nix/pkgs/x86_64-linux.nix
@@ -1,4 +1,5 @@
 final: prev: {
   vokobe = final.callPackage ./vokobe { inherit (final) naersk; };
   r2wars-web = final.callPackage ./r2wars-web { };
+  remarvin = final.callPackage ./remarvin { };
 }