use new deno with packages

This commit is contained in:
EatThePooh 2025-09-15 13:43:40 +07:00
parent 864ace2581
commit 22e9ebc0f7
3 changed files with 33 additions and 58 deletions

65
flake.lock generated
View file

@ -1,18 +1,12 @@
{
"nodes": {
"deno-with-packages": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1754403929,
"narHash": "sha256-2+VxvvvOQOmidNGEbJibuYyyFufEvnr37evnZxcf7ao=",
"lastModified": 1757917630,
"narHash": "sha256-zK0p0oq7NhBUUsfcPYS+iu2A0+HzzHJ4WxZ5MDd+Lis=",
"owner": "voleum-org",
"repo": "deno-with-packages",
"rev": "47ad6f8ad05062db9a2b3dc421f8a0ea5484ce41",
"rev": "26f60eb96b0d092373e4fbe0ceae1a080b8f00b6",
"type": "github"
},
"original": {
@ -26,11 +20,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1754487366,
"narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=",
"lastModified": 1756770412,
"narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18",
"rev": "4524271976b625a4a605beefd893f270620fd751",
"type": "github"
},
"original": {
@ -39,31 +33,28 @@
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"flake-root": {
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"lastModified": 1723604017,
"narHash": "sha256-rBtQ8gg+Dn4Sx/s+pvjdq3CB2wQNzx9XGFq/JVGCB6k=",
"owner": "srid",
"repo": "flake-root",
"rev": "b759a56851e10cb13f6b8e5698af7b59c44be26e",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"owner": "srid",
"repo": "flake-root",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1753939845,
"narHash": "sha256-K2ViRJfdVGE8tpJejs8Qpvvejks1+A4GQej/lBk5y7I=",
"lastModified": 1757745802,
"narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "94def634a20494ee057c76998843c015909d6311",
"rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1",
"type": "github"
},
"original": {
@ -75,11 +66,11 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1753579242,
"narHash": "sha256-zvaMGVn14/Zz8hnp4VWT9xVnhc8vuL3TStRqwk22biA=",
"lastModified": 1754788789,
"narHash": "sha256-x2rJ+Ovzq0sCMpgfgGaaqgBSwY+LST+WbZ6TytnT9Rk=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "0f36c44e01a6129be94e3ade315a5883f0228a6e",
"rev": "a73b9c743612e4244d865a2fdee11865283c04e6",
"type": "github"
},
"original": {
@ -92,23 +83,9 @@
"inputs": {
"deno-with-packages": "deno-with-packages",
"flake-parts": "flake-parts",
"flake-root": "flake-root",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View file

@ -4,29 +4,34 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-root.url = "github:srid/flake-root";
deno-with-packages.url = "github:voleum-org/deno-with-packages";
deno-with-packages.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.flake-root.flakeModule
inputs.deno-with-packages.flakeModule
];
systems = [ "x86_64-linux" ];
perSystem = { self', pkgs, config, system, ... }: let
lib = import ./nix // inputs.deno-with-packages.lib.${system};
lib = import ./nix;
shelf = import ./shelf {
inherit pkgs system lib;
};
in {
deno = {
enable = true;
lockfiles = shelf.lockfiles;
};
packages.website =
import ./nix/website.nix { inherit pkgs; root = ./.; };
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [ deno pandoc reuse ];
buildInputs = with pkgs; [ config.packages.deno pandoc reuse ];
inputsFrom = [ config.flake-root.devShell ];
shellHook = ''
export DENO_DIR=$PWD/.deno_cache
${shelf.setupScript}/bin/install-deno-cache
echo "Available scrolls:"
echo ${pkgs.lib.escapeShellArg (builtins.toJSON shelf.scrolls)} | jq .
'';

View file

@ -11,16 +11,9 @@ let
scrolls = builtins.map mkScroll scrollDirs;
lockfiles = builtins.map (s: s.build.lockFile) scrolls;
denoSharedCache = lib.denoSharedCache {
inherit pkgs lockfiles;
};
in
{
setupScript = lib.installDenoCache {
inherit pkgs;
cache = denoSharedCache;
};
inherit lockfiles;
scrolls =
builtins.map (s: builtins.removeAttrs s [ "build" ]) scrolls;