summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Rinehart <john.rinehart@ardanlabs.com>2021-05-12 15:44:23 +0300
committerJohn Rinehart <john.rinehart@ardanlabs.com>2021-05-12 15:44:23 +0300
commitcf6708279cbcd9a1ac4f234fc53b6ece8bf63b3f (patch)
tree4f938666fe5a23cb121ad83ef59be8c004c4abb7
parent75e758546d0679f4ce5b562625e3de21b45561f1 (diff)
feat: add nix build files (flakes==experimental, default==legacy)
-rw-r--r--default.nix25
-rw-r--r--flake.lock43
-rw-r--r--flake.nix23
3 files changed, 91 insertions, 0 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..3cf4137
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,25 @@
+{ pkgs ? (import <nixpkgs> {}), lib ? (import <nixpkgs/lib>), system ? builtins.currentSystem }:
+
+assert lib.versionAtLeast pkgs.go.version "1.14";
+
+pkgs.buildGoModule rec {
+ name = "wally-cli";
+ version = "v2.0.0";
+
+ src = ./.;
+
+ vendorSha256 = "HffgkuKmaOjTYi+jQ6vBlC50JqqbYiikURT6TCqL7e0=";
+
+ subPackages = [ "." ];
+
+ buildInputs = with pkgs; [ libusb1 ];
+ nativeBuildInputs = with pkgs; [ pkg-config ];
+
+ meta = with lib; {
+ description = "Flash your ZSA Keyboard the EZ way.";
+ homepage = "https://github.com/zsa/wally-cli";
+ license = licenses.mit;
+ maintainers = [ johnrichardrinehart ];
+ platforms = platforms.linux ++ platforms.darwin;
+ };
+} \ No newline at end of file
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..1d945d2
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,43 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "locked": {
+ "lastModified": 1620759905,
+ "narHash": "sha256-WiyWawrgmyN0EdmiHyG2V+fqReiVi8bM9cRdMaKQOFg=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "b543720b25df6ffdfcf9227afafc5b8c1fabfae8",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1620808985,
+ "narHash": "sha256-cf/+g1RVawT0rcKmfh2nf/lgnSrj9YZS+1PkCFmoeJQ=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "327368f98c6a927a84aed3c2f2fd1a7f6983e855",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "release-20.09",
+ "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..11f4e7f
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,23 @@
+{
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs/release-20.09";
+ flake-utils.url = "github:numtide/flake-utils";
+ };
+
+
+ outputs = inputs:
+ let
+ inherit (inputs.flake-utils.lib) eachDefaultSystem flattenTree mkApp;
+ in
+ eachDefaultSystem (system:
+ let
+ pkgs = inputs.nixpkgs.legacyPackages.${system};
+ lib = inputs.nixpkgs.lib;
+ in
+ rec {
+ defaultPackage = (import ./default.nix) {
+ inherit pkgs lib system;
+ };
+ }
+ );
+}