diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000000..88ab73fdd9 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1773282481, + "narHash": "sha256-b/GV2ysM8mKHhinse2wz+uP37epUrSE+sAKXy/xvBY4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fe416aaedd397cacb33a610b33d60ff2b431b127", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000000..182db9ee3c --- /dev/null +++ b/flake.nix @@ -0,0 +1,50 @@ +{ + description = "Tekton Results - API for storing Tekton task and pipeline results"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + + mkGoCmd = name: subPath: + pkgs.buildGoModule { + pname = name; + version = "0.0.0-dev"; + src = ./.; + vendorHash = null; + subPackages = [ subPath ]; + }; + in + { + packages.${system} = { + api = mkGoCmd "tekton-results-api" "cmd/api"; + watcher = mkGoCmd "tekton-results-watcher" "cmd/watcher"; + retention-policy-agent = mkGoCmd "tekton-results-retention-policy-agent" "cmd/retention-policy-agent"; + tkn-results = mkGoCmd "tkn-results" "cmd/tkn-results"; + default = self.packages.${system}.api; + }; + + checks.${system} = { + api = self.packages.${system}.api; + watcher = self.packages.${system}.watcher; + retention-policy-agent = self.packages.${system}.retention-policy-agent; + tkn-results = self.packages.${system}.tkn-results; + }; + + devShells.${system} = { + default = pkgs.mkShell { + buildInputs = [ + pkgs.go + pkgs.gopls + pkgs.protobuf + pkgs.protoc-gen-go + pkgs.protoc-gen-go-grpc + ]; + }; + }; + }; +}