Skip to content

Nix-flatten utility? #620

Closed as not planned
Closed as not planned

Description

@copumpkin

Would it be feasible to write a tool that takes a nix expression to evaluate against a nix file, and produces an equivalent single-file (modulo importing from derivation outputs, which is icky) expression with no imports of fixed nix files?

So for example, I could evaluate pkgs.foo against nixpkgs, and would end up with a single file containing a giant let block full of definitions from different files (formatting and comments preserved as much as possible), along with comments explaining where each let definition came from. The resulting single-file expression should be possible to evaluate in isolation.

Activity

  1. edolstra commented on Aug 26, 2015

    @edolstra
    Member

    See also https://github.com/NixOS/nix/tree/nix-pack which does a slightly different thing, namely pack all the files referenced from a file.

  2. copumpkin commented on Aug 26, 2015

    @copumpkin
    MemberAuthor

    Fun! Any idea why the PR associated with that seems to be 404'ing?

  3. edolstra commented on Aug 26, 2015

    @edolstra
    Member

    I don't think I ever created a PR for it...

  4. copumpkin commented on Aug 26, 2015

    @copumpkin
    MemberAuthor

    Weird, both the commit link and the top-level link suggest that #484 is the associated PR. Furthermore, as I was typing it, GitHub autocompleted #484 to say "Add nix-pack utility". But then the link is broken! GitHub is clearly haunted today...

  5. armijnhemel commented on Apr 30, 2017

    @armijnhemel
    Contributor

    @edolstra would it be possible to include it? It sounds like a useful utility to me.

  6. stale commented on Feb 15, 2021

    @stale

    I marked this as stale due to inactivity. → More info

  7. stale commented on May 1, 2022

    @stale

    I closed this issue due to inactivity. → More info

  8. added a commit that references this issue on Jan 1, 2024
  9. tomberek commented on Aug 13, 2026

    @tomberek
    Contributor

    Closing as stale. Re-open if needed.

  10. added a commit that references this issue on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions