home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 15be059c0e3ae1405d80aedb6edfcbfdd1c8d4a2
parent 878f16fc075ef2fbcc1a02cd207f07fe08697c99
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Mon, 20 Apr 2020 18:30:33 +0200

Add govanity service module and enable on kerkouane

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Mtmp/nixos-configuration/machine/kerkouane.nix | 21+++++++++++++++++++++
Mtmp/nixos-configuration/modules/module-list.nix | 1+
Atmp/nixos-configuration/modules/services/govanityurl.nix | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/tmp/nixos-configuration/machine/kerkouane.nix b/tmp/nixos-configuration/machine/kerkouane.nix @@ -23,6 +23,22 @@ with import ../assets/machines.nix; { }; }; services = { + govanityurl = { + enable = true; + user = "nginx"; + host = "pkg.sbr.pm"; + config = '' + paths: + /ape: + repo: https://github.com/vdemeester/ape + /nr: + repo: https://github.com/vdemeester/nr + /ram: + repo: https://github.com/vdemeester/ram + /sec: + repo: https://github.com/vdemeester/sec + ''; + }; nginx = { enable = true; virtualHosts."dl.sbr.pm" = { @@ -41,6 +57,11 @@ with import ../assets/machines.nix; { index = "index.html"; }; }; + virtualHosts."go.sbr.pm" = { + enableACME = true; + forceSSL = true; + locations."/" = { proxyPass = "http://127.0.0.1:8080"; }; + }; virtualHosts."sbr.pm" = { enableACME = true; forceSSL = true; diff --git a/tmp/nixos-configuration/modules/module-list.nix b/tmp/nixos-configuration/modules/module-list.nix @@ -32,6 +32,7 @@ ./profiles/zsh.nix ./programs/podman.nix ./services/athens.nix + ./services/govanityurl.nix ./services/nix-binary-cache.nix ./services/wireguard.client.nix ./virtualisation/buildkit.nix diff --git a/tmp/nixos-configuration/modules/services/govanityurl.nix b/tmp/nixos-configuration/modules/services/govanityurl.nix @@ -0,0 +1,54 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.services.govanityurl; +in +{ + options = { + services.govanityurl = { + enable = mkEnableOption '' + govanityurl is a go canonical path server + ''; + package = mkOption { + type = types.package; + default = pkgs.nur.repos.vdemeester.govanityurl; + description = '' + govanityurl package to use. + ''; + }; + + user = mkOption { + type = types.str; + }; + + host = mkOption { + type = types.str; + }; + + config = mkOption { + type = types.lines; + }; + }; + }; + config = mkIf cfg.enable { + systemd.packages = [ cfg.package ]; + environment.etc."govanityurl/config.yaml".text = '' + host: ${cfg.host} + ${cfg.config} + ''; + systemd.services.athens = { + description = "Govanity service"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + User = cfg.user; + Restart = "on-failure"; + ExecStart = '' + ${cfg.package}/bin/govanityurl /etc/govanityurl/config.yaml + ''; + }; + path = [ cfg.package ]; + }; + }; +}