From e8b15338a69828c654ed223f5b08681e5de73cfc Mon Sep 17 00:00:00 2001 From: Jason Staten Date: Thu, 10 Nov 2022 20:22:45 -0700 Subject: [PATCH] cornflakes --- flake.lock | 42 ++++++++++++++++++++++++++++++++++++++++++ flake.nix | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..f9c9f08 --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1667991831, + "narHash": "sha256-DHgEsLZI044B9T4AjA3K6+yB9/DqLr4dyA7OIx0FG7o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "872fceeed60ae6b7766cc0a4cd5bf5901b9098ec", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..9415af2 --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "honk"; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, utils }: + utils.lib.eachDefaultSystem (system: + let + lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101"; + version = builtins.substring 0 8 lastModifiedDate; + + pkgs = import nixpkgs { + inherit system; + overlays = [ + (final: prev: { + go = prev.go_1_19; + buildGoModule = prev.buildGo118Module; + }) + ]; + }; + + in { + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ go gopls gotools go-tools golangci-lint]; + }; + + defaultPackage = pkgs.buildGoModule { + pname = "honk"; + inherit version; + + src = ./.; + + vendorSha256 = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="; + }; + }); +}