From be6484860a458603856326837b74d88f6bcce6e2 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Fri, 14 Jul 2023 13:43:13 +0200 Subject: [PATCH] add nix flake --- flake.lock | 36 ++++++++++++++++++++++++++++++++++++ flake.nix | 22 ++++++++++++++++++++++ shell.nix | 2 +- 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6192448 --- /dev/null +++ b/flake.lock @@ -0,0 +1,36 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 0, + "narHash": "sha256-vSow/PEBkTy1PVpQ0Fzbv1gvGvkiGjL2d0CdOuKXRSs=", + "path": "/nix/store/dwq5hv2npvfprfmzss867d3nfd4nl1gh-source", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 0, + "narHash": "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=", + "path": "/nix/store/g1pv78p6lk92hjzr7syrcihvj4rx1fnz-source", + "type": "path" + }, + "original": { + "id": "systems", + "type": "indirect" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..78297f9 --- /dev/null +++ b/flake.nix @@ -0,0 +1,22 @@ +{ + description = "manifestor"; + + outputs = { self, nixpkgs, systems }: + let + eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system}); + in + { + packages = eachSystem (pkgs: { + default = pkgs.buildGoModule { + pname = "manifestor"; + version = "0"; + src = ./.; + vendorHash = "sha256-yTBPCTuZvrnBJnSjqP1KlOwK9lFoq5YllGyGrWCwJOw="; + }; + }); + + devShells = eachSystem (pkgs: { + default = import ./shell.nix { inherit pkgs; }; + }); + }; +} diff --git a/shell.nix b/shell.nix index 34668cb..b3aaa5e 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,4 @@ -let pkgs = import { }; in +{ pkgs ? import }: pkgs.mkShell { packages = [ pkgs.gcc