Skip to content

Commit

Permalink
Add nix flakes setup
Browse files Browse the repository at this point in the history
  • Loading branch information
catouc committed Nov 7, 2022
1 parent 82e7a47 commit d99282e
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 19 deletions.
26 changes: 7 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
bin/*

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# IDEs
.idea/
*.iml
.idea/*
.project
bin/*
.envrc
.direnv
result
out/
44 changes: 44 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils/v1.0.0";
};

description = "A small CLI to fish out the current or next semver version from a git repository";

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem ( system:
let
pkgs = nixpkgs.legacyPackages.${system};
build = pkgs.buildGoModule {
pname = "semver-go";
version = "v0.4.0";
modSha256 = pkgs.lib.fakeSha256;
vendorSha256 = null;
src = ./.;
nativeBuildInputs = [ pkgs.git ];
};
in
rec {
packages = {
semver-go = build;
default = build;
};

devShells = {
default = pkgs.mkShell {
buildInputs = [
pkgs.go
];
};
};
}
);
}

0 comments on commit d99282e

Please sign in to comment.