Files
allmende/nix/package.nix
T
nilsandClaude Sonnet 5.5 20ea9b32f7 Add e2e script to the repo, Dockerfile, and a Nix flake with a NixOS module
- scripts/e2e.sh (+ scripts/e2e/*.ts): the two-node end-to-end test, now
  self-contained and cleaning up after itself; `make e2e`, part of `make check`
- Dockerfile/.dockerignore: static Go build in a non-root alpine image, data in
  /data, defaults to region u1j; `make docker`
- flake.nix, nix/: package (buildGoModule), dev shell, NixOS module
  services.allmende (hardened systemd unit that waits for `allmende-admin init`),
  and a NixOS VM test run by `nix flake check`
- README: running a node with Docker and NixOS

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 21:21:21 +01:00

46 lines
1.0 KiB
Nix

{
lib,
buildGoModule,
version,
}:
buildGoModule {
pname = "allmende";
inherit version;
# Only what the Go build reads, so editing docs or tests does not rebuild.
# web/dist is the pre-built UI that the binary embeds.
src = lib.fileset.toSource {
root = ../.;
fileset = lib.fileset.unions [
../go.mod
../go.sum
../cmd
../internal
../web/embed.go
../web/dist
];
};
# Changes whenever go.mod or go.sum do: set it to lib.fakeHash, build, and
# copy the hash from the error.
vendorHash = "sha256-vUBmsqyS+/qXo3UDYzZmZQYik7rMhOrX7csy56UJbLU=";
subPackages = [ "cmd/allmende" ];
env.CGO_ENABLED = "0";
ldflags = [
"-s"
"-w"
];
# The tests start libp2p nodes and need loopback networking and mDNS, which
# the build sandbox does not give. `make test` runs them.
doCheck = false;
meta = {
description = "A free, distributed marketplace for buying, selling and renting";
license = lib.licenses.agpl3Only;
mainProgram = "allmende";
};
}