Merge pull request #95 from ryan4yin/adjust-devshells

feat: adjust devshells
This commit is contained in:
Ryan Yin 2024-02-27 09:48:47 +08:00 committed by GitHub
commit 450ffb57ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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' run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- name: Run a command with nix develop - name: Run a command with nix develop
run: | run: |
nix develop --ignore-environment --command bash -c ' nix develop .#export-pdf --ignore-environment --command bash -c '
pnpm install pnpm install
pnpm export-pdf pnpm export-pdf
' '

View File

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