Skip to content

Commit

Permalink
feat: added nix direnv (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrackThor authored Dec 14, 2024
1 parent 7ea4e3b commit 0fd5d78
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# nix
.direnv/
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
description = "A Nix-flake-based Node.js development environment";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; # latest stable version at this time

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; overlays = [ self.overlays.default ]; };
});
in
{
overlays.default = final: prev: rec {
nodejs = prev.nodejs;
};

devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
node2nix
nodejs
pre-commit
];

shellHook = ''
npm ci
export PATH=$PATH:$PWD/bin
'';
TEST="Hello Cloud Native Austria Contributor! :D";
};
});
};
}

0 comments on commit 0fd5d78

Please sign in to comment.