update: simpler update mechanism

also fix a bad dependency
This commit is contained in:
Jeremy Wall 2024-08-30 10:32:03 -04:00
parent 3e4b80a546
commit 58001efeb2
7 changed files with 33 additions and 66 deletions

View File

@ -1,10 +1,11 @@
%-darwin: %-darwin:
darwin-rebuild --flake ./nix/base-system $* darwin-rebuild --flake ./nix/base-system $*
update-quint-%: update-quint:
curl curl https://raw.githubusercontent.com/informalsystems/quint/$*/quint/package.json > nix/packages/quint/package.json #curl -L https://raw.githubusercontent.com/informalsystems/quint/$*/quint/package.json > nix/packages/quint/package.json
cd nix/packages/quint; nix run "nixpkgs#node2nix" -- -18 #curl -L https://raw.githubusercontent.com/informalsystems/quint/$*/quint/package-lock.json > nix/packages/quint/package-lock.json
cd nix/packages/quint; nix run "nixpkgs#node2nix" -- -18 -i node-packages.json
#pactch the default.nix #pactch the default.nix
sed -e 's#inherit nodeEnv;#inherit nodeEnv quint-src;#' -e 's/, system/, quint-src, system/' -i '' nix/packages/quint/default.nix #sed -e 's#inherit nodeEnv;#inherit nodeEnv quint-src;#' -e 's/, system/, quint-src, system/' -i '' nix/packages/quint/default.nix
sed -e 's#src = \./\.#src = "$${quint-src}/quint"#' -e 's#nodeEnv, #quint-src, nodeEnv, #' -i '' nix/packages/quint/node-packages.nix #sed -e 's#src = \./\.#src = "$${quint-src}/quint"#' -e 's#nodeEnv, #quint-src, nodeEnv, #' -i '' nix/packages/quint/node-packages.nix
rm -f nix/packages/quint/package.json #rm -f nix/packages/quint/package*.json

View File

@ -803,23 +803,6 @@
"type": "github" "type": "github"
} }
}, },
"quint-src": {
"flake": false,
"locked": {
"lastModified": 1722257041,
"narHash": "sha256-VjAvaFO/OdqIYPqTNbbBZl7ah1GPGMVQJltZYkJx5IY=",
"owner": "informalsystems",
"repo": "quint",
"rev": "ba49e6820a0302ba788bce738587b1deb3a899d9",
"type": "github"
},
"original": {
"owner": "informalsystems",
"ref": "v0.21.1",
"repo": "quint",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"agenix-flake": "agenix-flake", "agenix-flake": "agenix-flake",
@ -835,7 +818,6 @@
"nixpkgs": "nixpkgs_8", "nixpkgs": "nixpkgs_8",
"nixpkgs-darwin": "nixpkgs-darwin", "nixpkgs-darwin": "nixpkgs-darwin",
"nurl-flake": "nurl-flake", "nurl-flake": "nurl-flake",
"quint-src": "quint-src",
"roslyn-lsp": "roslyn-lsp", "roslyn-lsp": "roslyn-lsp",
"runwhen-flake": "runwhen-flake", "runwhen-flake": "runwhen-flake",
"rust-overlay-flake": "rust-overlay-flake", "rust-overlay-flake": "rust-overlay-flake",

View File

@ -58,10 +58,6 @@
flake = false; flake = false;
}; };
heracles-flake.url = "github:zaphar/Heracles"; heracles-flake.url = "github:zaphar/Heracles";
quint-src = {
url = "github:informalsystems/quint/v0.21.1";
flake = false;
};
}; };
outputs = { outputs = {
@ -83,7 +79,6 @@
heracles-flake, heracles-flake,
neovim-flake, neovim-flake,
clio-flake, clio-flake,
quint-src,
... # We don't use the self or nixpkgs args here so we just glob it. ... # We don't use the self or nixpkgs args here so we just glob it.
}: }:
rec { rec {
@ -263,7 +258,7 @@ EOF";
gnumeric = prev.gnumeric.overrideAttrs(oldAttrs: { gnumeric = prev.gnumeric.overrideAttrs(oldAttrs: {
meta.broken = false; meta.broken = false;
}); });
quint = (pkgs.callPackage ../packages/quint/default.nix { inherit quint-src; }).package; quint = (pkgs.callPackage ../packages/quint/default.nix {})."@informalsystems/quint";
}) })
rust-overlay rust-overlay
]; ];

View File

@ -2,7 +2,7 @@
{pkgs ? import <nixpkgs> { {pkgs ? import <nixpkgs> {
inherit system; inherit system;
}, quint-src, system ? builtins.currentSystem, nodejs ? pkgs."nodejs_18"}: }, system ? builtins.currentSystem, nodejs ? pkgs."nodejs_18"}:
let let
nodeEnv = import ./node-env.nix { nodeEnv = import ./node-env.nix {
@ -13,5 +13,5 @@ let
in in
import ./node-packages.nix { import ./node-packages.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit; inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv quint-src; inherit nodeEnv;
} }

View File

@ -109,7 +109,7 @@ let
); );
# Recursively composes the dependencies of a package # Recursively composes the dependencies of a package
composePackage = { name, packageName, src, dependencies ? [], ... }: composePackage = { name, packageName, src, dependencies ? [], ... }@args:
builtins.addErrorContext "while evaluating node package '${packageName}'" '' builtins.addErrorContext "while evaluating node package '${packageName}'" ''
installPackage "${packageName}" "${src}" installPackage "${packageName}" "${src}"
${includeDependencies { inherit dependencies; }} ${includeDependencies { inherit dependencies; }}
@ -194,7 +194,7 @@ let
# dependencies in the package.json file to the versions that are actually # dependencies in the package.json file to the versions that are actually
# being used. # being used.
pinpointDependenciesOfPackage = { packageName, dependencies ? [], production ? true, ... }: pinpointDependenciesOfPackage = { packageName, dependencies ? [], production ? true, ... }@args:
'' ''
if [ -d "${packageName}" ] if [ -d "${packageName}" ]
then then

