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

flake.nix — first linesNix
# 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

Size
678 B (678 bytes)
MIME type
text/plain
SHA-256
66fa0036c23ae849005763c2404119f9b7309e8599d4051033f22d0632745a1d
MD5
dd5da33cc367350099f7fa5f97fb8a4d

Download from the command line

curl -L -o flake.nix https://files.samplefiles.com/config/nix-flake/flake.nix

Or check the download in your browser with the checksum calculator.