add a nix flake for this project (#8)

This commit is contained in:
Jim Clark
2023-04-18 09:42:28 -07:00
committed by GitHub
parent c8635d37fa
commit 4f77f40fb2
2 changed files with 93 additions and 0 deletions

61
flake.lock generated Normal file
View File

@@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1681762469,
"narHash": "sha256-RYdEbufT7G+NKu/Gdz/XVCXprtzQid9eBKTQqBG1aM4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f25d4846d7a12a4d9d008aec86742d238b3b13c8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-22.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
}

32
flake.nix Normal file
View File

@@ -0,0 +1,32 @@
{
description = "Docker Pod";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-22.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [ go gotools golangci-lint gopls gopkgs go-outline ];
};
packages = {
default = pkgs.buildGoModule {
pname = "babashka-pod-docker";
version = "0.0.1";
src = ./.;
vendorSha256 = "sha256-KUWqddPcv+hLStd7JEzQBUiGLPLYwfmyVoG1BtaHWXY=";
postInstall = ''
mv $out/bin/parser $out/bin/babashka-pod-docker
'';
};
};
});
}