gnocchi.nix (753B)
1 { config, pkgs, username, domain, ... }: 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 = "${username}"; 13 WorkingDirectory = "/home/${username}/vault/src/gnocchi"; 14 ExecStart = "${pkgs.go}/bin/go run . -f /home/${username}/vault/src/blog.${domain}/content/weight.md -p 9090"; 15 Restart = "on-failure"; 16 RestartSec = "5s"; 17 }; 18 19 environment = { 20 HOME = "/home/${username}"; 21 GOPATH = "/home/${username}/go"; 22 }; 23 24 path = with pkgs; [ 25 "/run/current-system/sw" # find blog-weight script here 26 gcc 27 go 28 ]; 29 30 }; 31 32 }