2026-04-23 11:15:05 +02:00

34 lines
1.0 KiB
Nix

{
description = "A minimal dev shell: your first flake";
# Inputs: other flakes this one depends on.
# `nixpkgs` is the main package set. `follows` isn't used here, but you'll
# see it a lot when composing flakes (e.g. `inputs.foo.inputs.nixpkgs.follows = "nixpkgs";`).
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
# Outputs: a function that receives all inputs and returns an attrset.
# The attrset's structure is what `nix` CLI commands look for (e.g. `devShells.<system>.default`).
outputs = { self, nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in {
# `nix develop` picks this up by default.
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [
cowsay
jq
ripgrep
];
# Runs once when you enter the shell.
shellHook = ''
echo "welcome to your first nix dev shell"
cowsay "hello, flakes"
'';
};
};
}