add nix flake packages.slides

This commit is contained in:
Laureηt 2024-10-11 18:52:26 +02:00
parent 3f07274b19
commit fa4a2cadf1
Signed by: Laurent
SSH key fingerprint: SHA256:pb5NrYg80So5z9hmqQFPmp//sgr+DFeJkKhmGyU2NLk
4 changed files with 82 additions and 24 deletions

View file

@ -1,27 +1,32 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": { "locked": {
"lastModified": 1667395993, "lastModified": 1727826117,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=",
"owner": "numtide", "owner": "hercules-ci",
"repo": "flake-utils", "repo": "flake-parts",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "hercules-ci",
"repo": "flake-utils", "repo": "flake-parts",
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1673796341, "lastModified": 1728492678,
"narHash": "sha256-1kZi9OkukpNmOaPY7S5/+SlCDOuYnP3HkXHvNDyLQcc=", "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6dccdc458512abce8d19f74195bb20fdb067df50", "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -33,8 +38,24 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-parts": "flake-parts",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs",
"systems": "systems"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
} }
} }
}, },

View file

@ -1,17 +1,51 @@
{ {
description = "Biblio proj long";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils"; flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
systems.url = "github:nix-systems/default";
}; };
outputs = { self, nixpkgs, flake-utils }: outputs = {flake-parts, ...} @ inputs:
flake-utils.lib.eachDefaultSystem (system: flake-parts.lib.mkFlake {inherit inputs;} {
let pkgs = nixpkgs.legacyPackages.${system}; systems = import inputs.systems;
in {
devShell = pkgs.mkShell { perSystem = {
buildInputs = with pkgs; [ texlive.combined.scheme-full nodejs ]; pkgs,
system,
...
}: rec {
devShells.default = pkgs.mkShell {
packages = packages.slides.nativeBuildInputs;
};
packages.slides = pkgs.stdenvNoCC.mkDerivation rec {
name = "slides";
src = ./.; # because slides/assets is a symlink
npmRoot = "slides";
npmDeps = pkgs.fetchNpmDeps {
src = "${src}/slides";
hash = "sha256-GJ10or/LERFOsBG6CqnRFXnXSEZB7+0C5CV6t8X/Um8=";
};
nativeBuildInputs = [
pkgs.npmHooks.npmConfigHook
pkgs.nodejs
];
buildPhase = ''
cd slides
npm run build
'';
installPhase = ''
mv dist $out
'';
};
};
}; };
});
} }

View file

@ -3,5 +3,8 @@
"@slidev/cli": "^0.42.9", "@slidev/cli": "^0.42.9",
"@slidev/theme-default": "^0.21.2", "@slidev/theme-default": "^0.21.2",
"slidev-theme-academic": "^1.1.3" "slidev-theme-academic": "^1.1.3"
},
"scripts": {
"build": "slidev build slides.md"
} }
} }