diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..e79286f8 --- /dev/null +++ b/flake.lock @@ -0,0 +1,41 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1594123299, + "narHash": "sha256-zxjtMmOV93pIVG242RpEXu14w/13XYDo3ygMoRIJg4c=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "590d6d1badea1956a31480a0cba1d8d029cf45d3", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1595189225, + "narHash": "sha256-wK3GBjGNi4hUt4pvltubcUcDhyarECKtFxWLxO4gcg4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1c26e6baecd8a71e4d41ff0eb3c81ce3c05136c3", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "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 00000000..b22958fb --- /dev/null +++ b/flake.nix @@ -0,0 +1,30 @@ +{ + + description = "Kubernetes object analysis with recommendations for improved reliability and security"; + + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = import nixpkgs { inherit system; }; in + rec { + packages.kube-score = pkgs.buildGoModule { + name = "kube-score"; + src = self; + vendorSha256 = "sha256-E9pcJsnoF/SKRCjrHZY8Ybd8kV1F3FYwdnLJ0mHyRLA="; # master + # vendorSha256 = "sha256-COY4AonAvJhH+io6Z7I9CsK1pnsK/Yi248QMkVPK6u0="; # v1.7.2 + buildFlagsArray = '' + -ldflags= + -w -s + -X main.version=rolling + -X main.commit=${if self ? rev then self.rev else "dirty"} + -X main.date=${self.lastModifiedDate} + -X main.builtBy=nix + ''; + }; + defaultPackage = packages.kube-score; + apps.kube-score = flake-utils.lib.mkApp { drv = packages.kube-score; }; + defaultApp = apps.kube-score; + } + ); +}