gnocchi.nix (748B)
1 { config, pkgs, vars, ... }: 2 3 { 4 # Systemd service 5 systemd.services.gnocchi = { 6 description = "Gnocchi Go Application"; 7 wantedBy = [ "multi-user.target" ]; 8 after = [ "network.target" ]; 9 10 serviceConfig = { 11 Type = "simple"; 12 User = "${vars.user.username}"; 13 WorkingDirectory = "/home/${vars.user.username}/vault/src/gnocchi"; 14 ExecStart = "${pkgs.go}/bin/go run . -f /home/${vars.user.username}/vault/src/blog.${vars.user.domain}/content/weight.md -p 9090"; 15 Restart = "on-failure"; 16 RestartSec = "5s"; 17 }; 18 19 environment = { 20 HOME = "/home/${vars.user.username}"; 21 GOPATH = "/home/${vars.user.username}/go"; 22 }; 23 24 path = with pkgs; [ "/run/current-system/sw" gcc go ]; 25 26 }; 27 28 }