diff --git a/.nvimrc b/.nvimrc deleted file mode 100644 index 9378ea2..0000000 --- a/.nvimrc +++ /dev/null @@ -1,3 +0,0 @@ -" let g:loaded_airline=1 -" autocmd FileType hs let b:airline_disable_statusline = 1 -" set statusline=%!StatusLSP() diff --git a/flake.lock b/flake.lock index 149746d..b626956 100644 --- a/flake.lock +++ b/flake.lock @@ -1,13 +1,30 @@ { "nodes": { + "all-cabal-hashes-unpacked": { + "flake": false, + "locked": { + "lastModified": 1698672919, + "narHash": "sha256-KRYSEfhyt1uVUVgZnzOd+mstJyE7xwGEft429c3k32s=", + "owner": "commercialhaskell", + "repo": "all-cabal-hashes", + "rev": "971b157df9611634e0027b17ad79fa1d69aefe2c", + "type": "github" + }, + "original": { + "owner": "commercialhaskell", + "ref": "current-hackage", + "repo": "all-cabal-hashes", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { - "lastModified": 1627913399, - "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -19,11 +36,27 @@ "flake-compat_2": { "flake": false, "locked": { - "lastModified": 1627913399, - "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1668681692, + "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", "owner": "edolstra", "repo": "flake-compat", - "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", + "rev": "009399224d5e398d03b22badca40a37ac85412a1", "type": "github" }, "original": { @@ -33,12 +66,15 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1638122382, - "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", - "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { @@ -48,12 +84,15 @@ } }, "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, "locked": { - "lastModified": 1629481132, - "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=", + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", "owner": "numtide", "repo": "flake-utils", - "rev": "997f7efcb746a9c140ce1f13c72263189225f482", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", "type": "github" }, "original": { @@ -63,12 +102,15 @@ } }, "flake-utils_3": { + "inputs": { + "systems": "systems_3" + }, "locked": { - "lastModified": 1638122382, - "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", "owner": "numtide", "repo": "flake-utils", - "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", "type": "github" }, "original": { @@ -79,11 +121,11 @@ }, "flake-utils_4": { "locked": { - "lastModified": 1610051610, - "narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { @@ -94,11 +136,11 @@ }, "flake-utils_5": { "locked": { - "lastModified": 1631561581, - "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { @@ -109,11 +151,11 @@ }, "flake-utils_6": { "locked": { - "lastModified": 1638122382, - "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { @@ -122,14 +164,57 @@ "type": "github" } }, + "fourmolu-011": { + "flake": false, + "locked": { + "narHash": "sha256-g/yDZXeLCHq/iXoZTaTYSb8l9CMny3AKsRQgWElagZI=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/fourmolu-0.11.0.0/fourmolu-0.11.0.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/fourmolu-0.11.0.0/fourmolu-0.11.0.0.tar.gz" + } + }, + "fourmolu-012": { + "flake": false, + "locked": { + "narHash": "sha256-yru8ls67DMM6WSeVU6xDmmwa48I8S9CUv9NBaxSQ29M=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/fourmolu-0.12.0.0/fourmolu-0.12.0.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/fourmolu-0.12.0.0/fourmolu-0.12.0.0.tar.gz" + } + }, + "frames": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1698013301, + "narHash": "sha256-OFCKTlSwXSeMd/6YfUVmdkX2rR6RX3/tjYv1KtMCOoI=", + "owner": "acowley", + "repo": "Frames", + "rev": "1700500d4e6048207a9e96cf5773ef25feff67fd", + "type": "github" + }, + "original": { + "owner": "acowley", + "repo": "Frames", + "type": "github" + } + }, "gitignore": { "flake": false, "locked": { - "lastModified": 1611672876, - "narHash": "sha256-qHu3uZ/o9jBHiA3MEKHJ06k7w4heOhA+4HCSIvflRxo=", + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "211907489e9f198594c0eb0ca9256a1949c9d412", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", "type": "github" }, "original": { @@ -138,20 +223,144 @@ "type": "github" } }, + "gitignore_2": { + "inputs": { + "nixpkgs": [ + "replica", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gtk2hs": { + "flake": false, + "locked": { + "lastModified": 1670177302, + "narHash": "sha256-4wkqtXshzK8RYvmKEyqN2A/umifriofWGX3gws5yRp8=", + "owner": "teto", + "repo": "gtk2hs", + "rev": "eba9887639a546d9ab570b1730083ead187bb377", + "type": "github" + }, + "original": { + "owner": "teto", + "ref": "ghc92", + "repo": "gtk2hs", + "type": "github" + } + }, + "haskell-chart": { + "flake": false, + "locked": { + "lastModified": 1662849659, + "narHash": "sha256-37HX54Ljri66+DA56DkOBfXaUHRgeWQ2xks/+3OLAFU=", + "owner": "teto", + "repo": "haskell-chart", + "rev": "9d9d8dad4a136def29534a552c5085c499e4545d", + "type": "github" + }, + "original": { + "owner": "teto", + "ref": "ghc92", + "repo": "haskell-chart", + "type": "github" + } + }, + "haskell-hie-bios": { + "flake": false, + "locked": { + "lastModified": 1686930638, + "narHash": "sha256-gfcxxHtZ2jUsiKNn/O4jEkfWF/2H04aTnaIvPDbtNlQ=", + "owner": "haskell", + "repo": "hie-bios", + "rev": "3d4fadfb0dc44cb287db9897ecfb503899d33513", + "type": "github" + }, + "original": { + "owner": "haskell", + "repo": "hie-bios", + "type": "github" + } + }, + "haskell-implicit-hie-cradle": { + "flake": false, + "locked": { + "lastModified": 1686495518, + "narHash": "sha256-OAe+zOkMZuoTfVEMnxnCT1cmPgRF/riAR8nVdomnwxo=", + "owner": "smunix", + "repo": "implicit-hie-cradle", + "rev": "d6aa00355898469af56cfd5e62f7fc8bd9959ded", + "type": "github" + }, + "original": { + "owner": "smunix", + "ref": "smunix-patch-hls-0.5-1", + "repo": "implicit-hie-cradle", + "type": "github" + } + }, + "hlint-35": { + "flake": false, + "locked": { + "narHash": "sha256-qQNUlQQnahUGEO92Lm0RwjTGBGr2Yaw0KRuFRMoc5No=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/hlint-3.5/hlint-3.5.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/hlint-3.5/hlint-3.5.tar.gz" + } + }, + "hlint-36": { + "flake": false, + "locked": { + "narHash": "sha256-fH4RYnWeuBqJI5d3Ba+Xs0BxYr0IYFH1OWO3k2iHGlU=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/hlint-3.6.1/hlint-3.6.1.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/hlint-3.6.1/hlint-3.6.1.tar.gz" + } + }, "hls": { "inputs": { "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", + "fourmolu-011": "fourmolu-011", + "fourmolu-012": "fourmolu-012", "gitignore": "gitignore", - "nixpkgs": "nixpkgs", - "pre-commit-hooks": "pre-commit-hooks" + "haskell-hie-bios": "haskell-hie-bios", + "haskell-implicit-hie-cradle": "haskell-implicit-hie-cradle", + "hlint-35": "hlint-35", + "hlint-36": "hlint-36", + "lsp": "lsp", + "lsp-test": "lsp-test", + "lsp-types": "lsp-types", + "nixpkgs": "nixpkgs_2", + "ormolu-052": "ormolu-052", + "ormolu-07": "ormolu-07", + "stylish-haskell-0145": "stylish-haskell-0145" }, "locked": { - "lastModified": 1639236779, - "narHash": "sha256-iRL2qTSftKAfkMI+SPYo2rDht+7Dm4by/UJaEb6cTSI=", + "lastModified": 1698509590, + "narHash": "sha256-YoC4lXsT9EPScjV6g4vlyta4T/mLZ9fNJjPXQdfKjOc=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "c5706561ff29ac1cd92378ba11e31195389c10b0", + "rev": "5bf1b75eeb924a74f87176cc61930971d9312247", "type": "github" }, "original": { @@ -162,17 +371,22 @@ }, "idris": { "inputs": { - "flake-utils": "flake-utils_6", + "flake-utils": [ + "replica", + "flake-utils" + ], "idris-emacs-src": "idris-emacs-src", - "nixpkgs": "nixpkgs_5", - "nixpkgs-chez-racket": "nixpkgs-chez-racket" + "nixpkgs": [ + "replica", + "nixpkgs" + ] }, "locked": { - "lastModified": 1632512335, - "narHash": "sha256-PfhOjUdPS9frBG2ouHdK5CvbS1jro25/uSVsGvMfcJ0=", + "lastModified": 1673134368, + "narHash": "sha256-77fOU/rNUOMcIKAgLC8G5CruZKwomr8wYJT4ed5ET54=", "owner": "idris-lang", "repo": "Idris2", - "rev": "a9ccf4db4f69677c5287a1278ab167247dac161d", + "rev": "f630675cfb8b553ad3304163af544c2c4719fade", "type": "github" }, "original": { @@ -184,11 +398,11 @@ "idris-emacs-src": { "flake": false, "locked": { - "lastModified": 1613351183, - "narHash": "sha256-ngg48SzrR2LCtjle3WR3BOK86USRB0ZXmgXWu9EzQbo=", + "lastModified": 1666078909, + "narHash": "sha256-oYNHFIpcrFfPb4sXJwEBFKeH+PB4AGCrAFrfBrSTCeo=", "owner": "redfish64", "repo": "idris2-mode", - "rev": "77390611a934f13e03a45e9f8a4e476dd17a9c5b", + "rev": "3bcb52a65c488f31c99d20f235f6050418a84c9d", "type": "github" }, "original": { @@ -197,59 +411,97 @@ "type": "github" } }, + "lsp": { + "flake": false, + "locked": { + "narHash": "sha256-HcEfdYUrCHufEa+10M2wESjnK41xM/msd+t6r6JwQO0=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/lsp-2.2.0.0/lsp-2.2.0.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/lsp-2.2.0.0/lsp-2.2.0.0.tar.gz" + } + }, + "lsp-test": { + "flake": false, + "locked": { + "narHash": "sha256-E1D3X2+I9ZTZLpHDEDTXexQFYpyG5byOFRIvRTeBsn8=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/lsp-test-0.16.0.0/lsp-test-0.16.0.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/lsp-test-0.16.0.0/lsp-test-0.16.0.0.tar.gz" + } + }, + "lsp-types": { + "flake": false, + "locked": { + "narHash": "sha256-Oa5HuKdsdTSQUKtuSt06zVAq19Qxq5IJZObrnPwlB6s=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/lsp-types-2.0.2.0/lsp-types-2.0.2.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/lsp-types-2.0.2.0/lsp-types-2.0.2.0.tar.gz" + } + }, "nixpkgs": { "locked": { - "lastModified": 1638249621, - "narHash": "sha256-5sm83bBBg/U6rALZy/IwITtYY4rJJ5mn4z1Tt5W8FT8=", - "owner": "NixOS", + "lastModified": 1697793076, + "narHash": "sha256-02e7sCuqLtkyRgrZmdOyvAcQTQdcXj+vpyp9bca6cY4=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "af21d41260846fb9c9840a75e310e56dfe97d6a3", + "rev": "038b2922be3fc096e1d456f93f7d0f4090628729", "type": "github" }, "original": { - "owner": "NixOS", + "owner": "nixos", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-chez-racket": { + "nixpkgs-stable": { "locked": { - "lastModified": 1627484694, - "narHash": "sha256-UsEb5G0ZJ8l/2y9u9FNj2akXx2PC5QAan24U3t32cfI=", - "owner": "L-as", + "lastModified": 1671271954, + "narHash": "sha256-cSvu+bnvN08sOlTBWbBrKaBHQZq8mvk8bgpt0ZJ2Snc=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "9b3c4bee8cee477ac03b0cfd4ebca40954c66106", + "rev": "d513b448cc2a6da2c8803e3c197c9fc7e67b19e3", "type": "github" }, "original": { - "owner": "L-as", - "ref": "chez-racket", + "owner": "NixOS", + "ref": "nixos-22.05", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1639178239, - "narHash": "sha256-Gc6jJwMuUPUGLhYaXLQ/fKEyqlPzlIKX7OKtTXRJnBQ=", + "lastModified": 1686874404, + "narHash": "sha256-u2Ss8z+sGaVlKtq7sCovQ8WvXY+OoXJmY1zmyxITiaY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e7caea7700d49f1925edc6c796cc320f8aed3011", + "rev": "efc10371d5c5b8d2d58bab6c1100753efacfe550", "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "NixOS", + "ref": "haskell-updates", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs_3": { "locked": { - "lastModified": 1638986258, - "narHash": "sha256-OceRdctKZRSgqQxVRvvNB0MaEnFMzQqjUffecoDE9eI=", + "lastModified": 1698318101, + "narHash": "sha256-gUihHt3yPD7bVqg+k/UVHgngyaJ3DMEBchbymBMvK1E=", "owner": "nixos", "repo": "nixpkgs", - "rev": "581d2d6c9cd5c289002203581d8aa0861963a933", + "rev": "63678e9f3d3afecfeafa0acead6239cdb447574c", "type": "github" }, "original": { @@ -261,40 +513,41 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1610729867, - "narHash": "sha256-bk/SBaBLqZX/PEqal27DMQwAHHl0dcZMp8NNksQr80s=", + "lastModified": 1673027386, + "narHash": "sha256-Wjt+oDhRLcf3opIjUKHGN+Xrp3w2ZDms6bO4pCLvsco=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "04af07c659c6723a2259bb6bc00a47ec53330f20", + "rev": "b3818a46e686f24561a28eaa9fcf35e18b8d8e89", "type": "github" }, "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" + "id": "nixpkgs", + "type": "indirect" } }, "nixpkgs_5": { "locked": { - "lastModified": 1639178239, - "narHash": "sha256-Gc6jJwMuUPUGLhYaXLQ/fKEyqlPzlIKX7OKtTXRJnBQ=", + "lastModified": 1671271357, + "narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e7caea7700d49f1925edc6c796cc320f8aed3011", + "rev": "40f79f003b6377bd2f4ed4027dde1f8f922995dd", "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs_6": { "locked": { - "lastModified": 1632600271, - "narHash": "sha256-2WndMSEsdnamVktLmYLd8dZrRsGCH5Bd8mu5L4HuupU=", + "lastModified": 1672428209, + "narHash": "sha256-eejhqkDz2cb2vc5VeaWphJz8UXNuoNoM8/Op8eWv2tQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6201954aa117d24cc73e46f355c0ea19b8fcad6f", + "rev": "293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847", "type": "github" }, "original": { @@ -302,35 +555,62 @@ "type": "indirect" } }, - "poetry": { - "inputs": { - "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_4" + "ormolu-052": { + "flake": false, + "locked": { + "narHash": "sha256-H7eqId488RBRxcf7flgJefAZmRgFJASJva+Oy7GG4q4=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/ormolu-0.5.2.0/ormolu-0.5.2.0.tar.gz" }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/ormolu-0.5.2.0/ormolu-0.5.2.0.tar.gz" + } + }, + "ormolu-07": { + "flake": false, + "locked": { + "narHash": "sha256-5M5gNzSvsiQH1+0oexRByzf5EIET+0BFwR4fLIr2P7g=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/ormolu-0.7.1.0/ormolu-0.7.1.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/ormolu-0.7.1.0/ormolu-0.7.1.0.tar.gz" + } + }, + "papers": { + "flake": false, "locked": { - "lastModified": 1638854297, - "narHash": "sha256-mt5gMwAThp8FpcvRsKhs/y/VxLDNgH4MJJLlFbbs4gk=", - "owner": "nix-community", - "repo": "poetry2nix", - "rev": "a4b769203284c91529480adcbb4f17f04d3ff67b", + "dir": "libs/papers", + "lastModified": 1673134368, + "narHash": "sha256-77fOU/rNUOMcIKAgLC8G5CruZKwomr8wYJT4ed5ET54=", + "owner": "idris-lang", + "repo": "Idris2", + "rev": "f630675cfb8b553ad3304163af544c2c4719fade", "type": "github" }, "original": { - "id": "poetry", - "type": "indirect" + "dir": "libs/papers", + "owner": "idris-lang", + "repo": "Idris2", + "type": "github" } }, "pre-commit-hooks": { "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_2" + "flake-compat": "flake-compat_3", + "flake-utils": "flake-utils_5", + "gitignore": "gitignore_2", + "nixpkgs": "nixpkgs_5", + "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1624971177, - "narHash": "sha256-Amf/nBj1E77RmbSSmV+hg6YOpR+rddCbbVgo5C7BS0I=", + "lastModified": 1672912243, + "narHash": "sha256-QnQeKUjco2kO9J4rBqIBPp5XcOMblIMnmyhpjeaJBYc=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "397f0713d007250a2c7a745e555fa16c5dc8cadb", + "rev": "a4548c09eac4afb592ab2614f4a150120b29584c", "type": "github" }, "original": { @@ -341,16 +621,19 @@ }, "replica": { "inputs": { - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_4", "idris": "idris", - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_4", + "papers": "papers", + "pre-commit-hooks": "pre-commit-hooks", + "replicadhall": "replicadhall" }, "locked": { - "lastModified": 1634221508, - "narHash": "sha256-CgM816bx1+BSCYIZi5FIrY89YA2PMKazARa5ME2s3xg=", + "lastModified": 1674072606, + "narHash": "sha256-VTKAQ9zbCOQugM5npC06Y1ubJ/jz2d0wH3PUBud0A/8=", "owner": "ReplicaTest", "repo": "REPLica", - "rev": "e500b3c0a271d07ad93cc790cb92f013affc046d", + "rev": "182ad0f86550bd8b9d725d0495a9c9fd20cca310", "type": "github" }, "original": { @@ -359,15 +642,94 @@ "type": "github" } }, + "replicadhall": { + "inputs": { + "flake-utils": "flake-utils_6", + "nixpkgs": "nixpkgs_6" + }, + "locked": { + "lastModified": 1672865541, + "narHash": "sha256-yIcvyBCjiGc5qFdLPn7MuQ/7iN6ibHzQ98ciA0ffHBs=", + "owner": "ReplicaTest", + "repo": "replica-dhall", + "rev": "c2bf442fbbb092973c76d78e642fff3fe0abf0c3", + "type": "github" + }, + "original": { + "owner": "ReplicaTest", + "repo": "replica-dhall", + "type": "github" + } + }, "root": { "inputs": { + "all-cabal-hashes-unpacked": "all-cabal-hashes-unpacked", "flake-compat": "flake-compat", "flake-utils": "flake-utils", + "frames": "frames", + "gtk2hs": "gtk2hs", + "haskell-chart": "haskell-chart", "hls": "hls", "nixpkgs": "nixpkgs_3", - "poetry": "poetry", "replica": "replica" } + }, + "stylish-haskell-0145": { + "flake": false, + "locked": { + "narHash": "sha256-EE7RFQ6q4Ek8daRgOpNMGepYLa9o8cM4OLjTNUSHQf0=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/stylish-haskell-0.14.5.0/stylish-haskell-0.14.5.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/stylish-haskell-0.14.5.0/stylish-haskell-0.14.5.0.tar.gz" + } + }, + "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" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 5f8259c..8a71e94 100644 --- a/flake.nix +++ b/flake.nix @@ -13,81 +13,119 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; replica.url = "github:ReplicaTest/REPLica"; + # ihaskell.url = "github:gibiansky/IHaskell"; + # ihaskell.url = "github:teto/IHaskell/ghc2-pr-nova"; flake-utils.url = "github:numtide/flake-utils"; hls.url = "github:haskell/haskell-language-server"; + frames.url = "github:acowley/Frames"; + + gtk2hs = { + url = "github:teto/gtk2hs/ghc92"; + flake = false; + }; + + haskell-chart = { + url = "github:teto/haskell-chart/ghc92"; + # url = "github:timbod7/haskell-chart"; + flake = false; + }; + + # bytebuild = { + # url = "github:teto/bytebuild"; + # flake = false; + # }; + # bytesmith = { + # url = "github:teto/bytesmith/ghc92"; + # flake = false; + # }; + # haskell-ip = { + # url = "github:andrewthad/haskell-ip/ghc-9-2-3"; + # flake = false; + # }; + # word-compat = { + # # bf20ee95b82414d96eb83863f50212e6c31b8930 + # url = "github:fumieval/word-compat/bf20ee95b82414d96eb83863f50212e6c31b8930"; + # flake = false; + # }; + + # cabal hashes contains all the version for different haskell packages, to update: + # nix flake lock --update-input all-cabal-hashes-unpacked + all-cabal-hashes-unpacked = { + url = "github:commercialhaskell/all-cabal-hashes/current-hackage"; + flake = false; + }; + flake-compat = { url = "github:edolstra/flake-compat"; flake = false; }; }; - outputs = { self, nixpkgs, flake-utils, poetry, replica, hls, ... }: - flake-utils.lib.eachSystem ["x86_64-linux"] (system: let - - compilerVersion = "8107"; - # compilerVersion = "901"; - - haskellOverlay = hnew: hold: with pkgs.haskell.lib; { - - # TODO override Frames - ip = unmarkBroken (dontCheck hold.ip); - bytebuild = unmarkBroken (dontCheck hold.bytebuild); - - relude = hold.relude_1_0_0_1; - - # may not be needed anymore ? - wide-word = unmarkBroken (dontCheck hold.wide-word); - polysemy = hnew.polysemy_1_7_1_0; - co-log-polysemy = doJailbreak (hold.co-log-polysemy); - polysemy-plugin = hnew.polysemy-plugin_0_4_3_0; - - netlink = (overrideSrc hold.netlink { - # src = builtins.fetchGit { - # # url = https://github.com/ongy/netlink-hs; - # url = https://github.com/teto/netlink-hs; - # }; - version = "1.1.2.0"; - src = pkgs.fetchFromGitHub { - owner = "teto"; - repo = "netlink-hs"; - rev = "090a48ebdbc35171529c7db1bd420d227c19b76d"; - sha256 = "sha256-qopa1ED4Bqk185b1AXZ32BG2s80SHDSkCODyoZfnft0="; - }; - }); + # hls, + outputs = { self, all-cabal-hashes-unpacked, nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: let + + compilerVersion = "96"; + + haskellOverlay = hnew: hold: with pkgs.haskell.lib; + let + gtk2hs-src = self.inputs.gtk2hs; + gtk2hs-buildtools = hnew.callCabal2nix "gtk2hs-buildtools" "${gtk2hs-src}/tools" {}; + chart-src = self.inputs.haskell-chart; - # self-reference to build mptcpanalyzer/mptcp-pm - mptcp = self.packages."${system}".mptcp; + in + # (pkgs.frameHaskellOverlay-921 hnew hold) + # // + (pkgs.callPackage ./overlay-96.nix { inherit self; } hnew hold) + // { + + # this repo software + mptcp = self.packages.${system}.mptcp; + mptcp-pm = self.packages.${system}.mptcp-pm; + mptcpanalyzer = self.packages.${system}.mptcpanalyzer; }; pkgs = import nixpkgs { inherit system; - # overlays = pkgs.lib.attrValues (self.overlays); + overlays = [ + # self.overlay + (final: prev: { + all-cabal-hashes = prev.runCommand "all-cabal-hashes.tar.gz" + { } + '' + cd ${all-cabal-hashes-unpacked} + cd .. + tar czf $out $(basename ${all-cabal-hashes-unpacked}) + ''; + }) + ]; config = { allowUnfree = false; allowBroken = true;}; }; - hsPkgs = pkgs.haskell.packages."ghc${compilerVersion}"; + hsPkgs = pkgs.haskell.packages."ghc${compilerVersion}".extend( haskellOverlay ); # modifier used in haskellPackages.developPackage myModifier = drv: pkgs.haskell.lib.addBuildTools drv (with hsPkgs; [ cabal-install - replica.packages.${system}.build - hls.packages.${system}."haskell-language-server-${compilerVersion}" + self.inputs.replica.packages.${system}.replica + # hls.packages.${system}."haskell-language-server-${compilerVersion}" + # ihaskell.packages.${system}."ihaskell-${compilerVersion}" # not available # hls.packages.${system}."hie-bios-${compilerVersion}" - cairo # for chart-cairo - dhall # for the repl + # cairo # for chart-cairo + # dhall # for the repl pkgs.dhall-json # for dhall-to-json - glib + # glib hasktags - stan + # stan # pkg-config zlib - pkgs.dhall-lsp-server - pkgs.stylish-haskell + # pkgs.dhall-lsp-server # broken + # pkgs.stylish-haskell # we need the mptcp.h in mptcp-pm # pkgs.linuxHeaders @@ -97,7 +135,7 @@ mkPackage = name: hsPkgs.developPackage { - root = pkgs.lib.cleanSource (builtins.toPath ./. + "/${name}"); + root = ./. + "/${name}"; name = name; returnShellEnv = false; withHoogle = true; @@ -105,8 +143,37 @@ modifier = myModifier; }; + mkDevShell = name: self.packages.${system}."${name}".envFunc {}; + + # provides a dev shell with libraries built by nix + mkDevShellWithNix = name: + # self.packages.${system}."${name}".envFunc {}; + # Returns a derivation whose environment contains a GHC with only + hsPkgs.shellFor { + packages = p: + [p."${name}"]; + # map (name: p.${name}) (attrNames + # # Disable dependencies should not be part of the shell. + # (removeAttrs hlsSources )); + + # src = null; + }; + in { + + legacyPackages.mptcpHaskellPkgs = hsPkgs; packages = { + default = self.packages.${system}.mptcpanalyzer; + + # pkgs.haskell.lib.doJailbreak + Chart-cairo = hsPkgs.Chart-cairo; + # .overrideAttrs(oa: { + # # nativeBuildInputs = [ hsPkgs.Chart ]; + # # propagatedBuildInputs = [ hsPkgs.Chart ]; + # # buildInputs = []; + # # buildInputs = oa.buildInputs ++ [ hsPkgs.Chart ]; + + # })); # basic library mptcp = mkPackage "mptcp"; @@ -123,24 +190,36 @@ }); }; - defaultPackage = self.packages.${system}.mptcpanalyzer; - - devShells = { - mptcp = self.packages.${system}.mptcp.envFunc {}; - mptcp-pm = self.packages.${system}.mptcp-pm.envFunc {}; - - mptcpanalyzer = let - shell = self.packages.${system}.mptcpanalyzer.envFunc {}; - in shell.overrideAttrs(oa: { - postShellHook = '' - cd mptcpanalyzer - set -x - result=$(cabal list-bin exe:mptcpanalyzer) - if [ $? -eq 0 ]; then - export PATH="$(dirname $result):$PATH" - fi - ''; - }); + # TODO add a shellFor (for all 3 packages) + devShells = rec { + + default = mptcp; + # cabal will provide the libraries + # envFunc { withHoogle } + mptcp = mkDevShell "mptcp"; + mptcp-pm = mkDevShell "mptcp-pm"; + + # nix provides libraries in its environment + mptcp-nix = mkDevShellWithNix "mptcp"; # self.packages.${system}.mptcp.envFunc {}; + mptcp-pm-nix = mkDevShellWithNix "mptcp-pm"; + + mptcpanalyzer-nix = mkDevShellWithNix "mptcpanalyzer"; + # mptcpanalyzer = let + # shell = self.packages.${system}.mptcpanalyzer.envFunc {}; + # in shell.overrideAttrs(oa: { + # postShellHook = '' + # cd mptcpanalyzer + # set -x + # result=$(cabal list-bin exe:mptcpanalyzer) + # if [ $? -eq 0 ]; then + # export PATH="$(dirname $result):$PATH" + # fi + # ''; + # }); }; - }); + }) // { + + overlay = final: prev: { + }; + }; } diff --git a/mptcp-pm/mptcp-pm.cabal b/mptcp-pm/mptcp-pm.cabal index 6f5f4ad..373690e 100644 --- a/mptcp-pm/mptcp-pm.cabal +++ b/mptcp-pm/mptcp-pm.cabal @@ -25,7 +25,7 @@ extra-source-files: tested-with: GHC == 8.10.7 - GHC == 9.2.1 + GHC == 9.2.3 Source-repository head type: git @@ -59,20 +59,6 @@ common shared-properties , readable , polysemy -- winning combination - -- co-log-0.4.0.1 - -- co-log-core-0.2.1.1 - -- co-log-polysemy-0.0.1.3 - -- integer-logarithms-1.0.3.1 - -- polysemy-log-0.3.0.2 - -- polysemy-log-co-0.3.0.2 - -- co-log-polysemy-0.0.1.3 - -- polysemy-1.7.1.0 - -- polysemy-conc-0.5.0.0 - -- polysemy-log-0.3.0.2 - -- polysemy-log-co-0.3.0.2 - -- polysemy-plugin-0.4.3.0 - -- polysemy-time-0.1.4.0 - -- >= 0.2.2.4 , polysemy-log , polysemy-log-co @@ -124,7 +110,6 @@ library , cereal , enumset , ip >= 1.7.3 - , bytestring-conversion , text -- todo get rid of it -- for liftIO @@ -144,7 +129,7 @@ library Exposed-Modules: Net.SockDiag , Net.Bitset - , Net.Tcp.Constants + -- , Net.Tcp.Constants , Net.Mptcp.Types , Net.Mptcp.Utils , Net.Mptcp.Constants diff --git a/mptcp/cabal.project b/mptcp/cabal.project index e85216b..14d9825 100644 --- a/mptcp/cabal.project +++ b/mptcp/cabal.project @@ -1 +1,7 @@ packages: ./*.cabal + + +source-repository-package + type: git + location: https://github.com/teto/readable + tag: d235d2590d326d4a3c5736793993096f35d0ac76 diff --git a/mptcp/mptcp.cabal b/mptcp/mptcp.cabal index ad06f5c..5b793e4 100644 --- a/mptcp/mptcp.cabal +++ b/mptcp/mptcp.cabal @@ -19,7 +19,7 @@ extra-source-files: tested-with: GHC == 8.10.7 - GHC == 9.2.1 + GHC == 9.2.3 Flag SystemHeaders { Description: Use system kernel headers @@ -40,7 +40,6 @@ library , containers , enumset , ip >= 1.7.3 - , bytestring-conversion , text , unordered-containers hs-source-dirs: diff --git a/mptcpanalyzer/cabal.project b/mptcpanalyzer/cabal.project index 6c7687c..1c09b3f 100644 --- a/mptcpanalyzer/cabal.project +++ b/mptcpanalyzer/cabal.project @@ -11,12 +11,19 @@ source-repository-package --sha256:sha256-x3DqqNhevWHV13yRRcjIiBguCGst5olb7tQzPyshduE= --- https://input-output-hk.github.io/haskell.nix/tutorials/source-repository-hashes/#handling-git-repositories-in-projects source-repository-package - type: git - location: https://github.com/kowainik/co-log.git - subdir: co-log-polysemy - tag: 72fbe394b437c698d574cd7604ad3f7f807383e0 + type: git + location: https://github.com/teto/readable + tag: d235d2590d326d4a3c5736793993096f35d0ac76 + +index-state: 2022-08-10T23:35:05Z + +-- https://input-output-hk.github.io/haskell.nix/tutorials/source-repository-hashes/#handling-git-repositories-in-projects +-- source-repository-package +-- type: git +-- location: https://github.com/kowainik/co-log.git +-- subdir: co-log-polysemy +-- tag: 72fbe394b437c698d574cd7604ad3f7f807383e0 -- profiling: True documentation: False diff --git a/mptcpanalyzer/mptcpanalyzer.cabal b/mptcpanalyzer/mptcpanalyzer.cabal index fdd9248..ba9b4c3 100644 --- a/mptcpanalyzer/mptcpanalyzer.cabal +++ b/mptcpanalyzer/mptcpanalyzer.cabal @@ -37,7 +37,8 @@ extra-source-files: tests/integration/list-tcp.test -- benchmarks/* tested-with: - GHC == 8.10.7 + -- GHC == 8.10.7 + GHC == 9.2.4 Source-repository head type: git @@ -70,14 +71,12 @@ common shared-properties , aeson-extra , Cabal , Chart >= 1.5 - , Chart-cairo + -- , Chart-cairo + , Chart-diagrams , Frames , bytestring - -- , ghc >= 8.10.7 , bitwise-enum -- , enumset - -- , byteunits - -- , time-units , cereal , containers , mptcp @@ -122,7 +121,7 @@ common shared-properties -- -fno-warn-unused-imports -- -fforce-recomp makes it build twice if flag(WithPolysemy) - ghc-options: -fplugin=Polysemy.Plugin + -- ghc-options: -fplugin=Polysemy.Plugin build-depends: polysemy-plugin -- if flag(ExtraChecks) @@ -137,8 +136,8 @@ common shared-properties -- -ddump-timings -Wno-unused-imports -- build-depends: polysemy-plugin - -fno-warn-unused-binds - -fno-warn-unused-matches + -- -fno-warn-unused-binds + -- -fno-warn-unused-matches -- -ddump-splices to dump TH code ghc-options: @@ -147,24 +146,19 @@ common shared-properties -- -Werror=warn-missing-methods -Wpartial-fields -- -dth-dec-file - -fwrite-ide-info - -hiedir=.hie - -haddock + -- -fwrite-ide-info + -- -hiedir=.hie + -- -haddock -- -fexternal-interpreter -- -fplugin=Polysemy.Plugin default-extensions: - -- , OverloadedStrings - FlexibleContexts - , StrictData - , DataKinds - , FlexibleContexts - , GADTs + -- StrictData + DataKinds , LambdaCase - , OverloadedStrings - , PolyKinds + -- , OverloadedStrings , RankNTypes - , ScopedTypeVariables - , TemplateHaskell + -- , ScopedTypeVariables + -- , TemplateHaskell , TypeApplications , TypeOperators , TypeFamilies @@ -227,8 +221,9 @@ library , Chart-cairo , transformers hs-source-dirs: src/ - ghc-options: - -haddock + -- ghc-options: + -- -dshow-passes + -- -haddock -- TODO add data-files executable mptcpanalyzer @@ -314,7 +309,6 @@ Test-Suite test hs-source-dirs: tests default-language: Haskell2010 default-extensions: - -- , OverloadedStrings FlexibleContexts , StrictData , DataKinds @@ -341,23 +335,3 @@ Test-Suite test ghc-options: -Wall -threaded - - --- doctests are a pain --- test-suite doctests --- type: exitcode-stdio-1.0 --- main-is: doctests.hs --- build-depends: --- base --- , base-compat >=0.10.5 && <0.12 --- , doctest >=0.15 && <0.18 --- , QuickCheck >=2.12 && <2.15 --- , template-haskell --- , mptcpanalyzer --- -- there are several custom packages --- -- exe:example --- -- x-doctest-components: --- -- lib:mptcpanalyzer --- ghc-options: -Wall -threaded --- hs-source-dirs: tests --- default-language: Haskell2010 diff --git a/mptcpanalyzer/src/MptcpAnalyzer/ArtificialFields.hs b/mptcpanalyzer/src/MptcpAnalyzer/ArtificialFields.hs index c6ae22e..37fa990 100644 --- a/mptcpanalyzer/src/MptcpAnalyzer/ArtificialFields.hs +++ b/mptcpanalyzer/src/MptcpAnalyzer/ArtificialFields.hs @@ -11,6 +11,7 @@ generated in a postprocess step {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TemplateHaskell #-} module MptcpAnalyzer.ArtificialFields where import MptcpAnalyzer.Stream diff --git a/mptcpanalyzer/src/MptcpAnalyzer/Cache.hs b/mptcpanalyzer/src/MptcpAnalyzer/Cache.hs index 526dd57..d1b65b7 100644 --- a/mptcpanalyzer/src/MptcpAnalyzer/Cache.hs +++ b/mptcpanalyzer/src/MptcpAnalyzer/Cache.hs @@ -10,8 +10,13 @@ License : GPL-3 {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE StandaloneDeriving #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE ScopedTypeVariables #-} module MptcpAnalyzer.Cache ( - CacheId(..) + CacheId(..) , Cache(..) , CacheConfig(..) , runMockCache diff --git a/mptcpanalyzer/src/MptcpAnalyzer/Commands/Map.hs b/mptcpanalyzer/src/MptcpAnalyzer/Commands/Map.hs index 5485b00..430eb54 100644 --- a/mptcpanalyzer/src/MptcpAnalyzer/Commands/Map.hs +++ b/mptcpanalyzer/src/MptcpAnalyzer/Commands/Map.hs @@ -36,7 +36,6 @@ import qualified Polysemy as P import Polysemy.State as P import Polysemy.Trace as P import Prelude hiding (log) --- import Colog.Polysemy (Log, log) import Data.Either (lefts, rights) import Data.Function (on) import Data.List (sortBy, sortOn) diff --git a/mptcpanalyzer/src/MptcpAnalyzer/Commands/Plot.hs b/mptcpanalyzer/src/MptcpAnalyzer/Commands/Plot.hs index 5a354d4..4375394 100644 --- a/mptcpanalyzer/src/MptcpAnalyzer/Commands/Plot.hs +++ b/mptcpanalyzer/src/MptcpAnalyzer/Commands/Plot.hs @@ -67,7 +67,6 @@ import Polysemy import qualified Polysemy as P import Polysemy.State as P import Polysemy.Trace as P --- import Colog.Polysemy (Log, log) import System.Exit import System.Process hiding (runCommand) -- import Data.Time.LocalTime diff --git a/mptcpanalyzer/src/MptcpAnalyzer/Debug.hs b/mptcpanalyzer/src/MptcpAnalyzer/Debug.hs index bafe068..3e05d1c 100644 --- a/mptcpanalyzer/src/MptcpAnalyzer/Debug.hs +++ b/mptcpanalyzer/src/MptcpAnalyzer/Debug.hs @@ -4,6 +4,8 @@ Description : Utilities to help debug Maintainer : matt License : GPL-3 -} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE ScopedTypeVariables #-} module MptcpAnalyzer.Debug where diff --git a/mptcpanalyzer/src/MptcpAnalyzer/Frame.hs b/mptcpanalyzer/src/MptcpAnalyzer/Frame.hs index 09ef371..787916b 100644 --- a/mptcpanalyzer/src/MptcpAnalyzer/Frame.hs +++ b/mptcpanalyzer/src/MptcpAnalyzer/Frame.hs @@ -1,5 +1,6 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE FlexibleContexts #-} {-| Description : Maintainer : matt @@ -41,10 +42,10 @@ import System.IO.Unsafe (unsafePerformIO) -- bs <- P.runSafeT . P.runEffect $ produceDSV defaultParserOptions f >-> P.map BLU.fromString -- return bs -newtype Test a = FrameRec a - +-- newtype Test a = FrameRec a -- TODO here we want to put a bytestring -instance (ColumnHeaders rs, V.RecMapMethod Show ElField rs, V.RecordToList rs) => Serialize (Frame (Record rs)) where +-- +instance (ColumnHeaders rs, V.RecMapMethod Show ElField rs, V.RecordToList rs) => Serialize (Frame (Record rs)) where -- putByteString put f = do -- (csvDelimiter defaultTsharkPrefs) diff --git a/mptcpanalyzer/src/MptcpAnalyzer/Loader.hs b/mptcpanalyzer/src/MptcpAnalyzer/Loader.hs index dc4c07b..382b338 100644 --- a/mptcpanalyzer/src/MptcpAnalyzer/Loader.hs +++ b/mptcpanalyzer/src/MptcpAnalyzer/Loader.hs @@ -4,7 +4,10 @@ Description : Load pcap/csv into a @Frame@ Maintainer : matt License : GPL-3 -} -module MptcpAnalyzer.Loader ( +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE OverloadedStrings #-} +module MptcpAnalyzer.Loader +( loadPcapIntoFrame , loadPcapIntoFrameNoCache , buildAFrameFromStreamIdTcp diff --git a/mptcpanalyzer/src/MptcpAnalyzer/Types.hs b/mptcpanalyzer/src/MptcpAnalyzer/Types.hs index b92c4b6..198ee00 100644 --- a/mptcpanalyzer/src/MptcpAnalyzer/Types.hs +++ b/mptcpanalyzer/src/MptcpAnalyzer/Types.hs @@ -7,10 +7,11 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE PackageImports #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} +{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module MptcpAnalyzer.Types -- ( @@ -162,10 +163,6 @@ instance (V.KnownField t, Hashable (V.Snd t), Hashable (F.Record rs), rs F.⊆ ( deriving instance Hashable IP --- IPv6 is Word128 -deriving instance Generic IPv6 - -deriving instance Hashable Word128 deriving instance Hashable IPv6 -- shadow param diff --git a/mptcpanalyzer/src/Net/Mptcp/Stats.hs b/mptcpanalyzer/src/Net/Mptcp/Stats.hs index c99e5ed..f66a187 100644 --- a/mptcpanalyzer/src/Net/Mptcp/Stats.hs +++ b/mptcpanalyzer/src/Net/Mptcp/Stats.hs @@ -6,6 +6,8 @@ License : GPL-3 -} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE StandaloneDeriving #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE OverloadedStrings #-} module Net.Mptcp.Stats ( TcpSubflowUnidirectionalStats(..) , MptcpUnidirectionalStats(..) diff --git a/mptcpanalyzer/src/Net/Tcp/Stats.hs b/mptcpanalyzer/src/Net/Tcp/Stats.hs index 80ea1da..ce64195 100644 --- a/mptcpanalyzer/src/Net/Tcp/Stats.hs +++ b/mptcpanalyzer/src/Net/Tcp/Stats.hs @@ -1,6 +1,8 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DerivingVia #-} {-# LANGUAGE StandaloneDeriving #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE OverloadedStrings #-} {- Module: Net.Tcp.Stats Description : Compute basic TCP statistics diff --git a/mptcpanalyzer/src/Tshark/Fields.hs b/mptcpanalyzer/src/Tshark/Fields.hs index d0adf95..2dd0052 100644 --- a/mptcpanalyzer/src/Tshark/Fields.hs +++ b/mptcpanalyzer/src/Tshark/Fields.hs @@ -13,6 +13,7 @@ using "Frames" to load the resulting data into a frame. {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} +{-# LANGUAGE TemplateHaskell #-} module Tshark.Fields where import Net.Stream diff --git a/mptcpanalyzer/src/Tshark/Main.hs b/mptcpanalyzer/src/Tshark/Main.hs index 4327377..72bf0b4 100644 --- a/mptcpanalyzer/src/Tshark/Main.hs +++ b/mptcpanalyzer/src/Tshark/Main.hs @@ -7,6 +7,7 @@ Maintainer : matt WIRESHARK_CONFIG_DIR' -} +{-# LANGUAGE OverloadedStrings #-} module Tshark.Main ( TsharkParams(csvDelimiter, tsharkReadFilter) , generateCsvCommand @@ -18,6 +19,7 @@ module Tshark.Main ( where import Data.List (intercalate) +import Data.Text (Text) import qualified Data.Text as T import MptcpAnalyzer.ArtificialFields (ConnectionRole(RoleClient, RoleServer)) import qualified Net.IP @@ -142,4 +144,4 @@ generateCsvCommand fieldNames source tsharkParams = fields :: [T.Text] fields = ["-T", "fields"] - ++ Prelude.foldr (\fieldName l -> ["-e", fieldName] ++ l) [] fieldNames + ++ Prelude.foldr (\fieldName l -> ["-e" :: Text, fieldName] ++ l) [] fieldNames diff --git a/mptcpanalyzer/src/app/Main.hs b/mptcpanalyzer/src/app/Main.hs index 171bc6e..a1188a2 100755 --- a/mptcpanalyzer/src/app/Main.hs +++ b/mptcpanalyzer/src/app/Main.hs @@ -190,7 +190,6 @@ import qualified Polysemy.Trace as P import Prelude hiding (concat, init, log) import System.Directory import System.FilePath --- import Colog.Actions import Graphics.Rendering.Chart.Backend.Cairo (FileFormat(..), FileOptions(..), renderableToFile, toFile) import Graphics.Rendering.Chart.Renderable (toRenderable) diff --git a/overlay-96.nix b/overlay-96.nix new file mode 100644 index 0000000..c6bf284 --- /dev/null +++ b/overlay-96.nix @@ -0,0 +1,190 @@ +{ self, pkgs }: +hnew: hold: with pkgs.haskell.lib; + let + gtk2hs-src = self.inputs.gtk2hs; + gtk2hs-buildtools = hnew.callCabal2nix "gtk2hs-buildtools" "${gtk2hs-src}/tools" {}; + chart-src = self.inputs.haskell-chart; + + in + { + # Frames = hold.callHackage "Frames" "0.1.4.0" {}; + Frames = hold.callCabal2nix "Frames" "${self.inputs.frames}" {}; + + # readable = overrideSrc hold.readable { + # version = "matt-ghc923"; + # src = self.inputs.readable; + # } ; + + # TODO override Frames + # ip = let + # newIp = (overrideSrc hold.ip { src = self.inputs.haskell-ip; }); + # in doJailbreak (dontCheck (addBuildDepend newIp hnew.word-compat) ); + # circuithub:master + # bytebuild = unmarkBroken (dontCheck hold.bytebuild); + # bytebuild = overrideSrc hold.bytebuild { src = self.inputs.bytebuild; }; + # bytesmith = overrideSrc hold.bytesmith { src = self.inputs.bytesmith; }; + + # vinyl = hold.vinyl_0_14_3; + # active = doJailbreak hold.active; + + # chronos = overrideSrc hold.chronos { + # src = pkgs.fetchFromGitHub { + # # owner = "byorgey"; + # # rev = "fe6bf78a1b97ff7429630d0e8974c9bc40945dcf"; + # owner = "andrewthad"; + # repo = "chronos"; + # rev = "13b46574f2d811f27c693c78d92aed71c82f39d5"; + # sha256 = "sha256-YZ4/5yfeUx+8jZp5nuEXjOkUvO4EWsvXrY+uX4e+VnI="; + # }; + # }; + + # discussed at https://github.com/JonasDuregard/sized-functors/pull/10 + # 0.1.3.0 should be fine + # size-based = hold.callHackage "size-based" "0.1.3.0" {}; + + # size-based = overrideSrc (hold.size-based.overrideAttrs (oa: { + # patches = []; + # # })) { + # src = pkgs.fetchFromGitHub { + # # owner = "byorgey"; + # # rev = "fe6bf78a1b97ff7429630d0e8974c9bc40945dcf"; + # owner = "teto"; + # repo = "sized-functors"; + # rev = "98f884032c1830f0b7046fac5e8e5e73ebf5facf"; + # sha256 = "sha256-rQzO67AMP0Q95/aTKk76lalrV44RKqOs9g+W+Xd4W/M="; + # }; + # }; + # https://github.com/byorgey/sized-functors.git + + # relude = hold.relude_1_0_0_1; + + # TODO double check + Chart = pkgs.lib.pipe hold.Chart [ + (doJailbreak) + (addBuildDepend hnew.lens) + # (overrideCabal (old: { + # libraryHaskellDepends = old.libraryHaskellDepends ++ [ + # hnew.lens + # ]; + # })) + ]; + Chart-diagrams = doJailbreak hold.Chart-diagrams; + Chart-cairo = let + newCairo = hnew.callCabal2nix "Chart-cairo" "${chart-src}/chart-cairo" {}; + in + # newCairo; + # doJailbreak (newCairo.overrideAttrs(oa: { propagatedBuildInputs = [ hnew.Chart ]; })); + # overrideCabal newCairo (old: { libraryHaskellDepends = old.libraryHaskellDepends ++ [ hnew.Chart ]; }) ; + # newCairo; + pkgs.lib.pipe (newCairo) [ + # (addExtraLibrary hnew.cairo ) + (addSetupDepend hnew.cairo) + ]; + + # Chart-cairo = doJailbreak (hnew.callCabal2nix "Chart-cairo" "${chart-src}/chart-cairo" {}) ; + + # htoml hasn't been updated since 2016 https://github.com/cies/htoml/pull/22 + # htoml = dontCheck (overrideSrc hold.htoml { + # # src = builtins.fetchGit { + # # # url = https://github.com/ongy/netlink-hs; + # # url = https://github.com/teto/netlink-hs; + # # }; + # # version = "1.1.2.0"; + # src = pkgs.fetchFromGitHub { + # owner = "mirokuratczyk"; + # repo = "htoml"; + # rev = "33971287445c5e2531d9605a287486dfc3cbe1da"; + # sha256 = "sha256-BcHu+hzwSdf/11HEziCnNZ6lRrf5kEokfOU51XI9Rm0="; + # }; + # }); + + readable = doJailbreak hold.readable; + # readable = throw "error"; + # readable = overrideSrc hold.readable { + # version = "matt-ghc923"; + # src = self.inputs.readable; + # } ; + + polysemy = dontCheck hnew.polysemy_1_7_1_0; + polysemy-plugin = hnew.polysemy-plugin_0_4_3_1; + # polysemy-conc = hold.polysemy-conc_0_5_1_1; + # co-log-polysemy = doJailbreak (hold.co-log-polysemy); + co-log-polysemy = doJailbreak (overrideSrc hold.co-log-polysemy { + # src = builtins.fetchGit { + # # url = https://github.com/ongy/netlink-hs; + # url = https://github.com/teto/netlink-hs; + # }; + # version = "1.1.2.0"; + src = pkgs.fetchFromGitHub { + # //tree/ghc-9.2 + owner = "alaendle"; + repo = "co-log-polysemy"; + rev = "b4f96240179b486047ff4d80c978e8efcac8ac7e"; + sha256 = "sha256-QFjNzRSr/pb1nw4UBsg8uWBOkO+7ffpuYrUfLUuashM="; + }; + }); + # co-log-core = doJailbreak hold.co-log-core_0_3_0_0; + + colourista = hold.callCabal2nix "colourista" (pkgs.fetchzip { + url = "https://github.com/teto/colourista/archive/bf56469f7c2d9f226879831ed3a280f8f23be842.tar.gz"; + sha256 = "sha256-k91zTn1okIkvKQwOmZ+GFE0MfI6uSrPLPEhx0oDEONc="; + }) {}; + + inherit gtk2hs-buildtools ; + + # TODO see https://github.com/gtk2hs/gtk2hs/pull/310 and his fix at k0001/fix-cabal-3.6.0.0 + # use my fork instead + # cairo = hnew.callCabal2nix "cairo" "${gtk2hs-src}/cairo" {}; + cairo = hnew.callPackage ({ mkDerivation, array, base, bytestring, Cabal, cairo + , gtk2hs-buildtools, lib, mtl, text, utf8-string + }: + mkDerivation { + pname = "cairo"; + version = "0.13.8.2"; + src = "${gtk2hs-src}"; + postUnpack = "sourceRoot+=/cairo; echo source root reset to $sourceRoot"; + enableSeparateDataOutput = true; + setupHaskellDepends = [ pkgs.gcc base Cabal gtk2hs-buildtools ]; + libraryHaskellDepends = [ + array base bytestring Cabal mtl text utf8-string + ]; + libraryPkgconfigDepends = [ cairo ]; + homepage = "http://projects.haskell.org/gtk2hs/"; + description = "Binding to the Cairo library"; + license = lib.licenses.bsd3; + }) {inherit (pkgs) cairo;}; + + # polysemy-plugin = hnew.polysemy-plugin_0_4_3_0; + # polysemy-conc = hold.polysemy-conc_0_5_1_1; + # polysemy-test = hold.callCabal2nix "polysemy-test" (let src = pkgs.fetchzip { + # url = "https://github.com/tek/polysemy-test/archive/c83eb2a719e457e514d642a9d90651e69781c1d6.tar.gz"; + # sha256 = "sha256-EB5r45FKOejQa9WMXYGePmayBCeRygE0mEGatCot3mM="; + # }; in "${src}/packages/polysemy-test") {}; + + type-errors = dontCheck hold.type-errors; + # type-errors = hold.callCabal2nix "type-errors" (pkgs.fetchzip { + # url = "https://github.com/isovector/type-errors/archive/c73bd09eb7d1a7a6b5c61bd640c983496d0a9f8.tar.gz"; + # sha256 = "sha256-Q5SxA+fazW/e60uPqJ3krBt2optFK37OoAxy00lEbw8="; + # }) {}; + + # chronos = hold.chronos_1_1_3; + # polysemy-test = hold.callHackage "polysemy-test" "0.5.0.0" {}; + + netlink = overrideSrc hold.netlink { + # src = builtins.fetchGit { + # # url = https://github.com/ongy/netlink-hs; + # url = https://github.com/teto/netlink-hs; + # }; + version = "1.1.2.0"; + src = pkgs.fetchFromGitHub { + owner = "teto"; + repo = "netlink-hs"; + rev = "090a48ebdbc35171529c7db1bd420d227c19b76d"; + sha256 = "sha256-qopa1ED4Bqk185b1AXZ32BG2s80SHDSkCODyoZfnft0="; + }; + }; + haskell-src-meta = hold.haskell-src-meta.overrideAttrs (oa: { + patches = []; + }); + + }