summaryrefslogtreecommitdiffstats
path: root/lass/3modules/go.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-11-14 01:51:36 +0100
committermakefu <github@syntax-fehler.de>2015-11-14 01:51:36 +0100
commit773a67a983cbe1928da6c524db24a25229a6f5fe (patch)
tree2a00ed5a39f85b837578625cf49d193f4d308f14 /lass/3modules/go.nix
parenta0fbe917ac45cda4de0f16bced3ce3ebfc556fe8 (diff)
parente7d22252dcad25fd5594e9a431f5a39aa620906d (diff)
Merge remote-tracking branch 'cloudkrebs/master' into pre-merge
Diffstat (limited to 'lass/3modules/go.nix')
-rw-r--r--lass/3modules/go.nix61
1 files changed, 0 insertions, 61 deletions
diff --git a/lass/3modules/go.nix b/lass/3modules/go.nix
deleted file mode 100644
index aa900f11..00000000
--- a/lass/3modules/go.nix
+++ /dev/null
@@ -1,61 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with builtins;
-with lib;
-
-let
- cfg = config.lass.go;
-
- out = {
- options.lass.go = api;
- config = mkIf cfg.enable imp;
- };
-
- api = {
- enable = mkEnableOption "Enable go url shortener";
- port = mkOption {
- type = types.str;
- default = "1337";
- description = "on which port go should run on";
- };
- redisKeyPrefix = mkOption {
- type = types.str;
- default = "go:";
- description = "change the Redis key prefix which defaults to `go:`";
- };
- };
-
- imp = {
- users.extraUsers.go = {
- name = "go";
- uid = 42774411; #genid go
- description = "go url shortener user";
- home = "/var/lib/go";
- createHome = true;
- };
-
- systemd.services.go = {
- description = "go url shortener";
- after = [ "network.target" ];
- wantedBy = [ "multi-user.target" ];
-
- path = with pkgs; [
- go
- ];
-
- environment = {
- PORT = cfg.port;
- REDIS_KEY_PREFIX = cfg.redisKeyPrefix;
- };
-
- restartIfChanged = true;
-
- serviceConfig = {
- User = "go";
- Restart = "always";
- ExecStart = "${pkgs.go}/bin/go";
- };
- };
- };
-
-in out