summaryrefslogtreecommitdiffstats
path: root/lass/3modules/go.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2015-12-20 19:37:46 +0100
committertv <tv@krebsco.de>2015-12-20 19:37:46 +0100
commitc89907175546aa0c39bc6b2c4960f0ea6e6db8c9 (patch)
tree158bf1a5938fc37efc466b00b3f0906ac2a50d9f /lass/3modules/go.nix
parentc09bc6a29f21f1c6bd21575e385b8b3bc5c89b8a (diff)
parent5821d8438578db623a3e248c52fefa424fad0b51 (diff)
Merge remote-tracking branch 'gum/master'
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 aa900f118..000000000
--- 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