From 1a719d0597dcdb8eb5d57051eeed799e876e96bb Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sat, 18 Jul 2020 00:13:26 -0500 Subject: [PATCH] chore: package as nix flake --- flake.lock | 41 +++++++++++++++++++++++++++++++++++++++++ flake.nix | 22 ++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..bc361e3a --- /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": 1595039835, + "narHash": "sha256-yt9utM5EEjfz0sEip6c0HHY0f0YCfUjQbWOMhrVgSmo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0ae51edb29dc6aa5f86c1e3686047032818af089", + "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..0b70c51a --- /dev/null +++ b/flake.nix @@ -0,0 +1,22 @@ +{ + + 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 + }; + defaultPackage = packages.kube-score; + apps.kube-score = flake-utils.lib.mkApp { drv = packages.kube-score; }; + defaultApp = apps.kube-score; + } + ); +}