From 7775f8a95d6356ceb10e282e15266845255fd071 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Sun, 31 Jul 2022 13:12:34 +0200 Subject: [PATCH] Add helpers to main flake --- dhall/flake.lock | 12 ++++++------ dhall/flake.nix | 36 +++++++++++++++++++++++------------- elixir/flake.lock | 12 ++++++------ flake.nix | 9 ++++++++- gleam/flake.lock | 12 ++++++------ go1.17/flake.lock | 12 ++++++------ go1.18/flake.lock | 12 ++++++------ java/flake.lock | 12 ++++++------ kotlin/flake.lock | 12 ++++++------ nix/flake.lock | 12 ++++++------ node/flake.lock | 12 ++++++------ protobuf/flake.lock | 12 ++++++------ rust/flake.lock | 12 ++++++------ scala/flake.lock | 12 ++++++------ zig/flake.lock | 12 ++++++------ 15 files changed, 109 insertions(+), 92 deletions(-) diff --git a/dhall/flake.lock b/dhall/flake.lock index e676c2d..8da473f 100644 --- a/dhall/flake.lock +++ b/dhall/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1659265069, - "narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", + "lastModified": 1659265326, + "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=", "owner": "the-nix-way", "repo": "dev-templates", - "rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", + "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659264167, - "narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", + "lastModified": 1659265259, + "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", + "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6", "type": "github" }, "original": { diff --git a/dhall/flake.nix b/dhall/flake.nix index 762b036..54f3aa1 100644 --- a/dhall/flake.nix +++ b/dhall/flake.nix @@ -13,19 +13,29 @@ inherit (pkgs.lib) optionals; inherit (pkgs.stdenv) isLinux; - otherFormats = with pkgs.haskellPackages; - [ - dhall-bash - dhall-docs - dhall-json - dhall-lsp-server - dhall-nix - dhall-nixpkgs - dhall-openapi - dhall-toml - dhall-yaml - ] ++ optionals isLinux - (with pkgs.haskellPackages; [ dhall-csv dhall-haskell dhall-text ]); + # Helper function for building dhall-* tools + mkDhallTools = ls: builtins.map (tool: pkgs.haskellPackages."dhall-${tool}") ls; + + dhallTools = mkDhallTools [ + "bash" + "docs" + "json" + "lsp-server" + "nix" + "nixpkgs" + "openapi" + "toml" + "yaml" + ]; + + # dhall-* tools available only on Linux + dhallToolsLinux = mkDhallTools [ + "csv" + "haskell" + "text" + ]; + + otherFormats = dhallTools ++ optionals isLinux dhallToolsLinux; inherit (pkgs) mkShell; in { diff --git a/elixir/flake.lock b/elixir/flake.lock index e676c2d..8da473f 100644 --- a/elixir/flake.lock +++ b/elixir/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1659265069, - "narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", + "lastModified": 1659265326, + "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=", "owner": "the-nix-way", "repo": "dev-templates", - "rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", + "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659264167, - "narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", + "lastModified": 1659265259, + "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", + "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 9836663..def0e65 100644 --- a/flake.nix +++ b/flake.nix @@ -35,8 +35,15 @@ }; } ) // { - lib = { + lib = let + pkgs = nixpkgs; + inherit (pkgs.lib) optionals; + inherit (pkgs.stdenv) isDarwin isLinux; + in { inherit flake-utils nixpkgs; + + darwinOnly = ls: optionals isDarwin ls; + linuxOnly = ls: optionals isLinux ls; }; templates = { diff --git a/gleam/flake.lock b/gleam/flake.lock index e676c2d..8da473f 100644 --- a/gleam/flake.lock +++ b/gleam/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1659265069, - "narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", + "lastModified": 1659265326, + "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=", "owner": "the-nix-way", "repo": "dev-templates", - "rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", + "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659264167, - "narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", + "lastModified": 1659265259, + "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", + "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6", "type": "github" }, "original": { diff --git a/go1.17/flake.lock b/go1.17/flake.lock index e676c2d..8da473f 100644 --- a/go1.17/flake.lock +++ b/go1.17/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1659265069, - "narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", + "lastModified": 1659265326, + "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=", "owner": "the-nix-way", "repo": "dev-templates", - "rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", + "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659264167, - "narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", + "lastModified": 1659265259, + "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", + "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6", "type": "github" }, "original": { diff --git a/go1.18/flake.lock b/go1.18/flake.lock index e676c2d..8da473f 100644 --- a/go1.18/flake.lock +++ b/go1.18/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1659265069, - "narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", + "lastModified": 1659265326, + "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=", "owner": "the-nix-way", "repo": "dev-templates", - "rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", + "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659264167, - "narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", + "lastModified": 1659265259, + "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", + "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6", "type": "github" }, "original": { diff --git a/java/flake.lock b/java/flake.lock index e676c2d..8da473f 100644 --- a/java/flake.lock +++ b/java/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1659265069, - "narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", + "lastModified": 1659265326, + "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=", "owner": "the-nix-way", "repo": "dev-templates", - "rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", + "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659264167, - "narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", + "lastModified": 1659265259, + "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", + "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6", "type": "github" }, "original": { diff --git a/kotlin/flake.lock b/kotlin/flake.lock index e676c2d..8da473f 100644 --- a/kotlin/flake.lock +++ b/kotlin/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1659265069, - "narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", + "lastModified": 1659265326, + "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=", "owner": "the-nix-way", "repo": "dev-templates", - "rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", + "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659264167, - "narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", + "lastModified": 1659265259, + "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", + "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6", "type": "github" }, "original": { diff --git a/nix/flake.lock b/nix/flake.lock index e676c2d..8da473f 100644 --- a/nix/flake.lock +++ b/nix/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1659265069, - "narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", + "lastModified": 1659265326, + "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=", "owner": "the-nix-way", "repo": "dev-templates", - "rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", + "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659264167, - "narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", + "lastModified": 1659265259, + "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", + "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6", "type": "github" }, "original": { diff --git a/node/flake.lock b/node/flake.lock index e676c2d..8da473f 100644 --- a/node/flake.lock +++ b/node/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1659265069, - "narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", + "lastModified": 1659265326, + "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=", "owner": "the-nix-way", "repo": "dev-templates", - "rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", + "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659264167, - "narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", + "lastModified": 1659265259, + "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", + "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6", "type": "github" }, "original": { diff --git a/protobuf/flake.lock b/protobuf/flake.lock index e676c2d..8da473f 100644 --- a/protobuf/flake.lock +++ b/protobuf/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1659265069, - "narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", + "lastModified": 1659265326, + "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=", "owner": "the-nix-way", "repo": "dev-templates", - "rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", + "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659264167, - "narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", + "lastModified": 1659265259, + "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", + "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6", "type": "github" }, "original": { diff --git a/rust/flake.lock b/rust/flake.lock index 2a6a7e3..a627a48 100644 --- a/rust/flake.lock +++ b/rust/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1659265069, - "narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", + "lastModified": 1659265326, + "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=", "owner": "the-nix-way", "repo": "dev-templates", - "rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", + "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f", "type": "github" }, "original": { @@ -51,11 +51,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659264167, - "narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", + "lastModified": 1659265259, + "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", + "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6", "type": "github" }, "original": { diff --git a/scala/flake.lock b/scala/flake.lock index e676c2d..8da473f 100644 --- a/scala/flake.lock +++ b/scala/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1659265069, - "narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", + "lastModified": 1659265326, + "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=", "owner": "the-nix-way", "repo": "dev-templates", - "rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", + "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659264167, - "narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", + "lastModified": 1659265259, + "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", + "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6", "type": "github" }, "original": { diff --git a/zig/flake.lock b/zig/flake.lock index e676c2d..8da473f 100644 --- a/zig/flake.lock +++ b/zig/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1659265069, - "narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", + "lastModified": 1659265326, + "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=", "owner": "the-nix-way", "repo": "dev-templates", - "rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", + "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659264167, - "narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", + "lastModified": 1659265259, + "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", + "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6", "type": "github" }, "original": {