From e0f240a3d99f038f5c8a63676cc4f0ea99014e77 Mon Sep 17 00:00:00 2001 From: Gregor Pogacnik <1640719+fiksn@users.noreply.github.com> Date: Tue, 18 Jan 2022 20:06:04 +0100 Subject: [PATCH] Nix flake support --- flake.lock | 42 ++++++++++++++++++++++++++++++++++++++++++ flake.nix | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 76 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..c8a0e9a --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1638122382, + "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1642530650, + "narHash": "sha256-AWO+GS6I1gEzTk1PFXuLhfBTIoSiKVZufnhb45U2aPw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "d3a146c2ec9c1dae66d11d1cd45052e5a9fde9c5", + "type": "github" + }, + "original": { + "owner": "nixos", + "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..141113b --- /dev/null +++ b/flake.nix @@ -0,0 +1,34 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + rec { + packages = flake-utils.lib.flattenTree { + satdress = pkgs.buildGoModule { + pname = "satdress"; + version = "v0.5.0"; + src = self; + + vendorSha256 = "0xz93pmpvqg3wa9ixs7hkaqgmybnqgllf2991nrabkall1dckamh"; + }; + }; + + defaultPackage = packages.satdress; + + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ go packages.satdress ]; + + shellHook = '' + echo "Dev shell ready" + ''; + }; + + }); +}