From b502b21c7e90327bfc9a4d1e6a54d6a60dd86f45 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Fri, 29 Jul 2022 00:29:33 +0200 Subject: [PATCH] Add Dhall env --- README.md | 3 +++ dhall/.envrc | 1 + dhall/flake.lock | 42 ++++++++++++++++++++++++++++++++++++++++++ dhall/flake.nix | 40 ++++++++++++++++++++++++++++++++++++++++ gleam/flake.lock | 6 +++--- go1.17/flake.lock | 6 +++--- go1.18/flake.lock | 6 +++--- java/flake.lock | 6 +++--- nix/flake.lock | 6 +++--- nix/flake.nix | 3 ++- node/flake.lock | 6 +++--- rust/flake.lock | 6 +++--- scala/flake.lock | 6 +++--- zig/flake.lock | 6 +++--- 14 files changed, 115 insertions(+), 28 deletions(-) create mode 100644 dhall/.envrc create mode 100644 dhall/flake.lock create mode 100644 dhall/flake.nix diff --git a/README.md b/README.md index daa682e..e0cff09 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # Nix flake templates for easy dev environments ```shell +# Dhall +nix flake init --template github:the-nix-way/dev-templates#dhall + # Elixir nix flake init --template github:the-nix-way/dev-templates#elixir diff --git a/dhall/.envrc b/dhall/.envrc new file mode 100644 index 0000000..a5dbbcb --- /dev/null +++ b/dhall/.envrc @@ -0,0 +1 @@ +use flake . diff --git a/dhall/flake.lock b/dhall/flake.lock new file mode 100644 index 0000000..d88584a --- /dev/null +++ b/dhall/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "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": 1659047146, + "narHash": "sha256-2qZemVRDR5oCw0Hd32LQSWC7FaEy5sUp5ih9OxqE3yU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "68716026a095a765c09ec29f06ba234a0298418c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/dhall/flake.nix b/dhall/flake.nix new file mode 100644 index 0000000..f8debf3 --- /dev/null +++ b/dhall/flake.nix @@ -0,0 +1,40 @@ +{ + description = "A Nix-flake-based Dhall development environment"; + + 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 = import nixpkgs { inherit system; }; + dhall = pkgs.dhall; + + inherit (pkgs.lib) optionals; + inherit (pkgs.stdenv) isLinux; + + otherFormats = with pkgs.haskellPackages; [ + dhall-bash + dhall-docs + dhall-lsp-server + dhall-nix + dhall-json + dhall-toml + dhall-yaml + ] ++ optionals isLinux (with pkgs.haskellPackages; [ dhall-csv dhall-haskell ]); + + inherit (pkgs) mkShell; + in { + devShells = { + default = pkgs.mkShell { + buildInputs = [ dhall ] ++ otherFormats; + + shellHook = '' + echo "dhall `${dhall}/bin/dhall --version`" + ''; + }; + }; + }); +} diff --git a/gleam/flake.lock b/gleam/flake.lock index de65a66..d88584a 100644 --- a/gleam/flake.lock +++ b/gleam/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659045899, - "narHash": "sha256-/vNGtQG19phpMfvkgNtOvSNkG2+na56wMlP/JEOaIjc=", + "lastModified": 1659047146, + "narHash": "sha256-2qZemVRDR5oCw0Hd32LQSWC7FaEy5sUp5ih9OxqE3yU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a9fb3ea0e746226a8bed539854f44ba87df03909", + "rev": "68716026a095a765c09ec29f06ba234a0298418c", "type": "github" }, "original": { diff --git a/go1.17/flake.lock b/go1.17/flake.lock index de65a66..d88584a 100644 --- a/go1.17/flake.lock +++ b/go1.17/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659045899, - "narHash": "sha256-/vNGtQG19phpMfvkgNtOvSNkG2+na56wMlP/JEOaIjc=", + "lastModified": 1659047146, + "narHash": "sha256-2qZemVRDR5oCw0Hd32LQSWC7FaEy5sUp5ih9OxqE3yU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a9fb3ea0e746226a8bed539854f44ba87df03909", + "rev": "68716026a095a765c09ec29f06ba234a0298418c", "type": "github" }, "original": { diff --git a/go1.18/flake.lock b/go1.18/flake.lock index de65a66..d88584a 100644 --- a/go1.18/flake.lock +++ b/go1.18/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659045899, - "narHash": "sha256-/vNGtQG19phpMfvkgNtOvSNkG2+na56wMlP/JEOaIjc=", + "lastModified": 1659047146, + "narHash": "sha256-2qZemVRDR5oCw0Hd32LQSWC7FaEy5sUp5ih9OxqE3yU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a9fb3ea0e746226a8bed539854f44ba87df03909", + "rev": "68716026a095a765c09ec29f06ba234a0298418c", "type": "github" }, "original": { diff --git a/java/flake.lock b/java/flake.lock index de65a66..d88584a 100644 --- a/java/flake.lock +++ b/java/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659045899, - "narHash": "sha256-/vNGtQG19phpMfvkgNtOvSNkG2+na56wMlP/JEOaIjc=", + "lastModified": 1659047146, + "narHash": "sha256-2qZemVRDR5oCw0Hd32LQSWC7FaEy5sUp5ih9OxqE3yU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a9fb3ea0e746226a8bed539854f44ba87df03909", + "rev": "68716026a095a765c09ec29f06ba234a0298418c", "type": "github" }, "original": { diff --git a/nix/flake.lock b/nix/flake.lock index de65a66..d88584a 100644 --- a/nix/flake.lock +++ b/nix/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659045899, - "narHash": "sha256-/vNGtQG19phpMfvkgNtOvSNkG2+na56wMlP/JEOaIjc=", + "lastModified": 1659047146, + "narHash": "sha256-2qZemVRDR5oCw0Hd32LQSWC7FaEy5sUp5ih9OxqE3yU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a9fb3ea0e746226a8bed539854f44ba87df03909", + "rev": "68716026a095a765c09ec29f06ba234a0298418c", "type": "github" }, "original": { diff --git a/nix/flake.nix b/nix/flake.nix index 27edfd1..bf66139 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -12,8 +12,9 @@ pkgs = import nixpkgs { inherit system; }; nix = pkgs.nixUnstable; + dhallNix = pkgs.haskellPackages.dhall-nix; - helpers = with pkgs; [ cachix lorri nixfmt nixpkgs-fmt niv statix ]; + helpers = with pkgs; [ cachix dhallNix lorri niv nixfmt nixpkgs-fmt statix ]; inherit (pkgs) mkShell; in { diff --git a/node/flake.lock b/node/flake.lock index de65a66..d88584a 100644 --- a/node/flake.lock +++ b/node/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659045899, - "narHash": "sha256-/vNGtQG19phpMfvkgNtOvSNkG2+na56wMlP/JEOaIjc=", + "lastModified": 1659047146, + "narHash": "sha256-2qZemVRDR5oCw0Hd32LQSWC7FaEy5sUp5ih9OxqE3yU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a9fb3ea0e746226a8bed539854f44ba87df03909", + "rev": "68716026a095a765c09ec29f06ba234a0298418c", "type": "github" }, "original": { diff --git a/rust/flake.lock b/rust/flake.lock index 01c5a24..aa40f7f 100644 --- a/rust/flake.lock +++ b/rust/flake.lock @@ -32,11 +32,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659045899, - "narHash": "sha256-/vNGtQG19phpMfvkgNtOvSNkG2+na56wMlP/JEOaIjc=", + "lastModified": 1659047146, + "narHash": "sha256-2qZemVRDR5oCw0Hd32LQSWC7FaEy5sUp5ih9OxqE3yU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a9fb3ea0e746226a8bed539854f44ba87df03909", + "rev": "68716026a095a765c09ec29f06ba234a0298418c", "type": "github" }, "original": { diff --git a/scala/flake.lock b/scala/flake.lock index de65a66..d88584a 100644 --- a/scala/flake.lock +++ b/scala/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659045899, - "narHash": "sha256-/vNGtQG19phpMfvkgNtOvSNkG2+na56wMlP/JEOaIjc=", + "lastModified": 1659047146, + "narHash": "sha256-2qZemVRDR5oCw0Hd32LQSWC7FaEy5sUp5ih9OxqE3yU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a9fb3ea0e746226a8bed539854f44ba87df03909", + "rev": "68716026a095a765c09ec29f06ba234a0298418c", "type": "github" }, "original": { diff --git a/zig/flake.lock b/zig/flake.lock index de65a66..d88584a 100644 --- a/zig/flake.lock +++ b/zig/flake.lock @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659045899, - "narHash": "sha256-/vNGtQG19phpMfvkgNtOvSNkG2+na56wMlP/JEOaIjc=", + "lastModified": 1659047146, + "narHash": "sha256-2qZemVRDR5oCw0Hd32LQSWC7FaEy5sUp5ih9OxqE3yU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a9fb3ea0e746226a8bed539854f44ba87df03909", + "rev": "68716026a095a765c09ec29f06ba234a0298418c", "type": "github" }, "original": {