From 75b7e3f995e7d4c708dc29a5d08aac320aca6b76 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Tue, 9 Apr 2024 12:41:32 +0200 Subject: [PATCH 01/24] Cardano-db-sync module but doesnt work (rebased on main) --- flake.lock | 2890 ++++++++++++++++++++++++++++++++--- flake.nix | 3 + modules/cardano-db-sync.nix | 111 ++ modules/default.nix | 6 + tests/cardano-db-sync.nix | 36 + tests/default.nix | 1 + tests/ogmios.nix | 2 +- 7 files changed, 2837 insertions(+), 212 deletions(-) create mode 100644 modules/cardano-db-sync.nix create mode 100644 tests/cardano-db-sync.nix diff --git a/flake.lock b/flake.lock index 71e00a4..7c494ba 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,23 @@ { "nodes": { "CHaP": { + "flake": false, + "locked": { + "lastModified": 1702906471, + "narHash": "sha256-br+hVo3R6nfmiSEPXcLKhIX4Kg5gcK2PjzjmvQsuUp8=", + "owner": "IntersectMBO", + "repo": "cardano-haskell-packages", + "rev": "48a359ac3f1d437ebaa91126b20e15a65201f004", + "type": "github" + }, + "original": { + "owner": "IntersectMBO", + "ref": "repo", + "repo": "cardano-haskell-packages", + "type": "github" + } + }, + "CHaP_2": { "flake": false, "locked": { "lastModified": 1702593630, @@ -33,6 +50,55 @@ "type": "github" } }, + "HTTP_2": { + "flake": false, + "locked": { + "lastModified": 1451647621, + "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", + "owner": "phadej", + "repo": "HTTP", + "rev": "9bc0996d412fef1787449d841277ef663ad9a915", + "type": "github" + }, + "original": { + "owner": "phadej", + "repo": "HTTP", + "type": "github" + } + }, + "HTTP_3": { + "flake": false, + "locked": { + "lastModified": 1451647621, + "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", + "owner": "phadej", + "repo": "HTTP", + "rev": "9bc0996d412fef1787449d841277ef663ad9a915", + "type": "github" + }, + "original": { + "owner": "phadej", + "repo": "HTTP", + "type": "github" + } + }, + "ameba-src": { + "flake": false, + "locked": { + "lastModified": 1679041484, + "narHash": "sha256-pc9mtVR/PBhM5l1PnDkm+y+McxbrfAmQzxmLi761VF4=", + "owner": "crystal-ameba", + "repo": "ameba", + "rev": "7c74d196d6d9a496a81a0c7b79ef44f39faf41b8", + "type": "github" + }, + "original": { + "owner": "crystal-ameba", + "ref": "v1.4.3", + "repo": "ameba", + "type": "github" + } + }, "attic": { "inputs": { "crane": "crane", @@ -59,6 +125,82 @@ "type": "github" } }, + "auth-keys-hub": { + "inputs": { + "crystal": "crystal", + "flake-parts": "flake-parts_2", + "inclusive": "inclusive", + "nixpkgs": [ + "cardano-db-sync", + "cardano-parts", + "nixpkgs" + ], + "statix": "statix", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1691483346, + "narHash": "sha256-wvn84eGcc+PMbq/qSCWcZ/kV7/bjwuGOVSn/9rGaaKw=", + "owner": "input-output-hk", + "repo": "auth-keys-hub", + "rev": "ab7c79f49886b8f24cfae4b967a59ea62af9156e", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "auth-keys-hub", + "type": "github" + } + }, + "bats-assert": { + "flake": false, + "locked": { + "lastModified": 1636059754, + "narHash": "sha256-ewME0l27ZqfmAwJO4h5biTALc9bDLv7Bl3ftBzBuZwk=", + "owner": "bats-core", + "repo": "bats-assert", + "rev": "34551b1d7f8c7b677c1a66fc0ac140d6223409e5", + "type": "github" + }, + "original": { + "owner": "bats-core", + "repo": "bats-assert", + "type": "github" + } + }, + "bats-support": { + "flake": false, + "locked": { + "lastModified": 1548869839, + "narHash": "sha256-Gr4ntadr42F2Ks8Pte2D4wNDbijhujuoJi4OPZnTAZU=", + "owner": "bats-core", + "repo": "bats-support", + "rev": "d140a65044b2d6810381935ae7f0c94c7023c8c3", + "type": "github" + }, + "original": { + "owner": "bats-core", + "repo": "bats-support", + "type": "github" + } + }, + "bdwgc-src": { + "flake": false, + "locked": { + "lastModified": 1661523039, + "narHash": "sha256-UYJQGeSykmfydGAmTlNJNyAPBasBkddOSoopBHiY7TI=", + "owner": "ivmai", + "repo": "bdwgc", + "rev": "cd1fbc1dbfd2cc888436944dd2784f39820698d7", + "type": "github" + }, + "original": { + "owner": "ivmai", + "ref": "v8.2.2", + "repo": "bdwgc", + "type": "github" + } + }, "blank": { "locked": { "lastModified": 1625557891, @@ -106,6 +248,57 @@ "type": "github" } }, + "blst_2": { + "flake": false, + "locked": { + "lastModified": 1656163412, + "narHash": "sha256-xero1aTe2v4IhWIJaEDUsVDOfE77dOV5zKeHWntHogY=", + "owner": "supranational", + "repo": "blst", + "rev": "03b5124029979755c752eec45f3c29674b558446", + "type": "github" + }, + "original": { + "owner": "supranational", + "repo": "blst", + "rev": "03b5124029979755c752eec45f3c29674b558446", + "type": "github" + } + }, + "blst_3": { + "flake": false, + "locked": { + "lastModified": 1656163412, + "narHash": "sha256-xero1aTe2v4IhWIJaEDUsVDOfE77dOV5zKeHWntHogY=", + "owner": "supranational", + "repo": "blst", + "rev": "03b5124029979755c752eec45f3c29674b558446", + "type": "github" + }, + "original": { + "owner": "supranational", + "repo": "blst", + "rev": "03b5124029979755c752eec45f3c29674b558446", + "type": "github" + } + }, + "blst_4": { + "flake": false, + "locked": { + "lastModified": 1656163412, + "narHash": "sha256-xero1aTe2v4IhWIJaEDUsVDOfE77dOV5zKeHWntHogY=", + "owner": "supranational", + "repo": "blst", + "rev": "03b5124029979755c752eec45f3c29674b558446", + "type": "github" + }, + "original": { + "owner": "supranational", + "repo": "blst", + "rev": "03b5124029979755c752eec45f3c29674b558446", + "type": "github" + } + }, "cabal-32": { "flake": false, "locked": { @@ -123,6 +316,40 @@ "type": "github" } }, + "cabal-32_2": { + "flake": false, + "locked": { + "lastModified": 1603716527, + "narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=", + "owner": "haskell", + "repo": "cabal", + "rev": "48bf10787e27364730dd37a42b603cee8d6af7ee", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.2", + "repo": "cabal", + "type": "github" + } + }, + "cabal-32_3": { + "flake": false, + "locked": { + "lastModified": 1603716527, + "narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=", + "owner": "haskell", + "repo": "cabal", + "rev": "48bf10787e27364730dd37a42b603cee8d6af7ee", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.2", + "repo": "cabal", + "type": "github" + } + }, "cabal-34": { "flake": false, "locked": { @@ -140,6 +367,40 @@ "type": "github" } }, + "cabal-34_2": { + "flake": false, + "locked": { + "lastModified": 1645834128, + "narHash": "sha256-wG3d+dOt14z8+ydz4SL7pwGfe7SiimxcD/LOuPCV6xM=", + "owner": "haskell", + "repo": "cabal", + "rev": "5ff598c67f53f7c4f48e31d722ba37172230c462", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.4", + "repo": "cabal", + "type": "github" + } + }, + "cabal-34_3": { + "flake": false, + "locked": { + "lastModified": 1645834128, + "narHash": "sha256-wG3d+dOt14z8+ydz4SL7pwGfe7SiimxcD/LOuPCV6xM=", + "owner": "haskell", + "repo": "cabal", + "rev": "5ff598c67f53f7c4f48e31d722ba37172230c462", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.4", + "repo": "cabal", + "type": "github" + } + }, "cabal-36": { "flake": false, "locked": { @@ -157,9 +418,58 @@ "type": "github" } }, + "cabal-36_2": { + "flake": false, + "locked": { + "lastModified": 1669081697, + "narHash": "sha256-I5or+V7LZvMxfbYgZATU4awzkicBwwok4mVoje+sGmU=", + "owner": "haskell", + "repo": "cabal", + "rev": "8fd619e33d34924a94e691c5fea2c42f0fc7f144", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.6", + "repo": "cabal", + "type": "github" + } + }, + "cabal-36_3": { + "flake": false, + "locked": { + "lastModified": 1669081697, + "narHash": "sha256-I5or+V7LZvMxfbYgZATU4awzkicBwwok4mVoje+sGmU=", + "owner": "haskell", + "repo": "cabal", + "rev": "8fd619e33d34924a94e691c5fea2c42f0fc7f144", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.6", + "repo": "cabal", + "type": "github" + } + }, + "capkgs": { + "locked": { + "lastModified": 1697123727, + "narHash": "sha256-uSXZAELJF5EfivH9qyLssBUAvhcf3RM9sKhD3W2mdhc=", + "owner": "input-output-hk", + "repo": "capkgs", + "rev": "b197e225592dfe38afb80c94b628d99968c0541d", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "capkgs", + "type": "github" + } + }, "cardano-automation": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_5", "haskellNix": [ "cardano-node", "haskellNix" @@ -201,13 +511,94 @@ "type": "github" } }, - "cardano-mainnet-mirror": { + "cardano-db-sync": { "inputs": { - "nixpkgs": "nixpkgs_4" + "CHaP": "CHaP", + "cardano-parts": "cardano-parts", + "flake-compat": "flake-compat_5", + "hackageNix": "hackageNix", + "haskellNix": "haskellNix", + "iohkNix": "iohkNix", + "nixpkgs": [ + "cardano-db-sync", + "haskellNix", + "nixpkgs-unstable" + ], + "utils": "utils" }, "locked": { - "lastModified": 1642701714, - "narHash": "sha256-SR3luE+ePX6U193EKE/KSEuVzWAW0YsyPYDC4hOvALs=", + "lastModified": 1707925775, + "narHash": "sha256-z3YUrUImpV/wmJi+pfw6YuhBw+2Xd3jGlSWk7WI69/4=", + "owner": "intersectmbo", + "repo": "cardano-db-sync", + "rev": "ed3dc8bbb79f07c26ec43f10bad661b0bef3b915", + "type": "github" + }, + "original": { + "owner": "intersectmbo", + "ref": "13.2.0.1", + "repo": "cardano-db-sync", + "type": "github" + } + }, + "cardano-db-sync-schema": { + "flake": false, + "locked": { + "lastModified": 1688568916, + "narHash": "sha256-XTGTi3PzCcbLL+63JSXTe7mQmGKB0YgEoW1VpqdX2d0=", + "owner": "input-output-hk", + "repo": "cardano-db-sync", + "rev": "6e69a80797f2d68423b25ca7787e81533b367e42", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "13.1.1.3", + "repo": "cardano-db-sync", + "type": "github" + } + }, + "cardano-db-sync-schema-ng": { + "flake": false, + "locked": { + "lastModified": 1694078776, + "narHash": "sha256-QBnUDobTwWQmooCNr1WcaAzRbAKokon8lvAN6VQ1u34=", + "owner": "input-output-hk", + "repo": "cardano-db-sync", + "rev": "b44eb735fe64fe4e8079935df722d0a32a41c2a4", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "sancho-1-1-0", + "repo": "cardano-db-sync", + "type": "github" + } + }, + "cardano-db-sync-service": { + "flake": false, + "locked": { + "lastModified": 1688568916, + "narHash": "sha256-XTGTi3PzCcbLL+63JSXTe7mQmGKB0YgEoW1VpqdX2d0=", + "owner": "input-output-hk", + "repo": "cardano-db-sync", + "rev": "6e69a80797f2d68423b25ca7787e81533b367e42", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "13.1.1.3", + "repo": "cardano-db-sync", + "type": "github" + } + }, + "cardano-mainnet-mirror": { + "inputs": { + "nixpkgs": "nixpkgs_16" + }, + "locked": { + "lastModified": 1642701714, + "narHash": "sha256-SR3luE+ePX6U193EKE/KSEuVzWAW0YsyPYDC4hOvALs=", "owner": "input-output-hk", "repo": "cardano-mainnet-mirror", "rev": "819488be9eabbba6aaa7c931559bc584d8071e3d", @@ -222,20 +613,20 @@ }, "cardano-node": { "inputs": { - "CHaP": "CHaP", + "CHaP": "CHaP_2", "cardano-automation": "cardano-automation", "cardano-mainnet-mirror": "cardano-mainnet-mirror", "customConfig": "customConfig", "em": "em", - "empty-flake": "empty-flake", - "flake-compat": "flake-compat_3", - "hackageNix": "hackageNix", - "haskellNix": "haskellNix", + "empty-flake": "empty-flake_2", + "flake-compat": "flake-compat_8", + "hackageNix": "hackageNix_2", + "haskellNix": "haskellNix_2", "hostNixpkgs": [ "cardano-node", "nixpkgs" ], - "iohkNix": "iohkNix", + "iohkNix": "iohkNix_2", "nix2container": "nix2container_2", "nixpkgs": [ "cardano-node", @@ -244,7 +635,7 @@ ], "ops-lib": "ops-lib", "std": "std_2", - "utils": "utils_2" + "utils": "utils_3" }, "locked": { "lastModified": 1702654749, @@ -261,6 +652,65 @@ "type": "github" } }, + "cardano-node-service": { + "flake": false, + "locked": { + "lastModified": 1690209950, + "narHash": "sha256-d0V8N+y/OarYv6GQycGXnbPly7GeJRBEeE1017qj9eI=", + "owner": "input-output-hk", + "repo": "cardano-node", + "rev": "d2d90b48c5577b4412d5c9c9968b55f8ab4b9767", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "8.1.2", + "repo": "cardano-node", + "type": "github" + } + }, + "cardano-parts": { + "inputs": { + "auth-keys-hub": "auth-keys-hub", + "capkgs": "capkgs", + "cardano-db-sync-schema": "cardano-db-sync-schema", + "cardano-db-sync-schema-ng": "cardano-db-sync-schema-ng", + "cardano-db-sync-service": "cardano-db-sync-service", + "cardano-node-service": "cardano-node-service", + "cardano-wallet-service": "cardano-wallet-service", + "colmena": "colmena", + "empty-flake": "empty-flake", + "flake-parts": "flake-parts_3", + "haskell-nix": "haskell-nix", + "inputs-check": "inputs-check", + "iohk-nix": "iohk-nix", + "iohk-nix-ng": "iohk-nix-ng", + "nix": "nix_2", + "nixpkgs": [ + "cardano-db-sync", + "nixpkgs" + ], + "nixpkgs-unstable": "nixpkgs-unstable_2", + "offchain-metadata-tools-service": "offchain-metadata-tools-service", + "sops-nix": "sops-nix", + "terraform-providers": "terraform-providers", + "terranix": "terranix", + "treefmt-nix": "treefmt-nix_2" + }, + "locked": { + "lastModified": 1697147999, + "narHash": "sha256-mbSWIcmDnt2mlETCNL8MI97nDH1lkOxIxFHKXXfOV28=", + "owner": "input-output-hk", + "repo": "cardano-parts", + "rev": "af8993ee12f78ddfcc31eefe006391669cb11462", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-parts", + "type": "github" + } + }, "cardano-shell": { "flake": false, "locked": { @@ -277,6 +727,81 @@ "type": "github" } }, + "cardano-shell_2": { + "flake": false, + "locked": { + "lastModified": 1608537748, + "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", + "owner": "input-output-hk", + "repo": "cardano-shell", + "rev": "9392c75087cb9a3d453998f4230930dea3a95725", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-shell", + "type": "github" + } + }, + "cardano-shell_3": { + "flake": false, + "locked": { + "lastModified": 1608537748, + "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", + "owner": "input-output-hk", + "repo": "cardano-shell", + "rev": "9392c75087cb9a3d453998f4230930dea3a95725", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-shell", + "type": "github" + } + }, + "cardano-wallet-service": { + "flake": false, + "locked": { + "lastModified": 1689751896, + "narHash": "sha256-ijflgIw+1FpLoxM4Rksf4MJvNqnEPAv3gNWE8zMuefU=", + "owner": "cardano-foundation", + "repo": "cardano-wallet", + "rev": "3f0d2f3abe706958fab8cdc528184068bd0453c9", + "type": "github" + }, + "original": { + "owner": "cardano-foundation", + "ref": "v2023-07-18", + "repo": "cardano-wallet", + "type": "github" + } + }, + "colmena": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "cardano-db-sync", + "cardano-parts", + "nixpkgs" + ], + "stable": "stable" + }, + "locked": { + "lastModified": 1684127108, + "narHash": "sha256-01bfuSY4gnshhtqA1EJCw2CMsKkAx+dHS+sEpQ2+EAQ=", + "owner": "zhaofengli", + "repo": "colmena", + "rev": "5fdd743a11e7291bd8ac1e169d62ba6156c99be4", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "ref": "v0.4.0", + "repo": "colmena", + "type": "github" + } + }, "crane": { "inputs": { "nixpkgs": [ @@ -300,8 +825,8 @@ }, "crane_2": { "inputs": { - "flake-compat": "flake-compat_5", - "flake-utils": "flake-utils_7", + "flake-compat": "flake-compat_10", + "flake-utils": "flake-utils_10", "nixpkgs": [ "cardano-node", "std", @@ -324,6 +849,102 @@ "type": "github" } }, + "crystal": { + "inputs": { + "ameba-src": "ameba-src", + "bdwgc-src": "bdwgc-src", + "crystal-aarch64-darwin": "crystal-aarch64-darwin", + "crystal-src": "crystal-src", + "crystal-x86_64-darwin": "crystal-x86_64-darwin", + "crystal-x86_64-linux": "crystal-x86_64-linux", + "crystalline-src": "crystalline-src", + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1683429373, + "narHash": "sha256-Mx5lwMyk2T40wFqOoYcJLs4srwO2UrsepTZhlHNuTrI=", + "owner": "manveru", + "repo": "crystal-flake", + "rev": "e7a443c20e2be6e5dd870586705dd27c91aa9c5c", + "type": "github" + }, + "original": { + "owner": "manveru", + "repo": "crystal-flake", + "type": "github" + } + }, + "crystal-aarch64-darwin": { + "flake": false, + "locked": { + "narHash": "sha256-NqYaZHM3kHAgYbO0RDJtA8eHqp4vVe4MBpisTOGrRVw=", + "type": "tarball", + "url": "https://github.com/crystal-lang/crystal/releases/download/1.8.1/crystal-1.8.1-1-darwin-universal.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/crystal-lang/crystal/releases/download/1.8.1/crystal-1.8.1-1-darwin-universal.tar.gz" + } + }, + "crystal-src": { + "flake": false, + "locked": { + "lastModified": 1681995387, + "narHash": "sha256-t+1vM1m62UftCvfa90Dg6nqt6Zseh/GP/Gc1VfOa4+c=", + "owner": "crystal-lang", + "repo": "crystal", + "rev": "a59a3dbd738269d5aad6051c3834fc70f482f469", + "type": "github" + }, + "original": { + "owner": "crystal-lang", + "ref": "1.8.1", + "repo": "crystal", + "type": "github" + } + }, + "crystal-x86_64-darwin": { + "flake": false, + "locked": { + "narHash": "sha256-NqYaZHM3kHAgYbO0RDJtA8eHqp4vVe4MBpisTOGrRVw=", + "type": "tarball", + "url": "https://github.com/crystal-lang/crystal/releases/download/1.8.1/crystal-1.8.1-1-darwin-universal.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/crystal-lang/crystal/releases/download/1.8.1/crystal-1.8.1-1-darwin-universal.tar.gz" + } + }, + "crystal-x86_64-linux": { + "flake": false, + "locked": { + "narHash": "sha256-/Jk3uiglM/hzjygxmMUgVTvz+tuFFjBv8+uUIL05rXo=", + "type": "tarball", + "url": "https://github.com/crystal-lang/crystal/releases/download/1.8.1/crystal-1.8.1-1-linux-x86_64.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/crystal-lang/crystal/releases/download/1.8.1/crystal-1.8.1-1-linux-x86_64.tar.gz" + } + }, + "crystalline-src": { + "flake": false, + "locked": { + "lastModified": 1681549124, + "narHash": "sha256-kx3rdGqIbrOaHY7V3uXLqIFEYzzsMKzNwZ6Neq8zM3c=", + "owner": "elbywan", + "repo": "crystalline", + "rev": "4ac0ae282c5f4172230fea1e93df51c2b380f475", + "type": "github" + }, + "original": { + "owner": "elbywan", + "ref": "v0.9.0", + "repo": "crystalline", + "type": "github" + } + }, "customConfig": { "locked": { "lastModified": 1630400035, @@ -393,7 +1014,7 @@ "std", "nixpkgs" ], - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1686680692, @@ -414,7 +1035,7 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1695973661, @@ -526,11 +1147,51 @@ "type": "github" } }, + "empty-flake_2": { + "locked": { + "lastModified": 1630400035, + "narHash": "sha256-MWaVOCzuFwp09wZIW9iHq5wWen5C69I940N1swZLEQ0=", + "owner": "input-output-hk", + "repo": "empty-flake", + "rev": "2040a05b67bf9a669ce17eca56beb14b4206a99a", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "empty-flake", + "type": "github" + } + }, "fenix": { "inputs": { - "nixpkgs": "nixpkgs_9", + "nixpkgs": [ + "cardano-db-sync", + "cardano-parts", + "auth-keys-hub", + "statix", + "nixpkgs" + ], "rust-analyzer-src": "rust-analyzer-src" }, + "locked": { + "lastModified": 1645251813, + "narHash": "sha256-cQ66tGjnZclBCS3nD26mZ5fUH+3/HnysGffBiWXUSHk=", + "owner": "nix-community", + "repo": "fenix", + "rev": "9892337b588c38ec59466a1c89befce464aae7f8", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "fenix_2": { + "inputs": { + "nixpkgs": "nixpkgs_21", + "rust-analyzer-src": "rust-analyzer-src_2" + }, "locked": { "lastModified": 1677306201, "narHash": "sha256-VZ9x7qdTosFvVsrpgFHrtYfT6PU3yMIs7NRYn9ELapI=", @@ -561,14 +1222,14 @@ "type": "github" } }, - "flake-compat_2": { + "flake-compat_10": { "flake": false, "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", "owner": "edolstra", "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", "type": "github" }, "original": { @@ -577,24 +1238,39 @@ "type": "github" } }, - "flake-compat_3": { + "flake-compat_11": { "flake": false, "locked": { - "lastModified": 1647532380, - "narHash": "sha256-wswAxyO8AJTH7d5oU8VK82yBCpqwA+p6kLgpb1f1PAY=", - "owner": "input-output-hk", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", "repo": "flake-compat", - "rev": "7da118186435255a30b5ffeabba9629c344c0bec", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { - "owner": "input-output-hk", - "ref": "fixes", + "owner": "edolstra", "repo": "flake-compat", "type": "github" } }, - "flake-compat_4": { + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1672831974, @@ -611,7 +1287,7 @@ "type": "github" } }, - "flake-compat_5": { + "flake-compat_4": { "flake": false, "locked": { "lastModified": 1673956053, @@ -627,14 +1303,48 @@ "type": "github" } }, - "flake-compat_6": { + "flake-compat_5": { "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1647532380, + "narHash": "sha256-wswAxyO8AJTH7d5oU8VK82yBCpqwA+p6kLgpb1f1PAY=", + "owner": "input-output-hk", + "repo": "flake-compat", + "rev": "7da118186435255a30b5ffeabba9629c344c0bec", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "fixes", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_6": { + "flake": false, + "locked": { + "lastModified": 1672831974, + "narHash": "sha256-z9k3MfslLjWQfnjBtEtJZdq3H7kyi2kQtUThfTgdRk0=", + "owner": "input-output-hk", + "repo": "flake-compat", + "rev": "45f2638735f8cdc40fe302742b79f248d23eb368", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "hkm/gitlab-fix", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_7": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", "type": "github" }, "original": { @@ -643,10 +1353,116 @@ "type": "github" } }, + "flake-compat_8": { + "flake": false, + "locked": { + "lastModified": 1647532380, + "narHash": "sha256-wswAxyO8AJTH7d5oU8VK82yBCpqwA+p6kLgpb1f1PAY=", + "owner": "input-output-hk", + "repo": "flake-compat", + "rev": "7da118186435255a30b5ffeabba9629c344c0bec", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "fixes", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_9": { + "flake": false, + "locked": { + "lastModified": 1672831974, + "narHash": "sha256-z9k3MfslLjWQfnjBtEtJZdq3H7kyi2kQtUThfTgdRk0=", + "owner": "input-output-hk", + "repo": "flake-compat", + "rev": "45f2638735f8cdc40fe302742b79f248d23eb368", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "hkm/gitlab-fix", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" }, + "locked": { + "lastModified": 1672152762, + "narHash": "sha256-U8iWWHgabN07zfbgedogMVWrEP1Zywyf3Yx3OYHSSgE=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "19e0f88324d90509141e192664ded98bb88ef9b2", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1682984683, + "narHash": "sha256-fSMthG+tp60AHhNmaHc4StT3ltfHkQsJtN8GhfLWmtI=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "86684881e184f41aa322e653880e497b66429f3e", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_3" + }, + "locked": { + "lastModified": 1690933134, + "narHash": "sha256-ab989mN63fQZBFrkk4Q8bYxQCktuHmBIBqUG1jl6/FQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "59cf3f1447cfc75087e7273b04b31e689a8599fb", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_4": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_4" + }, + "locked": { + "lastModified": 1690933134, + "narHash": "sha256-ab989mN63fQZBFrkk4Q8bYxQCktuHmBIBqUG1jl6/FQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "59cf3f1447cfc75087e7273b04b31e689a8599fb", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_5": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_5" + }, "locked": { "lastModified": 1696343447, "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", @@ -691,7 +1507,7 @@ "type": "github" } }, - "flake-utils_2": { + "flake-utils_10": { "locked": { "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", @@ -706,13 +1522,16 @@ "type": "github" } }, - "flake-utils_3": { + "flake-utils_11": { + "inputs": { + "systems": "systems_4" + }, "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -721,7 +1540,7 @@ "type": "github" } }, - "flake-utils_4": { + "flake-utils_2": { "locked": { "lastModified": 1659877975, "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", @@ -736,7 +1555,53 @@ "type": "github" } }, + "flake-utils_3": { + "locked": { + "lastModified": 1679360468, + "narHash": "sha256-LGnza3cfXF10Biw3ZTg0u9o9t7s680Ww200t5KkHTh8=", + "owner": "hamishmack", + "repo": "flake-utils", + "rev": "e1ea268ff47ad475443dbabcd54744b4e5b9d4f5", + "type": "github" + }, + "original": { + "owner": "hamishmack", + "ref": "hkm/nested-hydraJobs", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "locked": { + "lastModified": 1634851050, + "narHash": "sha256-N83GlSGPJJdcqhUxSCS/WwW5pksYf3VP1M13cDRTSVA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c91f3de5adaf1de973b797ef7485e441a65b8935", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "flake-utils_5": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_6": { "locked": { "lastModified": 1653893745, "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", @@ -751,7 +1616,7 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_7": { "locked": { "lastModified": 1659877975, "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", @@ -766,13 +1631,13 @@ "type": "github" } }, - "flake-utils_7": { + "flake-utils_8": { "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", "type": "github" }, "original": { @@ -781,16 +1646,13 @@ "type": "github" } }, - "flake-utils_8": { - "inputs": { - "systems": "systems_3" - }, + "flake-utils_9": { "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", "type": "github" }, "original": { @@ -816,6 +1678,40 @@ "type": "github" } }, + "ghc-8.6.5-iohk_2": { + "flake": false, + "locked": { + "lastModified": 1600920045, + "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", + "owner": "input-output-hk", + "repo": "ghc", + "rev": "95713a6ecce4551240da7c96b6176f980af75cae", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "release/8.6.5-iohk", + "repo": "ghc", + "type": "github" + } + }, + "ghc-8.6.5-iohk_3": { + "flake": false, + "locked": { + "lastModified": 1600920045, + "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", + "owner": "input-output-hk", + "repo": "ghc", + "rev": "95713a6ecce4551240da7c96b6176f980af75cae", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "release/8.6.5-iohk", + "repo": "ghc", + "type": "github" + } + }, "ghc98X": { "flake": false, "locked": { @@ -835,6 +1731,25 @@ "url": "https://gitlab.haskell.org/ghc/ghc" } }, + "ghc98X_2": { + "flake": false, + "locked": { + "lastModified": 1696643148, + "narHash": "sha256-E02DfgISH7EvvNAu0BHiPvl1E5FGMDi0pWdNZtIBC9I=", + "ref": "ghc-9.8", + "rev": "443e870d977b1ab6fc05f47a9a17bc49296adbd6", + "revCount": 61642, + "submodules": true, + "type": "git", + "url": "https://gitlab.haskell.org/ghc/ghc" + }, + "original": { + "ref": "ghc-9.8", + "submodules": true, + "type": "git", + "url": "https://gitlab.haskell.org/ghc/ghc" + } + }, "ghc99": { "flake": false, "locked": { @@ -853,22 +1768,40 @@ "url": "https://gitlab.haskell.org/ghc/ghc" } }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "pre-commit-hooks-nix", - "nixpkgs" - ] - }, + "ghc99_2": { + "flake": false, "locked": { - "lastModified": 1703887061, - "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", - "type": "github" - }, - "original": { + "lastModified": 1697054644, + "narHash": "sha256-kKarOuXUaAH3QWv7ASx+gGFMHaHKe0pK5Zu37ky2AL4=", + "ref": "refs/heads/master", + "rev": "f383a242c76f90bcca8a4d7ee001dcb49c172a9a", + "revCount": 62040, + "submodules": true, + "type": "git", + "url": "https://gitlab.haskell.org/ghc/ghc" + }, + "original": { + "submodules": true, + "type": "git", + "url": "https://gitlab.haskell.org/ghc/ghc" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703887061, + "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", + "type": "github" + }, + "original": { "owner": "hercules-ci", "repo": "gitignore.nix", "type": "github" @@ -876,8 +1809,8 @@ }, "gomod2nix": { "inputs": { - "nixpkgs": "nixpkgs", - "utils": "utils" + "nixpkgs": "nixpkgs_13", + "utils": "utils_2" }, "locked": { "lastModified": 1655245309, @@ -893,7 +1826,39 @@ "type": "github" } }, + "hackage": { + "flake": false, + "locked": { + "lastModified": 1692145451, + "narHash": "sha256-kqfyD3Mu5kgiH5W2ZshUhzO46H0zYDpwD1SWz+POMrk=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "9d2daeca0e09002bc6fb552a097a1802a2f3a4e3", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, "hackageNix": { + "flake": false, + "locked": { + "lastModified": 1702945378, + "narHash": "sha256-mo1MlOphO4bRwZ8T3mDwU5LOtdQcWSA+93lT1HkCcyw=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "e59b9616a744727e8e64f605f9f216464f12f89b", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, + "hackageNix_2": { "flake": false, "locked": { "lastModified": 1701303758, @@ -909,32 +1874,27 @@ "type": "github" } }, - "haskellNix": { + "haskell-nix": { "inputs": { "HTTP": "HTTP", "cabal-32": "cabal-32", "cabal-34": "cabal-34", "cabal-36": "cabal-36", "cardano-shell": "cardano-shell", - "flake-compat": "flake-compat_4", + "flake-compat": "flake-compat_3", + "flake-utils": "flake-utils_3", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", - "ghc98X": "ghc98X", - "ghc99": "ghc99", - "hackage": [ - "cardano-node", - "hackageNix" - ], + "hackage": "hackage", "hls-1.10": "hls-1.10", "hls-2.0": "hls-2.0", - "hls-2.2": "hls-2.2", - "hls-2.3": "hls-2.3", - "hls-2.4": "hls-2.4", "hpc-coveralls": "hpc-coveralls", "hydra": "hydra", "iserv-proxy": "iserv-proxy", "nixpkgs": [ - "cardano-node", - "nixpkgs" + "cardano-db-sync", + "cardano-parts", + "haskell-nix", + "nixpkgs-unstable" ], "nixpkgs-2003": "nixpkgs-2003", "nixpkgs-2105": "nixpkgs-2105", @@ -944,8 +1904,115 @@ "nixpkgs-2305": "nixpkgs-2305", "nixpkgs-unstable": "nixpkgs-unstable", "old-ghc-nix": "old-ghc-nix", + "stackage": [ + "cardano-db-sync", + "cardano-parts", + "empty-flake" + ] + }, + "locked": { + "lastModified": 1692147008, + "narHash": "sha256-ZiRaryaboJbNZ7y7XKZs2xuSfydZyGeupJNOfYpgQSw=", + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "1970bb2d5b0eb8152f89b305f32d055dbd6857d9", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "haskell.nix", + "type": "github" + } + }, + "haskellNix": { + "inputs": { + "HTTP": "HTTP_2", + "cabal-32": "cabal-32_2", + "cabal-34": "cabal-34_2", + "cabal-36": "cabal-36_2", + "cardano-shell": "cardano-shell_2", + "flake-compat": "flake-compat_6", + "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_2", + "ghc98X": "ghc98X", + "ghc99": "ghc99", + "hackage": [ + "cardano-db-sync", + "hackageNix" + ], + "hls-1.10": "hls-1.10_2", + "hls-2.0": "hls-2.0_2", + "hls-2.2": "hls-2.2", + "hls-2.3": "hls-2.3", + "hls-2.4": "hls-2.4", + "hpc-coveralls": "hpc-coveralls_2", + "hydra": "hydra_2", + "iserv-proxy": "iserv-proxy_2", + "nixpkgs": [ + "cardano-db-sync", + "haskellNix", + "nixpkgs-unstable" + ], + "nixpkgs-2003": "nixpkgs-2003_2", + "nixpkgs-2105": "nixpkgs-2105_2", + "nixpkgs-2111": "nixpkgs-2111_2", + "nixpkgs-2205": "nixpkgs-2205_2", + "nixpkgs-2211": "nixpkgs-2211_2", + "nixpkgs-2305": "nixpkgs-2305_2", + "nixpkgs-unstable": "nixpkgs-unstable_3", + "old-ghc-nix": "old-ghc-nix_2", "stackage": "stackage" }, + "locked": { + "lastModified": 1701053834, + "narHash": "sha256-4sH4//POARjeKJv1mu8aU4W4A28GYqrj9KB3PqusHis=", + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "7c491c55157208575c70c7b8434e9d4a1cf173a6", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "haskell.nix", + "type": "github" + } + }, + "haskellNix_2": { + "inputs": { + "HTTP": "HTTP_3", + "cabal-32": "cabal-32_3", + "cabal-34": "cabal-34_3", + "cabal-36": "cabal-36_3", + "cardano-shell": "cardano-shell_3", + "flake-compat": "flake-compat_9", + "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_3", + "ghc98X": "ghc98X_2", + "ghc99": "ghc99_2", + "hackage": [ + "cardano-node", + "hackageNix" + ], + "hls-1.10": "hls-1.10_3", + "hls-2.0": "hls-2.0_3", + "hls-2.2": "hls-2.2_2", + "hls-2.3": "hls-2.3_2", + "hls-2.4": "hls-2.4_2", + "hpc-coveralls": "hpc-coveralls_3", + "hydra": "hydra_3", + "iserv-proxy": "iserv-proxy_3", + "nixpkgs": [ + "cardano-node", + "nixpkgs" + ], + "nixpkgs-2003": "nixpkgs-2003_3", + "nixpkgs-2105": "nixpkgs-2105_3", + "nixpkgs-2111": "nixpkgs-2111_3", + "nixpkgs-2205": "nixpkgs-2205_3", + "nixpkgs-2211": "nixpkgs-2211_3", + "nixpkgs-2305": "nixpkgs-2305_3", + "nixpkgs-unstable": "nixpkgs-unstable_4", + "old-ghc-nix": "old-ghc-nix_3", + "stackage": "stackage_2" + }, "locked": { "lastModified": 1700441391, "narHash": "sha256-oJqP1AUskUvr3GNUH97eKwaIUHdYgENS2kQ7GI9RI+c=", @@ -962,7 +2029,7 @@ }, "haumea": { "inputs": { - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_19" }, "locked": { "lastModified": 1685133229, @@ -1020,6 +2087,40 @@ "type": "github" } }, + "hls-1.10_2": { + "flake": false, + "locked": { + "lastModified": 1680000865, + "narHash": "sha256-rc7iiUAcrHxwRM/s0ErEsSPxOR3u8t7DvFeWlMycWgo=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "b08691db779f7a35ff322b71e72a12f6e3376fd9", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "1.10.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-1.10_3": { + "flake": false, + "locked": { + "lastModified": 1680000865, + "narHash": "sha256-rc7iiUAcrHxwRM/s0ErEsSPxOR3u8t7DvFeWlMycWgo=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "b08691db779f7a35ff322b71e72a12f6e3376fd9", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "1.10.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, "hls-2.0": { "flake": false, "locked": { @@ -1037,6 +2138,40 @@ "type": "github" } }, + "hls-2.0_2": { + "flake": false, + "locked": { + "lastModified": 1687698105, + "narHash": "sha256-OHXlgRzs/kuJH8q7Sxh507H+0Rb8b7VOiPAjcY9sM1k=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "783905f211ac63edf982dd1889c671653327e441", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.0.0.1", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.0_3": { + "flake": false, + "locked": { + "lastModified": 1687698105, + "narHash": "sha256-OHXlgRzs/kuJH8q7Sxh507H+0Rb8b7VOiPAjcY9sM1k=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "783905f211ac63edf982dd1889c671653327e441", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.0.0.1", + "repo": "haskell-language-server", + "type": "github" + } + }, "hls-2.2": { "flake": false, "locked": { @@ -1054,6 +2189,23 @@ "type": "github" } }, + "hls-2.2_2": { + "flake": false, + "locked": { + "lastModified": 1693064058, + "narHash": "sha256-8DGIyz5GjuCFmohY6Fa79hHA/p1iIqubfJUTGQElbNk=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "b30f4b6cf5822f3112c35d14a0cba51f3fe23b85", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.2.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, "hls-2.3": { "flake": false, "locked": { @@ -1071,6 +2223,23 @@ "type": "github" } }, + "hls-2.3_2": { + "flake": false, + "locked": { + "lastModified": 1695910642, + "narHash": "sha256-tR58doOs3DncFehHwCLczJgntyG/zlsSd7DgDgMPOkI=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "458ccdb55c9ea22cd5d13ec3051aaefb295321be", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.3.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, "hls-2.4": { "flake": false, "locked": { @@ -1088,6 +2257,23 @@ "type": "github" } }, + "hls-2.4_2": { + "flake": false, + "locked": { + "lastModified": 1696939266, + "narHash": "sha256-VOMf5+kyOeOmfXTHlv4LNFJuDGa7G3pDnOxtzYR40IU=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "362fdd1293efb4b82410b676ab1273479f6d17ee", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.4.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, "hpc-coveralls": { "flake": false, "locked": { @@ -1104,23 +2290,104 @@ "type": "github" } }, - "hydra": { - "inputs": { - "nix": "nix", - "nixpkgs": [ - "cardano-node", - "haskellNix", - "hydra", - "nix", - "nixpkgs" - ] - }, + "hpc-coveralls_2": { + "flake": false, "locked": { - "lastModified": 1671755331, - "narHash": "sha256-hXsgJj0Cy0ZiCiYdW2OdBz5WmFyOMKuw4zyxKpgUKm4=", - "owner": "NixOS", - "repo": "hydra", - "rev": "f48f00ee6d5727ae3e488cbf9ce157460853fea8", + "lastModified": 1607498076, + "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", + "type": "github" + }, + "original": { + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "type": "github" + } + }, + "hpc-coveralls_3": { + "flake": false, + "locked": { + "lastModified": 1607498076, + "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", + "type": "github" + }, + "original": { + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "type": "github" + } + }, + "hydra": { + "inputs": { + "nix": "nix", + "nixpkgs": [ + "cardano-db-sync", + "cardano-parts", + "haskell-nix", + "hydra", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1671755331, + "narHash": "sha256-hXsgJj0Cy0ZiCiYdW2OdBz5WmFyOMKuw4zyxKpgUKm4=", + "owner": "NixOS", + "repo": "hydra", + "rev": "f48f00ee6d5727ae3e488cbf9ce157460853fea8", + "type": "github" + }, + "original": { + "id": "hydra", + "type": "indirect" + } + }, + "hydra_2": { + "inputs": { + "nix": "nix_3", + "nixpkgs": [ + "cardano-db-sync", + "haskellNix", + "hydra", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1671755331, + "narHash": "sha256-hXsgJj0Cy0ZiCiYdW2OdBz5WmFyOMKuw4zyxKpgUKm4=", + "owner": "NixOS", + "repo": "hydra", + "rev": "f48f00ee6d5727ae3e488cbf9ce157460853fea8", + "type": "github" + }, + "original": { + "id": "hydra", + "type": "indirect" + } + }, + "hydra_3": { + "inputs": { + "nix": "nix_4", + "nixpkgs": [ + "cardano-node", + "haskellNix", + "hydra", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1671755331, + "narHash": "sha256-hXsgJj0Cy0ZiCiYdW2OdBz5WmFyOMKuw4zyxKpgUKm4=", + "owner": "NixOS", + "repo": "hydra", + "rev": "f48f00ee6d5727ae3e488cbf9ce157460853fea8", "type": "github" }, "original": { @@ -1175,15 +2442,119 @@ "type": "github" } }, - "iohkNix": { + "inclusive": { + "inputs": { + "stdlib": "stdlib" + }, + "locked": { + "lastModified": 1628098927, + "narHash": "sha256-Ft4sdf7VPL8MQtu18AAPiN2s5pUsbv+3RxqzJSa/yzg=", + "owner": "input-output-hk", + "repo": "nix-inclusive", + "rev": "13123eb7a8c3359738a4756b8d645729e8655b27", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "nix-inclusive", + "type": "github" + } + }, + "inputs-check": { + "inputs": { + "flake-parts": "flake-parts_4", + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1692633913, + "narHash": "sha256-f80/49lt2hIapc9AEaTBC93jnRZe5zxlm21JXXewkko=", + "owner": "input-output-hk", + "repo": "inputs-check", + "rev": "1e9f65e56140f4e357c9abaf5311e3ea979d33e9", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "inputs-check", + "type": "github" + } + }, + "iohk-nix": { "inputs": { "blst": "blst", + "nixpkgs": "nixpkgs_6", + "secp256k1": "secp256k1", + "sodium": "sodium" + }, + "locked": { + "lastModified": 1691469905, + "narHash": "sha256-TV0p1dFGYAMl1dLJEfe/tNFjxvV2H7VgHU1I43q+b84=", + "owner": "input-output-hk", + "repo": "iohk-nix", + "rev": "2f3760f135616ebc477d3ed74eba9b63c22f83a0", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "iohk-nix", + "rev": "2f3760f135616ebc477d3ed74eba9b63c22f83a0", + "type": "github" + } + }, + "iohk-nix-ng": { + "inputs": { + "blst": "blst_2", + "nixpkgs": "nixpkgs_7", + "secp256k1": "secp256k1_2", + "sodium": "sodium_2" + }, + "locked": { + "lastModified": 1696471795, + "narHash": "sha256-aNNvjUtCGXaXSp5M/HSj1SOeLjqLyTRWYbIHqAEeUp0=", + "owner": "input-output-hk", + "repo": "iohk-nix", + "rev": "91f16fa8acb58b312f94977715c630d8bf77e33e", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "iohk-nix", + "type": "github" + } + }, + "iohkNix": { + "inputs": { + "blst": "blst_3", + "nixpkgs": [ + "cardano-db-sync", + "nixpkgs" + ], + "secp256k1": "secp256k1_3", + "sodium": "sodium_3" + }, + "locked": { + "lastModified": 1698999258, + "narHash": "sha256-42D1BMbdyZD+lT+pWUzb5zDQyasNbMJtH/7stuPuPfE=", + "owner": "input-output-hk", + "repo": "iohk-nix", + "rev": "73dc2bb45af6f20cfe1d962f1334eed5e84ae764", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "iohk-nix", + "type": "github" + } + }, + "iohkNix_2": { + "inputs": { + "blst": "blst_4", "nixpkgs": [ "cardano-node", "nixpkgs" ], - "secp256k1": "secp256k1", - "sodium": "sodium" + "secp256k1": "secp256k1_4", + "sodium": "sodium_4" }, "locked": { "lastModified": 1698746924, @@ -1200,6 +2571,40 @@ } }, "iserv-proxy": { + "flake": false, + "locked": { + "lastModified": 1688517130, + "narHash": "sha256-hUqfxSlo+ffqVdkSZ1EDoB7/ILCL25eYkcCXW9/P3Wc=", + "ref": "hkm/remote-iserv", + "rev": "9151db2a9a61d7f5fe52ff8836f18bbd0fd8933c", + "revCount": 13, + "type": "git", + "url": "https://gitlab.haskell.org/hamishmack/iserv-proxy.git" + }, + "original": { + "ref": "hkm/remote-iserv", + "type": "git", + "url": "https://gitlab.haskell.org/hamishmack/iserv-proxy.git" + } + }, + "iserv-proxy_2": { + "flake": false, + "locked": { + "lastModified": 1691634696, + "narHash": "sha256-MZH2NznKC/gbgBu8NgIibtSUZeJ00HTLJ0PlWKCBHb0=", + "ref": "hkm/remote-iserv", + "rev": "43a979272d9addc29fbffc2e8542c5d96e993d73", + "revCount": 14, + "type": "git", + "url": "https://gitlab.haskell.org/hamishmack/iserv-proxy.git" + }, + "original": { + "ref": "hkm/remote-iserv", + "type": "git", + "url": "https://gitlab.haskell.org/hamishmack/iserv-proxy.git" + } + }, + "iserv-proxy_3": { "flake": false, "locked": { "lastModified": 1691634696, @@ -1232,6 +2637,54 @@ "type": "github" } }, + "lowdown-src_2": { + "flake": false, + "locked": { + "lastModified": 1633514407, + "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", + "owner": "kristapsdz", + "repo": "lowdown", + "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", + "type": "github" + }, + "original": { + "owner": "kristapsdz", + "repo": "lowdown", + "type": "github" + } + }, + "lowdown-src_3": { + "flake": false, + "locked": { + "lastModified": 1633514407, + "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", + "owner": "kristapsdz", + "repo": "lowdown", + "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", + "type": "github" + }, + "original": { + "owner": "kristapsdz", + "repo": "lowdown", + "type": "github" + } + }, + "lowdown-src_4": { + "flake": false, + "locked": { + "lastModified": 1633514407, + "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", + "owner": "kristapsdz", + "repo": "lowdown", + "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", + "type": "github" + }, + "original": { + "owner": "kristapsdz", + "repo": "lowdown", + "type": "github" + } + }, "n2c": { "inputs": { "flake-utils": [ @@ -1293,7 +2746,7 @@ "nix": { "inputs": { "lowdown-src": "lowdown-src", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_4", "nixpkgs-regression": "nixpkgs-regression" }, "locked": { @@ -1313,7 +2766,7 @@ }, "nix-nomad": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_7", "flake-utils": [ "cardano-node", "cardano-automation", @@ -1351,8 +2804,8 @@ }, "nix2container": { "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_2" + "flake-utils": "flake-utils_6", + "nixpkgs": "nixpkgs_14" }, "locked": { "lastModified": 1658567952, @@ -1370,8 +2823,8 @@ }, "nix2container_2": { "inputs": { - "flake-utils": "flake-utils_5", - "nixpkgs": "nixpkgs_6" + "flake-utils": "flake-utils_8", + "nixpkgs": "nixpkgs_18" }, "locked": { "lastModified": 1671269339, @@ -1387,33 +2840,97 @@ "type": "github" } }, - "nixago": { + "nix_2": { "inputs": { - "flake-utils": [ - "cardano-node", - "cardano-automation", - "tullia", - "std", - "flake-utils" - ], - "nixago-exts": [ - "cardano-node", - "cardano-automation", - "tullia", - "std", - "blank" - ], - "nixpkgs": [ - "cardano-node", - "cardano-automation", - "tullia", - "std", - "nixpkgs" - ] + "flake-compat": "flake-compat_4", + "lowdown-src": "lowdown-src_2", + "nixpkgs": "nixpkgs_8", + "nixpkgs-regression": "nixpkgs-regression_2" }, "locked": { - "lastModified": 1676075813, - "narHash": "sha256-X/aIT8Qc8UCqnxJvaZykx3CJ0ZnDFvO+dqp/7fglZWo=", + "lastModified": 1693573010, + "narHash": "sha256-HBm8mR2skhPtbJ7p+ByrOZjs7SfsfZPwy75MwI1EUmk=", + "owner": "nixos", + "repo": "nix", + "rev": "5568ca5ff130a8a0bc3db5878432eb527c74dd60", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "2.17-maintenance", + "repo": "nix", + "type": "github" + } + }, + "nix_3": { + "inputs": { + "lowdown-src": "lowdown-src_3", + "nixpkgs": "nixpkgs_12", + "nixpkgs-regression": "nixpkgs-regression_3" + }, + "locked": { + "lastModified": 1661606874, + "narHash": "sha256-9+rpYzI+SmxJn+EbYxjGv68Ucp22bdFUSy/4LkHkkDQ=", + "owner": "NixOS", + "repo": "nix", + "rev": "11e45768b34fdafdcf019ddbd337afa16127ff0f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "2.11.0", + "repo": "nix", + "type": "github" + } + }, + "nix_4": { + "inputs": { + "lowdown-src": "lowdown-src_4", + "nixpkgs": "nixpkgs_17", + "nixpkgs-regression": "nixpkgs-regression_4" + }, + "locked": { + "lastModified": 1661606874, + "narHash": "sha256-9+rpYzI+SmxJn+EbYxjGv68Ucp22bdFUSy/4LkHkkDQ=", + "owner": "NixOS", + "repo": "nix", + "rev": "11e45768b34fdafdcf019ddbd337afa16127ff0f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "2.11.0", + "repo": "nix", + "type": "github" + } + }, + "nixago": { + "inputs": { + "flake-utils": [ + "cardano-node", + "cardano-automation", + "tullia", + "std", + "flake-utils" + ], + "nixago-exts": [ + "cardano-node", + "cardano-automation", + "tullia", + "std", + "blank" + ], + "nixpkgs": [ + "cardano-node", + "cardano-automation", + "tullia", + "std", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1676075813, + "narHash": "sha256-X/aIT8Qc8UCqnxJvaZykx3CJ0ZnDFvO+dqp/7fglZWo=", "owner": "nix-community", "repo": "nixago", "rev": "9cab4dde31ec2f2c05d702ea8648ce580664e906", @@ -1459,173 +2976,596 @@ }, "nixpkgs": { "locked": { - "lastModified": 1653581809, - "narHash": "sha256-Uvka0V5MTGbeOfWte25+tfRL3moECDh1VwokWSZUdoY=", + "lastModified": 1677543769, + "narHash": "sha256-LwbqS8vGisXl2WHpK9r5+kodr0zoIT8F2YB0R4y1TsA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b26d52c9feb6476580016e78935cbf96eb3e2115", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2003": { + "locked": { + "lastModified": 1620055814, + "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.03-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2003_2": { + "locked": { + "lastModified": 1620055814, + "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.03-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2003_3": { + "locked": { + "lastModified": 1620055814, + "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.03-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2105": { + "locked": { + "lastModified": 1659914493, + "narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2105_2": { + "locked": { + "lastModified": 1659914493, + "narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2105_3": { + "locked": { + "lastModified": 1659914493, + "narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2111": { + "locked": { + "lastModified": 1659446231, + "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2111_2": { + "locked": { + "lastModified": 1659446231, + "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2111_3": { + "locked": { + "lastModified": 1659446231, + "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2205": { + "locked": { + "lastModified": 1685573264, + "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "380be19fbd2d9079f677978361792cb25e8a3635", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-22.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2205_2": { + "locked": { + "lastModified": 1685573264, + "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "380be19fbd2d9079f677978361792cb25e8a3635", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-22.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2205_3": { + "locked": { + "lastModified": 1685573264, + "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "380be19fbd2d9079f677978361792cb25e8a3635", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-22.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2211": { + "locked": { + "lastModified": 1688392541, + "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-22.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2211_2": { + "locked": { + "lastModified": 1688392541, + "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-22.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2211_3": { + "locked": { + "lastModified": 1688392541, + "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-22.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2305": { + "locked": { + "lastModified": 1690680713, + "narHash": "sha256-NXCWA8N+GfSQyoN7ZNiOgq/nDJKOp5/BHEpiZP8sUZw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b81af66deb21f73a70c67e5ea189568af53b1e8c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-23.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2305_2": { + "locked": { + "lastModified": 1695416179, + "narHash": "sha256-610o1+pwbSu+QuF3GE0NU5xQdTHM3t9wyYhB9l94Cd8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "715d72e967ec1dd5ecc71290ee072bcaf5181ed6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-23.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2305_3": { + "locked": { + "lastModified": 1695416179, + "narHash": "sha256-610o1+pwbSu+QuF3GE0NU5xQdTHM3t9wyYhB9l94Cd8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "715d72e967ec1dd5ecc71290ee072bcaf5181ed6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-23.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1671359686, + "narHash": "sha256-3MpC6yZo+Xn9cPordGz2/ii6IJpP2n8LE8e/ebUXLrs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "04f574a1c0fde90b51bf68198e2297ca4e7cccf4", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib_2": { + "locked": { + "dir": "lib", + "lastModified": 1682879489, + "narHash": "sha256-sASwo8gBt7JDnOOstnps90K1wxmVfyhsTPPNTGBPjjg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "da45bf6ec7bbcc5d1e14d3795c025199f28e0de0", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib_3": { + "locked": { + "dir": "lib", + "lastModified": 1690881714, + "narHash": "sha256-h/nXluEqdiQHs1oSgkOOWF+j8gcJMWhwnZ9PFabN6q0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9e1960bc196baf6881340d53dccb203a951745a2", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib_4": { + "locked": { + "dir": "lib", + "lastModified": 1690881714, + "narHash": "sha256-h/nXluEqdiQHs1oSgkOOWF+j8gcJMWhwnZ9PFabN6q0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9e1960bc196baf6881340d53dccb203a951745a2", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib_5": { + "locked": { + "dir": "lib", + "lastModified": 1696019113, + "narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-regression": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, + "nixpkgs-regression_2": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, + "nixpkgs-regression_3": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "83658b28fe638a170a19b8933aa008b30640fbd1", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", "type": "github" } }, - "nixpkgs-2003": { + "nixpkgs-regression_4": { "locked": { - "lastModified": 1620055814, - "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-20.03-darwin", "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", "type": "github" } }, - "nixpkgs-2105": { + "nixpkgs-stable": { "locked": { - "lastModified": 1659914493, - "narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=", + "lastModified": 1690066826, + "narHash": "sha256-6L2qb+Zc0BFkh72OS9uuX637gniOjzU6qCDBpjB2LGY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf", + "rev": "ce45b591975d070044ca24e3003c830d26fea1c8", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-21.05-darwin", + "ref": "release-23.05", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-2111": { + "nixpkgs-unstable": { "locked": { - "lastModified": 1659446231, - "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", + "lastModified": 1690720142, + "narHash": "sha256-GywuiZjBKfFkntQwpNQfL+Ksa2iGjPprBGL0/psgRZM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", + "rev": "3acb5c4264c490e7714d503c7166a3fde0c51324", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-21.11-darwin", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-2205": { + "nixpkgs-unstable_2": { "locked": { - "lastModified": 1685573264, - "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=", - "owner": "NixOS", + "lastModified": 1696577711, + "narHash": "sha256-94VRjvClIKDym1QRqPkX5LTQoAwZ1E6QE/3dWtOXSIQ=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "380be19fbd2d9079f677978361792cb25e8a3635", + "rev": "a2eb207f45e4a14a1e3019d9e3863d1e208e2295", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-22.05-darwin", + "owner": "nixos", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-2211": { + "nixpkgs-unstable_3": { "locked": { - "lastModified": 1688392541, - "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", + "lastModified": 1695318763, + "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", + "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-22.11-darwin", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-2305": { + "nixpkgs-unstable_4": { "locked": { - "lastModified": 1695416179, - "narHash": "sha256-610o1+pwbSu+QuF3GE0NU5xQdTHM3t9wyYhB9l94Cd8=", + "lastModified": 1695318763, + "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "715d72e967ec1dd5ecc71290ee072bcaf5181ed6", + "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-23.05-darwin", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-lib": { + "nixpkgs_10": { "locked": { - "dir": "lib", - "lastModified": 1696019113, - "narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=", + "lastModified": 1675249806, + "narHash": "sha256-u8Rcqekusl3pMZm68hZqr6zozI8Ug5IxqOiqDLAlu1k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a", + "rev": "79feedf38536de2a27d13fe2eaf200a9c05193ba", "type": "github" }, "original": { - "dir": "lib", "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-regression": { + "nixpkgs_11": { "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", + "lastModified": 1636823747, + "narHash": "sha256-oWo1nElRAOZqEf90Yek2ixdHyjD+gqtS/pAgwaQ9UhQ=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "rev": "f6a2ed2082d9a51668c86ba27d0b5496f7a2ea93", "type": "github" }, "original": { - "owner": "NixOS", + "owner": "nixos", "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", "type": "github" } }, - "nixpkgs-unstable": { + "nixpkgs_12": { "locked": { - "lastModified": 1695318763, - "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", + "lastModified": 1657693803, + "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", + "rev": "365e1b3a859281cf11b94f87231adeabbdd878a2", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-22.05-small", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_10": { + "nixpkgs_13": { "locked": { - "lastModified": 1697059129, - "narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=", + "lastModified": 1653581809, + "narHash": "sha256-Uvka0V5MTGbeOfWte25+tfRL3moECDh1VwokWSZUdoY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5e4c2ada4fcd54b99d56d7bd62f384511a7e2593", + "rev": "83658b28fe638a170a19b8933aa008b30640fbd1", "type": "github" }, "original": { @@ -1635,7 +3575,7 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_14": { "locked": { "lastModified": 1654807842, "narHash": "sha256-ADymZpr6LuTEBXcy6RtFHcUZdjKTBRTMYwu19WOx17E=", @@ -1650,7 +3590,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_15": { "locked": { "lastModified": 1675940568, "narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=", @@ -1666,7 +3606,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_16": { "locked": { "lastModified": 1642336556, "narHash": "sha256-QSPPbFEwy0T0DrIuSzAACkaANPQaR1lZR/nHZGz9z04=", @@ -1680,7 +3620,7 @@ "type": "indirect" } }, - "nixpkgs_5": { + "nixpkgs_17": { "locked": { "lastModified": 1657693803, "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", @@ -1696,7 +3636,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_18": { "locked": { "lastModified": 1654807842, "narHash": "sha256-ADymZpr6LuTEBXcy6RtFHcUZdjKTBRTMYwu19WOx17E=", @@ -1711,7 +3651,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_19": { "locked": { "lastModified": 1681001314, "narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=", @@ -1726,7 +3666,23 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_2": { + "locked": { + "lastModified": 1645013224, + "narHash": "sha256-b7OEC8vwzJv3rsz9pwnTX2LQDkeOWz2DbKypkVvNHXc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b66b39216b1fef2d8c33cc7a5c72d8da80b79970", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_20": { "locked": { "lastModified": 1675940568, "narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=", @@ -1742,7 +3698,7 @@ "type": "github" } }, - "nixpkgs_9": { + "nixpkgs_21": { "locked": { "lastModified": 1677063315, "narHash": "sha256-qiB4ajTeAOVnVSAwCNEEkoybrAlA+cpeiBxLobHndE8=", @@ -1758,6 +3714,134 @@ "type": "github" } }, + "nixpkgs_22": { + "locked": { + "lastModified": 1697059129, + "narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5e4c2ada4fcd54b99d56d7bd62f384511a7e2593", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1680945546, + "narHash": "sha256-8FuaH5t/aVi/pR1XxnF0qi4WwMYC+YxlfdsA0V+TEuQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "d9f759f2ea8d265d974a6e1259bd510ac5844c5d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1657693803, + "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "365e1b3a859281cf11b94f87231adeabbdd878a2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.05-small", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1692339729, + "narHash": "sha256-TUK76/Pqm9qIDjEGd27Lz9EiBIvn5F70JWDmEQ4Y5DQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ae521bd4e460b076a455dca8b13f4151489a725c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1684171562, + "narHash": "sha256-BMUWjVWAUdyMWKk0ATMC9H0Bv4qAV/TXwwPUvTiC5IQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "55af203d468a6f5032a519cba4f41acf5a74b638", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "release-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_7": { + "locked": { + "lastModified": 1684171562, + "narHash": "sha256-BMUWjVWAUdyMWKk0ATMC9H0Bv4qAV/TXwwPUvTiC5IQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "55af203d468a6f5032a519cba4f41acf5a74b638", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "release-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_8": { + "locked": { + "lastModified": 1670461440, + "narHash": "sha256-jy1LB8HOMKGJEGXgzFRLDU1CBGL0/LlkolgnqIsF0D8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "04a75b2eecc0acf6239acf9dd04485ff8d14f425", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.11-small", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_9": { + "locked": { + "lastModified": 1690026219, + "narHash": "sha256-oOduRk/kzQxOBknZXTLSEYd7tk+GoKvr8wV6Ab+t4AU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f465da166263bc0d4b39dfd4ca28b777c92d4b73", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nosys": { "locked": { "lastModified": 1668010795, @@ -1788,7 +3872,58 @@ "type": "github" } }, - "old-ghc-nix": { + "offchain-metadata-tools-service": { + "flake": false, + "locked": { + "lastModified": 1684160858, + "narHash": "sha256-2pu/T4uoXBxhI47PrOS6zHRZRwaSM6qA87HJySwwIBo=", + "owner": "input-output-hk", + "repo": "offchain-metadata-tools", + "rev": "a68c12b10fe5ed9802defb4a6ca80919b695d945", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "feat-add-password-to-db-conn-string", + "repo": "offchain-metadata-tools", + "type": "github" + } + }, + "old-ghc-nix": { + "flake": false, + "locked": { + "lastModified": 1631092763, + "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", + "owner": "angerman", + "repo": "old-ghc-nix", + "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", + "type": "github" + }, + "original": { + "owner": "angerman", + "ref": "master", + "repo": "old-ghc-nix", + "type": "github" + } + }, + "old-ghc-nix_2": { + "flake": false, + "locked": { + "lastModified": 1631092763, + "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", + "owner": "angerman", + "repo": "old-ghc-nix", + "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", + "type": "github" + }, + "original": { + "owner": "angerman", + "ref": "master", + "repo": "old-ghc-nix", + "type": "github" + } + }, + "old-ghc-nix_3": { "flake": false, "locked": { "lastModified": 1631092763, @@ -1879,7 +4014,7 @@ "paisano-mdbook-preprocessor": { "inputs": { "crane": "crane_2", - "fenix": "fenix", + "fenix": "fenix_2", "nixpkgs": [ "cardano-node", "std", @@ -1993,8 +4128,8 @@ }, "pre-commit-hooks-nix": { "inputs": { - "flake-compat": "flake-compat_6", - "flake-utils": "flake-utils_8", + "flake-compat": "flake-compat_11", + "flake-utils": "flake-utils_11", "gitignore": "gitignore", "nixpkgs": [ "nixpkgs" @@ -2021,18 +4156,36 @@ "inputs": { "attic": "attic", "cardano-configurations": "cardano-configurations", + "cardano-db-sync": "cardano-db-sync", "cardano-node": "cardano-node", "devour-flake": "devour-flake", "devshell": "devshell_3", - "flake-parts": "flake-parts", + "flake-parts": "flake-parts_5", "flake-root": "flake-root", "hercules-ci-effects": "hercules-ci-effects", - "nixpkgs": "nixpkgs_10", + "nixpkgs": "nixpkgs_22", "pre-commit-hooks-nix": "pre-commit-hooks-nix", - "treefmt-nix": "treefmt-nix" + "treefmt-nix": "treefmt-nix_3" } }, "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1645205556, + "narHash": "sha256-e4lZW3qRyOEJ+vLKFQP7m2Dxh5P44NrnekZYLxlucww=", + "owner": "rust-analyzer", + "repo": "rust-analyzer", + "rev": "acf5874b39f3dc5262317a6074d9fc7285081161", + "type": "github" + }, + "original": { + "owner": "rust-analyzer", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, + "rust-analyzer-src_2": { "flake": false, "locked": { "lastModified": 1677221702, @@ -2097,6 +4250,57 @@ "type": "github" } }, + "secp256k1_2": { + "flake": false, + "locked": { + "lastModified": 1683999695, + "narHash": "sha256-9nJJVENMXjXEJZzw8DHzin1DkFkF8h9m/c6PuM7Uk4s=", + "owner": "bitcoin-core", + "repo": "secp256k1", + "rev": "acf5c55ae6a94e5ca847e07def40427547876101", + "type": "github" + }, + "original": { + "owner": "bitcoin-core", + "ref": "v0.3.2", + "repo": "secp256k1", + "type": "github" + } + }, + "secp256k1_3": { + "flake": false, + "locked": { + "lastModified": 1683999695, + "narHash": "sha256-9nJJVENMXjXEJZzw8DHzin1DkFkF8h9m/c6PuM7Uk4s=", + "owner": "bitcoin-core", + "repo": "secp256k1", + "rev": "acf5c55ae6a94e5ca847e07def40427547876101", + "type": "github" + }, + "original": { + "owner": "bitcoin-core", + "ref": "v0.3.2", + "repo": "secp256k1", + "type": "github" + } + }, + "secp256k1_4": { + "flake": false, + "locked": { + "lastModified": 1683999695, + "narHash": "sha256-9nJJVENMXjXEJZzw8DHzin1DkFkF8h9m/c6PuM7Uk4s=", + "owner": "bitcoin-core", + "repo": "secp256k1", + "rev": "acf5c55ae6a94e5ca847e07def40427547876101", + "type": "github" + }, + "original": { + "owner": "bitcoin-core", + "ref": "v0.3.2", + "repo": "secp256k1", + "type": "github" + } + }, "sodium": { "flake": false, "locked": { @@ -2114,7 +4318,109 @@ "type": "github" } }, + "sodium_2": { + "flake": false, + "locked": { + "lastModified": 1675156279, + "narHash": "sha256-0uRcN5gvMwO7MCXVYnoqG/OmeBFi8qRVnDWJLnBb9+Y=", + "owner": "input-output-hk", + "repo": "libsodium", + "rev": "dbb48cce5429cb6585c9034f002568964f1ce567", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "libsodium", + "rev": "dbb48cce5429cb6585c9034f002568964f1ce567", + "type": "github" + } + }, + "sodium_3": { + "flake": false, + "locked": { + "lastModified": 1675156279, + "narHash": "sha256-0uRcN5gvMwO7MCXVYnoqG/OmeBFi8qRVnDWJLnBb9+Y=", + "owner": "input-output-hk", + "repo": "libsodium", + "rev": "dbb48cce5429cb6585c9034f002568964f1ce567", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "libsodium", + "rev": "dbb48cce5429cb6585c9034f002568964f1ce567", + "type": "github" + } + }, + "sodium_4": { + "flake": false, + "locked": { + "lastModified": 1675156279, + "narHash": "sha256-0uRcN5gvMwO7MCXVYnoqG/OmeBFi8qRVnDWJLnBb9+Y=", + "owner": "input-output-hk", + "repo": "libsodium", + "rev": "dbb48cce5429cb6585c9034f002568964f1ce567", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "libsodium", + "rev": "dbb48cce5429cb6585c9034f002568964f1ce567", + "type": "github" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": "nixpkgs_9", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1690199016, + "narHash": "sha256-yTLL72q6aqGmzHq+C3rDp3rIjno7EJZkFLof6Ika7cE=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "c36df4fe4bf4bb87759b1891cab21e7a05219500", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "stable": { + "locked": { + "lastModified": 1669735802, + "narHash": "sha256-qtG/o/i5ZWZLmXw108N2aPiVsxOcidpHJYNkT45ry9Q=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "731cc710aeebecbf45a258e977e8b68350549522", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, "stackage": { + "flake": false, + "locked": { + "lastModified": 1701043780, + "narHash": "sha256-d5CYT7WGEaL6IFNmUg4JUb+onxI/tO1qgHs/TCIKB3A=", + "owner": "input-output-hk", + "repo": "stackage.nix", + "rev": "cb49435b81adf0549589c51f39b5b38b4369f106", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "stackage.nix", + "type": "github" + } + }, + "stackage_2": { "flake": false, "locked": { "lastModified": 1700438989, @@ -2130,6 +4436,25 @@ "type": "github" } }, + "statix": { + "inputs": { + "fenix": "fenix", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1676888642, + "narHash": "sha256-C73LOMVVCkeL0jA5xN7klLEDEB4NkuiATEJY4A/tIyM=", + "owner": "nerdypepper", + "repo": "statix", + "rev": "3c7136a23f444db252a556928c1489869ca3ab4e", + "type": "github" + }, + "original": { + "owner": "nerdypepper", + "repo": "statix", + "type": "github" + } + }, "std": { "inputs": { "arion": [ @@ -2142,7 +4467,7 @@ "blank": "blank", "devshell": "devshell", "dmerge": "dmerge", - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_7", "incl": "incl", "makes": [ "cardano-node", @@ -2160,7 +4485,7 @@ ], "n2c": "n2c", "nixago": "nixago", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_15", "paisano": "paisano", "paisano-tui": "paisano-tui", "yants": "yants" @@ -2189,7 +4514,7 @@ "blank": "blank_2", "devshell": "devshell_2", "dmerge": "dmerge_2", - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_9", "haumea": "haumea", "incl": "incl_2", "makes": [ @@ -2204,7 +4529,7 @@ ], "n2c": "n2c_2", "nixago": "nixago_2", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_20", "paisano": "paisano_2", "paisano-mdbook-preprocessor": "paisano-mdbook-preprocessor", "paisano-tui": "paisano-tui_2", @@ -2224,6 +4549,21 @@ "type": "github" } }, + "stdlib": { + "locked": { + "lastModified": 1590026685, + "narHash": "sha256-E5INrVvYX/P/UpcoUFDAsuHem+lsqT+/teBs9O7oc9Q=", + "owner": "manveru", + "repo": "nix-lib", + "rev": "99088cf7febcdb21afd375a335dcafa959bef3ed", + "type": "github" + }, + "original": { + "owner": "manveru", + "repo": "nix-lib", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -2269,7 +4609,117 @@ "type": "github" } }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "terraform-providers": { + "inputs": { + "nixpkgs": "nixpkgs_10" + }, + "locked": { + "lastModified": 1695893013, + "narHash": "sha256-+5EuXNXwxpTiOEGCbZWtZCU75WcVwnS89heLa5xJ2K0=", + "owner": "nix-community", + "repo": "nixpkgs-terraform-providers-bin", + "rev": "6c6865ae6f9bff7aaa4e86c875f520f2aca65c0d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs-terraform-providers-bin", + "type": "github" + } + }, + "terranix": { + "inputs": { + "bats-assert": "bats-assert", + "bats-support": "bats-support", + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_11", + "terranix-examples": "terranix-examples" + }, + "locked": { + "lastModified": 1684906298, + "narHash": "sha256-pNuJxmVMGbBHw7pa+Bx0HY0orXIXoyyAXOKuQ1zpfus=", + "owner": "terranix", + "repo": "terranix", + "rev": "c0dd15076856c6cb425795b8c7d5d37d3a1e922a", + "type": "github" + }, + "original": { + "owner": "terranix", + "repo": "terranix", + "type": "github" + } + }, + "terranix-examples": { + "locked": { + "lastModified": 1636300201, + "narHash": "sha256-0n1je1WpiR6XfCsvi8ZK7GrpEnMl+DpwhWaO1949Vbc=", + "owner": "terranix", + "repo": "terranix-examples", + "rev": "a934aa1cf88f6bd6c6ddb4c77b77ec6e1660bd5e", + "type": "github" + }, + "original": { + "owner": "terranix", + "repo": "terranix-examples", + "type": "github" + } + }, "treefmt-nix": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1683117219, + "narHash": "sha256-IyNRNRxw0slA3VQySVA7QPXHMOxlbx0ePWvj9oln+Wk=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "c8c3731dc404f837f38f89c2c5ffc2afc02e249d", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_2": { + "inputs": { + "nixpkgs": [ + "cardano-db-sync", + "cardano-parts", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1691440708, + "narHash": "sha256-c7Cc08vJ0IPFgIERpTdO2xvDHQNL7Uf5iXT0GlYO6vo=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "2a535809ac5c9a32288f4d3b938296e056d948cc", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_3": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -2315,6 +4765,24 @@ } }, "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_2": { "locked": { "lastModified": 1653893745, "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", @@ -2329,7 +4797,7 @@ "type": "github" } }, - "utils_2": { + "utils_3": { "locked": { "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", diff --git a/flake.nix b/flake.nix index 3c44314..8578d2d 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,9 @@ url = "github:input-output-hk/cardano-configurations/21249e0d5c68b4e8f3661b250aa8272a8785d678"; flake = false; }; + cardano-db-sync = { + url = "github:intersectmbo/cardano-db-sync?ref=13.2.0.1"; # compatible with 8.7.3 + }; # Utilities attic = { diff --git a/modules/cardano-db-sync.nix b/modules/cardano-db-sync.nix new file mode 100644 index 0000000..0f5d724 --- /dev/null +++ b/modules/cardano-db-sync.nix @@ -0,0 +1,111 @@ +{ + config, + lib, + ... +}: +with lib; let + cfg = config.cardano.cardano-db-sync; +in { + options.cardano.cardano-db-sync = with types; { + enable = mkEnableOption "Cardano DB Sync provides a way to query local cardano node."; + postgres.database = mkOption { + type = str; + default = "cdbsync"; + description = "Used for postgresql database and the cardano-db-sync service user."; + }; + # `services.cardano-db-sync` module options: + explorerConfig = mkOption { + type = attrs; + default = cfg.environment.dbSyncConfig; + }; + logConfig = mkOption { + type = attrs; + default = {}; + }; + disableLedger = mkOption { + type = bool; + default = false; + description = '' + Disables the leger state. Drastically reduces memory usage + and it syncs faster, but some data are missing. + ''; + }; + takeSnapshot = mkOption { + type = enum ["never" "once" "always"]; + default = "never"; + description = '' + Take snapshot before starting cardano-db-sync, + "once" (skip if there is one already), + "always" (removing previous snapshot), + or "never". + ''; + }; + restoreSnapshot = mkOption { + type = nullOr str; + default = null; + description = '' + Restore a snapshot before starting cardano-db-sync, + if the snasphot file given by the option exist. + Snapshot file is deleted after restore. + ''; + }; + restoreSnapshotSha = mkOption { + type = nullOr str; + default = null; + description = '' + SHA256 checksum of the snapshot to restore + ''; + }; + }; + + config = mkIf cfg.enable { + services.cardano-db-sync = { + enable = true; + environment = config.services.cardano-node.environments.${config.cardano.network}; + inherit (config.cardano.node) socketPath; + postgres = { + inherit (config.services.postgresql) port; + inherit (cfg.postgres) database; + user = cfg.postgres.database; + socketdir = "/var/run/postgresql"; + }; + inherit (cfg) explorerConfig; + inherit (cfg) logConfig; + inherit (cfg) disableLedger; + inherit (cfg) takeSnapshot; + inherit (cfg) restoreSnapshot; + inherit (cfg) restoreSnapshotSha; + }; + services.postgresql = { + enable = true; + ensureDatabases = [cfg.postgres.database]; + ensureUsers = [ + { + name = "${cfg.postgres.database}"; + ensureDBOwnership = true; + } + ]; + }; + # users.users = { + # "${cfg.postgres.database}" = { + # group = "${cfg.postgres.database}"; + # isSystemUser = true; + # }; + # }; + # users.groups."${cfg.postgres.database}" = {}; + systemd.services.cardano-db-sync = mkIf (config.cardano.node.enable or false) { + after = ["cardano-node-socket.service"]; + requires = ["cardano-node-socket.service"]; + serviceConfig = { + DynamicUser = true; + User = cfg.postgres.database; + }; + }; + assertions = [ + { + assertion = config.cardano.node.enable; + message = "Cardano db sync requires `cardano.node.enable`."; + } + ]; + }; +} diff --git a/modules/default.nix b/modules/default.nix index beeb00a..d6fec75 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -52,6 +52,12 @@ ./http.nix ]; }; + cardano-db-sync = { + imports = [ + inputs.cardano-db-sync.nixosModules.cardano-db-sync + ./cardano-db-sync.nix + ]; + }; # the default module imports all modules default = { imports = with builtins; attrValues (removeAttrs config.flake.nixosModules ["default"]); diff --git a/tests/cardano-db-sync.nix b/tests/cardano-db-sync.nix new file mode 100644 index 0000000..0db8f5a --- /dev/null +++ b/tests/cardano-db-sync.nix @@ -0,0 +1,36 @@ +{ + perSystem.vmTests.tests.cardano-db-sync = { + impure = true; + module = { + nodes.machine = {pkgs, ...}: { + cardano = { + network = "preview"; + cli.enable = true; + node.enable = true; + # cardano-db-sync.enable = true; + }; + services.postgresql = { + enable = true; + ensureUsers = [ + { + name = "karol"; + ensureDBOwnership = true; + } + ]; + }; + environment.systemPackages = with pkgs; [jq bc curl postgresql]; + }; + + testScript = {nodes, ...}: let + magic = toString nodes.machine.config.cardano.networkNumber; + in '' + machine.wait_for_unit("cardano-node") + machine.wait_for_unit("cardano-node-socket") + machine.wait_until_succeeds("""[[ $(echo "$(cardano-cli query tip --testnet-magic ${magic} | jq '.syncProgress' --raw-output) > 0.001" | bc) == "1" ]]""") + machine.wait_for_unit("cardano-db-sync") + + print(machine.succeed("systemd-analyze security cardano-db-sync")) + ''; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index c4ee832..b6e97c3 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -5,5 +5,6 @@ ./ogmios.nix ./kupo.nix ./http.nix + ./cardano-db-sync.nix ]; } diff --git a/tests/ogmios.nix b/tests/ogmios.nix index 7435aee..46cfb3e 100644 --- a/tests/ogmios.nix +++ b/tests/ogmios.nix @@ -2,7 +2,7 @@ perSystem.vmTests.tests.ogmios = { impure = true; module = { - nodes .machine = {pkgs, ...}: { + nodes.machine = {pkgs, ...}: { cardano = { network = "preview"; cli.enable = true; From 53a04b8bc0d86d0f0f9aea23211ecc2128aa6061 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Tue, 9 Apr 2024 16:51:12 +0200 Subject: [PATCH 02/24] Bump nixpkgs --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 7c494ba..87af340 100644 --- a/flake.lock +++ b/flake.lock @@ -3716,11 +3716,11 @@ }, "nixpkgs_22": { "locked": { - "lastModified": 1697059129, - "narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=", + "lastModified": 1712439257, + "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5e4c2ada4fcd54b99d56d7bd62f384511a7e2593", + "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", "type": "github" }, "original": { From 94875e8dfd6e248788f3e80b1141bb9b2f7657e9 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Tue, 9 Apr 2024 16:53:47 +0200 Subject: [PATCH 03/24] WIP cardano-db-sync test --- modules/cardano-db-sync.nix | 26 ++++++++++---------------- tests/cardano-db-sync.nix | 28 +++++++++++++--------------- 2 files changed, 23 insertions(+), 31 deletions(-) diff --git a/modules/cardano-db-sync.nix b/modules/cardano-db-sync.nix index 0f5d724..ea739d1 100644 --- a/modules/cardano-db-sync.nix +++ b/modules/cardano-db-sync.nix @@ -13,10 +13,15 @@ in { default = "cdbsync"; description = "Used for postgresql database and the cardano-db-sync service user."; }; + _environment = mkOption { + default = config.services.cardano-node.environments.${config.cardano.network}; + internal = true; + type = attrs; + }; # `services.cardano-db-sync` module options: explorerConfig = mkOption { type = attrs; - default = cfg.environment.dbSyncConfig; + default = cfg._environment.dbSyncConfig; }; logConfig = mkOption { type = attrs; @@ -61,20 +66,15 @@ in { config = mkIf cfg.enable { services.cardano-db-sync = { enable = true; - environment = config.services.cardano-node.environments.${config.cardano.network}; + environment = cfg._environment; inherit (config.cardano.node) socketPath; postgres = { - inherit (config.services.postgresql) port; + inherit (config.services.postgresql.settings) port; inherit (cfg.postgres) database; user = cfg.postgres.database; socketdir = "/var/run/postgresql"; }; - inherit (cfg) explorerConfig; - inherit (cfg) logConfig; - inherit (cfg) disableLedger; - inherit (cfg) takeSnapshot; - inherit (cfg) restoreSnapshot; - inherit (cfg) restoreSnapshotSha; + inherit (cfg) explorerConfig logConfig disableLedger takeSnapshot restoreSnapshot restoreSnapshotSha; }; services.postgresql = { enable = true; @@ -86,19 +86,13 @@ in { } ]; }; - # users.users = { - # "${cfg.postgres.database}" = { - # group = "${cfg.postgres.database}"; - # isSystemUser = true; - # }; - # }; - # users.groups."${cfg.postgres.database}" = {}; systemd.services.cardano-db-sync = mkIf (config.cardano.node.enable or false) { after = ["cardano-node-socket.service"]; requires = ["cardano-node-socket.service"]; serviceConfig = { DynamicUser = true; User = cfg.postgres.database; + Group = cfg.postgres.database; }; }; assertions = [ diff --git a/tests/cardano-db-sync.nix b/tests/cardano-db-sync.nix index 0db8f5a..d578d08 100644 --- a/tests/cardano-db-sync.nix +++ b/tests/cardano-db-sync.nix @@ -7,29 +7,27 @@ network = "preview"; cli.enable = true; node.enable = true; - # cardano-db-sync.enable = true; - }; - services.postgresql = { - enable = true; - ensureUsers = [ - { - name = "karol"; - ensureDBOwnership = true; - } - ]; + cardano-db-sync.enable = true; }; environment.systemPackages = with pkgs; [jq bc curl postgresql]; }; testScript = {nodes, ...}: let - magic = toString nodes.machine.config.cardano.networkNumber; + cfg = nodes.machine.config; + dbname = cfg.cardano.cardano-db-sync.postgres.database; + host = "localhost"; + sql = '' + select + 100 * (extract (epoch from (max (time) at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) + / (extract (epoch from (now () at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) + as sync_percent + from block ; + sync_percent + ''; in '' - machine.wait_for_unit("cardano-node") - machine.wait_for_unit("cardano-node-socket") - machine.wait_until_succeeds("""[[ $(echo "$(cardano-cli query tip --testnet-magic ${magic} | jq '.syncProgress' --raw-output) > 0.001" | bc) == "1" ]]""") machine.wait_for_unit("cardano-db-sync") - print(machine.succeed("systemd-analyze security cardano-db-sync")) + print(machine.succeed("""psql --no-password -h '${host}' -U '${dbname}' -d '${dbname}' -c '${sql}' <<< '*\n' """)) ''; }; }; From e98ee7a7588edaa1389210c50f95a4d261d662c0 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Fri, 12 Apr 2024 19:08:57 +0200 Subject: [PATCH 04/24] Make the test pass --- tests/cardano-db-sync.nix | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/tests/cardano-db-sync.nix b/tests/cardano-db-sync.nix index d578d08..22cd9ba 100644 --- a/tests/cardano-db-sync.nix +++ b/tests/cardano-db-sync.nix @@ -12,22 +12,29 @@ environment.systemPackages = with pkgs; [jq bc curl postgresql]; }; - testScript = {nodes, ...}: let - cfg = nodes.machine.config; - dbname = cfg.cardano.cardano-db-sync.postgres.database; - host = "localhost"; - sql = '' - select - 100 * (extract (epoch from (max (time) at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) - / (extract (epoch from (now () at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) - as sync_percent - from block ; - sync_percent - ''; - in '' + testScript = _: + # let + # cfg = nodes.machine; + # dbname = cfg.cardano.cardano-db-sync.postgres.database; + # host = "localhost"; + # sql = '' + # select + # 100 * (extract (epoch from (max (time) at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) + # / (extract (epoch from (now () at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) + # as sync_percent + # from block ; + # sync_percent + # ''; + # print(machine.succeed("systemd-analyze security cardano-db-sync")) + # print(machine.succeed("""psql --no-password -h '${host}' -U '${dbname}' -d '${dbname}' -c '${sql}' <<< '*\n' """)) + # in + '' machine.wait_for_unit("cardano-db-sync") - print(machine.succeed("systemd-analyze security cardano-db-sync")) - print(machine.succeed("""psql --no-password -h '${host}' -U '${dbname}' -d '${dbname}' -c '${sql}' <<< '*\n' """)) + + print(machine.execute("pwd")) + print(machine.execute("ls /var/lib")) + print(machine.execute("users")) + print(machine.execute("cat /etc/passwd")) ''; }; }; From c6a7d349d6429e08fb3a50561618192e9e8caed9 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Tue, 16 Apr 2024 11:55:45 +0200 Subject: [PATCH 05/24] Cardano-db-sync test [not yet] passes --- modules/cardano-db-sync.nix | 77 +++++++++++++++++++++---------------- modules/http.nix | 5 +++ tests/cardano-db-sync.nix | 31 +++++---------- 3 files changed, 57 insertions(+), 56 deletions(-) diff --git a/modules/cardano-db-sync.nix b/modules/cardano-db-sync.nix index ea739d1..0a54224 100644 --- a/modules/cardano-db-sync.nix +++ b/modules/cardano-db-sync.nix @@ -63,43 +63,52 @@ in { }; }; - config = mkIf cfg.enable { - services.cardano-db-sync = { - enable = true; - environment = cfg._environment; - inherit (config.cardano.node) socketPath; - postgres = { - inherit (config.services.postgresql.settings) port; - inherit (cfg.postgres) database; - user = cfg.postgres.database; - socketdir = "/var/run/postgresql"; + config = let + inherit (cfg.postgres) database; + in + mkIf cfg.enable { + services.cardano-db-sync = { + enable = true; + environment = cfg._environment; + inherit (config.cardano.node) socketPath; + postgres = { + inherit (config.services.postgresql.settings) port; + inherit database; + user = database; + socketdir = "/var/run/postgresql"; + }; + stateDir = "/var/lib/${database}"; + inherit (cfg) explorerConfig logConfig disableLedger takeSnapshot restoreSnapshot restoreSnapshotSha; }; - inherit (cfg) explorerConfig logConfig disableLedger takeSnapshot restoreSnapshot restoreSnapshotSha; - }; - services.postgresql = { - enable = true; - ensureDatabases = [cfg.postgres.database]; - ensureUsers = [ + services.postgresql = { + enable = true; + ensureDatabases = [database]; + ensureUsers = [ + { + name = "${database}"; + ensureDBOwnership = true; + } + ]; + authentication = + # type database DBuser auth-method optional_ident_map + '' + local sameuser ${database} peer + ''; + }; + systemd.services.cardano-db-sync = mkIf (config.cardano.node.enable or false) { + after = ["cardano-node-socket.service"]; + requires = ["cardano-node-socket.service"]; + serviceConfig = { + DynamicUser = true; + User = database; + Group = database; + }; + }; + assertions = [ { - name = "${cfg.postgres.database}"; - ensureDBOwnership = true; + assertion = config.cardano.node.enable; + message = "Cardano db sync requires `cardano.node.enable`."; } ]; }; - systemd.services.cardano-db-sync = mkIf (config.cardano.node.enable or false) { - after = ["cardano-node-socket.service"]; - requires = ["cardano-node-socket.service"]; - serviceConfig = { - DynamicUser = true; - User = cfg.postgres.database; - Group = cfg.postgres.database; - }; - }; - assertions = [ - { - assertion = config.cardano.node.enable; - message = "Cardano db sync requires `cardano.node.enable`."; - } - ]; - }; } diff --git a/modules/http.nix b/modules/http.nix index 9b4bb1d..472859a 100644 --- a/modules/http.nix +++ b/modules/http.nix @@ -26,6 +26,11 @@ in { inherit (config.services.ogmios) port; inherit (config.services.ogmios.package) version; }; + # it's cardano-db-sync db, so: + cardano-db = { + inherit (config.services.cardano-db-sync.postgres) port; + inherit (config.services.cardano-db-sync.package) version; + }; kupo = { inherit (config.services.kupo) port; inherit (config.services.kupo.package) version; diff --git a/tests/cardano-db-sync.nix b/tests/cardano-db-sync.nix index 22cd9ba..7e92f00 100644 --- a/tests/cardano-db-sync.nix +++ b/tests/cardano-db-sync.nix @@ -12,29 +12,16 @@ environment.systemPackages = with pkgs; [jq bc curl postgresql]; }; - testScript = _: - # let - # cfg = nodes.machine; - # dbname = cfg.cardano.cardano-db-sync.postgres.database; - # host = "localhost"; - # sql = '' - # select - # 100 * (extract (epoch from (max (time) at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) - # / (extract (epoch from (now () at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) - # as sync_percent - # from block ; - # sync_percent - # ''; - # print(machine.succeed("systemd-analyze security cardano-db-sync")) - # print(machine.succeed("""psql --no-password -h '${host}' -U '${dbname}' -d '${dbname}' -c '${sql}' <<< '*\n' """)) - # in - '' + testScript = {nodes, ...}: let + cfg = nodes.machine; + dbname = cfg.cardano.cardano-db-sync.postgres.database; + inherit (cfg.services.cardano-db-sync.postgres) socketdir; + # get sync percentage, return true if it's above 0.000001 + sql = "select (100 * (extract (epoch from (max (time) at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) / (extract (epoch from (now () at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC')))) > 0.000001 from block limit 1;"; + output = "?column?\\n----------\\nt\\n(1 row)"; # postgres "true" result + in '' machine.wait_for_unit("cardano-db-sync") - - print(machine.execute("pwd")) - print(machine.execute("ls /var/lib")) - print(machine.execute("users")) - print(machine.execute("cat /etc/passwd")) + machine.wait_until_succeeds(r"""[[ $(sudo -u postgres psql --no-password "host=${socketdir} user=postgres dbname=${dbname}" -c "${sql}") = "${output}" ]] """, 150) ''; }; }; From fd311afcc76c5dba691f9ee4283d970bb6e01aa1 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Thu, 25 Apr 2024 17:29:12 +0200 Subject: [PATCH 06/24] Fix output check in the test - test passes --- tests/cardano-db-sync.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/cardano-db-sync.nix b/tests/cardano-db-sync.nix index 7e92f00..5be1f31 100644 --- a/tests/cardano-db-sync.nix +++ b/tests/cardano-db-sync.nix @@ -17,11 +17,23 @@ dbname = cfg.cardano.cardano-db-sync.postgres.database; inherit (cfg.services.cardano-db-sync.postgres) socketdir; # get sync percentage, return true if it's above 0.000001 - sql = "select (100 * (extract (epoch from (max (time) at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) / (extract (epoch from (now () at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC')))) > 0.000001 from block limit 1;"; - output = "?column?\\n----------\\nt\\n(1 row)"; # postgres "true" result + sql = "select (100 * (extract (epoch from (max (time) at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) / (extract (epoch from (now () at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC')))) > 0.00000001 from block limit 1;"; + output = " ?column? \\n----------\\n t\\n(1 row)\\n\\n"; # postgres "true" result in '' + import time machine.wait_for_unit("cardano-db-sync") - machine.wait_until_succeeds(r"""[[ $(sudo -u postgres psql --no-password "host=${socketdir} user=postgres dbname=${dbname}" -c "${sql}") = "${output}" ]] """, 150) + i = 0 + timeout = 100 + while True: + (status, output) = machine.execute(r"""sudo -u postgres psql --no-password "host=${socketdir} user=postgres dbname=${dbname}" -c "${sql}" """) + if i >= timeout: + print("Can't wait forever for the dbsync to reach 0.000001. Exiting - dbsync doesn't seem to sync.") + raise Exception("Timeout") + elif status == 0 and output == "${output}": + print("DbSync started syncing. Succeeds.") + break + i += 1 + time.sleep(1) ''; }; }; From d1a636e0303a0b60a138d0678afad28f093dd72e Mon Sep 17 00:00:00 2001 From: zmrocze Date: Sun, 28 Apr 2024 21:15:13 +0200 Subject: [PATCH 07/24] Add docs --- modules/cardano-db-sync.nix | 135 ++++++++++++++++++++++++------------ 1 file changed, 90 insertions(+), 45 deletions(-) diff --git a/modules/cardano-db-sync.nix b/modules/cardano-db-sync.nix index 0a54224..883aa3d 100644 --- a/modules/cardano-db-sync.nix +++ b/modules/cardano-db-sync.nix @@ -7,11 +7,49 @@ with lib; let cfg = config.cardano.cardano-db-sync; in { options.cardano.cardano-db-sync = with types; { - enable = mkEnableOption "Cardano DB Sync provides a way to query local cardano node."; - postgres.database = mkOption { - type = str; - default = "cdbsync"; - description = "Used for postgresql database and the cardano-db-sync service user."; + enable = mkEnableOption '' + Cardano DB Sync provides a way to query local cardano node. + + Cardano DB sync connects to a cardano node and saves blocks to a database. + You need to either provide the db connection arguments: + ``` + services.cardano-db-sync.database = { + # these are the defaults: + name = "cdbsync"; + user = "cdbsync"; + port = 5432; + socketdir = "/run/postgresql"; + }; + ``` + or enable the default postgresql service with `services.cardano-db-sync.postgres.enable`. + ''; + postgres = { + enable = mkEnableOption "Run postgres and connect dbsync to it."; + }; + database = { + name = mkOption { + type = str; + default = "cdbsync"; + description = "Postgres database name."; + }; + user = mkOption { + type = str; + default = "cdbsync"; + description = "Postgres database user."; + }; + port = mkOption { + type = int; + default = + if cfg.postgres.enable + then config.services.postgresql.settings.port + else 5432; + description = "Postgres database port. See also option socketDir `cardano.cardano-db-sync.database.socketdir`."; + }; + socketdir = lib.mkOption { + type = lib.types.str; + default = "/run/postgresql"; + description = "Path to the postgresql socket."; + }; }; _environment = mkOption { default = config.services.cardano-node.environments.${config.cardano.network}; @@ -66,49 +104,56 @@ in { config = let inherit (cfg.postgres) database; in - mkIf cfg.enable { - services.cardano-db-sync = { - enable = true; - environment = cfg._environment; - inherit (config.cardano.node) socketPath; - postgres = { - inherit (config.services.postgresql.settings) port; - inherit database; - user = database; - socketdir = "/var/run/postgresql"; + mkIf cfg.enable (mkMerge [ + { + services.cardano-db-sync = { + enable = true; + environment = cfg._environment; + inherit (config.cardano.node) socketPath; + postgres = { + inherit (cfg.database) user socketdir port; + database = cfg.database.name; + }; + stateDir = "/var/lib/${cfg.database.name}"; + inherit (cfg) explorerConfig logConfig disableLedger takeSnapshot restoreSnapshot restoreSnapshotSha; }; - stateDir = "/var/lib/${database}"; - inherit (cfg) explorerConfig logConfig disableLedger takeSnapshot restoreSnapshot restoreSnapshotSha; - }; - services.postgresql = { - enable = true; - ensureDatabases = [database]; - ensureUsers = [ + systemd.services.cardano-db-sync = mkIf (config.cardano.node.enable or false) { + after = ["cardano-node-socket.service"]; + requires = ["cardano-node-socket.service"]; + serviceConfig = { + DynamicUser = true; + User = cfg.database.user; + Group = cfg.database.user; + }; + }; + assertions = [ + { + assertion = config.cardano.node.enable; + message = "Cardano db sync requires `cardano.node.enable`."; + } { - name = "${database}"; - ensureDBOwnership = true; + assertion = (! cfg.postgres.enable) || (cfg.database.name == cfg.database.user); + message = "When postgres is enabled, we use the ensureDBOwnership option which expects the user name to match db name."; } ]; - authentication = - # type database DBuser auth-method optional_ident_map - '' - local sameuser ${database} peer - ''; - }; - systemd.services.cardano-db-sync = mkIf (config.cardano.node.enable or false) { - after = ["cardano-node-socket.service"]; - requires = ["cardano-node-socket.service"]; - serviceConfig = { - DynamicUser = true; - User = database; - Group = database; + } + (mkIf cfg.postgres.enable { + services.postgresql = { + enable = true; + # see assertions: this is same as user name + ensureDatabases = [cfg.database.name]; + ensureUsers = [ + { + name = "${cfg.database.name}"; + ensureDBOwnership = true; + } + ]; + authentication = + # type database DBuser auth-method optional_ident_map + '' + local sameuser ${cfg.database.name} peer + ''; }; - }; - assertions = [ - { - assertion = config.cardano.node.enable; - message = "Cardano db sync requires `cardano.node.enable`."; - } - ]; - }; + }) + ]); } From dde43e73f970275194bf11c695ec2edb185b9ba0 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Mon, 29 Apr 2024 14:47:49 +0200 Subject: [PATCH 08/24] Fix test after module changes --- modules/cardano-db-sync.nix | 2 +- tests/cardano-db-sync.nix | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/cardano-db-sync.nix b/modules/cardano-db-sync.nix index 883aa3d..4da6e22 100644 --- a/modules/cardano-db-sync.nix +++ b/modules/cardano-db-sync.nix @@ -21,7 +21,7 @@ in { socketdir = "/run/postgresql"; }; ``` - or enable the default postgresql service with `services.cardano-db-sync.postgres.enable`. + or enable the default postgresql service with `services.cardano-db-sync.postgres.enable` and possibly overwrite the `services.postgresql` options for your need. ''; postgres = { enable = mkEnableOption "Run postgres and connect dbsync to it."; diff --git a/tests/cardano-db-sync.nix b/tests/cardano-db-sync.nix index 5be1f31..09e52d3 100644 --- a/tests/cardano-db-sync.nix +++ b/tests/cardano-db-sync.nix @@ -1,5 +1,8 @@ { perSystem.vmTests.tests.cardano-db-sync = { + # The test runs cardano-db-sync with postgres enabled and checks that the db syncs. + # We call the db as the `postgres` user, but the service connects as the `cdbsync` user, but it is systemd dynamic user. + # Test runs impure to access the "preview" network. impure = true; module = { nodes.machine = {pkgs, ...}: { @@ -7,15 +10,17 @@ network = "preview"; cli.enable = true; node.enable = true; - cardano-db-sync.enable = true; + cardano-db-sync = { + enable = true; + postgres.enable = true; + }; }; environment.systemPackages = with pkgs; [jq bc curl postgresql]; }; testScript = {nodes, ...}: let cfg = nodes.machine; - dbname = cfg.cardano.cardano-db-sync.postgres.database; - inherit (cfg.services.cardano-db-sync.postgres) socketdir; + inherit (cfg.cardano.cardano-db-sync.database) name socketdir; # get sync percentage, return true if it's above 0.000001 sql = "select (100 * (extract (epoch from (max (time) at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) / (extract (epoch from (now () at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC')))) > 0.00000001 from block limit 1;"; output = " ?column? \\n----------\\n t\\n(1 row)\\n\\n"; # postgres "true" result @@ -25,7 +30,7 @@ i = 0 timeout = 100 while True: - (status, output) = machine.execute(r"""sudo -u postgres psql --no-password "host=${socketdir} user=postgres dbname=${dbname}" -c "${sql}" """) + (status, output) = machine.execute(r"""sudo -u postgres psql --no-password "host=${socketdir} user=postgres dbname=${name}" -c "${sql}" """) if i >= timeout: print("Can't wait forever for the dbsync to reach 0.000001. Exiting - dbsync doesn't seem to sync.") raise Exception("Timeout") @@ -34,6 +39,7 @@ break i += 1 time.sleep(1) + print(machine.succeed("systemd-analyze security cardano-db-sync")) ''; }; }; From 0b36b55e621139277445717de568bf58556437fc Mon Sep 17 00:00:00 2001 From: zmrocze Date: Mon, 29 Apr 2024 15:58:16 +0200 Subject: [PATCH 09/24] Harden cardano-db-sync service --- modules/cardano-db-sync.nix | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/modules/cardano-db-sync.nix b/modules/cardano-db-sync.nix index 4da6e22..0f7a253 100644 --- a/modules/cardano-db-sync.nix +++ b/modules/cardano-db-sync.nix @@ -123,7 +123,33 @@ in { serviceConfig = { DynamicUser = true; User = cfg.database.user; - Group = cfg.database.user; + # Security + UMask = "0077"; + CapabilityBoundingSet = ""; + ProtectClock = true; + ProtectKernelLogs = true; + ProtectDevices = true; + ProtectKernelModules = true; + SystemCallArchitectures = "native"; + MemoryDenyWriteExecute = true; + RestrictNamespaces = true; + ProtectHostname = true; + ProtectKernelTunables = true; + RestrictRealtime = true; + SystemCallFilter = ["@system-service" "~@privileged"]; + PrivateDevices = true; + RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6"; + IPAddressAllow = "localhost"; + IPAddressDeny = "any"; + ProtectHome = true; + DevicePolicy = "closed"; + DeviceAllow = ""; + ProtectProc = "invisible"; + ProcSubset = "pid"; + PrivateTmp = true; + ProtectControlGroups = true; + PrivateUsers = true; + LockPersonality = true; }; }; assertions = [ From aec0a4f4fbb0319589c67cd98f9cd551d21956c7 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Mon, 29 Apr 2024 16:00:31 +0200 Subject: [PATCH 10/24] Remove cardano-db from default http-proxy --- modules/http.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/http.nix b/modules/http.nix index 472859a..9b4bb1d 100644 --- a/modules/http.nix +++ b/modules/http.nix @@ -26,11 +26,6 @@ in { inherit (config.services.ogmios) port; inherit (config.services.ogmios.package) version; }; - # it's cardano-db-sync db, so: - cardano-db = { - inherit (config.services.cardano-db-sync.postgres) port; - inherit (config.services.cardano-db-sync.package) version; - }; kupo = { inherit (config.services.kupo) port; inherit (config.services.kupo.package) version; From cf847aaf2596207dad124aad0ef1bb7afe483618 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Mon, 29 Apr 2024 16:24:45 +0200 Subject: [PATCH 11/24] Try to fix building docs - FAIL --- modules/cardano-db-sync.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/cardano-db-sync.nix b/modules/cardano-db-sync.nix index 0f7a253..b718449 100644 --- a/modules/cardano-db-sync.nix +++ b/modules/cardano-db-sync.nix @@ -52,14 +52,14 @@ in { }; }; _environment = mkOption { - default = config.services.cardano-node.environments.${config.cardano.network}; + default = config.services.cardano-node.environments.${config.cardano.network} or {hack = "";}; internal = true; type = attrs; }; # `services.cardano-db-sync` module options: explorerConfig = mkOption { type = attrs; - default = cfg._environment.dbSyncConfig; + default = cfg._environment.dbSyncConfig or {hack = "Should be cfg._environment.dbSyncConfig";}; }; logConfig = mkOption { type = attrs; From 9a49bd5b016dc9af5adc9ca5d700167a20313aa0 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Mon, 29 Apr 2024 18:51:11 +0200 Subject: [PATCH 12/24] [2] Try to fix building docs - FAIL --- modules/cardano-db-sync.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/cardano-db-sync.nix b/modules/cardano-db-sync.nix index b718449..00d6f09 100644 --- a/modules/cardano-db-sync.nix +++ b/modules/cardano-db-sync.nix @@ -55,15 +55,18 @@ in { default = config.services.cardano-node.environments.${config.cardano.network} or {hack = "";}; internal = true; type = attrs; + description = "Attribute set describing the chosen network (mainnet, testnet, etc.). By default taken from `services.cardano-node.environments`."; }; # `services.cardano-db-sync` module options: explorerConfig = mkOption { type = attrs; default = cfg._environment.dbSyncConfig or {hack = "Should be cfg._environment.dbSyncConfig";}; + description = "Together with logConfig constructs the db-sync config file."; }; logConfig = mkOption { type = attrs; default = {}; + description = "Together with explorerConfig constructs the db-sync config file."; }; disableLedger = mkOption { type = bool; From 824e300d8ac3977e3f121ce11ee166663c3dbe39 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Tue, 30 Apr 2024 14:29:17 +0200 Subject: [PATCH 13/24] Fix python packages version --- docs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/default.nix b/docs/default.nix index bcdbb9f..718ea67 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -12,14 +12,14 @@ in { pkgs, ... }: let - inherit (pkgs) stdenv mkdocs python310Packages; + inherit (pkgs) stdenv mkdocs python311Packages; my-mkdocs = pkgs.runCommand "my-mkdocs" { buildInputs = [ mkdocs - python310Packages.mkdocs-material + python311Packages.mkdocs-material ]; } '' mkdir -p $out/bin From 5fd2dc75bb8c3ee5b5483ca7df22f630c2e21b81 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Tue, 30 Apr 2024 14:37:08 +0200 Subject: [PATCH 14/24] Fix mkdocs to python 3.11 --- docs/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/default.nix b/docs/default.nix index 718ea67..f745f5e 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -12,9 +12,11 @@ in { pkgs, ... }: let - inherit (pkgs) stdenv mkdocs python311Packages; + inherit (pkgs) stdenv python311Packages; - my-mkdocs = + my-mkdocs = let + inherit (python311Packages) mkdocs; + in pkgs.runCommand "my-mkdocs" { buildInputs = [ From 6b380fb56be62b2d84c1361b6c1f6c47ce3f19f7 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Tue, 30 Apr 2024 15:11:29 +0200 Subject: [PATCH 15/24] Not use our nixpkgs for attic --- flake.lock | 204 ++++++++++++++++++++++++++++++----------------------- flake.nix | 3 +- 2 files changed, 117 insertions(+), 90 deletions(-) diff --git a/flake.lock b/flake.lock index 87af340..9c72b30 100644 --- a/flake.lock +++ b/flake.lock @@ -104,19 +104,15 @@ "crane": "crane", "flake-compat": "flake-compat", "flake-utils": "flake-utils", - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": [ - "nixpkgs" - ] + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1704159259, - "narHash": "sha256-OOEFibN9JQBepVeqxSNSBr6JUmdoZiH263ogms2jk0k=", + "lastModified": 1711742460, + "narHash": "sha256-0O4v6e4a1toxXZ2gf5INhg4WPE5C5T+SVvsBt+45Mcc=", "owner": "zhaofengli", "repo": "attic", - "rev": "e6bedf1869f382cfc51b69848d6e09d51585ead6", + "rev": "4dbdbee45728d8ce5788db6461aaaa89d98081f0", "type": "github" }, "original": { @@ -594,7 +590,7 @@ }, "cardano-mainnet-mirror": { "inputs": { - "nixpkgs": "nixpkgs_16" + "nixpkgs": "nixpkgs_17" }, "locked": { "lastModified": 1642701714, @@ -859,7 +855,7 @@ "crystal-x86_64-linux": "crystal-x86_64-linux", "crystalline-src": "crystalline-src", "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1683429373, @@ -1189,7 +1185,7 @@ }, "fenix_2": { "inputs": { - "nixpkgs": "nixpkgs_21", + "nixpkgs": "nixpkgs_22", "rust-analyzer-src": "rust-analyzer-src_2" }, "locked": { @@ -1809,7 +1805,7 @@ }, "gomod2nix": { "inputs": { - "nixpkgs": "nixpkgs_13", + "nixpkgs": "nixpkgs_14", "utils": "utils_2" }, "locked": { @@ -2029,7 +2025,7 @@ }, "haumea": { "inputs": { - "nixpkgs": "nixpkgs_19" + "nixpkgs": "nixpkgs_20" }, "locked": { "lastModified": 1685133229, @@ -2463,7 +2459,7 @@ "inputs-check": { "inputs": { "flake-parts": "flake-parts_4", - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1692633913, @@ -2482,7 +2478,7 @@ "iohk-nix": { "inputs": { "blst": "blst", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_7", "secp256k1": "secp256k1", "sodium": "sodium" }, @@ -2504,7 +2500,7 @@ "iohk-nix-ng": { "inputs": { "blst": "blst_2", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_8", "secp256k1": "secp256k1_2", "sodium": "sodium_2" }, @@ -2746,7 +2742,7 @@ "nix": { "inputs": { "lowdown-src": "lowdown-src", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nixpkgs-regression": "nixpkgs-regression" }, "locked": { @@ -2805,7 +2801,7 @@ "nix2container": { "inputs": { "flake-utils": "flake-utils_6", - "nixpkgs": "nixpkgs_14" + "nixpkgs": "nixpkgs_15" }, "locked": { "lastModified": 1658567952, @@ -2824,7 +2820,7 @@ "nix2container_2": { "inputs": { "flake-utils": "flake-utils_8", - "nixpkgs": "nixpkgs_18" + "nixpkgs": "nixpkgs_19" }, "locked": { "lastModified": 1671269339, @@ -2844,7 +2840,7 @@ "inputs": { "flake-compat": "flake-compat_4", "lowdown-src": "lowdown-src_2", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_9", "nixpkgs-regression": "nixpkgs-regression_2" }, "locked": { @@ -2865,7 +2861,7 @@ "nix_3": { "inputs": { "lowdown-src": "lowdown-src_3", - "nixpkgs": "nixpkgs_12", + "nixpkgs": "nixpkgs_13", "nixpkgs-regression": "nixpkgs-regression_3" }, "locked": { @@ -2886,7 +2882,7 @@ "nix_4": { "inputs": { "lowdown-src": "lowdown-src_4", - "nixpkgs": "nixpkgs_17", + "nixpkgs": "nixpkgs_18", "nixpkgs-regression": "nixpkgs-regression_4" }, "locked": { @@ -2976,16 +2972,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1677543769, - "narHash": "sha256-LwbqS8vGisXl2WHpK9r5+kodr0zoIT8F2YB0R4y1TsA=", + "lastModified": 1711401922, + "narHash": "sha256-QoQqXoj8ClGo0sqD/qWKFWezgEwUL0SUh37/vY2jNhc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b26d52c9feb6476580016e78935cbf96eb3e2115", + "rev": "07262b18b97000d16a4bdb003418bd2fb067a932", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-22.11", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -3433,6 +3429,22 @@ } }, "nixpkgs-stable": { + "locked": { + "lastModified": 1711460390, + "narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "44733514b72e732bd49f5511bd0203dea9b9a434", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { "locked": { "lastModified": 1690066826, "narHash": "sha256-6L2qb+Zc0BFkh72OS9uuX637gniOjzU6qCDBpjB2LGY=", @@ -3513,6 +3525,22 @@ } }, "nixpkgs_10": { + "locked": { + "lastModified": 1690026219, + "narHash": "sha256-oOduRk/kzQxOBknZXTLSEYd7tk+GoKvr8wV6Ab+t4AU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f465da166263bc0d4b39dfd4ca28b777c92d4b73", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { "locked": { "lastModified": 1675249806, "narHash": "sha256-u8Rcqekusl3pMZm68hZqr6zozI8Ug5IxqOiqDLAlu1k=", @@ -3528,7 +3556,7 @@ "type": "github" } }, - "nixpkgs_11": { + "nixpkgs_12": { "locked": { "lastModified": 1636823747, "narHash": "sha256-oWo1nElRAOZqEf90Yek2ixdHyjD+gqtS/pAgwaQ9UhQ=", @@ -3543,7 +3571,7 @@ "type": "github" } }, - "nixpkgs_12": { + "nixpkgs_13": { "locked": { "lastModified": 1657693803, "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", @@ -3559,7 +3587,7 @@ "type": "github" } }, - "nixpkgs_13": { + "nixpkgs_14": { "locked": { "lastModified": 1653581809, "narHash": "sha256-Uvka0V5MTGbeOfWte25+tfRL3moECDh1VwokWSZUdoY=", @@ -3575,7 +3603,7 @@ "type": "github" } }, - "nixpkgs_14": { + "nixpkgs_15": { "locked": { "lastModified": 1654807842, "narHash": "sha256-ADymZpr6LuTEBXcy6RtFHcUZdjKTBRTMYwu19WOx17E=", @@ -3590,7 +3618,7 @@ "type": "github" } }, - "nixpkgs_15": { + "nixpkgs_16": { "locked": { "lastModified": 1675940568, "narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=", @@ -3606,7 +3634,7 @@ "type": "github" } }, - "nixpkgs_16": { + "nixpkgs_17": { "locked": { "lastModified": 1642336556, "narHash": "sha256-QSPPbFEwy0T0DrIuSzAACkaANPQaR1lZR/nHZGz9z04=", @@ -3620,7 +3648,7 @@ "type": "indirect" } }, - "nixpkgs_17": { + "nixpkgs_18": { "locked": { "lastModified": 1657693803, "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", @@ -3636,7 +3664,7 @@ "type": "github" } }, - "nixpkgs_18": { + "nixpkgs_19": { "locked": { "lastModified": 1654807842, "narHash": "sha256-ADymZpr6LuTEBXcy6RtFHcUZdjKTBRTMYwu19WOx17E=", @@ -3651,38 +3679,38 @@ "type": "github" } }, - "nixpkgs_19": { + "nixpkgs_2": { "locked": { - "lastModified": 1681001314, - "narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "367c0e1086a4eb4502b24d872cea2c7acdd557f4", + "lastModified": 1677543769, + "narHash": "sha256-LwbqS8vGisXl2WHpK9r5+kodr0zoIT8F2YB0R4y1TsA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b26d52c9feb6476580016e78935cbf96eb3e2115", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", + "owner": "NixOS", + "ref": "nixos-22.11", + "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_20": { "locked": { - "lastModified": 1645013224, - "narHash": "sha256-b7OEC8vwzJv3rsz9pwnTX2LQDkeOWz2DbKypkVvNHXc=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "b66b39216b1fef2d8c33cc7a5c72d8da80b79970", + "lastModified": 1681001314, + "narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "367c0e1086a4eb4502b24d872cea2c7acdd557f4", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", + "owner": "nix-community", + "repo": "nixpkgs.lib", "type": "github" } }, - "nixpkgs_20": { + "nixpkgs_21": { "locked": { "lastModified": 1675940568, "narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=", @@ -3698,7 +3726,7 @@ "type": "github" } }, - "nixpkgs_21": { + "nixpkgs_22": { "locked": { "lastModified": 1677063315, "narHash": "sha256-qiB4ajTeAOVnVSAwCNEEkoybrAlA+cpeiBxLobHndE8=", @@ -3714,13 +3742,13 @@ "type": "github" } }, - "nixpkgs_22": { + "nixpkgs_23": { "locked": { - "lastModified": 1712439257, - "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", + "lastModified": 1714253743, + "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", + "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", "type": "github" }, "original": { @@ -3731,6 +3759,22 @@ } }, "nixpkgs_3": { + "locked": { + "lastModified": 1645013224, + "narHash": "sha256-b7OEC8vwzJv3rsz9pwnTX2LQDkeOWz2DbKypkVvNHXc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b66b39216b1fef2d8c33cc7a5c72d8da80b79970", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1680945546, "narHash": "sha256-8FuaH5t/aVi/pR1XxnF0qi4WwMYC+YxlfdsA0V+TEuQ=", @@ -3746,7 +3790,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1657693803, "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", @@ -3762,7 +3806,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1692339729, "narHash": "sha256-TUK76/Pqm9qIDjEGd27Lz9EiBIvn5F70JWDmEQ4Y5DQ=", @@ -3778,7 +3822,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1684171562, "narHash": "sha256-BMUWjVWAUdyMWKk0ATMC9H0Bv4qAV/TXwwPUvTiC5IQ=", @@ -3794,7 +3838,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1684171562, "narHash": "sha256-BMUWjVWAUdyMWKk0ATMC9H0Bv4qAV/TXwwPUvTiC5IQ=", @@ -3810,7 +3854,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1670461440, "narHash": "sha256-jy1LB8HOMKGJEGXgzFRLDU1CBGL0/LlkolgnqIsF0D8=", @@ -3826,22 +3870,6 @@ "type": "github" } }, - "nixpkgs_9": { - "locked": { - "lastModified": 1690026219, - "narHash": "sha256-oOduRk/kzQxOBknZXTLSEYd7tk+GoKvr8wV6Ab+t4AU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "f465da166263bc0d4b39dfd4ca28b777c92d4b73", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nosys": { "locked": { "lastModified": 1668010795, @@ -4163,7 +4191,7 @@ "flake-parts": "flake-parts_5", "flake-root": "flake-root", "hercules-ci-effects": "hercules-ci-effects", - "nixpkgs": "nixpkgs_22", + "nixpkgs": "nixpkgs_23", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "treefmt-nix": "treefmt-nix_3" } @@ -4371,8 +4399,8 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_9", - "nixpkgs-stable": "nixpkgs-stable" + "nixpkgs": "nixpkgs_10", + "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { "lastModified": 1690199016, @@ -4439,7 +4467,7 @@ "statix": { "inputs": { "fenix": "fenix", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1676888642, @@ -4485,7 +4513,7 @@ ], "n2c": "n2c", "nixago": "nixago", - "nixpkgs": "nixpkgs_15", + "nixpkgs": "nixpkgs_16", "paisano": "paisano", "paisano-tui": "paisano-tui", "yants": "yants" @@ -4529,7 +4557,7 @@ ], "n2c": "n2c_2", "nixago": "nixago_2", - "nixpkgs": "nixpkgs_20", + "nixpkgs": "nixpkgs_21", "paisano": "paisano_2", "paisano-mdbook-preprocessor": "paisano-mdbook-preprocessor", "paisano-tui": "paisano-tui_2", @@ -4626,7 +4654,7 @@ }, "terraform-providers": { "inputs": { - "nixpkgs": "nixpkgs_10" + "nixpkgs": "nixpkgs_11" }, "locked": { "lastModified": 1695893013, @@ -4647,7 +4675,7 @@ "bats-assert": "bats-assert", "bats-support": "bats-support", "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_11", + "nixpkgs": "nixpkgs_12", "terranix-examples": "terranix-examples" }, "locked": { @@ -4681,7 +4709,7 @@ }, "treefmt-nix": { "inputs": { - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1683117219, diff --git a/flake.nix b/flake.nix index 8578d2d..a239cd6 100644 --- a/flake.nix +++ b/flake.nix @@ -20,8 +20,7 @@ # Utilities attic = { url = "github:zhaofengli/attic"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.nixpkgs-stable.follows = "nixpkgs"; + # doesn't build yet with our nixpkgs }; devour-flake = { url = "github:srid/devour-flake"; From 06e800fdd2043f09e8587198d08b0d7744d360c9 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Tue, 30 Apr 2024 17:24:41 +0200 Subject: [PATCH 16/24] Increase timeout on cardano-db-sync test --- tests/cardano-db-sync.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cardano-db-sync.nix b/tests/cardano-db-sync.nix index 09e52d3..bf393dc 100644 --- a/tests/cardano-db-sync.nix +++ b/tests/cardano-db-sync.nix @@ -28,7 +28,7 @@ import time machine.wait_for_unit("cardano-db-sync") i = 0 - timeout = 100 + timeout = 420 while True: (status, output) = machine.execute(r"""sudo -u postgres psql --no-password "host=${socketdir} user=postgres dbname=${name}" -c "${sql}" """) if i >= timeout: From 4d951d3ec419d1430f17796103a66e8e83ea3100 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Wed, 1 May 2024 14:18:59 +0200 Subject: [PATCH 17/24] Increase timeout more --- tests/cardano-db-sync.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/cardano-db-sync.nix b/tests/cardano-db-sync.nix index bf393dc..a2abfec 100644 --- a/tests/cardano-db-sync.nix +++ b/tests/cardano-db-sync.nix @@ -21,8 +21,8 @@ testScript = {nodes, ...}: let cfg = nodes.machine; inherit (cfg.cardano.cardano-db-sync.database) name socketdir; - # get sync percentage, return true if it's above 0.000001 - sql = "select (100 * (extract (epoch from (max (time) at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) / (extract (epoch from (now () at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC')))) > 0.00000001 from block limit 1;"; + # get sync percentage, return true if it's above 0.000000001 + sql = "select (100 * (extract (epoch from (max (time) at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) / (extract (epoch from (now () at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC')))) > 0.000000001 from block limit 1;"; output = " ?column? \\n----------\\n t\\n(1 row)\\n\\n"; # postgres "true" result in '' import time @@ -32,13 +32,13 @@ while True: (status, output) = machine.execute(r"""sudo -u postgres psql --no-password "host=${socketdir} user=postgres dbname=${name}" -c "${sql}" """) if i >= timeout: - print("Can't wait forever for the dbsync to reach 0.000001. Exiting - dbsync doesn't seem to sync.") + print("Can't wait forever for the dbsync to reach 0.000000001. Exiting - dbsync doesn't seem to sync.") raise Exception("Timeout") elif status == 0 and output == "${output}": print("DbSync started syncing. Succeeds.") break i += 1 - time.sleep(1) + time.sleep(3) print(machine.succeed("systemd-analyze security cardano-db-sync")) ''; }; From abff1df058c7365fb2c02524a310a9f85cb063db Mon Sep 17 00:00:00 2001 From: zmrocze Date: Sun, 5 May 2024 20:18:27 +0200 Subject: [PATCH 18/24] Review fixes & fixes --- flake.nix | 2 +- modules/cardano-db-sync.nix | 109 ++++++++++-------------------------- tests/cardano-db-sync.nix | 4 +- 3 files changed, 33 insertions(+), 82 deletions(-) diff --git a/flake.nix b/flake.nix index a239cd6..6bf3d20 100644 --- a/flake.nix +++ b/flake.nix @@ -14,7 +14,7 @@ flake = false; }; cardano-db-sync = { - url = "github:intersectmbo/cardano-db-sync?ref=13.2.0.1"; # compatible with 8.7.3 + url = "github:intersectmbo/cardano-db-sync/13.2.0.1"; # compatible with 8.7.3 }; # Utilities diff --git a/modules/cardano-db-sync.nix b/modules/cardano-db-sync.nix index 00d6f09..a5c0ce9 100644 --- a/modules/cardano-db-sync.nix +++ b/modules/cardano-db-sync.nix @@ -4,15 +4,15 @@ ... }: with lib; let - cfg = config.cardano.cardano-db-sync; + cfg = config.cardano.db-sync; in { - options.cardano.cardano-db-sync = with types; { + options.cardano.db-sync = with types; { enable = mkEnableOption '' Cardano DB Sync provides a way to query local cardano node. Cardano DB sync connects to a cardano node and saves blocks to a database. You need to either provide the db connection arguments: - ``` + ```nix services.cardano-db-sync.database = { # these are the defaults: name = "cdbsync"; @@ -24,7 +24,12 @@ in { or enable the default postgresql service with `services.cardano-db-sync.postgres.enable` and possibly overwrite the `services.postgresql` options for your need. ''; postgres = { - enable = mkEnableOption "Run postgres and connect dbsync to it."; + enable = mkEnableOption "Run postgres and connect dbsync to it." // {default = true;}; + }; + nodeSocketPath = mkOption { + description = "Path to cardano-node socket."; + type = lib.types.path; + default = config.cardano.node.socketPath; }; database = { name = mkOption { @@ -39,69 +44,16 @@ in { }; port = mkOption { type = int; - default = - if cfg.postgres.enable - then config.services.postgresql.settings.port - else 5432; - description = "Postgres database port. See also option socketDir `cardano.cardano-db-sync.database.socketdir`."; + default = config.services.postgresql.settings.port or 5432; + description = "Postgres database port. See also option socketDir `cardano.db-sync.database.socketdir`."; }; socketdir = lib.mkOption { type = lib.types.str; - default = "/run/postgresql"; + # use first socket from postgresql settings or default to /run/postgresql + default = builtins.head ((config.services.postgresql.settings.unix_socket_directories or []) ++ ["/run/postgresql"]); description = "Path to the postgresql socket."; }; }; - _environment = mkOption { - default = config.services.cardano-node.environments.${config.cardano.network} or {hack = "";}; - internal = true; - type = attrs; - description = "Attribute set describing the chosen network (mainnet, testnet, etc.). By default taken from `services.cardano-node.environments`."; - }; - # `services.cardano-db-sync` module options: - explorerConfig = mkOption { - type = attrs; - default = cfg._environment.dbSyncConfig or {hack = "Should be cfg._environment.dbSyncConfig";}; - description = "Together with logConfig constructs the db-sync config file."; - }; - logConfig = mkOption { - type = attrs; - default = {}; - description = "Together with explorerConfig constructs the db-sync config file."; - }; - disableLedger = mkOption { - type = bool; - default = false; - description = '' - Disables the leger state. Drastically reduces memory usage - and it syncs faster, but some data are missing. - ''; - }; - takeSnapshot = mkOption { - type = enum ["never" "once" "always"]; - default = "never"; - description = '' - Take snapshot before starting cardano-db-sync, - "once" (skip if there is one already), - "always" (removing previous snapshot), - or "never". - ''; - }; - restoreSnapshot = mkOption { - type = nullOr str; - default = null; - description = '' - Restore a snapshot before starting cardano-db-sync, - if the snasphot file given by the option exist. - Snapshot file is deleted after restore. - ''; - }; - restoreSnapshotSha = mkOption { - type = nullOr str; - default = null; - description = '' - SHA256 checksum of the snapshot to restore - ''; - }; }; config = let @@ -111,18 +63,15 @@ in { { services.cardano-db-sync = { enable = true; - environment = cfg._environment; - inherit (config.cardano.node) socketPath; + environment = config.services.cardano-node.environments.${config.cardano.network}; + socketPath = cfg.nodeSocketPath; postgres = { inherit (cfg.database) user socketdir port; database = cfg.database.name; }; - stateDir = "/var/lib/${cfg.database.name}"; - inherit (cfg) explorerConfig logConfig disableLedger takeSnapshot restoreSnapshot restoreSnapshotSha; + stateDir = "/var/lib/${cfg.database.user}"; }; - systemd.services.cardano-db-sync = mkIf (config.cardano.node.enable or false) { - after = ["cardano-node-socket.service"]; - requires = ["cardano-node-socket.service"]; + systemd.services.cardano-db-sync = { serviceConfig = { DynamicUser = true; User = cfg.database.user; @@ -155,21 +104,17 @@ in { LockPersonality = true; }; }; - assertions = [ - { - assertion = config.cardano.node.enable; - message = "Cardano db sync requires `cardano.node.enable`."; - } - { - assertion = (! cfg.postgres.enable) || (cfg.database.name == cfg.database.user); - message = "When postgres is enabled, we use the ensureDBOwnership option which expects the user name to match db name."; - } - ]; } + (mkIf (config.cardano.node.enable or false) { + systemd.services.cardano-db-sync = { + after = ["cardano-node-socket.service"]; + requires = ["cardano-node-socket.service"]; + }; + }) (mkIf cfg.postgres.enable { services.postgresql = { enable = true; - # see assertions: this is same as user name + # see warnings: this should be same as user name ensureDatabases = [cfg.database.name]; ensureUsers = [ { @@ -183,6 +128,12 @@ in { local sameuser ${cfg.database.name} peer ''; }; + warnings = + if (cfg.database.name == cfg.database.user) + then [ + "When postgres is enabled, we use the ensureDBOwnership option which expects the user name to match db name." + ] + else []; }) ]); } diff --git a/tests/cardano-db-sync.nix b/tests/cardano-db-sync.nix index a2abfec..191be69 100644 --- a/tests/cardano-db-sync.nix +++ b/tests/cardano-db-sync.nix @@ -10,7 +10,7 @@ network = "preview"; cli.enable = true; node.enable = true; - cardano-db-sync = { + db-sync = { enable = true; postgres.enable = true; }; @@ -20,7 +20,7 @@ testScript = {nodes, ...}: let cfg = nodes.machine; - inherit (cfg.cardano.cardano-db-sync.database) name socketdir; + inherit (cfg.cardano.db-sync.database) name socketdir; # get sync percentage, return true if it's above 0.000000001 sql = "select (100 * (extract (epoch from (max (time) at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) / (extract (epoch from (now () at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC')))) > 0.000000001 from block limit 1;"; output = " ?column? \\n----------\\n t\\n(1 row)\\n\\n"; # postgres "true" result From 3310186830e6f042a3562c51509daf3891ccccbb Mon Sep 17 00:00:00 2001 From: zmrocze Date: Mon, 6 May 2024 18:40:43 +0200 Subject: [PATCH 19/24] Fix nodeSocketPath option & Remove attic input --- ci/default.nix | 1 - flake.lock | 399 +++++++++++++----------------------- flake.nix | 4 - modules/cardano-db-sync.nix | 10 +- 4 files changed, 152 insertions(+), 262 deletions(-) diff --git a/ci/default.nix b/ci/default.nix index 0aaa6f4..6dfa934 100644 --- a/ci/default.nix +++ b/ci/default.nix @@ -25,7 +25,6 @@ push-cache-effect = { enable = true; - attic-client-pkg = inputs.attic.packages.x86_64-linux.attic-client; caches = { mlabs-cardano-nix = { type = "attic"; diff --git a/flake.lock b/flake.lock index 9c72b30..7c52f3f 100644 --- a/flake.lock +++ b/flake.lock @@ -99,28 +99,6 @@ "type": "github" } }, - "attic": { - "inputs": { - "crane": "crane", - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1711742460, - "narHash": "sha256-0O4v6e4a1toxXZ2gf5INhg4WPE5C5T+SVvsBt+45Mcc=", - "owner": "zhaofengli", - "repo": "attic", - "rev": "4dbdbee45728d8ce5788db6461aaaa89d98081f0", - "type": "github" - }, - "original": { - "owner": "zhaofengli", - "repo": "attic", - "type": "github" - } - }, "auth-keys-hub": { "inputs": { "crystal": "crystal", @@ -465,7 +443,7 @@ }, "cardano-automation": { "inputs": { - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_4", "haskellNix": [ "cardano-node", "haskellNix" @@ -511,7 +489,7 @@ "inputs": { "CHaP": "CHaP", "cardano-parts": "cardano-parts", - "flake-compat": "flake-compat_5", + "flake-compat": "flake-compat_4", "hackageNix": "hackageNix", "haskellNix": "haskellNix", "iohkNix": "iohkNix", @@ -590,7 +568,7 @@ }, "cardano-mainnet-mirror": { "inputs": { - "nixpkgs": "nixpkgs_17" + "nixpkgs": "nixpkgs_16" }, "locked": { "lastModified": 1642701714, @@ -615,7 +593,7 @@ "customConfig": "customConfig", "em": "em", "empty-flake": "empty-flake_2", - "flake-compat": "flake-compat_8", + "flake-compat": "flake-compat_7", "hackageNix": "hackageNix_2", "haskellNix": "haskellNix_2", "hostNixpkgs": [ @@ -774,8 +752,8 @@ }, "colmena": { "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_2", + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", "nixpkgs": [ "cardano-db-sync", "cardano-parts", @@ -800,29 +778,8 @@ }, "crane": { "inputs": { - "nixpkgs": [ - "attic", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1702918879, - "narHash": "sha256-tWJqzajIvYcaRWxn+cLUB9L9Pv4dQ3Bfit/YjU5ze3g=", - "owner": "ipetkov", - "repo": "crane", - "rev": "7195c00c272fdd92fc74e7d5a0a2844b9fadb2fb", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "crane_2": { - "inputs": { - "flake-compat": "flake-compat_10", - "flake-utils": "flake-utils_10", + "flake-compat": "flake-compat_9", + "flake-utils": "flake-utils_9", "nixpkgs": [ "cardano-node", "std", @@ -855,7 +812,7 @@ "crystal-x86_64-linux": "crystal-x86_64-linux", "crystalline-src": "crystalline-src", "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs" }, "locked": { "lastModified": 1683429373, @@ -1185,7 +1142,7 @@ }, "fenix_2": { "inputs": { - "nixpkgs": "nixpkgs_22", + "nixpkgs": "nixpkgs_21", "rust-analyzer-src": "rust-analyzer-src_2" }, "locked": { @@ -1205,11 +1162,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", "type": "github" }, "original": { @@ -1219,22 +1176,6 @@ } }, "flake-compat_10": { - "flake": false, - "locked": { - "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_11": { "flake": false, "locked": { "lastModified": 1696426674, @@ -1251,22 +1192,6 @@ } }, "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_3": { "flake": false, "locked": { "lastModified": 1672831974, @@ -1283,7 +1208,7 @@ "type": "github" } }, - "flake-compat_4": { + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1673956053, @@ -1299,7 +1224,7 @@ "type": "github" } }, - "flake-compat_5": { + "flake-compat_4": { "flake": false, "locked": { "lastModified": 1647532380, @@ -1316,7 +1241,7 @@ "type": "github" } }, - "flake-compat_6": { + "flake-compat_5": { "flake": false, "locked": { "lastModified": 1672831974, @@ -1333,7 +1258,7 @@ "type": "github" } }, - "flake-compat_7": { + "flake-compat_6": { "flake": false, "locked": { "lastModified": 1650374568, @@ -1349,7 +1274,7 @@ "type": "github" } }, - "flake-compat_8": { + "flake-compat_7": { "flake": false, "locked": { "lastModified": 1647532380, @@ -1366,7 +1291,7 @@ "type": "github" } }, - "flake-compat_9": { + "flake-compat_8": { "flake": false, "locked": { "lastModified": 1672831974, @@ -1383,6 +1308,22 @@ "type": "github" } }, + "flake-compat_9": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -1490,11 +1431,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "owner": "numtide", "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", "type": "github" }, "original": { @@ -1504,21 +1445,6 @@ } }, "flake-utils_10": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_11": { "inputs": { "systems": "systems_4" }, @@ -1537,21 +1463,6 @@ } }, "flake-utils_2": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { "locked": { "lastModified": 1679360468, "narHash": "sha256-LGnza3cfXF10Biw3ZTg0u9o9t7s680Ww200t5KkHTh8=", @@ -1567,7 +1478,7 @@ "type": "github" } }, - "flake-utils_4": { + "flake-utils_3": { "locked": { "lastModified": 1634851050, "narHash": "sha256-N83GlSGPJJdcqhUxSCS/WwW5pksYf3VP1M13cDRTSVA=", @@ -1582,7 +1493,7 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_4": { "locked": { "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", @@ -1597,7 +1508,7 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_5": { "locked": { "lastModified": 1653893745, "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", @@ -1612,7 +1523,7 @@ "type": "github" } }, - "flake-utils_7": { + "flake-utils_6": { "locked": { "lastModified": 1659877975, "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", @@ -1627,7 +1538,7 @@ "type": "github" } }, - "flake-utils_8": { + "flake-utils_7": { "locked": { "lastModified": 1653893745, "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", @@ -1642,7 +1553,7 @@ "type": "github" } }, - "flake-utils_9": { + "flake-utils_8": { "locked": { "lastModified": 1659877975, "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", @@ -1657,6 +1568,21 @@ "type": "github" } }, + "flake-utils_9": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "ghc-8.6.5-iohk": { "flake": false, "locked": { @@ -1805,7 +1731,7 @@ }, "gomod2nix": { "inputs": { - "nixpkgs": "nixpkgs_14", + "nixpkgs": "nixpkgs_13", "utils": "utils_2" }, "locked": { @@ -1877,8 +1803,8 @@ "cabal-34": "cabal-34", "cabal-36": "cabal-36", "cardano-shell": "cardano-shell", - "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_3", + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_2", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", "hackage": "hackage", "hls-1.10": "hls-1.10", @@ -1927,7 +1853,7 @@ "cabal-34": "cabal-34_2", "cabal-36": "cabal-36_2", "cardano-shell": "cardano-shell_2", - "flake-compat": "flake-compat_6", + "flake-compat": "flake-compat_5", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_2", "ghc98X": "ghc98X", "ghc99": "ghc99", @@ -1979,7 +1905,7 @@ "cabal-34": "cabal-34_3", "cabal-36": "cabal-36_3", "cardano-shell": "cardano-shell_3", - "flake-compat": "flake-compat_9", + "flake-compat": "flake-compat_8", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_3", "ghc98X": "ghc98X_2", "ghc99": "ghc99_2", @@ -2025,7 +1951,7 @@ }, "haumea": { "inputs": { - "nixpkgs": "nixpkgs_20" + "nixpkgs": "nixpkgs_19" }, "locked": { "lastModified": 1685133229, @@ -2459,7 +2385,7 @@ "inputs-check": { "inputs": { "flake-parts": "flake-parts_4", - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1692633913, @@ -2478,7 +2404,7 @@ "iohk-nix": { "inputs": { "blst": "blst", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_6", "secp256k1": "secp256k1", "sodium": "sodium" }, @@ -2500,7 +2426,7 @@ "iohk-nix-ng": { "inputs": { "blst": "blst_2", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_7", "secp256k1": "secp256k1_2", "sodium": "sodium_2" }, @@ -2742,7 +2668,7 @@ "nix": { "inputs": { "lowdown-src": "lowdown-src", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_4", "nixpkgs-regression": "nixpkgs-regression" }, "locked": { @@ -2762,7 +2688,7 @@ }, "nix-nomad": { "inputs": { - "flake-compat": "flake-compat_7", + "flake-compat": "flake-compat_6", "flake-utils": [ "cardano-node", "cardano-automation", @@ -2800,8 +2726,8 @@ }, "nix2container": { "inputs": { - "flake-utils": "flake-utils_6", - "nixpkgs": "nixpkgs_15" + "flake-utils": "flake-utils_5", + "nixpkgs": "nixpkgs_14" }, "locked": { "lastModified": 1658567952, @@ -2819,8 +2745,8 @@ }, "nix2container_2": { "inputs": { - "flake-utils": "flake-utils_8", - "nixpkgs": "nixpkgs_19" + "flake-utils": "flake-utils_7", + "nixpkgs": "nixpkgs_18" }, "locked": { "lastModified": 1671269339, @@ -2838,9 +2764,9 @@ }, "nix_2": { "inputs": { - "flake-compat": "flake-compat_4", + "flake-compat": "flake-compat_3", "lowdown-src": "lowdown-src_2", - "nixpkgs": "nixpkgs_9", + "nixpkgs": "nixpkgs_8", "nixpkgs-regression": "nixpkgs-regression_2" }, "locked": { @@ -2861,7 +2787,7 @@ "nix_3": { "inputs": { "lowdown-src": "lowdown-src_3", - "nixpkgs": "nixpkgs_13", + "nixpkgs": "nixpkgs_12", "nixpkgs-regression": "nixpkgs-regression_3" }, "locked": { @@ -2882,7 +2808,7 @@ "nix_4": { "inputs": { "lowdown-src": "lowdown-src_4", - "nixpkgs": "nixpkgs_18", + "nixpkgs": "nixpkgs_17", "nixpkgs-regression": "nixpkgs-regression_4" }, "locked": { @@ -2972,16 +2898,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1711401922, - "narHash": "sha256-QoQqXoj8ClGo0sqD/qWKFWezgEwUL0SUh37/vY2jNhc=", + "lastModified": 1677543769, + "narHash": "sha256-LwbqS8vGisXl2WHpK9r5+kodr0zoIT8F2YB0R4y1TsA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "07262b18b97000d16a4bdb003418bd2fb067a932", + "rev": "b26d52c9feb6476580016e78935cbf96eb3e2115", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-22.11", "repo": "nixpkgs", "type": "github" } @@ -3429,22 +3355,6 @@ } }, "nixpkgs-stable": { - "locked": { - "lastModified": 1711460390, - "narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "44733514b72e732bd49f5511bd0203dea9b9a434", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-23.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable_2": { "locked": { "lastModified": 1690066826, "narHash": "sha256-6L2qb+Zc0BFkh72OS9uuX637gniOjzU6qCDBpjB2LGY=", @@ -3525,22 +3435,6 @@ } }, "nixpkgs_10": { - "locked": { - "lastModified": 1690026219, - "narHash": "sha256-oOduRk/kzQxOBknZXTLSEYd7tk+GoKvr8wV6Ab+t4AU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "f465da166263bc0d4b39dfd4ca28b777c92d4b73", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_11": { "locked": { "lastModified": 1675249806, "narHash": "sha256-u8Rcqekusl3pMZm68hZqr6zozI8Ug5IxqOiqDLAlu1k=", @@ -3556,7 +3450,7 @@ "type": "github" } }, - "nixpkgs_12": { + "nixpkgs_11": { "locked": { "lastModified": 1636823747, "narHash": "sha256-oWo1nElRAOZqEf90Yek2ixdHyjD+gqtS/pAgwaQ9UhQ=", @@ -3571,7 +3465,7 @@ "type": "github" } }, - "nixpkgs_13": { + "nixpkgs_12": { "locked": { "lastModified": 1657693803, "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", @@ -3587,7 +3481,7 @@ "type": "github" } }, - "nixpkgs_14": { + "nixpkgs_13": { "locked": { "lastModified": 1653581809, "narHash": "sha256-Uvka0V5MTGbeOfWte25+tfRL3moECDh1VwokWSZUdoY=", @@ -3603,7 +3497,7 @@ "type": "github" } }, - "nixpkgs_15": { + "nixpkgs_14": { "locked": { "lastModified": 1654807842, "narHash": "sha256-ADymZpr6LuTEBXcy6RtFHcUZdjKTBRTMYwu19WOx17E=", @@ -3618,7 +3512,7 @@ "type": "github" } }, - "nixpkgs_16": { + "nixpkgs_15": { "locked": { "lastModified": 1675940568, "narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=", @@ -3634,7 +3528,7 @@ "type": "github" } }, - "nixpkgs_17": { + "nixpkgs_16": { "locked": { "lastModified": 1642336556, "narHash": "sha256-QSPPbFEwy0T0DrIuSzAACkaANPQaR1lZR/nHZGz9z04=", @@ -3648,7 +3542,7 @@ "type": "indirect" } }, - "nixpkgs_18": { + "nixpkgs_17": { "locked": { "lastModified": 1657693803, "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", @@ -3664,7 +3558,7 @@ "type": "github" } }, - "nixpkgs_19": { + "nixpkgs_18": { "locked": { "lastModified": 1654807842, "narHash": "sha256-ADymZpr6LuTEBXcy6RtFHcUZdjKTBRTMYwu19WOx17E=", @@ -3679,23 +3573,7 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1677543769, - "narHash": "sha256-LwbqS8vGisXl2WHpK9r5+kodr0zoIT8F2YB0R4y1TsA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b26d52c9feb6476580016e78935cbf96eb3e2115", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-22.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_20": { + "nixpkgs_19": { "locked": { "lastModified": 1681001314, "narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=", @@ -3710,7 +3588,23 @@ "type": "github" } }, - "nixpkgs_21": { + "nixpkgs_2": { + "locked": { + "lastModified": 1645013224, + "narHash": "sha256-b7OEC8vwzJv3rsz9pwnTX2LQDkeOWz2DbKypkVvNHXc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b66b39216b1fef2d8c33cc7a5c72d8da80b79970", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_20": { "locked": { "lastModified": 1675940568, "narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=", @@ -3726,7 +3620,7 @@ "type": "github" } }, - "nixpkgs_22": { + "nixpkgs_21": { "locked": { "lastModified": 1677063315, "narHash": "sha256-qiB4ajTeAOVnVSAwCNEEkoybrAlA+cpeiBxLobHndE8=", @@ -3742,7 +3636,7 @@ "type": "github" } }, - "nixpkgs_23": { + "nixpkgs_22": { "locked": { "lastModified": 1714253743, "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", @@ -3759,22 +3653,6 @@ } }, "nixpkgs_3": { - "locked": { - "lastModified": 1645013224, - "narHash": "sha256-b7OEC8vwzJv3rsz9pwnTX2LQDkeOWz2DbKypkVvNHXc=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "b66b39216b1fef2d8c33cc7a5c72d8da80b79970", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { "locked": { "lastModified": 1680945546, "narHash": "sha256-8FuaH5t/aVi/pR1XxnF0qi4WwMYC+YxlfdsA0V+TEuQ=", @@ -3790,7 +3668,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { "lastModified": 1657693803, "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", @@ -3806,7 +3684,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_5": { "locked": { "lastModified": 1692339729, "narHash": "sha256-TUK76/Pqm9qIDjEGd27Lz9EiBIvn5F70JWDmEQ4Y5DQ=", @@ -3822,7 +3700,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_6": { "locked": { "lastModified": 1684171562, "narHash": "sha256-BMUWjVWAUdyMWKk0ATMC9H0Bv4qAV/TXwwPUvTiC5IQ=", @@ -3838,7 +3716,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_7": { "locked": { "lastModified": 1684171562, "narHash": "sha256-BMUWjVWAUdyMWKk0ATMC9H0Bv4qAV/TXwwPUvTiC5IQ=", @@ -3854,7 +3732,7 @@ "type": "github" } }, - "nixpkgs_9": { + "nixpkgs_8": { "locked": { "lastModified": 1670461440, "narHash": "sha256-jy1LB8HOMKGJEGXgzFRLDU1CBGL0/LlkolgnqIsF0D8=", @@ -3870,6 +3748,22 @@ "type": "github" } }, + "nixpkgs_9": { + "locked": { + "lastModified": 1690026219, + "narHash": "sha256-oOduRk/kzQxOBknZXTLSEYd7tk+GoKvr8wV6Ab+t4AU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f465da166263bc0d4b39dfd4ca28b777c92d4b73", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nosys": { "locked": { "lastModified": 1668010795, @@ -4041,7 +3935,7 @@ }, "paisano-mdbook-preprocessor": { "inputs": { - "crane": "crane_2", + "crane": "crane", "fenix": "fenix_2", "nixpkgs": [ "cardano-node", @@ -4156,8 +4050,8 @@ }, "pre-commit-hooks-nix": { "inputs": { - "flake-compat": "flake-compat_11", - "flake-utils": "flake-utils_11", + "flake-compat": "flake-compat_10", + "flake-utils": "flake-utils_10", "gitignore": "gitignore", "nixpkgs": [ "nixpkgs" @@ -4182,7 +4076,6 @@ }, "root": { "inputs": { - "attic": "attic", "cardano-configurations": "cardano-configurations", "cardano-db-sync": "cardano-db-sync", "cardano-node": "cardano-node", @@ -4191,7 +4084,7 @@ "flake-parts": "flake-parts_5", "flake-root": "flake-root", "hercules-ci-effects": "hercules-ci-effects", - "nixpkgs": "nixpkgs_23", + "nixpkgs": "nixpkgs_22", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "treefmt-nix": "treefmt-nix_3" } @@ -4399,8 +4292,8 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_10", - "nixpkgs-stable": "nixpkgs-stable_2" + "nixpkgs": "nixpkgs_9", + "nixpkgs-stable": "nixpkgs-stable" }, "locked": { "lastModified": 1690199016, @@ -4467,7 +4360,7 @@ "statix": { "inputs": { "fenix": "fenix", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1676888642, @@ -4495,7 +4388,7 @@ "blank": "blank", "devshell": "devshell", "dmerge": "dmerge", - "flake-utils": "flake-utils_7", + "flake-utils": "flake-utils_6", "incl": "incl", "makes": [ "cardano-node", @@ -4513,7 +4406,7 @@ ], "n2c": "n2c", "nixago": "nixago", - "nixpkgs": "nixpkgs_16", + "nixpkgs": "nixpkgs_15", "paisano": "paisano", "paisano-tui": "paisano-tui", "yants": "yants" @@ -4542,7 +4435,7 @@ "blank": "blank_2", "devshell": "devshell_2", "dmerge": "dmerge_2", - "flake-utils": "flake-utils_9", + "flake-utils": "flake-utils_8", "haumea": "haumea", "incl": "incl_2", "makes": [ @@ -4557,7 +4450,7 @@ ], "n2c": "n2c_2", "nixago": "nixago_2", - "nixpkgs": "nixpkgs_21", + "nixpkgs": "nixpkgs_20", "paisano": "paisano_2", "paisano-mdbook-preprocessor": "paisano-mdbook-preprocessor", "paisano-tui": "paisano-tui_2", @@ -4654,7 +4547,7 @@ }, "terraform-providers": { "inputs": { - "nixpkgs": "nixpkgs_11" + "nixpkgs": "nixpkgs_10" }, "locked": { "lastModified": 1695893013, @@ -4674,8 +4567,8 @@ "inputs": { "bats-assert": "bats-assert", "bats-support": "bats-support", - "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_12", + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_11", "terranix-examples": "terranix-examples" }, "locked": { @@ -4709,7 +4602,7 @@ }, "treefmt-nix": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1683117219, diff --git a/flake.nix b/flake.nix index 6bf3d20..60f9917 100644 --- a/flake.nix +++ b/flake.nix @@ -18,10 +18,6 @@ }; # Utilities - attic = { - url = "github:zhaofengli/attic"; - # doesn't build yet with our nixpkgs - }; devour-flake = { url = "github:srid/devour-flake"; flake = false; diff --git a/modules/cardano-db-sync.nix b/modules/cardano-db-sync.nix index a5c0ce9..94a998a 100644 --- a/modules/cardano-db-sync.nix +++ b/modules/cardano-db-sync.nix @@ -28,8 +28,10 @@ in { }; nodeSocketPath = mkOption { description = "Path to cardano-node socket."; - type = lib.types.path; - default = config.cardano.node.socketPath; + type = types.path; + default = + mkIf (config.cardano.node.enable or false) + (config.cardano.node.socketPath or null); }; database = { name = mkOption { @@ -47,8 +49,8 @@ in { default = config.services.postgresql.settings.port or 5432; description = "Postgres database port. See also option socketDir `cardano.db-sync.database.socketdir`."; }; - socketdir = lib.mkOption { - type = lib.types.str; + socketdir = mkOption { + type = str; # use first socket from postgresql settings or default to /run/postgresql default = builtins.head ((config.services.postgresql.settings.unix_socket_directories or []) ++ ["/run/postgresql"]); description = "Path to the postgresql socket."; From 9973615311081aa5b17729c67f21919566e51055 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Tue, 14 May 2024 14:43:13 +0200 Subject: [PATCH 20/24] Remove nodeSocketPath option --- modules/cardano-db-sync.nix | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/modules/cardano-db-sync.nix b/modules/cardano-db-sync.nix index 94a998a..4e756a1 100644 --- a/modules/cardano-db-sync.nix +++ b/modules/cardano-db-sync.nix @@ -26,13 +26,6 @@ in { postgres = { enable = mkEnableOption "Run postgres and connect dbsync to it." // {default = true;}; }; - nodeSocketPath = mkOption { - description = "Path to cardano-node socket."; - type = types.path; - default = - mkIf (config.cardano.node.enable or false) - (config.cardano.node.socketPath or null); - }; database = { name = mkOption { type = str; @@ -66,7 +59,7 @@ in { services.cardano-db-sync = { enable = true; environment = config.services.cardano-node.environments.${config.cardano.network}; - socketPath = cfg.nodeSocketPath; + inherit (config.cardano.node) socketPath; postgres = { inherit (cfg.database) user socketdir port; database = cfg.database.name; From 84a9654b824e72e798ab6b692d3cffac7464dd6f Mon Sep 17 00:00:00 2001 From: zmrocze Date: Tue, 14 May 2024 14:54:52 +0200 Subject: [PATCH 21/24] Remove redundant database options --- modules/cardano-db-sync.nix | 184 ++++++++++++++++-------------------- 1 file changed, 80 insertions(+), 104 deletions(-) diff --git a/modules/cardano-db-sync.nix b/modules/cardano-db-sync.nix index 4e756a1..58d4247 100644 --- a/modules/cardano-db-sync.nix +++ b/modules/cardano-db-sync.nix @@ -5,6 +5,7 @@ }: with lib; let cfg = config.cardano.db-sync; + dbsync-cfg = config.services.cardano-db-sync; in { options.cardano.db-sync = with types; { enable = mkEnableOption '' @@ -23,112 +24,87 @@ in { ``` or enable the default postgresql service with `services.cardano-db-sync.postgres.enable` and possibly overwrite the `services.postgresql` options for your need. ''; - postgres = { - enable = mkEnableOption "Run postgres and connect dbsync to it." // {default = true;}; - }; - database = { - name = mkOption { - type = str; - default = "cdbsync"; - description = "Postgres database name."; - }; - user = mkOption { - type = str; - default = "cdbsync"; - description = "Postgres database user."; - }; - port = mkOption { - type = int; - default = config.services.postgresql.settings.port or 5432; - description = "Postgres database port. See also option socketDir `cardano.db-sync.database.socketdir`."; - }; - socketdir = mkOption { - type = str; - # use first socket from postgresql settings or default to /run/postgresql - default = builtins.head ((config.services.postgresql.settings.unix_socket_directories or []) ++ ["/run/postgresql"]); - description = "Path to the postgresql socket."; - }; - }; + postgres.enable = mkEnableOption "Run postgres and connect dbsync to it." // {default = true;}; }; - config = let - inherit (cfg.postgres) database; - in - mkIf cfg.enable (mkMerge [ - { - services.cardano-db-sync = { - enable = true; - environment = config.services.cardano-node.environments.${config.cardano.network}; - inherit (config.cardano.node) socketPath; - postgres = { - inherit (cfg.database) user socketdir port; - database = cfg.database.name; - }; - stateDir = "/var/lib/${cfg.database.user}"; - }; - systemd.services.cardano-db-sync = { - serviceConfig = { - DynamicUser = true; - User = cfg.database.user; - # Security - UMask = "0077"; - CapabilityBoundingSet = ""; - ProtectClock = true; - ProtectKernelLogs = true; - ProtectDevices = true; - ProtectKernelModules = true; - SystemCallArchitectures = "native"; - MemoryDenyWriteExecute = true; - RestrictNamespaces = true; - ProtectHostname = true; - ProtectKernelTunables = true; - RestrictRealtime = true; - SystemCallFilter = ["@system-service" "~@privileged"]; - PrivateDevices = true; - RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6"; - IPAddressAllow = "localhost"; - IPAddressDeny = "any"; - ProtectHome = true; - DevicePolicy = "closed"; - DeviceAllow = ""; - ProtectProc = "invisible"; - ProcSubset = "pid"; - PrivateTmp = true; - ProtectControlGroups = true; - PrivateUsers = true; - LockPersonality = true; - }; - }; - } - (mkIf (config.cardano.node.enable or false) { - systemd.services.cardano-db-sync = { - after = ["cardano-node-socket.service"]; - requires = ["cardano-node-socket.service"]; + config = mkIf cfg.enable (mkMerge [ + { + services.cardano-db-sync = { + enable = true; + environment = config.services.cardano-node.environments.${config.cardano.network}; + inherit (config.cardano.node) socketPath; + postgres = { + user = "cdbsync"; + # use first socket from postgresql settings or default to /run/postgresql + socketdir = builtins.head ((config.services.postgresql.settings.unix_socket_directories or []) ++ ["/run/postgresql"]); + port = config.services.postgresql.settings.port or 5432; + database = "cdbsync"; }; - }) - (mkIf cfg.postgres.enable { - services.postgresql = { - enable = true; - # see warnings: this should be same as user name - ensureDatabases = [cfg.database.name]; - ensureUsers = [ - { - name = "${cfg.database.name}"; - ensureDBOwnership = true; - } - ]; - authentication = - # type database DBuser auth-method optional_ident_map - '' - local sameuser ${cfg.database.name} peer - ''; + stateDir = "/var/lib/${dbsync-cfg.postgres.user}"; + }; + systemd.services.cardano-db-sync = { + serviceConfig = { + DynamicUser = true; + User = dbsync-cfg.postgres.user; + # Security + UMask = "0077"; + CapabilityBoundingSet = ""; + ProtectClock = true; + ProtectKernelLogs = true; + ProtectDevices = true; + ProtectKernelModules = true; + SystemCallArchitectures = "native"; + MemoryDenyWriteExecute = true; + RestrictNamespaces = true; + ProtectHostname = true; + ProtectKernelTunables = true; + RestrictRealtime = true; + SystemCallFilter = ["@system-service" "~@privileged"]; + PrivateDevices = true; + RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6"; + IPAddressAllow = "localhost"; + IPAddressDeny = "any"; + ProtectHome = true; + DevicePolicy = "closed"; + DeviceAllow = ""; + ProtectProc = "invisible"; + ProcSubset = "pid"; + PrivateTmp = true; + ProtectControlGroups = true; + PrivateUsers = true; + LockPersonality = true; }; - warnings = - if (cfg.database.name == cfg.database.user) - then [ - "When postgres is enabled, we use the ensureDBOwnership option which expects the user name to match db name." - ] - else []; - }) - ]); + }; + } + (mkIf (config.cardano.node.enable or false) { + systemd.services.cardano-db-sync = { + after = ["cardano-node-socket.service"]; + requires = ["cardano-node-socket.service"]; + }; + }) + (mkIf cfg.postgres.enable { + services.postgresql = { + enable = true; + # see warnings: this should be same as user name + ensureDatabases = [dbsync-cfg.postgres.name]; + ensureUsers = [ + { + name = "${dbsync-cfg.postgres.name}"; + ensureDBOwnership = true; + } + ]; + authentication = + # type database DBuser auth-method optional_ident_map + '' + local sameuser ${dbsync-cfg.postgres.name} peer + ''; + }; + warnings = + if (dbsync-cfg.postgres.name != dbsync-cfg.postgres.user) + then [ + "When postgres is enabled, we use the ensureDBOwnership option which expects the user name to match db name." + ] + else []; + }) + ]); } From deae3f6136a68bd49146ab5b9acd5d6d6ba99e43 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Tue, 14 May 2024 16:59:36 +0200 Subject: [PATCH 22/24] Fix cardano-db-sync test after change --- modules/cardano-db-sync.nix | 8 ++++---- tests/cardano-db-sync.nix | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/cardano-db-sync.nix b/modules/cardano-db-sync.nix index 58d4247..d7c9312 100644 --- a/modules/cardano-db-sync.nix +++ b/modules/cardano-db-sync.nix @@ -86,21 +86,21 @@ in { services.postgresql = { enable = true; # see warnings: this should be same as user name - ensureDatabases = [dbsync-cfg.postgres.name]; + ensureDatabases = [dbsync-cfg.postgres.database]; ensureUsers = [ { - name = "${dbsync-cfg.postgres.name}"; + name = "${dbsync-cfg.postgres.database}"; ensureDBOwnership = true; } ]; authentication = # type database DBuser auth-method optional_ident_map '' - local sameuser ${dbsync-cfg.postgres.name} peer + local sameuser ${dbsync-cfg.postgres.database} peer ''; }; warnings = - if (dbsync-cfg.postgres.name != dbsync-cfg.postgres.user) + if (dbsync-cfg.postgres.database != dbsync-cfg.postgres.user) then [ "When postgres is enabled, we use the ensureDBOwnership option which expects the user name to match db name." ] diff --git a/tests/cardano-db-sync.nix b/tests/cardano-db-sync.nix index 191be69..26de017 100644 --- a/tests/cardano-db-sync.nix +++ b/tests/cardano-db-sync.nix @@ -20,7 +20,8 @@ testScript = {nodes, ...}: let cfg = nodes.machine; - inherit (cfg.cardano.db-sync.database) name socketdir; + inherit (cfg.services.cardano-db-sync.postgres) socketdir; + name = cfg.services.cardano-db-sync.postgres.database; # get sync percentage, return true if it's above 0.000000001 sql = "select (100 * (extract (epoch from (max (time) at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC'))) / (extract (epoch from (now () at time zone 'UTC')) - extract (epoch from (min (time) at time zone 'UTC')))) > 0.000000001 from block limit 1;"; output = " ?column? \\n----------\\n t\\n(1 row)\\n\\n"; # postgres "true" result From 6b2d074758e1ded5825dac63c361f677d94baeb1 Mon Sep 17 00:00:00 2001 From: zmrocze Date: Tue, 14 May 2024 17:52:47 +0200 Subject: [PATCH 23/24] Remove redundant postgres authentication --- modules/cardano-db-sync.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/cardano-db-sync.nix b/modules/cardano-db-sync.nix index d7c9312..912792d 100644 --- a/modules/cardano-db-sync.nix +++ b/modules/cardano-db-sync.nix @@ -93,11 +93,6 @@ in { ensureDBOwnership = true; } ]; - authentication = - # type database DBuser auth-method optional_ident_map - '' - local sameuser ${dbsync-cfg.postgres.database} peer - ''; }; warnings = if (dbsync-cfg.postgres.database != dbsync-cfg.postgres.user) From 25ea7fa2b6d6dc5cd64ad9a233dca642e8997022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Boros?= Date: Thu, 16 May 2024 20:26:58 +0000 Subject: [PATCH 24/24] review --- modules/{cardano-db-sync.nix => db-sync.nix} | 61 ++++++++++---------- modules/default.nix | 4 +- tests/{cardano-db-sync.nix => db-sync.nix} | 9 +-- tests/default.nix | 4 +- tests/{cardano-node.nix => node.nix} | 1 + 5 files changed, 38 insertions(+), 41 deletions(-) rename modules/{cardano-db-sync.nix => db-sync.nix} (64%) rename tests/{cardano-db-sync.nix => db-sync.nix} (90%) rename tests/{cardano-node.nix => node.nix} (95%) diff --git a/modules/cardano-db-sync.nix b/modules/db-sync.nix similarity index 64% rename from modules/cardano-db-sync.nix rename to modules/db-sync.nix index 912792d..103a675 100644 --- a/modules/cardano-db-sync.nix +++ b/modules/db-sync.nix @@ -2,28 +2,30 @@ config, lib, ... -}: -with lib; let +}: let cfg = config.cardano.db-sync; dbsync-cfg = config.services.cardano-db-sync; + inherit (lib) mkIf mkMerge mkEnableOption; in { - options.cardano.db-sync = with types; { - enable = mkEnableOption '' - Cardano DB Sync provides a way to query local cardano node. + options.cardano.db-sync = { + enable = + mkEnableOption '' + Cardano DB Sync provides a way to query local cardano node. - Cardano DB sync connects to a cardano node and saves blocks to a database. - You need to either provide the db connection arguments: - ```nix - services.cardano-db-sync.database = { - # these are the defaults: - name = "cdbsync"; - user = "cdbsync"; - port = 5432; - socketdir = "/run/postgresql"; - }; - ``` - or enable the default postgresql service with `services.cardano-db-sync.postgres.enable` and possibly overwrite the `services.postgresql` options for your need. - ''; + Cardano DB sync connects to a cardano node and saves blocks to a database. + You need to either provide the db connection arguments: + ```nix + services.cardano-db-sync.database = { + # these are the defaults: + name = "cardano-db-sync"; + user = "cardano-db-sync"; + port = 5432; + socketdir = "/run/postgresql"; + }; + ``` + or enable the default postgresql service with `services.cardano-db-sync.postgres.enable` and possibly overwrite the `services.postgresql` options for your need. + '' + // {default = config.cardano.enable or false;}; postgres.enable = mkEnableOption "Run postgres and connect dbsync to it." // {default = true;}; }; @@ -34,18 +36,17 @@ in { environment = config.services.cardano-node.environments.${config.cardano.network}; inherit (config.cardano.node) socketPath; postgres = { - user = "cdbsync"; + user = "cardano-db-sync"; # use first socket from postgresql settings or default to /run/postgresql socketdir = builtins.head ((config.services.postgresql.settings.unix_socket_directories or []) ++ ["/run/postgresql"]); port = config.services.postgresql.settings.port or 5432; - database = "cdbsync"; + database = "cardano-db-sync"; }; - stateDir = "/var/lib/${dbsync-cfg.postgres.user}"; + stateDir = "/var/lib/cardano-db-sync"; }; systemd.services.cardano-db-sync = { serviceConfig = { - DynamicUser = true; - User = dbsync-cfg.postgres.user; + User = "cardano-db-sync"; # Security UMask = "0077"; CapabilityBoundingSet = ""; @@ -62,8 +63,6 @@ in { SystemCallFilter = ["@system-service" "~@privileged"]; PrivateDevices = true; RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6"; - IPAddressAllow = "localhost"; - IPAddressDeny = "any"; ProtectHome = true; DevicePolicy = "closed"; DeviceAllow = ""; @@ -94,12 +93,12 @@ in { } ]; }; - warnings = - if (dbsync-cfg.postgres.database != dbsync-cfg.postgres.user) - then [ - "When postgres is enabled, we use the ensureDBOwnership option which expects the user name to match db name." - ] - else []; + assertions = [ + { + assertion = cfg.postgres.enable && dbsync-cfg.postgres.database == dbsync-cfg.postgres.user; + message = "`cardano-db-sync.postgres.database` and `user` must be equal for `services.postgresql.ensureUsers.*.ensureDBOwnership` to work."; + } + ]; }) ]); } diff --git a/modules/default.nix b/modules/default.nix index d6fec75..2c79122 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -52,10 +52,10 @@ ./http.nix ]; }; - cardano-db-sync = { + db-sync = { imports = [ inputs.cardano-db-sync.nixosModules.cardano-db-sync - ./cardano-db-sync.nix + ./db-sync.nix ]; }; # the default module imports all modules diff --git a/tests/cardano-db-sync.nix b/tests/db-sync.nix similarity index 90% rename from tests/cardano-db-sync.nix rename to tests/db-sync.nix index 26de017..3238aae 100644 --- a/tests/cardano-db-sync.nix +++ b/tests/db-sync.nix @@ -1,5 +1,5 @@ { - perSystem.vmTests.tests.cardano-db-sync = { + perSystem.vmTests.tests.db-sync = { # The test runs cardano-db-sync with postgres enabled and checks that the db syncs. # We call the db as the `postgres` user, but the service connects as the `cdbsync` user, but it is systemd dynamic user. # Test runs impure to access the "preview" network. @@ -10,10 +10,7 @@ network = "preview"; cli.enable = true; node.enable = true; - db-sync = { - enable = true; - postgres.enable = true; - }; + db-sync.enable = true; }; environment.systemPackages = with pkgs; [jq bc curl postgresql]; }; @@ -36,7 +33,7 @@ print("Can't wait forever for the dbsync to reach 0.000000001. Exiting - dbsync doesn't seem to sync.") raise Exception("Timeout") elif status == 0 and output == "${output}": - print("DbSync started syncing. Succeeds.") + print("DbSync started syncing. Success.") break i += 1 time.sleep(3) diff --git a/tests/default.nix b/tests/default.nix index b6e97c3..6161d79 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -1,10 +1,10 @@ { imports = [ ./cardano-cli.nix - ./cardano-node.nix + ./node.nix ./ogmios.nix ./kupo.nix ./http.nix - ./cardano-db-sync.nix + ./db-sync.nix ]; } diff --git a/tests/cardano-node.nix b/tests/node.nix similarity index 95% rename from tests/cardano-node.nix rename to tests/node.nix index 6a4b9a0..d220c5e 100644 --- a/tests/cardano-node.nix +++ b/tests/node.nix @@ -18,6 +18,7 @@ machine.wait_for_unit("cardano-node") machine.wait_until_succeeds("""[[ $(echo "$(cardano-cli query tip --testnet-magic ${magic} | jq '.syncProgress' --raw-output) > 0.001" | bc) == "1" ]]""") print(machine.succeed("systemd-analyze security cardano-node")) + print('\nVM Test Succeeded.') ''; }; };