Add helpers to main flake

This commit is contained in:
Luc Perkins 2022-07-31 13:12:34 +02:00
parent 0ab8af8409
commit 7775f8a95d
No known key found for this signature in database
GPG key ID: 4F102D0C16E232F2
15 changed files with 109 additions and 92 deletions

View file

@ -6,11 +6,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1659265069, "lastModified": 1659265326,
"narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=",
"owner": "the-nix-way", "owner": "the-nix-way",
"repo": "dev-templates", "repo": "dev-templates",
"rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,11 +36,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1659264167, "lastModified": 1659265259,
"narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -13,19 +13,29 @@
inherit (pkgs.lib) optionals; inherit (pkgs.lib) optionals;
inherit (pkgs.stdenv) isLinux; inherit (pkgs.stdenv) isLinux;
otherFormats = with pkgs.haskellPackages; # Helper function for building dhall-* tools
[ mkDhallTools = ls: builtins.map (tool: pkgs.haskellPackages."dhall-${tool}") ls;
dhall-bash
dhall-docs dhallTools = mkDhallTools [
dhall-json "bash"
dhall-lsp-server "docs"
dhall-nix "json"
dhall-nixpkgs "lsp-server"
dhall-openapi "nix"
dhall-toml "nixpkgs"
dhall-yaml "openapi"
] ++ optionals isLinux "toml"
(with pkgs.haskellPackages; [ dhall-csv dhall-haskell dhall-text ]); "yaml"
];
# dhall-* tools available only on Linux
dhallToolsLinux = mkDhallTools [
"csv"
"haskell"
"text"
];
otherFormats = dhallTools ++ optionals isLinux dhallToolsLinux;
inherit (pkgs) mkShell; inherit (pkgs) mkShell;
in { in {

View file

@ -6,11 +6,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1659265069, "lastModified": 1659265326,
"narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=",
"owner": "the-nix-way", "owner": "the-nix-way",
"repo": "dev-templates", "repo": "dev-templates",
"rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,11 +36,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1659264167, "lastModified": 1659265259,
"narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -35,8 +35,15 @@
}; };
} }
) // { ) // {
lib = { lib = let
pkgs = nixpkgs;
inherit (pkgs.lib) optionals;
inherit (pkgs.stdenv) isDarwin isLinux;
in {
inherit flake-utils nixpkgs; inherit flake-utils nixpkgs;
darwinOnly = ls: optionals isDarwin ls;
linuxOnly = ls: optionals isLinux ls;
}; };
templates = { templates = {

View file

@ -6,11 +6,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1659265069, "lastModified": 1659265326,
"narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=",
"owner": "the-nix-way", "owner": "the-nix-way",
"repo": "dev-templates", "repo": "dev-templates",
"rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,11 +36,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1659264167, "lastModified": 1659265259,
"narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -6,11 +6,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1659265069, "lastModified": 1659265326,
"narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=",
"owner": "the-nix-way", "owner": "the-nix-way",
"repo": "dev-templates", "repo": "dev-templates",
"rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,11 +36,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1659264167, "lastModified": 1659265259,
"narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -6,11 +6,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1659265069, "lastModified": 1659265326,
"narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=",
"owner": "the-nix-way", "owner": "the-nix-way",
"repo": "dev-templates", "repo": "dev-templates",
"rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,11 +36,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1659264167, "lastModified": 1659265259,
"narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -6,11 +6,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1659265069, "lastModified": 1659265326,
"narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=",
"owner": "the-nix-way", "owner": "the-nix-way",
"repo": "dev-templates", "repo": "dev-templates",
"rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,11 +36,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1659264167, "lastModified": 1659265259,
"narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -6,11 +6,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1659265069, "lastModified": 1659265326,
"narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=",
"owner": "the-nix-way", "owner": "the-nix-way",
"repo": "dev-templates", "repo": "dev-templates",
"rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,11 +36,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1659264167, "lastModified": 1659265259,
"narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -6,11 +6,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1659265069, "lastModified": 1659265326,
"narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=",
"owner": "the-nix-way", "owner": "the-nix-way",
"repo": "dev-templates", "repo": "dev-templates",
"rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,11 +36,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1659264167, "lastModified": 1659265259,
"narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -6,11 +6,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1659265069, "lastModified": 1659265326,
"narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=",
"owner": "the-nix-way", "owner": "the-nix-way",
"repo": "dev-templates", "repo": "dev-templates",
"rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,11 +36,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1659264167, "lastModified": 1659265259,
"narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -6,11 +6,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1659265069, "lastModified": 1659265326,
"narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=",
"owner": "the-nix-way", "owner": "the-nix-way",
"repo": "dev-templates", "repo": "dev-templates",
"rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,11 +36,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1659264167, "lastModified": 1659265259,
"narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -6,11 +6,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1659265069, "lastModified": 1659265326,
"narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=",
"owner": "the-nix-way", "owner": "the-nix-way",
"repo": "dev-templates", "repo": "dev-templates",
"rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -51,11 +51,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1659264167, "lastModified": 1659265259,
"narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -6,11 +6,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1659265069, "lastModified": 1659265326,
"narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=",
"owner": "the-nix-way", "owner": "the-nix-way",
"repo": "dev-templates", "repo": "dev-templates",
"rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,11 +36,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1659264167, "lastModified": 1659265259,
"narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -6,11 +6,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1659265069, "lastModified": 1659265326,
"narHash": "sha256-1lwvQPag89K9dAkYetpinXc4we7/P6DBDrZbIvy50Lk=", "narHash": "sha256-Te2cVb8d4DzYqa7pzR1MWukNPL1D9puIogr+A4vt+zU=",
"owner": "the-nix-way", "owner": "the-nix-way",
"repo": "dev-templates", "repo": "dev-templates",
"rev": "5f7ae4d7f102a3d8be37352bf45ac6437c1124dc", "rev": "0ab8af8409fc01fc47c8495613c43cd8bff3008f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,11 +36,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1659264167, "lastModified": 1659265259,
"narHash": "sha256-5w5j5xaTX+yNAaYjl2sIB35LWSoDpU0wnxHVx8Kzsro=", "narHash": "sha256-zxZ54QZkw4IK6w/+wFLkB20/K75k4sw9W1kV1S1L2BI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3de6a330bcd434d59901c9c7f8fbe252e2207e22", "rev": "7ded42e3567f41aaf26f93bf5d40e14a011d10a6",
"type": "github" "type": "github"
}, },
"original": { "original": {