Skip to content

Commit

Permalink
Merge pull request #148 from mattpolzin/convert-to-draft
Browse files Browse the repository at this point in the history
version bump
  • Loading branch information
mattpolzin authored Mar 7, 2025
2 parents c30b971 + 6ba0056 commit 0fabe66
Show file tree
Hide file tree
Showing 11 changed files with 582 additions and 1,740 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ jobs:
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build
run: nix build --accept-flake-config
run: |
nix build \
--accept-flake-config \
--trusted-public-keys 'gh-nix-idris2-packages.cachix.org-1:iOqSB5DrESFT+3A1iNzErgB68IDG8BrHLbLkhztOXfo= gh-harmony.cachix.org-1:KX5tTtEt3Y6an8pywe3Cy6jR9bUo+1Cl7hJmh+5eI4I= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY='
- name: Check
run: nix flake check -L --accept-flake-config

3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,11 @@ build: ./node_modules/ depends/idris-adds-${idris-adds-version} depends/json-${i
harmony: build

nix ?= nix
node2nix ?= $(nix) run nixpkgs\#node2nix

# This executes a Nix build. Call as `make nix-build` from CLI, not
# from a Nix file.
nix-build:
${MAKE} clean
$(node2nix) -- --composition node2nix.nix # -l # <- can't use -l for lockfile because lockfile version 3 not supported yet.
$(nix) build .

version:
Expand All @@ -130,7 +128,6 @@ version:
$(ised) "s/appVersion = \".*\"/appVersion = \"${v}\"/" ./src/AppVersion.idr
$(ised) "s/\"version\": \".*\"/\"version\": \"${v}\"/" ./package.json
@npm update
@$(node2nix) -- --composition node2nix.nix # -l # <- can't use -l for lockfile because lockfile version 3 not supported yet.
@$(nix) fmt

package: build
Expand Down
20 changes: 16 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
callPackage,
fetchFromGitHub,
git,
buildIdris,
lib,
installShellFiles,
makeBinaryWrapper,
nodejs,
buildNpmPackage,
}:
let
nodeDependencies = (callPackage ./node2nix.nix { inherit nodejs; }).nodeDependencies;
idrisAddsVersion = "0.4.1";

idrisAdds = buildIdris {
Expand All @@ -21,6 +20,20 @@ let
hash = "sha256-WEr6oRZ8+50G1qv7Kv62M4DRsgAa6x1BCODC1vDOQUY=";
};
};

nodeDependencies = buildNpmPackage {
name = "harmony-npm-deps";
src = ./.;
npmDepsHash = "sha256-GRnI5EBmGnkXIsY3SK9Ma0uVias03GvqpMqdZOqfqqQ=";
dontNpmBuild = true;
dontBuild = true;

postInstall = ''
rm -rf $out/bin
mv $out/lib/node_modules/@mattpolzin/harmony/node_modules $out/node_modules
rm -rf $out/lib
'';
};
in
buildIdris {
ipkgName = "harmony";
Expand All @@ -46,12 +59,11 @@ buildIdris {
wrapProgram $out/bin/harmony \
--prefix PATH : ${
lib.makeBinPath [
nodeDependencies
git
"$out"
]
} \
--prefix NODE_PATH : ${nodeDependencies}/lib/node_modules
--prefix NODE_PATH : ${nodeDependencies}/node_modules
'';

postFixup = ''
Expand Down
Loading

0 comments on commit 0fabe66

Please sign in to comment.