From 41a64a324887808795af55ef76be97c87b24bc57 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Fri, 12 May 2023 20:51:28 +1000 Subject: [PATCH] microbin works --- modules/nixos/microbin.nix | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/modules/nixos/microbin.nix b/modules/nixos/microbin.nix index 4d2cb097..bad0f415 100644 --- a/modules/nixos/microbin.nix +++ b/modules/nixos/microbin.nix @@ -25,6 +25,17 @@ in description = "Group account under which microbin runs."; }; + hostname = mkOption { + type = types.str; + description = "Hostname of your microbin service"; + }; + + port = mkOption { + type = types.port; + default = 8080; + description = "Port on which to run the serice"; + }; + }; }; @@ -34,18 +45,17 @@ in after = [ "remote-fs.target" "network.target" ]; wantedBy = [ "multi-user.target" ]; serviceConfig = { - ExecStart = "${pkgs.microbin}/bin/microbin --port ${cfg.port} \\ - --public-path ${cfg.hostname} \\ - --editable \\ - --enable-burn-after \\ - --private \\ - --qr \\ - --title=sealight \\ - --highlightsyntax"; + ExecStart = ''${pkgs.microbin}/bin/microbin --port ${builtins.toString cfg.port} + --public-path ${cfg.hostname} + --editable + --enable-burn-after + --private + --qr + --title=sealight + --highlightsyntax''; WorkingDirectory = dataFolder; TimeoutStopSec = " 20 "; KillMode = " process "; - Restart = " on-failure "; RestartSec = " 10 "; User = cfg.user; Group = cfg.group;