From dd808711cebc8d983afbd26c90db7f0b4fea9cc2 Mon Sep 17 00:00:00 2001 From: Nicolas Froger Date: Mon, 15 Aug 2022 23:33:26 +0200 Subject: [PATCH] add nix flake Signed-off-by: Nicolas Froger --- .envrc | 7 +++++++ flake.lock | 43 +++++++++++++++++++++++++++++++++++++++++++ flake.nix | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..ab2f82b --- /dev/null +++ b/.envrc @@ -0,0 +1,7 @@ +use_configsh() { + watch_file config.sh + eval "$(cat config.sh)" +} + +use_flake +use_configsh diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..20ff1ea --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "futils": { + "locked": { + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1659526864, + "narHash": "sha256-XFzXrc1+6DZb9hBgHfEzfwylPUSqVFJbQPs8eOgYufU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "478f3cbc8448b5852539d785fbfe9a53304133be", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-22.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "futils": "futils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..545e39d --- /dev/null +++ b/flake.nix @@ -0,0 +1,32 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05"; + futils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, futils } @ inputs: + let + inherit (nixpkgs) lib; + inherit (lib) recursiveUpdate; + inherit (futils.lib) eachDefaultSystem; + + nixpkgsImport = system: + import nixpkgs { + inherit system; + }; + + defaultSystemOutputs = eachDefaultSystem (system: + let + pkgs = nixpkgsImport system; + in + { + devShells.default = pkgs.mkShell { + buildInputs = with pkgs; [ + git + go + ]; + }; + }); + in + defaultSystemOutputs; +}