feat: add nix flake

This commit is contained in:
Technofab 2023-05-23 18:30:41 +02:00
parent 5eb92a0677
commit 43de744f09
No known key found for this signature in database
GPG key ID: A0AA746B951C8830
2 changed files with 75 additions and 0 deletions

34
flake.nix Normal file
View file

@ -0,0 +1,34 @@
{
description = "A jsonnet package manager";
inputs.nixpkgs.url = "nixpkgs/nixos-22.11";
outputs = { self, nixpkgs, systems }:
let
version = "0.5.1";
forEachSystem = nixpkgs.lib.genAttrs (import systems);
nixpkgsFor = forEachSystem (system: import nixpkgs { inherit system; });
in {
# Provide some binary packages for selected system types.
packages = forEachSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in {
jb = pkgs.buildGoModule {
pname = "jsonnet-bundler";
inherit version;
src = ./.;
CGO_ENABLED = 0;
ldflags = [ "-s" "-w" "-X main.Version=${version}" ];
vendorSha256 = "sha256-5a+8emtKjOlSr4V9P2YW5u0FVy9to5rIVfF9i90BCe4=";
doCheck = false;
};
}
);
defaultPackage = forEachSystem (system: self.packages.${system}.jb);
};
}