Skip to content

Instantly share code, notes, and snippets.

@Widdershin
Created September 4, 2025 06:06
Show Gist options
  • Save Widdershin/e4128ead1a7fc2a8669e758021d63e4f to your computer and use it in GitHub Desktop.
Save Widdershin/e4128ead1a7fc2a8669e758021d63e4f to your computer and use it in GitHub Desktop.
flake.nix template
dotenv_if_exists .env
if ! has nix_direnv_version || ! nix_direnv_version 3.1.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.1.0/direnvrc" "sha256-yMJ2OVMzrFaDPn7q8nCBZFRYpL/f0RcHzhmw/i6btJM="
fi
if has nix; then
use_flake .
fi
{
description = "Basic devshell";
inputs = {
# Uses the latest stable Nixpkgs release
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.05";
# flake-utils is used to simplify multi-system support
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
# Use nix develop to enter the dev shell
devShells.default = pkgs.mkShell {
buildInputs = [
# Add your development dependencies here
pkgs.nodejs_24
];
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment