{"id":13648160,"url":"https://github.com/Mic92/nix-update","last_synced_at":"2025-04-22T07:30:46.637Z","repository":{"id":37930367,"uuid":"245145732","full_name":"Mic92/nix-update","owner":"Mic92","description":"Swiss-knife for updating nix packages.","archived":false,"fork":false,"pushed_at":"2024-04-30T21:09:04.000Z","size":450,"stargazers_count":390,"open_issues_count":20,"forks_count":35,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-05-02T00:17:14.448Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Mic92.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.rst","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":"2020-03-05T11:31:09.000Z","updated_at":"2024-06-25T14:00:19.040Z","dependencies_parsed_at":"2023-02-12T15:02:08.193Z","dependency_job_id":"85a7d74c-f7f1-4560-b099-197907de4791","html_url":"https://github.com/Mic92/nix-update","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mic92%2Fnix-update","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mic92%2Fnix-update/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mic92%2Fnix-update/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mic92%2Fnix-update/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mic92","download_url":"https://codeload.github.com/Mic92/nix-update/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223892283,"owners_count":17220733,"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":["hacktoberfest"],"created_at":"2024-08-02T01:04:01.091Z","updated_at":"2024-11-09T22:31:16.061Z","avatar_url":"https://github.com/Mic92.png","language":"Python","funding_links":[],"categories":["Python","Development"],"sub_categories":["Discovery"],"readme":"# nix-update\n\nNix-update updates versions/source hashes of nix packages. It is\ndesigned to work with nixpkgs but also other package sets.\n\n## Features\n\n- automatically figure out the latest version of packages from:\n  - BitBucket\n  - Codeberg\n  - crates.io\n  - Gitea\n  - GitHub\n  - GitLab\n  - PyPi\n  - RubyGems.org\n  - Sourcehut\n  - Savannah\n- update buildRustPackage's cargoHash/cargoSha256/cargoLock and cargoSetupHook's cargoDeps\n- update buildGoModule's vendorHash/vendorSha256\n- update buildNpmPackage's npmDepsHash and npmConfigHook's npmDeps\n- update buildComposerProject's vendorHash\n- update buildMavenPackage's mvnHash\n- update mixRelease's mixFodDeps\n- update fetchYarnDeps offlineCache output hash\n- update flake outputs (see `--flake`)\n- build and run the resulting package (see `--build`,\n  `--run` or `--shell`\n- commit updated files (see `--commit` flag)\n- run update scripts (`passthru.updateScript`, see `--use-update-script` flag)\n- run package tests (see `--test` flag)\n- specify the system to use (see `--system` flag)\n\n## Installation\n\n`nix-update` is included in nixpkgs.\n\nTo run without installing it, use:\n\n```console\n$ nix-shell -p nix-update\n```\n\nTo install it:\n\n```console\n$ nix-env -f '\u003cnixpkgs\u003e' -iA nix-update\n```\n\nTo run it from the git repository:\n\n```console\n$ nix-build\n$ ./result/bin/nix-update\n```\n\nIf you have nix flakes enabled you can also do:\n\n```console\n$ nix run github:Mic92/nix-update\n```\n\n## USAGE\n\nFirst change to your directory containing the nix expression (Could be a\nnixpkgs or your own repository). Than run `nix-update` as follows\n\n```console\n$ nix-update attribute [--version version]\n```\n\nIf your package is defined in a flake use the `--flake` flag instead:\n\n```console\n$ nix-update attribute --flake [--version version]\n```\n\n`nix-update` will than try to update either the\n`packages.{currentSystem}.{attribute}` or `{attribute}` output attribute of the\ngiven flake. To update a package in `legacyPackages`, pass the full path to that\npackage including the platform: `legacyPackages.{platform}.{attribute}`.\n\nThis example will fetch the latest github release:\n\n```console\n$ nix-update nixpkgs-review\n```\n\nIt is also possible to specify the version manually\n\n```console\n$ nix-update --version=2.1.1 nixpkgs-review\n```\n\nTo update an unstable package to the latest commit of the default branch:\n\n```console\n$ nix-update --version=branch nixpkgs-review\n```\n\nTo update an unstable package the latest commit from a certain branch:\n\n```console\n$ nix-update --version=branch=develop nixpkgs-review\n```\n\nTo only update sources hashes without updating the version:\n\n```console\n$ nix-update --version=skip nixpkgs-review\n```\n\nTo extract version information from versions with prefixes or suffixes,\na regex can be used\n\n```console\n$ nix-update jq --version-regex 'jq-(.*)'\n```\n\nBy default `nix-update` will locate the file that needs to be patched using the `src` attribute of a derivation.\nIn some cases this heurestic is wrong. One can override the behavior like that:\n\n```console\n$ nix-update hello --override-filename pkgs/applications/misc/hello/default.nix\n```\n\nThe `nix-update` command checks for new releases of a package using the `src`\nattribute. However, in some cases a package may use a non-standard release URL\nthat is not supported by `nix-update`, but still has a repository with release\ninformation. For example, the Signal Desktop package in Nixpkgs fetches updates\nfrom https://updates.signal.org/, but also publishes release information on its\nGitHub page. In such cases, use the `--url` parameter to direct nix-update to\nthe correct repository:\n\n```console\nnix-update --url https://github.com/signalapp/Signal-Desktop --override-filename pkgs/applications/networking/instant-messengers/signal-desktop/default.nix   signal-desktop\n```\n\nWith the `--shell`, `--build`, `--test` and `--run` flags the update can be\ntested. Additionally, the `--review` flag can be used to\ninitiate a run of [nixpkgs-review](https://github.com/Mic92/nixpkgs-review), which will ensure all\ndependent packages can be built.\n\nIn order to ensure consistent formatting, the `--format` flag will invoke [nixfmt](https://github.com/NixOS/nixfmt) (`nixfmt-rfc-style` in nixpkgs).\n\n```console\n# Also runs nix-build\n$ nix-update --build nixpkgs-review\n# Also runs nix-build nixpkgs-review.tests\n$ nix-update --test nixpkgs-review\n# Also runs nix-shell\n$ nix-update --shell nixpkgs-review\n# Also runs nix run\n$ nix-update --run nixpkgs-review\n# Run `nixpkgs-review wip` to validate dependent packages\n$ nix-update --review nixpkgs-review\n# Format file\n$ nix-update --format nixpkgs-review\n```\n\nNix-update also can optionally generate a commit message in the form\n`attribute: old_version -\u003e new_version` with the applied\nversion update:\n\n```console\n$ nix-update --commit bitcoin-abc\n...\n[master 53d68a6a5a9] bitcoin-abc: 0.21.1 -\u003e 0.21.2\n1 file changed, 2 insertions(+), 2 deletions(-)\n```\n\nBy default, nix-update will attempt to update to the next stable version\nof a package. Alphas, betas, release candidates and similar unstable\nreleases will be ignored. This can be affected by changing the parameter\n`version` from its default value `stable` to `unstable`.\n\n```console\n$ nix-update sbt\nNot updating version, already 1.4.6\n\n$ nix-update sbt --version=unstable\nUpdate 1.4.6 -\u003e 1.5.0-M1 in sbt\n```\n\n## Development setup\n\nFirst clone the repo to your preferred location (in the following, we assume `~/` - your home):\n\n```console\n$ git clone https://github.com/Mic92/nix-update/ ~/nix-update\n```\n\nThan enter the dev shell:\n\n```console\n$ cd ~/nix-update\n$ nix develop\n```\n\nChange to the repository that contains the nix files you want to update, i.e. nixpkgs:\n\n```console\n$ cd nixpkgs\n```\n\nNow you can run `nix-update` just by specifying the full path to its executable wrapper:\n\n```console\n$ ~/git/nix-update/bin/nix-update --commit hello\n```\n\n## TODO\n\n- create pull requests\n\n## Known Bugs\n\nnix-update might not work correctly if a file contain multiple packages\nas it performs naive search and replace to update version numbers. This\nmight be a problem if:\n\n- A file contains the same version string for multiple packages.\n- `name` is used instead of `pname` and/or `${version}` is injected into `name`.\n\nRelated discussions:\n\n- \u003chttps://github.com/repology/repology-updater/issues/854\u003e\n- \u003chttps://github.com/NixOS/nixpkgs/issues/68531#issuecomment-533760929\u003e\n\n## Related projects:\n\n- [nixpkgs-update](https://github.com/ryantm/nixpkgs-update) is\n  optimized for mass-updates in nixpkgs while nix-update is better\n  suited for interactive usage that might require user-intervention\n  i.e. fixing the build and testing the result. nix-update is also not\n  limited to nixpkgs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMic92%2Fnix-update","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMic92%2Fnix-update","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMic92%2Fnix-update/lists"}