improve readme and nix file

This commit is contained in:
Quentin 2025-03-20 23:34:10 +01:00
parent 6a399249b5
commit 917c10737d
Signed by untrusted user: quentin
GPG key ID: E9602264D639FF68
3 changed files with 26 additions and 22 deletions

View file

@ -1,19 +0,0 @@
BIN=guichet
SRC=main.go ssha.go profile.go admin.go invite.go directory.go picture.go
DOCKER=lxpz/guichet_amd64
all: $(BIN)
$(BIN): $(SRC)
go get -d -v
go build -v -o $(BIN)
$(BIN).static: $(SRC)
go get -d -v
CGO_ENABLED=0 GOOS=linux go build -a -v -o $(BIN).static
docker: $(BIN).static
docker build -t $(DOCKER):$(TAG) .
docker push $(DOCKER):$(TAG)
docker tag $(DOCKER):$(TAG) $(DOCKER):latest
docker push $(DOCKER):latest

View file

@ -27,9 +27,23 @@ Guichet is licensed under the terms of the GPLv3.
Guichet requires go 1.13 or later.
To build Guichet, clone this repository outside of your `$GOPATH`.
Then, run `make` in the root of the repo.
Development build:
```
go build
```
Production build:
```
nix build
```
Production container:
```
docker run .#docker
```
## Configuration of Guichet

View file

@ -47,11 +47,20 @@
Entrypoint = "/bin/guichet";
};
};
docker = pkgs.writeScriptBin "guichet-docker" ''
#!/usr/bin/env bash
set -euxo pipefail
docker load <$(nix build --print-out-paths .#container)
'';
in {
packages.x86_64-linux.guichet = guichet;
packages.x86_64-linux.container = container;
packages.x86_64-linux.docker = docker;
packages.x86_64-linux.default = guichet;
devShell.x86_64-linux = pkgs.mkShell { nativeBuildInputs = [ pkgs.go pkgs.gomod2nix ]; };
};
}