refactor file structure
This commit is contained in:
39
hosts/freun.dev/workout-tracker.nix
Normal file
39
hosts/freun.dev/workout-tracker.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
fqdn = "fit.freun.dev";
|
||||
port = 3322;
|
||||
version = "2.0.3";
|
||||
in
|
||||
{
|
||||
services.workout-tracker = {
|
||||
enable = true;
|
||||
inherit port;
|
||||
package = pkgs.stdenv.mkDerivation {
|
||||
name = "workout-tracker";
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/jovandeginste/workout-tracker/releases/download/v${version}/workout-tracker-v${version}-linux-amd64.tar.gz";
|
||||
hash = "sha256-kcchO+7HQwmpYRXqrTtyHWDqy7DkKugO+PJRucboycE=";
|
||||
};
|
||||
nativeBuildInputs = [
|
||||
pkgs.autoPatchelfHook
|
||||
];
|
||||
sourceRoot = ".";
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -m755 -D workout-tracker $out/bin/workout-tracker
|
||||
runHook postInstall
|
||||
'';
|
||||
meta = with pkgs.lib; {
|
||||
description = "A simple workout tracker";
|
||||
license = licenses.mit;
|
||||
mainProgram = "workout-tracker";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.caddy.virtualHosts = {
|
||||
"${fqdn}".extraConfig = ''
|
||||
reverse_proxy localhost:${toString port}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user