Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nix): add custom Nix environment to use Node.js v14 #25

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ini perlu diatur sih om, better sepertinya .envrc.example

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ada contohnya Om?
Aku perlu baca-baca direnv dulu nih kayaknya. 😅

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ignore di .gitignore

echo ".envrc\n.direnv/" >> .gitignore

Karena .direnv itu isinya cache

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ dist
# when working with contributors
package-lock.json
yarn.lock

# Nix
.direnv
42 changes: 42 additions & 0 deletions flake.lock

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

24 changes: 24 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
description = "Use nodejs-14_x in pkode";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, utils, ... }:
utils.lib.eachDefaultSystem (system:
let
inherit (lib) attrValues;
pkgs = nixpkgs.legacyPackages.${system};
lib = nixpkgs.lib;
in
rec {
devShell = with pkgs; mkShell {
buildInputs = [
nodejs-14_x
];
};
});

}