{"id":14968092,"url":"https://github.com/a-kenji/flake-edit","last_synced_at":"2026-04-01T17:45:31.088Z","repository":{"id":249453751,"uuid":"701545077","full_name":"a-kenji/flake-edit","owner":"a-kenji","description":"Edit your flake inputs with ease.","archived":false,"fork":false,"pushed_at":"2026-03-23T03:54:06.000Z","size":4813,"stargazers_count":53,"open_issues_count":13,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-24T00:09:38.188Z","etag":null,"topics":["automation","cli","configuration","flakes","library","nix","nixos","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a-kenji.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-06T21:58:29.000Z","updated_at":"2026-03-23T03:54:04.000Z","dependencies_parsed_at":"2026-01-05T18:02:50.507Z","dependency_job_id":null,"html_url":"https://github.com/a-kenji/flake-edit","commit_stats":{"total_commits":474,"total_committers":2,"mean_commits":237.0,"dds":0.2932489451476793,"last_synced_commit":"10c6947d53318c70aea9e1dd227192cfd100a5f0"},"previous_names":["a-kenji/flake-edit"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/a-kenji/flake-edit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-kenji%2Fflake-edit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-kenji%2Fflake-edit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-kenji%2Fflake-edit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-kenji%2Fflake-edit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a-kenji","download_url":"https://codeload.github.com/a-kenji/flake-edit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-kenji%2Fflake-edit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","cli","configuration","flakes","library","nix","nixos","rust"],"created_at":"2024-09-24T13:39:16.873Z","updated_at":"2026-04-01T17:45:31.082Z","avatar_url":"https://github.com/a-kenji.png","language":"Rust","funding_links":[],"categories":["Development"],"sub_categories":[],"readme":"# `$ flake-edit` - edit your flake inputs with ease\n\n[![Built with Nix](https://img.shields.io/static/v1?label=built%20with\u0026message=nix\u0026color=5277C3\u0026logo=nixos\u0026style=flat-square\u0026logoColor=ffffff)](https://builtwithnix.org) [![Crates](https://img.shields.io/crates/v/flake-edit?style=flat-square)](https://crates.io/crates/flake-edit)\n[![Documentation](https://img.shields.io/badge/flake_edit-documentation-fc0060?style=flat-square)](https://docs.rs/flake-edit)\n[![Matrix Chat Room](https://img.shields.io/badge/chat-on%20matrix-1d7e64?logo=matrix\u0026style=flat-square)](https://matrix.to/#/#flake-edit:matrix.org)\n\n\u003c!--toc:start--\u003e\n- [`$ flake-edit` - edit your flake inputs with ease](#flake-edit-edit-your-flake-inputs-with-ease)\n  - [`$ flake-edit` - usage](#-flake-edit---usage)\n    - [`$ flake-edit add`](#-flake-edit-add)\n    - [`$ flake-edit remove`](#-flake-edit-remove)\n    - [`$ flake-edit update`](#-flake-edit-update)\n    - [`$ flake-edit change`](#-flake-edit-change)\n    - [`$ flake-edit pin`](#-flake-edit-pin)\n    - [`$ flake-edit unpin`](#-flake-edit-unpin)\n    - [`$ flake-edit list`](#-flake-edit-list)\n    - [`$ flake-edit follow`](#-flake-edit-follow)\n    - [`$ flake-edit config`](#-flake-edit-config)\n  - [Quick Start](#quick-start)\n    - [Installation](#installation)\n    - [Running](#running)\n    - [Basic Usage](#basic-usage)\n  - [Configuration](#configuration)\n  - [As a library](#as-a-library)\n  - [Status](#status)\n  - [License](#license)\n\u003c!--toc:end--\u003e\n\n## `$ flake-edit` - usage\n\n`flake-edit` has the following cli interface:\n\n\u003c!-- `$ flake-edit help` --\u003e\n\n```\nEdit your flake inputs with ease.\n\nUsage: flake-edit [OPTIONS] \u003cCOMMAND\u003e\n\nCommands:\n  add\n          Add a new flake reference\n  remove\n          Remove a specific flake reference based on its id\n  change\n          Change an existing flake reference's URI\n  list\n          List flake inputs\n  update\n          Update inputs to their latest specified release\n  pin\n          Pin inputs to their current or a specified rev\n  unpin\n          Unpin an input so it tracks the upstream default again\n  follow\n          Automatically add and remove follows declarations\n  add-follow\n          Manually add a single follows declaration\n  config\n          Manage flake-edit configuration\n  help\n          Print this message or the help of the given subcommand(s)\n\nOptions:\n      --flake \u003cFLAKE\u003e\n          Location of the `flake.nix` file, that will be used. Defaults to `flake.nix` in the current directory\n      --lock-file \u003cLOCK_FILE\u003e\n          Location of the `flake.lock` file. Defaults to `flake.lock` in the current directory\n      --diff\n          Print a diff of the changes, will not write the changes to disk\n      --no-lock\n          Skip updating the lockfile after editing flake.nix\n      --non-interactive\n          Disable interactive prompts\n      --no-cache\n          Disable reading from and writing to the completion cache\n      --cache \u003cCACHE\u003e\n          Path to a custom cache file\n      --config \u003cCONFIG\u003e\n          Path to a custom configuration file\n  -h, --help\n          Print help\n  -V, --version\n          Print version\n```\n\n### `$ flake-edit add`\n\u003c!-- `$ flake-edit help add` --\u003e\n\n```\nAdd a new flake reference\n\nUsage: flake-edit add [OPTIONS] [ID] [URI]\n\nArguments:\n  [ID]\n          The name of an input attribute\n  [URI]\n          The uri that should be added to the input\n\nOptions:\n      --ref-or-rev \u003cREF_OR_REV\u003e\n          Pin to a specific ref_or_rev\n  -n, --no-flake\n          The input itself is not a flake\n  -s, --shallow\n          Use shallow clone for the input\n      --config \u003cCONFIG\u003e\n          Path to a custom configuration file\n  -h, --help\n          Print help\n```\nFor some types, the id will be automatically inferred.\n![flake-edit add example](https://vhs.charm.sh/vhs-iJiVTOvSd8V9WEl79Ie68.gif)\n\nFor some inputs, the uri can be put in directly and the id and type will be inferred.\n![flake-edit add inferred example](https://vhs.charm.sh/vhs-3RsaCQO9CAznelPup2kDgV.gif\n)\n\n### `$ flake-edit remove`\n\u003c!-- `$ flake-edit help remove` --\u003e\n\n```\nRemove a specific flake reference based on its id\n\nUsage: flake-edit remove [OPTIONS] [ID]\n\nArguments:\n  [ID]\n          \n\nOptions:\n      --config \u003cCONFIG\u003e\n          Path to a custom configuration file\n  -h, --help\n          Print help\n```\n![flake-edit remove example](https://vhs.charm.sh/vhs-1Uo70AaoEMuYh2UR1JVARD.gif)\n\n### `$ flake-edit update`\n\u003c!-- `$ flake-edit help update` --\u003e\n\n```\nUpdate inputs to their latest specified release\n\nUsage: flake-edit update [OPTIONS] [ID]\n\nArguments:\n  [ID]\n          The id of an input attribute. If omitted will update all inputs\n\nOptions:\n      --init\n          Whether the latest semver release of the remote should be used even thought the release itself isn't yet pinned to a specific release\n      --config \u003cCONFIG\u003e\n          Path to a custom configuration file\n  -h, --help\n          Print help\n```\n\n![flake-edit update example](https://vhs.charm.sh/vhs-289dZ9Y9cAYRkdSWtd4hT6.gif)\n\n### `$ flake-edit change`\n\u003c!-- `$ flake-edit help change` --\u003e\n\n```\nChange an existing flake reference's URI\n\nUsage: flake-edit change [OPTIONS] [ID] [URI]\n\nArguments:\n  [ID]\n          The name of an existing input attribute\n  [URI]\n          The new URI for the input\n\nOptions:\n      --ref-or-rev \u003cREF_OR_REV\u003e\n          Pin to a specific ref_or_rev\n  -s, --shallow\n          Use shallow clone for the input\n      --config \u003cCONFIG\u003e\n          Path to a custom configuration file\n  -h, --help\n          Print help\n```\n![flake-edit change example](https://vhs.charm.sh/vhs-7C7FrGVs2mCNIvQmPiNQfL.gif)\n\n### `$ flake-edit pin`\n\u003c!-- `$ flake-edit help pin` --\u003e\n\n```\nPin inputs to their current or a specified rev\n\nUsage: flake-edit pin [OPTIONS] [ID] [REV]\n\nArguments:\n  [ID]\n          The id of an input attribute\n  [REV]\n          Optionally specify a rev for the inputs attribute\n\nOptions:\n      --config \u003cCONFIG\u003e\n          Path to a custom configuration file\n  -h, --help\n          Print help\n```\n![flake-edit pin](https://vhs.charm.sh/vhs-629lX7LqP4MS1aHffb4Ufh.gif)\nPin a specific input to it's current revision (rev).\n\n### `$ flake-edit unpin`\n\u003c!-- `$ flake-edit help unpin` --\u003e\n\n```\nUnpin an input so it tracks the upstream default again\n\nUsage: flake-edit unpin [OPTIONS] [ID]\n\nArguments:\n  [ID]\n          The id of an input attribute\n\nOptions:\n      --config \u003cCONFIG\u003e\n          Path to a custom configuration file\n  -h, --help\n          Print help\n```\n![flake-edit unpin example](https://vhs.charm.sh/vhs-G8Eo84Ysjpt5c09Q9VD4u.gif)\n\n### `$ flake-edit list`\n\u003c!-- `$ flake-edit help list` --\u003e\n\n```\nList flake inputs\n\nUsage: flake-edit list [OPTIONS]\n\nOptions:\n      --format \u003cFORMAT\u003e\n          [default: detailed]\n      --config \u003cCONFIG\u003e\n          Path to a custom configuration file\n  -h, --help\n          Print help\n```\nList the outputs, that are specified inside the inputs attribute.\n![flake-edit list example](https://vhs.charm.sh/vhs-2ZSgdhkzBe3eoxuYtM1JL6.gif)\nList the outputs, that are specified inside the inputs attribute, in json format.\n![flake-edit list example](https://vhs.charm.sh/vhs-35E6eiL63lFTSC70rQyE1Y.gif)\n\n### `$ flake-edit follow`\n\u003c!-- `$ flake-edit help follow` --\u003e\n\n```\nAutomatically add and remove follows declarations.\n\nAnalyzes the flake.lock to find nested inputs that match top-level inputs, then adds appropriate follows declarations and removes stale ones.\n\nWith file paths, processes multiple flakes in batch. For every `flake.nix` file passed in it will assume a `flake.lock` file exists in the same directory.\n\nUsage: flake-edit follow [OPTIONS] [PATHS]...\n\nArguments:\n  [PATHS]...\n          Flake.nix paths to process. If empty, runs on current directory\n\nOptions:\n      --transitive [\u003cTRANSITIVE\u003e]\n          Enable transitive follows deduplication, promoting shared nested inputs to top-level when they appear at least N times. Defaults to 2 if no value is given. Overrides the config file's `follow.transitive_min`\n\n      --config \u003cCONFIG\u003e\n          Path to a custom configuration file\n\n  -h, --help\n          Print help (see a summary with '-h')\n```\nAutomatically add follows relationships for all nested inputs matching top-level inputs.\n![flake-edit follow example](https://vhs.charm.sh/vhs-5ZsxM5lx22BY2IuquxCGgk.gif)\n\n### `$ flake-edit add-follow`\n\u003c!-- `$ flake-edit help add-follow` --\u003e\n\n```\nManually add a single follows declaration.\n\nExample: `flake-edit add-follow rust-overlay.nixpkgs nixpkgs`\n\nThis creates: `rust-overlay.inputs.nixpkgs.follows = \"nixpkgs\";`\n\nWithout arguments, starts an interactive selection.\n\nUsage: flake-edit add-follow [OPTIONS] [INPUT] [TARGET]\n\nArguments:\n  [INPUT]\n          The input path in dot notation (e.g., \"rust-overlay.nixpkgs\" means the nixpkgs input of rust-overlay)\n\n  [TARGET]\n          The target input to follow (e.g., \"nixpkgs\")\n\nOptions:\n      --config \u003cCONFIG\u003e\n          Path to a custom configuration file\n\n  -h, --help\n          Print help (see a summary with '-h')\n```\n\nAdd a follows relationship to a specific nested input.\n![flake-edit add-follow example](https://vhs.charm.sh/vhs-1HFngcI5dHEoTeU2L0K06d.gif)\n\n### `$ flake-edit config`\n\u003c!-- `$ flake-edit help config` --\u003e\n\n```\nManage flake-edit configuration\n\nUsage: flake-edit config [OPTIONS]\n\nOptions:\n      --print-default\n          Output the default configuration to stdout\n      --path\n          Show where configuration would be loaded from\n      --config \u003cCONFIG\u003e\n          Path to a custom configuration file\n  -h, --help\n          Print help\n```\n\n## Quick Start\n\n### Installation\n\n```\ncargo install flake-edit --locked\n```\n\n### Running\n\nFrom `nixpkgs`:\n\n```\nnix run nixpkgs#flake-edit -- --diff follow\n```\n\nFrom `main` of `flake-edit`:\n```\nnix run github:a-kenji/flake-edit -- --diff follow\n```\n\n### Basic Usage\n\nAdd a new input to your flake:\n\n```\nflake-edit add github:numtide/treefmt-nix\n```\n\nAuto-follow all your inputs through `flake.nix`:\n\n```\nflake-edit follow\n```\n\nAdd `--diff` to any command to get a preview of the changes:\n\n```\nflake-edit --diff follow\n```\n\n## Configuration\n\n`flake-edit` uses TOML configuration files.\n\nRun `flake-edit config --print-default` to create a default configuration:\n\n\u003c!-- `$ flake-edit config --print-default` --\u003e\n\n```\n# flake-edit ~ configuration file\n# https://github.com/a-kenji/flake-edit\n\n# Configuration for `flake-edit follow [PATHS]`\n[follow]\n# Inputs to ignore. Supports two formats:\n#   - Full path: \"crane.nixpkgs\" - ignores only that specific nested input\n#   - Simple name: \"systems\" - ignores all nested inputs with that name\n# ignore = [\"systems\", \"crane.flake-utils\"]\n\n# Minimum number of transitive follows required to add a top-level follows input.\n# Set to 0 to disable transitive follows deduplication.\n# transitive_min = 2\n\n# Alias mappings.\n# Key is the canonical name (must exist at top-level), values are alternatives.\n# Example: if nested input is \"nixpkgs-lib\" and top-level \"nixpkgs\" exists,\n# follow will suggest: poetry2nix.nixpkgs-lib -\u003e nixpkgs\n# aliases = { nixpkgs = [\"nixpkgs-lib\"] }\n```\n\n## As a library\n\nAdd `flake-edit` as a library by running:\n\n```\ncargo add flake-edit --no-default-features\n```\n\nBe aware that the `lib` interface is still unstable.\nThough we are already happy to get feedback.\n\n\n## Status\n\u003e [!NOTE]\n\u003e This project is currently in active development and should be considered a work in progress.\n\u003e The goal of `flake-edit` is to provide a robust and well-tested interface to flake inputs.\n\u003e Many edge cases are not covered yet, if you find any issues please consider opening an issue, or a pr.\n\u003e And we would be happy for feedback of the cli interface especially.\n\n## Contributing\nWe welcome contributions from the community!\nCheck out the [Contributing Guidelines](./doc/CONTRIBUTING.md) on how to get started.\n\n## Release Notes\nStay updated with the latest changes by viewing the [Changelog](./CHANGELOG.md).\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-kenji%2Fflake-edit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-kenji%2Fflake-edit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-kenji%2Fflake-edit/lists"}