diff --git a/Makefile b/Makefile index 559dd12..8779099 100644 --- a/Makefile +++ b/Makefile @@ -125,7 +125,6 @@ version: $(ised) "s/version = .*/version = ${v}/" ./harmony.ipkg $(ised) "s/appVersion = \".*\"/appVersion = \"${v}\"/" ./src/AppVersion.idr $(ised) "s/\"version\": \".*\"/\"version\": \"${v}\"/" ./package.json - $(ised) "s/version = \".*\";/version = \"${v}\";/" ./default.nix @npm update @$(node2nix) -- --composition node2nix.nix # -l # <- can't use -l for lockfile because lockfile version 3 not supported yet. @$(nix) fmt diff --git a/default.nix b/default.nix index 3bd0502..94ed3bd 100644 --- a/default.nix +++ b/default.nix @@ -2,7 +2,6 @@ callPackage, fetchFromGitHub, git, - idris2Packages, buildIdris, lib, installShellFiles, @@ -15,75 +14,61 @@ let idrisAdds = buildIdris { ipkgName = "idris-adds"; - version = idrisAddsVersion; src = fetchFromGitHub { owner = "mattpolzin"; repo = "idris-adds"; rev = idrisAddsVersion; hash = "sha256-WEr6oRZ8+50G1qv7Kv62M4DRsgAa6x1BCODC1vDOQUY="; }; - idrisLibraries = [ ]; + }; +in +buildIdris { + ipkgName = "harmony"; + src = builtins.path { + path = ./.; + name = "harmony-pkg-src"; }; - harmonyPkg = buildIdris { - version = "5.0.0"; - ipkgName = "harmony"; - src = builtins.path { - path = ./.; - name = "harmony-pkg-src"; - }; + extraIdrisLibraries = [ idrisAdds ]; - idrisLibraries = - let - ps = idris2Packages; - in - [ - idrisAdds - ps.elab-util - ps.parser - ps.parser-json - ps.json - ]; - nativeBuildInputs = [ - installShellFiles - makeBinaryWrapper - ]; - buildInputs = [ - nodejs - git - ]; + nativeBuildInputs = [ + installShellFiles + makeBinaryWrapper + ]; + buildInputs = [ + nodejs + git + ]; - IDRIS2_DATA = "./support"; + IDRIS2_DATA = "./support"; - postInstall = '' - wrapProgram $out/bin/harmony \ - --prefix PATH : ${ - lib.makeBinPath [ - nodeDependencies - git - "$out" - ] - } \ - --prefix NODE_PATH : ${nodeDependencies}/lib/node_modules - ''; + postInstall = '' + wrapProgram $out/bin/harmony \ + --prefix PATH : ${ + lib.makeBinPath [ + nodeDependencies + git + "$out" + ] + } \ + --prefix NODE_PATH : ${nodeDependencies}/lib/node_modules + ''; - postFixup = '' - installShellCompletion --cmd harmony \ - --bash <($out/bin/harmony --bash-completion-script) \ - --zsh <($out/bin/harmony --zsh-completion-script) \ - ''; + postFixup = '' + installShellCompletion --cmd harmony \ + --bash <($out/bin/harmony --bash-completion-script) \ + --zsh <($out/bin/harmony --zsh-completion-script) \ + ''; - installCheckPhase = '' - export harmony=$out/bin/harmony - INTERACTIVE="" make test - ''; + installCheckPhase = '' + export harmony=$out/bin/harmony + INTERACTIVE="" make test + ''; - meta = with lib; { - description = "Harmony GitHub collaboration tool"; - homepage = "https://github.com/mattpolzin/harmony"; - license = licenses.mit; - mainProgram = "harmony"; - }; + meta = with lib; { + description = "Harmony GitHub collaboration tool"; + homepage = "https://github.com/mattpolzin/harmony"; + license = licenses.mit; + mainProgram = "harmony"; }; -in -harmonyPkg.executable +} diff --git a/flake.lock b/flake.lock index 4691947..5c5929b 100644 --- a/flake.lock +++ b/flake.lock @@ -375,11 +375,11 @@ "idris2PackDbSrc": { "flake": false, "locked": { - "lastModified": 1725745982, - "narHash": "sha256-8YvumumQB9HwyGfEVE6dn6TiSrpqXYLFTn4FZtU0lcg=", + "lastModified": 1725832302, + "narHash": "sha256-Pc2S4rIPboBGP4K1+awQFgXjlgh2zv8SUosT5nV+KBc=", "owner": "stefan-hoeck", "repo": "idris2-pack-db", - "rev": "b8aca43629f07e22aaf87168da685051057b0aaf", + "rev": "a6c2ec780a604d1b34cebba38a14f561b9e58250", "type": "github" }, "original": { @@ -528,11 +528,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1725534445, - "narHash": "sha256-Yd0FK9SkWy+ZPuNqUgmVPXokxDgMJoGuNpMEtkfcf84=", + "lastModified": 1725816686, + "narHash": "sha256-0Kq2MkQ/sQX1rhWJ/ySBBQlBJBUK8mPMDcuDhhdBkSU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9bb1e7571aadf31ddb4af77fc64b2d59580f9a39", + "rev": "add0443ee587a0c44f22793b8c8649a0dbc3bb00", "type": "github" }, "original": { @@ -550,11 +550,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1725829794, - "narHash": "sha256-8+JrAv+h79ftJnwlkK+29FkrlgdZ9y5IJekx3KhyawQ=", + "lastModified": 1725853120, + "narHash": "sha256-py4/g7gFFjVcqIWiKGmtcH57pORD1TlXbhbjhSAw7Ac=", "owner": "mattpolzin", "repo": "nix-idris2-packages", - "rev": "3b21629d93eb9917cd1d6e11e6822f3e8404fa59", + "rev": "5ce9f4764bb20fef00520c6bc108453085b40883", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 8396005..de83dac 100644 --- a/flake.nix +++ b/flake.nix @@ -26,10 +26,10 @@ let pkgs = nixpkgs.legacyPackages.${system}; idris2Packages = packageset.idris2Packages.${system}; - inherit (packageset.packages.${system}) buildIdris; + buildIdris = packageset.packages.${system}.buildIdris'; in { - harmony = pkgs.callPackage ./default.nix { inherit buildIdris idris2Packages; }; + harmony = pkgs.callPackage ./default.nix { inherit buildIdris; }; default = self.packages.${system}.harmony; } diff --git a/version-check.sh b/version-check.sh index 6cebc52..5e12cb3 100755 --- a/version-check.sh +++ b/version-check.sh @@ -3,12 +3,11 @@ pkgversion="$(cat harmony.ipkg | sed -n 's/version = \(.*\)/\1/p')" idrversion="$(cat src/AppVersion.idr | sed -n 's/appVersion = "\(.*\)"/\1/p')" npmversion="$(cat package.json | jq -r .version)" -nixversion="$(cat default.nix | sed -n 's/.*version = "\(.*\)";/\1/p')" -if [ "$pkgversion" == "$npmversion" ] && [ "$pkgversion" == "$idrversion" ] && [ "$pkgversion" == "$nixversion" ]; then +if [ "$pkgversion" == "$npmversion" ] && [ "$pkgversion" == "$idrversion" ]; then exit 0 else - echo "Idris package manifest version (${pkgversion}), in-source version (${idrversion}), NPM package version (${npmversion}), and Nix version (${nixversion}) do not agree!" + echo "Idris package manifest version (${pkgversion}), in-source version (${idrversion}), and NPM package version (${npmversion}) do not agree!" exit 1 fi