Profile
Back to NewsBack
GitHub Trending 3 min
Reader Mode
fzakaria/omniflake: Thousands of Nix flakes, from one flake input

fzakaria/omniflake: Thousands of Nix flakes, from one flake input

15 hours ago

omniflake

Background: One flake to rule them all.

Thousands of Nix flakes behind one flake input. Add omniflake once and use any indexed flake by name; a flake is fetched only when you evaluate something from it.

{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  inputs.omniflake.url = "github:fzakaria/omniflake";
  inputs.omniflake.inputs.nixpkgs.follows = "nixpkgs";

outputs = { self, nixpkgs, omniflake, ... }: { nixosConfigurations.host = nixpkgs.lib.nixosSystem { modules = [ omniflake.flakes.home-manager.nixosModules.home-manager omniflake.flakes.disko.nixosModules.disko omniflake.flakes.sops-nix.nixosModules.sops ]; }; }; }

Documentation: How to use it · How it works · Unification · Adding or removing a flake · Building the index · Caveats

Status

!check workflow !update workflow

  • 18,220 flakes in the index, from 18,440 in the library tier (233 could not be pinned, 0 not yet pinned)
  • 1,797 ship no usable lock file and use one computed by Nix
  • 13 held at an earlier revision, their newer one having failed to pin
  • One follows line in your flake redirects nixpkgs in every one of them
  • Last updated 2026-11-02

Quickstart

# number of indexed flakes
$ nix eval github:fzakaria/omniflake#lib.count

run a package from one of them

$ nix run 'github:fzakaria/omniflake#flakes.nh.packages.x86_64-linux.default'

Adding omniflake as an input adds six nodes to your flake.lock: omniflake and its five inputs. The indexed flakes are not inputs and do not appear in your lock file.

$ time nix flake lock
real    0m1.5s

Attributes

| attribute | nixpkgs and the other four foundation inputs come from | | ---------------------------------- | -------------------------------------------------------------- | | omniflake.flakes. | omniflake's inputs, substituted at every depth | | omniflake.pinned. | the flake's own lock file | | omniflake.unified. | omniflake's inputs, and every other input name the index knows | | omniflake.lib.load "" {…} | the attribute set you pass; { } means the flake's own lock | | omniflake.lib.withOverrides {…} | the attribute set you pass, for every flake | | omniflake.lib.unifyAll {…} | the index, then the foundations, then the set you pass | | omniflake.lib.names, lib.count | metadata; forces no fetch |

has three spellings, and they reach the same thunk:

omniflake.flakes.home-manager                          # bare
omniflake.flakes."github:nix-community/home-manager"   # qualified
omniflake.github.flakes.nix-community.home-manager     # nested

Every flake answers to the last two. A bare name is assigned only when one repository claims it, so home-manager, claimed by 61 repositories, is a name handed over by names.txt rather than won on stars.

See Unification for what is substituted and why.

Caveats

Using omniflake means trusting this repository's pinning of every indexed flake. Attribute names are stable API. See Caveats before depending on it.

Chat with me