chore(web): Build website using importNpmLock from nixpkgs

This allows us to remove npmlock2nix as a dependency.

Change-Id: Ic08a2ba082618292c6ea34141bcaeb3b04a306a9
Reviewed-on: https://cl.snix.dev/c/snix/+/30117
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
This commit is contained in:
adisbladis 2025-03-18 19:43:26 +01:00 committed by adis bladis
parent e18503beb0
commit 726ce7ca9b
3 changed files with 11 additions and 17 deletions

View file

@ -1,3 +0,0 @@
{ depot, pkgs, ... }:
pkgs.callPackage depot.third_party.sources.npmlock2nix { }

View file

@ -104,18 +104,6 @@
"url": "https://github.com/NixOS/nixpkgs/archive/205fd4226592cc83fd4c0885a3e4c9c400efabb5.tar.gz", "url": "https://github.com/NixOS/nixpkgs/archive/205fd4226592cc83fd4c0885a3e4c9c400efabb5.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}, },
"npmlock2nix": {
"branch": "master",
"description": "nixify npm based packages [maintainer=@andir] ",
"homepage": "",
"owner": "mitya57",
"repo": "npmlock2nix",
"rev": "9197bbf397d76059a76310523d45df10d2e4ca81",
"sha256": "1ddfby72fsnpn4yw43g4zxvg6jzlk5hi5cfnnccg9jgw53ckr4xh",
"type": "tarball",
"url": "https://github.com/mitya57/npmlock2nix/archive/9197bbf397d76059a76310523d45df10d2e4ca81.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"rust-overlay": { "rust-overlay": {
"branch": "master", "branch": "master",
"description": "Pure and reproducible nix overlay of binary distributed rust toolchains", "description": "Pure and reproducible nix overlay of binary distributed rust toolchains",

View file

@ -9,13 +9,22 @@
]; ];
}; };
website = depot.third_party.npmlock2nix.v2.build { website = pkgs.buildNpmPackage {
pname = "snix-website"; pname = "snix-website";
version = "0.0.0"; version = "0.0.0";
nativeBuildInputs = [
pkgs.hugo
];
src = depot.third_party.gitignoreSource ./.; src = depot.third_party.gitignoreSource ./.;
npmDeps = pkgs.importNpmLock {
npmRoot = ./.;
};
npmConfigHook = pkgs.importNpmLock.npmConfigHook;
installPhase = "cp -r public/. $out"; installPhase = "cp -r public/. $out";
buildCommands = [ "PATH=\"$PATH:${pkgs.hugo}/bin\" npm run build" ];
}; };
} }