diff --git a/.gitignore b/.gitignore index 5399d67..26d8d23 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..70b4a6b --- /dev/null +++ b/flake.lock @@ -0,0 +1,44 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1652776076, + "narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8", + "type": "github" + }, + "original": { + "owner": "numtide", + "ref": "v1.0.0", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1667050928, + "narHash": "sha256-xOn0ZgjImIyeecEsrjxuvlW7IW5genTwvvnDQRFncB8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "fdebb81f45a1ba2c4afca5fd9f526e1653ad0949", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7d83984 --- /dev/null +++ b/flake.nix @@ -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 + ]; + }; + }; + } + ); +} \ No newline at end of file