From 0580070f86ea64fd5e21ae1a212f25a3caf8b3e7 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 13 Nov 2015 00:50:02 +0100 Subject: l 3 go: activate redis via mkDefault --- lass/3modules/go.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lass/3modules/go.nix') diff --git a/lass/3modules/go.nix b/lass/3modules/go.nix index aa900f118..b83d2e5a1 100644 --- a/lass/3modules/go.nix +++ b/lass/3modules/go.nix @@ -26,6 +26,11 @@ let }; imp = { + services.redis = { + enable = mkDefault true; + bind = mkDefault "127.0.0.1"; + }; + users.extraUsers.go = { name = "go"; uid = 42774411; #genid go -- cgit v1.2.3 From 58eab5df691efd6933063ba1ec9278cd940a1ba1 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 13 Nov 2015 01:16:15 +0100 Subject: l 3 go -> k 3 go --- lass/3modules/go.nix | 66 ---------------------------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 lass/3modules/go.nix (limited to 'lass/3modules/go.nix') diff --git a/lass/3modules/go.nix b/lass/3modules/go.nix deleted file mode 100644 index b83d2e5a1..000000000 --- a/lass/3modules/go.nix +++ /dev/null @@ -1,66 +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 = { - services.redis = { - enable = mkDefault true; - bind = mkDefault "127.0.0.1"; - }; - - 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 -- cgit v1.2.3