mirror of
https://github.com/ryan4yin/nixos-and-flakes-book.git
synced 2024-11-28 11:04:09 +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'
|
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
|
||||||
'
|
'
|
||||||
|
34
flake.nix
34
flake.nix
@ -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`"
|
||||||
|
Loading…
Reference in New Issue
Block a user