diff --git a/.gitignore b/.gitignore index a0c0ef6..49eeb09 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .stack-work -*.dump-hi \ No newline at end of file +*.dump-hi +.direnv +.envrc diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..782379c --- /dev/null +++ b/flake.lock @@ -0,0 +1,571 @@ +{ + "nodes": { + "autodocodec": { + "flake": false, + "locked": { + "lastModified": 1722952210, + "narHash": "sha256-+vz0En2dkS0nfOq12QAJtV6GcdP0WoDv7HwzrMIsnGo=", + "owner": "NorfairKing", + "repo": "autodocodec", + "rev": "ac36615cb344ec43259fb65cafe3e55308ce4662", + "type": "github" + }, + "original": { + "owner": "NorfairKing", + "repo": "autodocodec", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "freckle": { + "inputs": { + "flake-utils": "flake-utils_2", + "haskell-openapi-code-generator": "haskell-openapi-code-generator", + "nix-github-actions": "nix-github-actions", + "nixpkgs-22-11": "nixpkgs-22-11", + "nixpkgs-23-05": "nixpkgs-23-05", + "nixpkgs-23-11": "nixpkgs-23-11", + "nixpkgs-24-05": "nixpkgs-24-05", + "nixpkgs-24-11": "nixpkgs-24-11", + "nixpkgs-haskell-updates": "nixpkgs-haskell-updates", + "nixpkgs-stable": "nixpkgs-stable_2", + "stack-lint-extra-deps": "stack-lint-extra-deps" + }, + "locked": { + "dir": "main", + "lastModified": 1737569736, + "narHash": "sha256-6HBkkX3/cCway37QwfG26hhxHkVN5eUFlF31hXeyQ7M=", + "ref": "refs/heads/main", + "rev": "af46165a2dad1aee35d0b6b2d2a1c705e9c1832e", + "revCount": 131, + "type": "git", + "url": "ssh://git@github.com/freckle/flakes?dir=main" + }, + "original": { + "dir": "main", + "type": "git", + "url": "ssh://git@github.com/freckle/flakes?dir=main" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "freckle", + "haskell-openapi-code-generator", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "haskell-openapi-code-generator": { + "inputs": { + "autodocodec": "autodocodec", + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks", + "safe-coloured-text": "safe-coloured-text", + "sydtest": "sydtest", + "validity": "validity" + }, + "locked": { + "lastModified": 1731515792, + "narHash": "sha256-EoU807Pqii6hnLvXIu8G2fDOyKLBrOSesXsEEh3YoZQ=", + "owner": "Haskell-OpenAPI-Code-Generator", + "repo": "Haskell-OpenAPI-Client-Code-Generator", + "rev": "0eb15be1a8ae9c311e727e300e7564bf2eb7096f", + "type": "github" + }, + "original": { + "owner": "Haskell-OpenAPI-Code-Generator", + "repo": "Haskell-OpenAPI-Client-Code-Generator", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "freckle", + "nixpkgs-stable" + ] + }, + "locked": { + "lastModified": 1731952509, + "narHash": "sha256-p4gB3Rhw8R6Ak4eMl8pqjCPOLCZRqaehZxdZ/mbFClM=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "7b5f051df789b6b20d259924d349a9ba3319b226", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1722987190, + "narHash": "sha256-68hmex5efCiM2aZlAAEcQgmFI4ZwWt8a80vOeB/5w3A=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "21cc704b5e918c5fbf4f9fff22b4ac2681706d90", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-22-11": { + "locked": { + "lastModified": 1688392541, + "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-23-05": { + "locked": { + "lastModified": 1704290814, + "narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "70bdadeb94ffc8806c0570eb5c2695ad29f0e421", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-23-11": { + "locked": { + "lastModified": 1720535198, + "narHash": "sha256-zwVvxrdIzralnSbcpghA92tWu2DV2lwv89xZc8MTrbg=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "205fd4226592cc83fd4c0885a3e4c9c400efabb5", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-24-05": { + "locked": { + "lastModified": 1735563628, + "narHash": "sha256-OnSAY7XDSx7CtDoqNh8jwVwh4xNL/2HaJxGjryLWzX8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b134951a4c9f3c995fd7be05f3243f8ecd65d798", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-24-11": { + "locked": { + "lastModified": 1736916166, + "narHash": "sha256-puPDoVKxkuNmYIGMpMQiK8bEjaACcCksolsG36gdaNQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e24b4c09e963677b1beea49d411cd315a024ad3a", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-haskell-updates": { + "locked": { + "lastModified": 1737139524, + "narHash": "sha256-V1pCN/58jA3eDKB4HrddImuuZCbhAWymaR8pJkf/TTE=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ea13a8bd5db362f54cce6a23178307217204e718", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "haskell-updates", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-haskell-updates_2": { + "locked": { + "lastModified": 1736295319, + "narHash": "sha256-D408QVHL43RPYdPnGhTpBHJs4wVIebbsmh/SAAY0vAE=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b6b38bb0649cb8393492949e01b1e331c3a05718", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "haskell-updates", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1720386169, + "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1736200483, + "narHash": "sha256-JO+lFN2HsCwSLMUWXHeOad6QUxOuwe9UOAF/iSl1J4I=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3f0a8ac25fb674611b98089ca3a5dd6480175751", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1719082008, + "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9693852a2070b398ee123a329e68f0dab5526681", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1736200483, + "narHash": "sha256-JO+lFN2HsCwSLMUWXHeOad6QUxOuwe9UOAF/iSl1J4I=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3f0a8ac25fb674611b98089ca3a5dd6480175751", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "pgp-wordlist": { + "flake": false, + "locked": { + "lastModified": 1714149562, + "narHash": "sha256-WCFQgtWqq+gLst4lXkFYlmlW7L8PQOJfChsKMApy3Ng=", + "owner": "quchen", + "repo": "pgp-wordlist", + "rev": "1f0cfd90d62179952cbfd59c3405283a1d364272", + "type": "github" + }, + "original": { + "owner": "quchen", + "repo": "pgp-wordlist", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": "nixpkgs_2", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1723202784, + "narHash": "sha256-qbhjc/NEGaDbyy0ucycubq4N3//gDFFH3DOmp1D3u1Q=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "c7012d0c18567c889b948781bc74a501e92275d1", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "freckle": "freckle", + "stable": "stable" + } + }, + "safe-coloured-text": { + "flake": false, + "locked": { + "lastModified": 1722709522, + "narHash": "sha256-zglWqKISYz34A+/PvqwvwrbQYSEcko8C595VAeINitw=", + "owner": "NorfairKing", + "repo": "safe-coloured-text", + "rev": "046f10147a058c00c2706d98c341219e3cbc7669", + "type": "github" + }, + "original": { + "owner": "NorfairKing", + "repo": "safe-coloured-text", + "type": "github" + } + }, + "stable": { + "locked": { + "lastModified": 1737404927, + "narHash": "sha256-e1WgPJpIYbOuokjgylcsuoEUCB4Jl2rQXa2LUD6XAG8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ae584d90cbd0396a422289ee3efb1f1c9d141dc3", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "stack-lint-extra-deps": { + "inputs": { + "nixpkgs": "nixpkgs_3", + "nixpkgs-haskell-updates": "nixpkgs-haskell-updates_2", + "pgp-wordlist": "pgp-wordlist", + "stacklock2nix": "stacklock2nix" + }, + "locked": { + "lastModified": 1736981709, + "narHash": "sha256-mOSfcBBVJ/hEH5j0H7PFggQwk/k9okL/Xm6lSiaW8Hw=", + "owner": "freckle", + "repo": "stack-lint-extra-deps", + "rev": "d7a272d9774a10a2ed0c113e130c7e61728600b0", + "type": "github" + }, + "original": { + "owner": "freckle", + "repo": "stack-lint-extra-deps", + "type": "github" + } + }, + "stacklock2nix": { + "locked": { + "lastModified": 1731366632, + "narHash": "sha256-dd10Hyqbyhg83pgxE8Sl1jo9wdYzTU4muH83TjhyrCY=", + "owner": "cdepillabout", + "repo": "stacklock2nix", + "rev": "3cb77e9c869be90ad939f368096ff2cc940881d4", + "type": "github" + }, + "original": { + "owner": "cdepillabout", + "repo": "stacklock2nix", + "type": "github" + } + }, + "sydtest": { + "flake": false, + "locked": { + "lastModified": 1722766036, + "narHash": "sha256-i7N8HKkFPUfnOOmj47Di/XnQS66mUzTG6HISUccNhOA=", + "owner": "NorfairKing", + "repo": "sydtest", + "rev": "23baea50a08857baf3121fc55096c40a93ff5f17", + "type": "github" + }, + "original": { + "owner": "NorfairKing", + "repo": "sydtest", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "validity": { + "flake": false, + "locked": { + "lastModified": 1722943924, + "narHash": "sha256-hq5FwDFW+02u5Qsx8v1KWoQUsY6S6ufI4WYKZ6yhYUA=", + "owner": "NorfairKing", + "repo": "validity", + "rev": "51b8843b9bd5228160b99f653d3271147245d689", + "type": "github" + }, + "original": { + "owner": "NorfairKing", + "repo": "validity", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8c1e58f --- /dev/null +++ b/flake.nix @@ -0,0 +1,53 @@ +{ + inputs = { + stable.url = "github:nixos/nixpkgs/nixos-24.11"; + freckle.url = "git+ssh://git@github.com/freckle/flakes?dir=main"; + flake-utils.url = "github:numtide/flake-utils"; + }; + outputs = + inputs: + inputs.flake-utils.lib.eachDefaultSystem ( + system: + let + nixpkgsArgs = { + inherit system; + config = { }; + }; + + nixpkgs = { + stable = import inputs.stable nixpkgsArgs; + }; + freckle = inputs.freckle.packages.${system}; + freckleLib = inputs.freckle.lib.${system}; + + in + rec { + packages = { + fourmolu = freckle.fourmolu-0-13-x; + + ghc = freckleLib.haskellBundle { + ghcVersion = "ghc-9-10-1"; + enableHLS = true; + }; + }; + + devShells.default = nixpkgs.stable.mkShell { + buildInputs = with (nixpkgs.stable); [ + pcre + pcre.dev + zlib + zlib.dev + ]; + + nativeBuildInputs = with (packages); [ + fourmolu + ghc + ]; + + shellHook = '' + export STACK_YAML=stack-nightly.yaml + ''; + }; + } + ); +} diff --git a/stack-nightly.yaml b/stack-nightly.yaml index 57535ae..beb620f 100644 --- a/stack-nightly.yaml +++ b/stack-nightly.yaml @@ -1,26 +1,4 @@ -# Indicates last update, must be overridden by --resolver -resolver: nightly-2024-02-06 +resolver: nightly-2025-01-20 packages: - bcp47 - bcp47-orphans -extra-deps: - - country-0.2.4.1 - - # https://github.com/bitemyapp/esqueleto/issues/386 - # - esqueleto-3.5.11.1 - - github: arguri/esqueleto - commit: 28816847095a74abdba6c1c0fcb73e2ab80749ce - - # For country - - bytehash-0.1.1.1 - - # For bytehash - - primitive-0.9.0.0 - -allow-newer: true -allow-newer-deps: - # bytestring, deepseq - - country - - # bytestring - - bytehash diff --git a/stack-nightly.yaml.lock b/stack-nightly.yaml.lock index e5bdbfe..f5c246c 100644 --- a/stack-nightly.yaml.lock +++ b/stack-nightly.yaml.lock @@ -3,38 +3,10 @@ # For more information, please see the documentation at: # https://docs.haskellstack.org/en/stable/lock_files -packages: -- completed: - hackage: country-0.2.4.1@sha256:db91ee099549626aab89fb3c082c272a0488d05a3b4e8a6ea335f15908537a35,3388 - pantry-tree: - sha256: 59fa6ff92aec88b3eba964e34a14d8d3493141503441138434383474f628853f - size: 1396 - original: - hackage: country-0.2.4.1 -- completed: - hackage: esqueleto-3.5.11.1@sha256:0721b72053946d06d49a63e768117cf7da8efaf28849eff466212386d9b6e480,4966 - pantry-tree: - sha256: f4f9870ae95c7b5b8db342078bad170aca2a66451a1381eb18e041ea191ac380 - size: 2492 - original: - hackage: esqueleto-3.5.11.1 -- completed: - hackage: bytehash-0.1.1.1@sha256:995c95eebe86224e444dfe99e12446871a6ca58b960380e6dd4b4e12c9c7a141,2118 - pantry-tree: - sha256: 92ab802956b39e456517ef5f02df582831f1b31ec7d330d7db549ec3c5e88e00 - size: 587 - original: - hackage: bytehash-0.1.1.1 -- completed: - hackage: primitive-0.9.0.0@sha256:1ceb39f67c0e614180f2992a6d30f26603ab2cd23c4f8e25b30213f98807f6f1,3141 - pantry-tree: - sha256: ebf0e03c7ca2f607d30cceeda49dc1f82a652177131f8922ac37846603421246 - size: 1793 - original: - hackage: primitive-0.9.0.0 +packages: [] snapshots: - completed: - sha256: dcbdef675b6bcce95be27d1cd7688f72b39769ad8c6a1ae10c14fadecdabf14d - size: 597670 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2024/2/6.yaml - original: nightly-2024-02-06 + sha256: 3ce900e74d0890ae59692705e21c0dc1312acae79850f64a3b9e339e14612854 + size: 631308 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2025/1/20.yaml + original: nightly-2025-01-20