chore: add Nix flake dev shell + package (Go 1.24, Node 20, golangci-lint, goreleaser)
Some checks failed
docs / publish-docs (push) Failing after 54s
test / test (push) Failing after 2m31s
build / build (push) Failing after 2m34s

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Mikael Hugo 2026-05-10 23:24:06 +02:00
parent 802c0a4c30
commit 87adfc1242
2 changed files with 132 additions and 0 deletions

61
flake.lock generated Normal file
View file

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1778003029,
"narHash": "sha256-q/nkKLDtHIyLjZpKhWk3cSK5IYsFqtMd6UtXF3ddjgA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0c88e1f2bdb93d5999019e99cb0e61e1fe2af4c5",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

71
flake.nix Normal file
View file

@ -0,0 +1,71 @@
{
description = "CentralCloud ntfy server fork push notification backend for oncall alerts";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
flake-utils.url = "github:numtide/flake-utils";
};
nixConfig = {
extra-substituters = [
"https://cache.centralcloud.com/default"
];
extra-trusted-public-keys = [
"default:ywfU21WX06iOn2Ec2lae1jYh4w8LO4IQkmp06vJzsk8="
];
};
outputs = {
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
go_1_24
gotools # goimports, godoc, etc.
golangci-lint
goreleaser
# Frontend (web UI)
nodejs_20
nodePackages.npm
# Dev tooling
gnumake
git
curl
jq
];
shellHook = ''
export GOPATH="$HOME/go"
export PATH="$GOPATH/bin:$PATH"
echo "CentralCloud ntfy server dev shell"
echo " go : $(go version)"
echo " node : $(node --version)"
echo ""
echo "Run: go run main.go serve"
echo "Build: make build"
echo "Test: go test ./..."
'';
};
packages.default = pkgs.buildGoModule {
pname = "ntfy";
version = "2.22.0";
src = ./.;
vendorHash = null;
doCheck = false;
meta = {
description = "Send push notifications to your phone or desktop via PUT/POST";
homepage = "https://ntfy.sh";
license = pkgs.lib.licenses.asl20;
mainProgram = "ntfy";
};
};
});
}