Add nix flake for dev shell (#3702)

This commit is contained in:
6543 2024-05-13 20:11:09 +02:00 committed by GitHub
parent fd94a2e646
commit a700b5855e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 119 additions and 0 deletions

View file

@ -112,6 +112,8 @@
"*.excalidraw",
"*.svg",
"Makefile",
"flake.nix",
"flake.lock",
// TODO: remove the following
"CHANGELOG.md",
".woodpecker/",

76
flake.lock Normal file
View file

@ -0,0 +1,76 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"id": "flake-utils",
"type": "indirect"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1715614915,
"narHash": "sha256-O6sqpppOtlfgx6PK5bnkAvBudK1rpjP7ig0dj7HvIl0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d2ed14aa4f912254c578fc19b842f2910c9146be",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"systems": "systems_2"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"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
}

41
flake.nix Normal file
View file

@ -0,0 +1,41 @@
{
# Override nixpkgs to use the latest set of node packages
inputs.nixpkgs.url = "github:NixOS/nixpkgs/master";
inputs.systems.url = "github:nix-systems/default";
outputs =
{
self,
nixpkgs,
flake-utils,
systems,
}:
flake-utils.lib.eachSystem (import systems) (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
# generic
gnumake
gnutar
# frontend
nodejs
nodePackages.pnpm
nodePackages.typescript
nodePackages.typescript-language-server
# backend
go
gofumpt
golangci-lint
go-mockery
protobuf
];
};
}
);
}