move server code to cmd/server
Alan Pearce alan@alanpearce.eu
Sun, 21 Apr 2024 14:00:47 +0200
3 files changed, 6 insertions(+), 6 deletions(-)
M nix/default.nix → nix/default.nix
@@ -14,7 +14,7 @@ (pkgs.writeTextDir "config.toml" (builtins.readFile ./../config.toml)) public ]; config = { - Cmd = [ "${server}/bin/website" ]; + Cmd = [ "${server}/bin/server" ]; Env = [ "PRODUCTION=true" "LISTEN_ADDRESS=::" @@ -39,7 +39,7 @@ root = ./..; fileset = unions [ ./../go.mod ./../go.sum - ./../cmd + ./../cmd/build ./../internal ]; }; @@ -61,7 +61,7 @@ } '' ${builder}/bin/build -s $src -d $out/public ''; server = buildGoApplication { - pname = "website"; + pname = "server"; inherit version; CGO_ENABLED = 0; src = with lib.fileset; toSource { @@ -69,7 +69,7 @@ root = ./..; fileset = unions [ ./../go.mod ./../go.sum - ./../server.go + ./../cmd/server ./../internal ]; };
M nix/scripts.nix → nix/scripts.nix
@@ -16,10 +16,10 @@ image = system: "nix build ${(mkAttr "image") system}"; in with pkgs; [ (writeShellScriptBin "watch-builder" '' - ${watchFlake} "direnv exec . watchexec -i server.go -i public -r go run ./cmd/build $@" + ${watchFlake} "direnv exec . watchexec -i cmd/server -i public -r go run ./cmd/build $@" '') (writeShellScriptBin "watch-server" '' - ${watchFlake} "direnv exec . watchexec -r go run ./server.go $@" + ${watchFlake} "direnv exec . watchexec -r go run ./cmd/server $@" '') (writeShellScriptBin "check-licenses" '' ${go-licenses}/bin/go-licenses check --include_tests ./... --disallowed_types=restricted,forbidden