Skip to content

Flake-compat for modern Nix implementations and people who agree evaluating from store is dumber than DJT :)

License

Notifications You must be signed in to change notification settings

Lillecarl/flake-compatish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

115 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flake-compatish

Evaluate flakes without the flake evaluator. Requires Nix 2.4+ with builtins.fetchTree.

Why

Flakes copy your source to the Nix store before evaluation. For large projects or when hacking on dependencies like nixpkgs, this creates painful iteration cycles.

flake-compatish lets you:

  • Keep flake.nix for CI/others - maintain full flake compatibility
  • Skip the store copy locally - evaluate directly from your working directory
  • Override inputs on the fly - point dependencies at local checkouts without touching flake.lock

Usage

Add flake-compatish as a flake input, then create a default.nix:

let
  lock = builtins.fromJSON (builtins.readFile ./flake.lock);
  flake-compatish = builtins.fetchTree lock.nodes.flake-compatish.locked;
in
import flake-compatish { source = ./.; }

With overrides

import flake-compatish {
  source = ./.;
  overrides = {
    # Path: use directly without store copy (fast local dev)
    self = ./.;
    nixpkgs = ~/Code/nixpkgs;

    # String: parsed as flake ref and fetched
    nixpkgs = "github:nixos/nixpkgs/nixos-unstable";
  };
}

Output structure

{
  inputs = { self, nixpkgs, ... };  # resolved inputs
  outputs = { packages, ... };      # flake outputs
  impure = { packages, ... };       # outputs with current system auto-selected
}

Running tests

nix eval --impure --file ./test

About

Flake-compat for modern Nix implementations and people who agree evaluating from store is dumber than DJT :)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 22

Languages