diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml new file mode 100644 index 000000000..5adb475a8 --- /dev/null +++ b/.github/workflows/cachix.yml @@ -0,0 +1,50 @@ +name: Push flake to cachix + +on: + push: + branches: [main, develop] + paths: + - "**/*.nix" + - "flake.lock" + - "**/*.cabal" + +jobs: + push-to-cachix: + name: Push flake to cachix + strategy: + matrix: + os: [ubuntu-22.04, macos-12] + runs-on: ${{ matrix.os }} + steps: + - name: 📥 Checkout repository + uses: actions/checkout@v3 + + - name: ❄️ Install Nix + uses: nixbuild/nix-quick-install-action@v25 + with: + nix_conf: | + substituters = https://cache.nixos.org/ https://cache.iog.io https://nix-community.cachix.org https://miso-haskell.cachix.org https://rzk-lang.cachix.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= miso-haskell.cachix.org-1:6N2DooyFlZOHUfJtAx1Q09H0P5XXYzoxxQYiwn6W1e8= rzk-lang.cachix.org-1:hz9Ld3hYNWSM7cswW/28Dt4ABgGdK0CfBDx/MrciZW8= + keep-outputs = true + + - name: 👝 Restore and Cache Nix store + uses: nix-community/cache-nix-action@v4 + with: + key: ${{ runner.os }}-cachix-${{ hashfiles('flake*', '.github/workflows/cachix.yml', '**/*.cabal') }} + restore-keys: | + ${{ runner.os }}-cachix-${{ hashfiles('flake*', '.github/workflows/cachix.yml', '**/*.cabal') }} + ${{ runner.os }}-cachix- + ${{ runner.os }}-nix- + gc-linux: true + gc-max-store-size-linux: 13000000000 + purge: true + purge-created-max-age: 1209600 + + - name: 🔨 Push flake to cachix + env: + CACHIX_CACHE: ${{ vars.CACHIX_CACHE }} + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + run: nix run .#pushToCachix + + - name: 🔨 Save flake from garbage collection + run: nix run .#save-flake \ No newline at end of file diff --git a/.github/workflows/ghcjs.yml b/.github/workflows/ghcjs.yml index 9bdf67935..2fdbdb047 100644 --- a/.github/workflows/ghcjs.yml +++ b/.github/workflows/ghcjs.yml @@ -6,20 +6,16 @@ on: tags: [v*] paths: - .github/workflows/ghcjs.yml - - rzk/** - - rzk-js/** - - rzk-playground/** - - stack.yaml + - rzk*/** - "**/*.nix" + - "**/*.lock" pull_request: branches: [develop] paths: - .github/workflows/ghcjs.yml - - rzk/** - - rzk-js/** - - rzk-playground/** - - stack.yaml + - rzk*/** - "**/*.nix" + - "**/*.lock" workflow_dispatch: # allow triggering this workflow manually @@ -38,50 +34,43 @@ jobs: uses: nixbuild/nix-quick-install-action@v25 with: nix_conf: | - substituters = https://cache.nixos.org/ https://cache.iog.io https://nix-community.cachix.org https://miso-haskell.cachix.org - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= miso-haskell.cachix.org-1:6N2DooyFlZOHUfJtAx1Q09H0P5XXYzoxxQYiwn6W1e8= + substituters = https://cache.nixos.org/ https://cache.iog.io https://nix-community.cachix.org https://miso-haskell.cachix.org https://rzk-lang.cachix.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= miso-haskell.cachix.org-1:6N2DooyFlZOHUfJtAx1Q09H0P5XXYzoxxQYiwn6W1e8= rzk-lang.cachix.org-1:hz9Ld3hYNWSM7cswW/28Dt4ABgGdK0CfBDx/MrciZW8= keep-outputs = true - name: 👝 Restore and Cache Nix store uses: nix-community/cache-nix-action@v4 with: - key: ${{ runner.os }}-nix-${{ hashfiles('./flake.nix', './flake.lock', '.github/workflows/ghcjs.yml', './rzk/rzk.cabal') }} + key: ${{ runner.os }}-playground-ghcjs-${{ hashfiles('flake*', '**/*.nix', '.github/workflows/ghcjs.yml', '**/*.cabal') }} restore-keys: | - ${{ runner.os }}-nix-${{ hashfiles('./flake.nix', './flake.lock', '.github/workflows/ghcjs.yml', './rzk/rzk.cabal') }} + ${{ runner.os }}-playground-ghcjs- ${{ runner.os }}-nix- gc-linux: true - gc-max-store-size-linux: 7000000000 + gc-max-store-size-linux: 12000000000 purge: true purge-created-max-age: 1209600 - - name: 👝 Restore and Cache NextJS cache + - name: 👝 Restore and Cache NodeJS dependencies uses: actions/cache@v3 with: - key: ${{ runner.os }}-next-${{ hashFiles('**/package-lock.json') }} + key: ${{ runner.os }}-playground-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | + ${{ runner.os }}-playground-node- ${{ runner.os }}-next- path: | ~/.npm - rzk-playground/.next/cache - name: 🔨 Remove lexer and parser generator files run: | rm -f rzk/src/Language/Rzk/Syntax/Lex.x rm -f rzk/src/Language/Rzk/Syntax/Par.y - # Uncomment to debug this job - # - name: Setup tmate session - # uses: mxschmitt/action-tmate@v3 - - name: 🔨 Build Playground env: ASSET_URL: /${{ github.event.repository.name }}/${{ github.ref_name }}/playground run: | nix run .#release-rzk-playground - - name: 🔨 Save flake from garbage collection - run: nix run .#save-flake - - name: '🚀 Publish JS "binaries" (${{ github.ref_name }})' if: ${{ github.ref_name != 'main' && github.event_name == 'push' }} uses: JamesIves/github-pages-deploy-action@v4 @@ -101,3 +90,6 @@ jobs: target-folder: playground clean: false single-commit: true + + - name: 🔨 Save flake from garbage collection + run: nix run .#save-flake diff --git a/flake.lock b/flake.lock index 8f9e48b36..95fbb5ee8 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,23 @@ { "nodes": { "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696267196, + "narHash": "sha256-AAQ/2sD+0D18bb8hKuEEVpHUYD1GmO2Uh/taFamn6XQ=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "4f910c9827911b1ec2bf26b5a062cd09f8d89f85", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "rev": "4f910c9827911b1ec2bf26b5a062cd09f8d89f85", + "type": "github" + } + }, + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1673956053, @@ -34,22 +51,227 @@ "type": "github" } }, - "jsaddle": { + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flakes": { + "locked": { + "lastModified": 1696364002, + "narHash": "sha256-7/it2KnhD5GAwsiPRJNyzvYWiD1c6Tf8CuwaP6FHaa0=", + "owner": "deemp", + "repo": "flakes", + "rev": "5ebf3c3704248e825dc4ec04fa751b1b83fe4050", + "type": "github" + }, + "original": { + "owner": "deemp", + "repo": "flakes", + "type": "github" + } + }, + "flakes-tools": { + "inputs": { + "flakes": "flakes" + }, + "locked": { + "dir": "flakes-tools", + "lastModified": 1696364169, + "narHash": "sha256-UInZAkAY+T/YYj2AinLixf0CbbNorBeRsHadWSBg0yc=", + "owner": "deemp", + "repo": "flakes", + "rev": "93dacca29b38865b76ef5e8c4c5c81df426cf5e8", + "type": "github" + }, + "original": { + "dir": "flakes-tools", + "owner": "deemp", + "repo": "flakes", + "rev": "93dacca29b38865b76ef5e8c4c5c81df426cf5e8", + "type": "github" + } + }, + "fourmolu-011": { + "flake": false, + "locked": { + "narHash": "sha256-g/yDZXeLCHq/iXoZTaTYSb8l9CMny3AKsRQgWElagZI=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/fourmolu-0.11.0.0/fourmolu-0.11.0.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/fourmolu-0.11.0.0/fourmolu-0.11.0.0.tar.gz" + } + }, + "fourmolu-014": { + "flake": false, + "locked": { + "narHash": "sha256-s4ucw2kSwna2SpWB2jxsRRa/cnyqHSYEFoPBdKTpDq4=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/fourmolu-0.14.0.0/fourmolu-0.14.0.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/fourmolu-0.14.0.0/fourmolu-0.14.0.0.tar.gz" + } + }, + "gitignore": { + "flake": false, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "haskell-hie-bios": { "flake": false, "locked": { - "lastModified": 1694167118, - "narHash": "sha256-QNWimHH7c0xYe8sVmS2U3CgCR2q2fz2G35XTUywSrk8=", - "owner": "ghcjs", - "repo": "jsaddle", - "rev": "ffcda85943fd4b91a715643b921a10df9aba44e1", + "lastModified": 1686930638, + "narHash": "sha256-gfcxxHtZ2jUsiKNn/O4jEkfWF/2H04aTnaIvPDbtNlQ=", + "owner": "haskell", + "repo": "hie-bios", + "rev": "3d4fadfb0dc44cb287db9897ecfb503899d33513", "type": "github" }, "original": { - "owner": "ghcjs", - "repo": "jsaddle", + "owner": "haskell", + "repo": "hie-bios", "type": "github" } }, + "haskell-implicit-hie-cradle": { + "flake": false, + "locked": { + "lastModified": 1686495518, + "narHash": "sha256-OAe+zOkMZuoTfVEMnxnCT1cmPgRF/riAR8nVdomnwxo=", + "owner": "smunix", + "repo": "implicit-hie-cradle", + "rev": "d6aa00355898469af56cfd5e62f7fc8bd9959ded", + "type": "github" + }, + "original": { + "owner": "smunix", + "ref": "smunix-patch-hls-0.5-1", + "repo": "implicit-hie-cradle", + "type": "github" + } + }, + "haskell-language-server": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_2", + "fourmolu-011": "fourmolu-011", + "fourmolu-014": "fourmolu-014", + "gitignore": "gitignore", + "haskell-hie-bios": "haskell-hie-bios", + "haskell-implicit-hie-cradle": "haskell-implicit-hie-cradle", + "hlint-35": "hlint-35", + "hlint-36": "hlint-36", + "lsp": "lsp", + "lsp-test": "lsp-test", + "lsp-types": "lsp-types", + "nixpkgs": "nixpkgs", + "ormolu-052": "ormolu-052", + "ormolu-07": "ormolu-07", + "stylish-haskell-0145": "stylish-haskell-0145" + }, + "locked": { + "lastModified": 1696344359, + "narHash": "sha256-gj1B5Ha0IActnjRBIQtGWIXieSxHBgazhBjWe8uaHWI=", + "owner": "deemp", + "repo": "haskell-language-server", + "rev": "74604905f33e0c62b08fe3d533293a54cc883913", + "type": "github" + }, + "original": { + "owner": "deemp", + "repo": "haskell-language-server", + "rev": "74604905f33e0c62b08fe3d533293a54cc883913", + "type": "github" + } + }, + "hlint-35": { + "flake": false, + "locked": { + "narHash": "sha256-qQNUlQQnahUGEO92Lm0RwjTGBGr2Yaw0KRuFRMoc5No=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/hlint-3.5/hlint-3.5.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/hlint-3.5/hlint-3.5.tar.gz" + } + }, + "hlint-36": { + "flake": false, + "locked": { + "narHash": "sha256-fH4RYnWeuBqJI5d3Ba+Xs0BxYr0IYFH1OWO3k2iHGlU=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/hlint-3.6.1/hlint-3.6.1.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/hlint-3.6.1/hlint-3.6.1.tar.gz" + } + }, + "lsp": { + "flake": false, + "locked": { + "narHash": "sha256-HcEfdYUrCHufEa+10M2wESjnK41xM/msd+t6r6JwQO0=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/lsp-2.2.0.0/lsp-2.2.0.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/lsp-2.2.0.0/lsp-2.2.0.0.tar.gz" + } + }, + "lsp-test": { + "flake": false, + "locked": { + "narHash": "sha256-E1D3X2+I9ZTZLpHDEDTXexQFYpyG5byOFRIvRTeBsn8=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/lsp-test-0.16.0.0/lsp-test-0.16.0.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/lsp-test-0.16.0.0/lsp-test-0.16.0.0.tar.gz" + } + }, + "lsp-types": { + "flake": false, + "locked": { + "narHash": "sha256-Oa5HuKdsdTSQUKtuSt06zVAq19Qxq5IJZObrnPwlB6s=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/lsp-types-2.0.2.0/lsp-types-2.0.2.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/lsp-types-2.0.2.0/lsp-types-2.0.2.0.tar.gz" + } + }, "miso": { "flake": false, "locked": { @@ -83,6 +305,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1686874404, + "narHash": "sha256-u2Ss8z+sGaVlKtq7sCovQ8WvXY+OoXJmY1zmyxITiaY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "efc10371d5c5b8d2d58bab6c1100753efacfe550", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "haskell-updates", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1694934517, "narHash": "sha256-U9aI4/jw+kYTZye4LJC2eIU30SqvZgL/UeRY4VHIjK8=", @@ -98,14 +336,51 @@ "type": "github" } }, + "ormolu-052": { + "flake": false, + "locked": { + "narHash": "sha256-H7eqId488RBRxcf7flgJefAZmRgFJASJva+Oy7GG4q4=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/ormolu-0.5.2.0/ormolu-0.5.2.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/ormolu-0.5.2.0/ormolu-0.5.2.0.tar.gz" + } + }, + "ormolu-07": { + "flake": false, + "locked": { + "narHash": "sha256-5M5gNzSvsiQH1+0oexRByzf5EIET+0BFwR4fLIr2P7g=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/ormolu-0.7.1.0/ormolu-0.7.1.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/ormolu-0.7.1.0/ormolu-0.7.1.0.tar.gz" + } + }, "root": { "inputs": { "flake-compat": "flake-compat", "flake-utils": "flake-utils", - "jsaddle": "jsaddle", + "flakes-tools": "flakes-tools", + "haskell-language-server": "haskell-language-server", "miso": "miso", "nix-filter": "nix-filter", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" + } + }, + "stylish-haskell-0145": { + "flake": false, + "locked": { + "narHash": "sha256-EE7RFQ6q4Ek8daRgOpNMGepYLa9o8cM4OLjTNUSHQf0=", + "type": "tarball", + "url": "https://hackage.haskell.org/package/stylish-haskell-0.14.5.0/stylish-haskell-0.14.5.0.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://hackage.haskell.org/package/stylish-haskell-0.14.5.0/stylish-haskell-0.14.5.0.tar.gz" } }, "systems": { @@ -122,6 +397,21 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 595a589e8..32da8f991 100644 --- a/flake.nix +++ b/flake.nix @@ -7,18 +7,18 @@ flake = false; }; flake-compat = { - url = "github:edolstra/flake-compat"; + url = "github:edolstra/flake-compat/4f910c9827911b1ec2bf26b5a062cd09f8d89f85"; flake = false; }; nix-filter.url = "github:numtide/nix-filter"; - jsaddle = { - url = "github:ghcjs/jsaddle"; - flake = false; - }; + haskell-language-server.url = "github:deemp/haskell-language-server/74604905f33e0c62b08fe3d533293a54cc883913"; + flakes-tools.url = "github:deemp/flakes/93dacca29b38865b76ef5e8c4c5c81df426cf5e8?dir=flakes-tools"; }; outputs = inputs: inputs.flake-utils.lib.eachDefaultSystem (system: let pkgs = inputs.nixpkgs.legacyPackages.${system}; + hlsPkgs = inputs.haskell-language-server.packages.${system}; + inherit (inputs.flakes-tools.lib.${system}) mkFlakesTools; rzk = "rzk"; rzk-js = "rzk-js"; @@ -32,16 +32,30 @@ include = [ "Main.hs" "${rzk-js}.cabal" ]; }); + hpackHpkgs = pkgs.haskell.packages.${ghcVersion}.override { + overrides = final: prev: { + hpack = final.callHackageDirect + { + pkg = "hpack"; + ver = "0.36.0"; + sha256 = "sha256-a8jKkzO3CWIoBg+Uaw5TtpDwmeajWCTW1zJNrlpBKPU="; + } + { }; + http-client-tls = prev.http-client-tls_0_3_6_3; + tls = prev.tls_1_7_1; + crypton-connection = pkgs.haskell.lib.unmarkBroken prev.crypton-connection; + }; + }; + tools = [ pkgs.cabal-install - pkgs.hpack pkgs.nodejs_18 pkgs.bun ]; - default = import ./nix/default.nix { inherit inputs pkgs rzk rzk-src ghcVersion tools; }; - ghcjs = import ./nix/ghcjs.nix { inherit inputs pkgs scripts rzk rzk-src rzk-js rzk-js-src ghcVersion tools; }; - scripts = import ./nix/scripts.nix { inherit pkgs packages; }; + default = import ./nix/default.nix { inherit inputs pkgs rzk rzk-src ghcVersion tools hlsPkgs hpackHpkgs; }; + ghcjs = import ./nix/ghcjs.nix { inherit inputs pkgs scripts rzk rzk-src rzk-js rzk-js-src ghcVersion tools hpackHpkgs; }; + scripts = import ./nix/scripts.nix { inherit pkgs packages mkFlakesTools; }; packages = { diff --git a/nix/default.nix b/nix/default.nix index 3d0ef9001..81b03b7e8 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -1,10 +1,26 @@ -{ inputs, pkgs, ghcVersion, rzk, rzk-src, tools }: +{ inputs, pkgs, ghcVersion, rzk, rzk-src, tools, hlsPkgs, hpackHpkgs }: let inherit (pkgs.haskell.lib) overrideCabal; # https://nixos.wiki/wiki/Haskell#Overrides - hpkgs = pkgs.haskell.packages.${ghcVersion}.override { + hls = hlsPkgs.haskell-language-server-96; + hpkgs = hpackHpkgs.override { overrides = final: prev: { - ${rzk} = final.callCabal2nix rzk rzk-src { }; + lsp = final.callHackageDirect + { + pkg = "lsp"; + ver = "2.2.0.0"; + sha256 = "sha256-HcEfdYUrCHufEa+10M2wESjnK41xM/msd+t6r6JwQO0="; + } + { }; + lsp-types = final.callHackageDirect + { + pkg = "lsp-types"; + ver = "2.0.2.0"; + sha256 = "sha256-Oa5HuKdsdTSQUKtuSt06zVAq19Qxq5IJZObrnPwlB6s="; + } + { }; + + ${rzk} = final.callCabal2nix rzk rzk-src { inherit (hpackHpkgs) hpack; }; }; }; @@ -13,7 +29,7 @@ let hpkgs.shellFor { shellHook = "export LANG=C.utf8"; packages = ps: [ ps.rzk ]; - nativeBuildInputs = tools ++ [ hpkgs.haskell-language-server ]; + nativeBuildInputs = tools ++ [ hls ]; }; }; diff --git a/nix/ghcjs.nix b/nix/ghcjs.nix index f243e9511..a4253015b 100644 --- a/nix/ghcjs.nix +++ b/nix/ghcjs.nix @@ -1,9 +1,9 @@ -{ inputs, pkgs, scripts, rzk, rzk-js, rzk-src, rzk-js-src, ghcVersion, tools }: +{ inputs, pkgs, scripts, rzk, rzk-js, rzk-src, rzk-js-src, ghcVersion, tools, hpackHpkgs }: let inherit (pkgs.haskell.lib) overrideCabal; misoNix = (import "${inputs.miso.outPath}/default.nix" { inherit (pkgs) system; }); pkgsMiso = misoNix.pkgs; - + inherit (hpackHpkgs) hpack; hpkgs = # This isn't equivalent to `pkgsMiso.haskell.packages.ghcjs.override` ([link](https://nixos.wiki/wiki/Haskell#Overrides)) # but avoids multiple rebuilds @@ -16,9 +16,8 @@ let isExecutable = false; doCheck = false; doHaddock = false; - libraryToolDepends = [ pkgs.hpack pkgs.alex pkgs.happy ] ++ (x.libraryToolDepends or [ ]); - testToolDepends = [ pkgs.hpack pkgs.alex pkgs.happy ] ++ (x.testToolDepends or [ ]); - prePatch = "hpack --force"; + libraryToolDepends = [ hpack pkgs.alex pkgs.happy ] ++ (x.libraryToolDepends or [ ]); + testToolDepends = [ hpack pkgs.alex pkgs.happy ] ++ (x.testToolDepends or [ ]); }); rzk-js = overrideCabal (hpkgs.callCabal2nix rzk-js rzk-js-src { inherit (hpkgs) rzk; }) @@ -41,9 +40,8 @@ let isExecutable = false; doCheck = false; doHaddock = false; - libraryToolDepends = [ pkgs.hpack pkgs.alex pkgs.happy ] ++ (x.libraryToolDepends or [ ]); - testToolDepends = [ pkgs.hpack pkgs.alex pkgs.happy ] ++ (x.testToolDepends or [ ]); - prePatch = "hpack --force"; + libraryToolDepends = [ hpack pkgs.alex pkgs.happy ] ++ (x.libraryToolDepends or [ ]); + testToolDepends = [ hpack pkgs.alex pkgs.happy ] ++ (x.testToolDepends or [ ]); }); rzk-js = overrideCabal (final.callCabal2nix rzk-js rzk-js-src { inherit (final) rzk; }) diff --git a/nix/js-backend.nix b/nix/js-backend.nix index 976d3d128..91fe07f3b 100644 --- a/nix/js-backend.nix +++ b/nix/js-backend.nix @@ -5,7 +5,6 @@ let inherit (pkgs.haskell.lib) overrideCabal; overrideJS = { overrides = self: super: { - jsaddle = super.callCabal2nix "jsaddle" "${inputs.jsaddle.outPath}/jsaddle" { }; rzk = overrideCabal (super.callCabal2nix rzk rzk-src { }) (x: { diff --git a/nix/scripts.nix b/nix/scripts.nix index a4248f020..ab2c5beb1 100644 --- a/nix/scripts.nix +++ b/nix/scripts.nix @@ -1,4 +1,4 @@ -{ pkgs, packages }: +{ pkgs, packages, mkFlakesTools }: let scripts = { build-rzk-js = pkgs.writeShellApplication { @@ -73,5 +73,7 @@ let scripts = printf "Wrote release files to '${release}'\n" ''; }; + + inherit (mkFlakesTools { root = ../.; dirs = [ "." ]; }) pushToCachix; }; in scripts