treewide: Migrate to the new dream2nix API
This commit is contained in:
parent
5163ef9d6a
commit
40e0946201
59 changed files with 15003 additions and 24504 deletions
nix
|
@ -1,57 +0,0 @@
|
|||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
dream2nix,
|
||||
fenix,
|
||||
system,
|
||||
...
|
||||
}: let
|
||||
inherit (nixpkgs.legacyPackages.${system}) runCommandLocal yj;
|
||||
|
||||
rust-toolchain = fenix.packages.${system}.stable;
|
||||
in
|
||||
dream2nix.lib.makeFlakeOutputs {
|
||||
systems = [system];
|
||||
config.projectRoot = self;
|
||||
projects = ../projects.toml;
|
||||
|
||||
source = runCommandLocal "source" {nativeBuildInputs = [yj];} ''
|
||||
cp -r ${self} $out/
|
||||
chmod -R u+w $out
|
||||
yj < $out/templates/package.yaml > $out/templates/package.json
|
||||
'';
|
||||
|
||||
packageOverrides = {
|
||||
tlaternet-webserver.set-toolchain.overrideRustToolchain = old: {
|
||||
cargo = rust-toolchain.minimalToolchain;
|
||||
rustc = rust-toolchain.minimalToolchain;
|
||||
};
|
||||
|
||||
tlaternet-webserver-deps.set-toolchain.overrideRustToolchain = old: {
|
||||
cargo = rust-toolchain.minimalToolchain;
|
||||
rustc = rust-toolchain.minimalToolchain;
|
||||
};
|
||||
|
||||
tlaternet = {
|
||||
install-only-dist = {
|
||||
installPhase = ''
|
||||
cp -r $nodeModules/tlaternet/dist $out
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
sharp = {
|
||||
add-libvips = {
|
||||
buildInputs = old:
|
||||
old
|
||||
++ (with nixpkgs.legacyPackages.${system}; [
|
||||
vips
|
||||
pkg-config
|
||||
]);
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
// {
|
||||
inherit rust-toolchain;
|
||||
}
|
|
@ -10,7 +10,7 @@ echo 'Note: Update the flake inputs with `nix flake update --commit-lockfile *fi
|
|||
cd "$(git rev-parse --show-toplevel)" || exit
|
||||
|
||||
# Update cargo deps
|
||||
cd server || exit
|
||||
cd packages/server || exit
|
||||
cargo update
|
||||
|
||||
if ! git diff --quiet Cargo.lock Cargo.toml; then
|
||||
|
|
|
@ -1,14 +1,25 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
system,
|
||||
writeShellApplication,
|
||||
cargo,
|
||||
git,
|
||||
nix,
|
||||
npm,
|
||||
npm-check-updates,
|
||||
yq-go,
|
||||
}:
|
||||
writeShellApplication {
|
||||
name = "update";
|
||||
runtimeInputs = [cargo git nix npm npm-check-updates yq-go];
|
||||
text = builtins.readFile ./scripts/update.sh;
|
||||
}
|
||||
}: let
|
||||
selfPackages = self.packages.${system};
|
||||
inherit (selfPackages.server.config.deps) cargo;
|
||||
inherit (selfPackages.templates.config.deps) npm;
|
||||
|
||||
npm-check-updates =
|
||||
(builtins.elemAt (lib.attrValues
|
||||
selfPackages.templates.config.nodejs-granular-v3.deps.npm-check-updates)
|
||||
0)
|
||||
.package-func
|
||||
.result;
|
||||
in
|
||||
writeShellApplication {
|
||||
name = "update";
|
||||
runtimeInputs = [cargo git nix npm npm-check-updates yq-go];
|
||||
text = builtins.readFile ./scripts/update.sh;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue