{"id":23407973,"url":"https://github.com/notashelf/flint","last_synced_at":"2025-04-11T23:09:27.687Z","repository":{"id":269279791,"uuid":"906914209","full_name":"NotAShelf/flint","owner":"NotAShelf","description":"Stupid simple utility for linting your flake inputs","archived":false,"fork":false,"pushed_at":"2024-12-22T12:18:24.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-22T12:22:01.442Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NotAShelf.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2024-12-22T09:40:24.000Z","updated_at":"2024-12-22T12:18:27.000Z","dependencies_parsed_at":"2024-12-22T12:22:13.433Z","dependency_job_id":"6f5fd62f-7264-43a4-a3aa-781634404ba0","html_url":"https://github.com/NotAShelf/flint","commit_stats":null,"previous_names":["notashelf/flint"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotAShelf%2Fflint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotAShelf%2Fflint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotAShelf%2Fflint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotAShelf%2Fflint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NotAShelf","download_url":"https://codeload.github.com/NotAShelf/flint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230842906,"owners_count":18288734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-22T14:32:00.487Z","updated_at":"2025-04-11T23:09:27.682Z","avatar_url":"https://github.com/NotAShelf.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flint\n\nFlint (_flake input linter_) is a utility for analyzing a given `flake.lock` for\nduplicate inputs.\n\n## Usage\n\n```bash\nUsage: flint [options]\n\nOptions:\n  -fail-if-multiple-versions\n        exit with error if multiple versions found\n  -lockfile string\n        path to flake.lock (default \"flake.lock\")\n  -output string\n        output format: plain or json (default \"plain\")\n  -verbose\n        enable verbose output\n\nExamples:\n  flint --lockfile=/path/to/flake.lock --verbose\n  flint --lockfile=/path/to/flake.lock --output=json\n```\n\nFlint requires a **lockfile** to analyze. By default, Flint will look into the\ncurrent directory for a `flake.lock`. If you wish to analyze another lockfile,\nyou must provide one with `-lockfile` (or `--lockfile`) using an absolute path\nto your `flake.lock`.\n\nThe `-verbose` (or `--verbose`) option will provide just a little additional\ninformation on each input. Flint, by design, is sufficiently verbose without\nthis argument.\n\n### `-fail-if-multiple-versions`\n\nYou can tell Flint to _fail_ if there are duplicate inputs by passing\n`-fail-if-multiple-versions`. This is mostly useful for CI/CD purposes, or if\nyou want to chain Flint into other utilities or scripts.\n\n### Output formats\n\nThe default output format is **plain**, and aims to be human-readable above all.\nIf you wish to parse the output further, you may pass `-output=json` (or\n`--output=json`) to print the full output in **json**.\n\n## Understanding Output\n\nLets assume you are analyzing a simple `flake.lock` with the plain output\nformat.\n\n```bash\n$ flint --lockfile ./flake.lock --output=plain\n```\n\nYou will get something of this sort:\n\n```bash\nDependency Analysis Report\nInput: github:NixOS/nixpkgs\n  Alias: nixpkgs\n    Dependants: input1\n  Alias: nixpkgs_2\n    Dependants: input2\n  Alias: nixpkgs_3\n    Dependants: root\n```\n\nThis means that you have two inputs, **input1** and **input2**, pulling separate\ninstances of nixpkgs in addition to `root`, which means nixpkgs is also pulled\nby your current flake.\n\n```nix\n# flake.nix\n{\n  inputs = {\n    # Your flake pulling nixpkgs\n    nixpkgs.url = \"github:NixOS/nixpkgs\";\n\n    # Inputs pulling their own instances of nixpkgs\n    input1.url = \"github:foo/bar\";\n    input2.url = \"github:foo/baz\";\n  };\n}\n```\n\nYou would clear duplicates by `follow`ing the root nixpkgs URL.\n\n```nix\n# flake.nix\n{\n  inputs = {\n    # Your flake pulling nixpkgs\n    nixpkgs.url = \"github:NixOS/nixpkgs\";\n\n    # Inputs pulling their own instances of nixpkgs\n    input1 = {\n      url = \"github:foo/bar\";\n      inputs.nixpkgs.follows = \"nixpkgs\";\n    };\n\n    input2 = {\n      url = \"github:foo/baz\";\n      inputs.nixpkgs.follows = \"nixpkgs\";\n    };\n  };\n}\n```\n\nRunning Flint again after locking your flake with `nix flake lock` would return:\n\n```bash\nDependency Analysis Report\nNo duplicate inputs detected in the repositories analyzed.\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://imgs.xkcd.com/comics/manuals.png\" alt=\"Mandatory xkcd comic\"\u003e\n\u003c/p\u003e\n\n## Hacking\n\nClone the repository and run `nix develop`. A `.envrc` is provided for Direnv\nusers.\n\n## License\n\nFlint is licensed under Mozilla Public License 2.0, please see\n[LICENSE](LICENSE) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotashelf%2Fflint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotashelf%2Fflint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotashelf%2Fflint/lists"}