diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8a9dddb --- /dev/null +++ b/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1699923567, + "narHash": "sha256-oVMICs/4eZdIkbZvKs/JZe0SwrON/2d5veuwhBOrnmE=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5d6c73222280b7f69109dfa5c9572f4b74c3453c", + "type": "github" + }, + "original": { + "owner": "nixos", + "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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..567f4b5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +{ + description = "git-age"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { + self, + flake-utils, + nixpkgs, + }: + flake-utils.lib.eachDefaultSystem ( + system: let + pkgs = nixpkgs.legacyPackages.${system}; + git-age = pkgs.buildGoModule rec { + pname = "git-age"; + version = "0.0.3"; + + src = ./.; + + vendorHash = "sha256-W+WDMGyKQaHSsPLg1sVsHCmu087Cu0y7hq0f4uaVDqA="; + + ldflags = [ + "-s" + "-w" + "-X=go.jolheiser.com/git-age/cmd.version=${version}" + ]; + + doCheck = false; + + meta = with pkgs.lib; { + description = ""; + homepage = "https://git.jojodev.com/jolheiser/git-age"; + license = licenses.mpl20; + maintainers = with maintainers; [jolheiser]; + mainProgram = "git-age"; + }; + }; + in { + packages.default = git-age; + } + ); +}