mirror of
https://github.com/ryan4yin/nixos-and-flakes-book.git
synced 2024-11-24 17:13:12 +01:00
Merge pull request #95 from ryan4yin/adjust-devshells
feat: adjust devshells
This commit is contained in:
commit
450ffb57ce
2
.github/workflows/release-pdf.yml
vendored
2
.github/workflows/release-pdf.yml
vendored
@ -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
|
||||
'
|
||||
|
34
flake.nix
34
flake.nix
@ -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`"
|
||||
|
Loading…
Reference in New Issue
Block a user