Files
awesome-docs/flake.nix
2025-04-18 09:47:15 +02:00

29 lines
836 B
Nix

{
description = "A Nix-flake-based Node.js development environment";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
nodejs_22
(yarn.override { nodejs = nodejs_22; })
vale
];
shellHook = ''
echo "Node: `${pkgs.nodejs}/bin/node --version`"
echo "Vale: `vale -v | awk '{print $3}'`"
'';
};
});
};
}