From cdad513955d5dff197e993214ee6ea3d213a7f7d Mon Sep 17 00:00:00 2001 From: Jez Cope Date: Fri, 28 May 2021 09:52:07 +0100 Subject: [PATCH] Initial commit --- .gitignore | 1 + devshell.toml | 4 ++++ envrc.sample | 2 ++ flake.lock | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 20 ++++++++++++++++++ 5 files changed, 84 insertions(+) create mode 100644 .gitignore create mode 100644 devshell.toml create mode 100644 envrc.sample create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..92b2793 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.direnv diff --git a/devshell.toml b/devshell.toml new file mode 100644 index 0000000..4b8c8bf --- /dev/null +++ b/devshell.toml @@ -0,0 +1,4 @@ +# https://numtide.github.io/devshell +[[commands]] +package = "devshell.cli" +help = "Per project developer environments" diff --git a/envrc.sample b/envrc.sample new file mode 100644 index 0000000..59d671d --- /dev/null +++ b/envrc.sample @@ -0,0 +1,2 @@ +source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/1.2.3/direnvrc" "sha256-/aHqL/6nLpHcZJcB5/7/5+mO338l28uFbq88DMfWJn4=" +use flake diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..9a27645 --- /dev/null +++ b/flake.lock @@ -0,0 +1,57 @@ +{ + "nodes": { + "devshell": { + "locked": { + "lastModified": 1622013274, + "narHash": "sha256-mK/Lv0lCbl07dI5s7tR/7nb79HunKnJik3KyR6yeI2k=", + "owner": "numtide", + "repo": "devshell", + "rev": "e7faf69e6bf8546517cc936c7f6d31c7eb3abcb2", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "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": 1622190693, + "narHash": "sha256-xSnIDR4HYljTPmgwZ942/JZTwQNidm/+uZjif4PpBmk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "69ef6e0883033bf80ce109a9f148d99539123838", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "devshell": "devshell", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..fb42e8a --- /dev/null +++ b/flake.nix @@ -0,0 +1,20 @@ +{ + description = "virtual environments"; + + inputs.devshell.url = "github:numtide/devshell"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, flake-utils, devshell, nixpkgs }: + flake-utils.lib.eachDefaultSystem (system: { + devShell = + let pkgs = import nixpkgs { + inherit system; + + overlays = [ devshell.overlay ]; + }; + in + pkgs.devshell.mkShell { + imports = [ (pkgs.devshell.importTOML ./devshell.toml) ]; + }; + }); +}