Config Files · 1 file
Sample Nix Flake File
flake.nix pins inputs and defines packages and dev shells for Nix. Our sample is realistic and valid for its tool, with fake hosts and secrets.
Nix flake · 678 B
Nix flake
A Nix flake with pinned nixpkgs input, a package and a development shell for several systems. All hosts, keys and secrets are fake.
CC0 · free for any use · Verified by an independent tool · Report a problem
# Sample flake.nix — samplefiles.com
{
description = "Sample project flake";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
forAll = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
in {
packages = forAll (pkgs: {
default = pkgs.writeShellScriptBin "hello-sample" ''
echo "Hello from samplefiles.com"
'';
});
devShells = forAll (pkgs: {
default = pkgs.mkShell {
packages = [ pkgs.nodejs_22 pkgs.python312 pkgs.ffmpeg ];
};
});
};
}File details
Download from the command line
curl -L -o flake.nix https://files.samplefiles.com/config/nix-flake/flake.nixwget https://files.samplefiles.com/config/nix-flake/flake.nixhttps://files.samplefiles.com/config/nix-flake/flake.nixprintf '%s %s\n' 66fa0036c23ae849005763c2404119f9b7309e8599d4051033f22d0632745a1d flake.nix | shasum -a 256 -cOr check the download in your browser with the checksum calculator.