Files
NixOS/other/dev-template.nix

76 lines
2.9 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
description = "A reproducible development environment";
# ─────────────────────────────────────────────
# Inputs external flakes this flake depends on
# ─────────────────────────────────────────────
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# flake-utils generates per-system outputs so you don't
# have to repeat yourself for every architecture.
flake-utils.url = "github:numtide/flake-utils";
};
# ─────────────────────────────────────────────
# Outputs everything this flake exposes
# ─────────────────────────────────────────────
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
# Allow non-free packages
config.allowUnfree = true;
};
in
{
# ─────────────────────────────────────────
# `nix develop` drops you into this shell
# ─────────────────────────────────────────
devShells.default = pkgs.mkShell {
# Human-readable name shown in the shell prompt
name = "replaceNameHere";
# ── Runtime packages available inside the shell ──────────────
# Add or remove anything from https://search.nixos.org/packages
packages = with pkgs; [
# Version control
git
# Common utilities
curl
wget
bat
# ── Language toolchains ──────────────────────────────────
# replacePackagesHere
];
# ── Build inputs (headers, libraries needed at compile time) ──
# Use this for native C libraries, e.g.:
# buildInputs = with pkgs; [ openssl zlib pkg-config ];
# replaceBuildInputsHere
# ── Shell hook runs every time you enter the shell ──────────
shellHook = ''
echo ""
echo " 🐚 Development shell ready!"
echo " 📦 nixpkgs: ${nixpkgs.rev or "unknown"}"
echo ""
# replaceShellHookHere
'';
# ── Environment variables always present in the shell ─────────
# Allow broken or insecure packages
# NIX_CONFIG = "allow-broken = true";
};
}
);
}