View File

@ -0,0 +1,3 @@
[
"@informalsystems/quint"
]

View File

@ -1,6 +1,6 @@
# This file has been generated by node2nix 1.11.1. Do not edit! # This file has been generated by node2nix 1.11.1. Do not edit!
{quint-src, nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}: {nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:
let let
sources = { sources = {
@ -256,13 +256,13 @@ let
sha512 = "zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="; sha512 = "zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==";
}; };
}; };
"antlr4ts-0.5.0-dev" = { "antlr4ts-0.5.0-alpha.4" = {
name = "antlr4ts"; name = "antlr4ts";
packageName = "antlr4ts"; packageName = "antlr4ts";
version = "0.5.0-dev"; version = "antlr4ts-0.5.0-alpha.4";
src = fetchurl { src = fetchurl {
url = "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-dev.tgz"; url = "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz";
sha512 = "FXZRGC53ZejWLOMzxJ6IpgmGYNzBYeaoN5FBQe2Y6+iEA+JFNZz+J67TF84ajksmzVX8BUi+Ytx7oih+BWtA8A=="; sha512 = "sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==";
}; };
}; };
"bignumber.js-9.1.2" = { "bignumber.js-9.1.2" = {
@ -355,13 +355,13 @@ let
sha512 = "Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg=="; sha512 = "Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==";
}; };
}; };
"escalade-3.1.2" = { "escalade-3.2.0" = {
name = "escalade"; name = "escalade";
packageName = "escalade"; packageName = "escalade";
version = "3.1.2"; version = "3.2.0";
src = fetchurl { src = fetchurl {
url = "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz"; url = "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz";
sha512 = "ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA=="; sha512 = "WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==";
}; };
}; };
"fs-minipass-2.1.0" = { "fs-minipass-2.1.0" = {
@ -689,11 +689,16 @@ let
}; };
}; };
}; };
args = { in
{
"@informalsystems/quint" = nodeEnv.buildNodePackage {
name = "_at_informalsystems_slash_quint"; name = "_at_informalsystems_slash_quint";
packageName = "@informalsystems/quint"; packageName = "@informalsystems/quint";
version = "0.21.1"; version = "0.21.1";
src = "${quint-src}/quint"; src = fetchurl {
url = "https://registry.npmjs.org/@informalsystems/quint/-/quint-0.21.1.tgz";
sha512 = "kqXHC4a+6N1L0UDFzHknryLmOGwEuLk5pQyiirAKyCvkSHGn6QmnZTdn0jJI2bUppA0BS1lANTLrC2UQOGdKQg==";
};
dependencies = [ dependencies = [
sources."@grpc/grpc-js-1.11.1" sources."@grpc/grpc-js-1.11.1"
sources."@grpc/proto-loader-0.7.13" sources."@grpc/proto-loader-0.7.13"
@ -723,7 +728,7 @@ let
sources."@types/seedrandom-3.0.8" sources."@types/seedrandom-3.0.8"
sources."ansi-regex-5.0.1" sources."ansi-regex-5.0.1"
sources."ansi-styles-4.3.0" sources."ansi-styles-4.3.0"
sources."antlr4ts-0.5.0-dev" sources."antlr4ts-0.5.0-alpha.4"
sources."bignumber.js-9.1.2" sources."bignumber.js-9.1.2"
sources."buffer-from-1.1.2" sources."buffer-from-1.1.2"
sources."chalk-4.1.2" sources."chalk-4.1.2"
@ -734,7 +739,7 @@ let
sources."deprecation-2.3.1" sources."deprecation-2.3.1"
sources."emoji-regex-8.0.0" sources."emoji-regex-8.0.0"
sources."eol-0.9.1" sources."eol-0.9.1"
sources."escalade-3.1.2" sources."escalade-3.2.0"
(sources."fs-minipass-2.1.0" // { (sources."fs-minipass-2.1.0" // {
dependencies = [ dependencies = [
sources."minipass-3.3.6" sources."minipass-3.3.6"
@ -789,23 +794,4 @@ let
bypassCache = true; bypassCache = true;
reconstructLock = true; reconstructLock = true;
}; };
in
{
args = args;
sources = sources;
tarball = nodeEnv.buildNodeSourceDist args;
package = nodeEnv.buildNodePackage args;
shell = nodeEnv.buildNodeShell args;
nodeDependencies = nodeEnv.buildNodeDependencies (lib.overrideExisting args {
src = stdenv.mkDerivation {
name = args.name + "-package-json";
src = nix-gitignore.gitignoreSourcePure [
"*"
"!package.json"
"!package-lock.json"
] args.src;
dontBuild = true;
installPhase = "mkdir -p $out; cp -r ./* $out;";
};
});
} }