Skip to content

Commit

Permalink
chore: added nix config
Browse files Browse the repository at this point in the history
  • Loading branch information
cecilia-sanare committed Apr 10, 2024
1 parent 460a31a commit 716553a
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 7 deletions.
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.

15 changes: 15 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
description = "React Utils";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

outputs = { nixpkgs, ... }: let
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
in {
# Devshell for bootstrapping; acessible via 'nix develop' or 'nix-shell' (legacy)
devShells = forAllSystems (systems:
let pkgs = nixpkgs.legacyPackages.${systems};
in import ./shell.nix { inherit pkgs; }
);
};
}
8 changes: 8 additions & 0 deletions nixpkgs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file
# Useful to avoid using channels when using legacy nix commands
let lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
in
import (fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
sha256 = lock.narHash;
})
21 changes: 14 additions & 7 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
{ pkgs ? import <nixpkgs-unstable> { } }:
# Shell for bootstrapping flake-enabled nix and home-manager
# Enter it through 'nix develop' or (legacy) 'nix-shell'

pkgs.mkShell {
buildInputs = with pkgs; [
gnumake
nodejs_20
bun
];
{ pkgs ? (import ./nixpkgs.nix) { } }: {
default = pkgs.mkShell {
# Enable experimental features without having to specify the argument
NIX_CONFIG = "experimental-features = nix-command flakes";
buildInputs = with pkgs; [
gnumake
nixpkgs-fmt
nixd
bun
nodejs_20
];
};
}

0 comments on commit 716553a

Please sign in to comment.