feat: adjust devshells

This commit is contained in:
Ryan Yin 2024-02-27 09:45:08 +08:00
parent c2eddcb097
commit c7bff12ab6
2 changed files with 21 additions and 15 deletions

View file

@ -21,7 +21,7 @@ jobs:
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- name: Run a command with nix develop
run: |
nix develop --ignore-environment --command bash -c '
nix develop .#export-pdf --ignore-environment --command bash -c '
pnpm install
pnpm export-pdf
'

View file

@ -6,27 +6,33 @@
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{ self
, nixpkgs
, flake-utils
}:
flake-utils.lib.eachDefaultSystem (system:
let
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
overlays = [
(self: super: rec {
nodejs = super.nodejs_20;
pnpm = super.nodePackages.pnpm;
yarn = (super.yarn.override { inherit nodejs; });
yarn = super.yarn.override {inherit nodejs;};
})
];
pkgs = import nixpkgs { inherit overlays system; };
pkgs_chromium = import nixpkgs { inherit system; };
in
{
pkgs = import nixpkgs {inherit overlays system;};
pkgs_chromium = import nixpkgs {inherit system;};
packages = with pkgs; [node2nix nodejs pnpm yarn git];
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [ node2nix nodejs pnpm yarn git];
inherit packages;
shellHook = ''
echo "node `${pkgs.nodejs}/bin/node --version`"
'';
};
devShells.export-pdf = pkgs.mkShell {
inherit packages;
shellHook = ''
echo "node `${pkgs.nodejs}/bin/node --version`"