{"id":162217,"url":"https://github.com/ebzzry/barf","last_synced_at":"2026-02-18T07:34:15.817Z","repository":{"id":235038042,"uuid":"759332012","full_name":"ebzzry/barf","owner":"ebzzry","description":"Nixpkgs helper","archived":false,"fork":false,"pushed_at":"2024-02-18T09:46:42.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-14T22:55:55.952Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Common Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ebzzry.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}},"created_at":"2024-02-18T09:46:24.000Z","updated_at":"2024-07-30T18:01:51.000Z","dependencies_parsed_at":"2024-04-22T04:03:04.491Z","dependency_job_id":null,"html_url":"https://github.com/ebzzry/barf","commit_stats":null,"previous_names":["ebzzry/barf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebzzry%2Fbarf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebzzry%2Fbarf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebzzry%2Fbarf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebzzry%2Fbarf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ebzzry","download_url":"https://codeload.github.com/ebzzry/barf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228242102,"owners_count":17890472,"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-01-06T20:22:14.683Z","updated_at":"2024-12-05T05:31:05.021Z","avatar_url":"https://github.com/ebzzry.png","language":"Common Lisp","readme":"# barf 🤮\n\nThis utility provides a single `barf` binary for managing your Nixpkgs and NixOS\ninstallation. It makes it easier, at least for me, instead of memorizing many\ncommands with different interfaces. This is not exhaustive and only covers the\ncommands listed [here](#commands).\n\nThis program was salvaged from\n[ebzzry/scripts](https://github.com/ebzzry/scripts), turning it into a\nrepository of its own, to make it easier to distribute.\n\n\nTable of contents\n-----------------\n\n- [Installation](#installation)\n- [Initialization](#initialization)\n- [Commands](#commands)\n  + [Base commands](#basecommands)\n  + [Channel management](#channelmanagementcommands)\n  + [Channel commands](#channelcommands)\n  + [Upstream commands](#upstreamcommands)\n  + [Querying packages](#querycommands)\n  + [Common commands](#commoncommands)\n  + [Miscellaneous commands](#miscellaneouscommands)\n  + [Prefetch commands](#prefetchcommands)\n- [Usage](#usage)\n- [Notes](#notes)\n\n\n\u003ca name=\"installation\"\u003eInstallation\u003c/a\u003e\n---------------------------------------\n\nInstall the dependencies:\n\n    nix-env -i git sbcl gnumake curl cl-launch bzip2 nix-prefetch-scripts fd ripgrep\n\nThen, install barf:\n\n```bash\nmkdir -p ~/bin ~/common-lisp\ngit clone https://gitlab.common-lisp.net/asdf/asdf ~/common-lisp/asdf\ngit clone https://github.com/ebzzry/barf ~/common-lisp/barf\ncurl -O https://beta.quicklisp.org/quicklisp.lisp\nsbcl --load quicklisp.lisp --eval  '(quicklisp-quickstart:install)' --eval '(let ((ql-util::*do-not-prompt* t)) (ql:add-to-init-file) (ql:quickload :cl-launch) (sb-ext:quit))'\nmake -C ~/common-lisp/barf install\n```\n\n\nOr, in one line:\n\n```bash\nmkdir -p ~/bin ~/common-lisp; git clone https://gitlab.common-lisp.net/asdf/asdf ~/common-lisp/asdf; git clone https://github.com/ebzzry/barf ~/common-lisp/barf; curl -O https://beta.quicklisp.org/quicklisp.lisp; sbcl --load quicklisp.lisp --eval  '(quicklisp-quickstart:install)' --eval '(let ((ql-util::*do-not-prompt* t)) (ql:add-to-init-file)  (ql:quickload :cl-launch) (sb-ext:quit))'; make -C ~/common-lisp/barf install\n```\n\n\n\u003ca name=\"initialization\"\u003eInitialization\u003c/a\u003e\n-------------------------------------------\n\nOn your first run, initialize the databases for the upstream nixpkgs checkout\nand index database:\n\n    barf init\n\nBear in mind that re-running `init` will purge the index and package databases.\n\nPeriodically, run the following command to update the aforementioned databases,\nplus the channels for the user and root:\n\n    barf full-update\n\n\n\u003ca name=\"commands\"\u003eCommands\u003c/a\u003e\n-------------------------------\n\nBelow are the currently available commands. When an option looks like\n`\u003cpackage\u003e` it means it accepts at least one *package* argument. When an option\nlooks like `\u003cpackage?\u003e`it means it accepts zero ore more *package*\narguments. When a command doesn’t have an argument, it means it doesn’t take\nany. The `|` indicates an alternative, shorter name.\n\n### \u003ca name=\"basecommands\"\u003eBase commands\u003c/a\u003e\n\n- `out-path|o-p \u003cpackage\u003e`\n- `which|h \u003cbinary\u003e`\n- `store \u003coptions\u003e`\n- `repl`\n- `pure-shell|shell`\n- `impure-shell|i-s`\n- `rebuild`\n- `rebuild-switch|r-s`\n- `rebuild-switch-upgrade|r-s-u`\n- `instantiate`\n- `eval \u003cexpression\u003e`\n- `grep|g \u003cstring\u003e`\n- `find|fd \u003cpackage\u003e`\n- `install-package|i-p \u003clocation\u003e`\n- `install-package-uri|i-p-u \u003clocation\u003e`\n- `references|r \u003cpackage\u003e`\n- `referrers|R \u003cpackage\u003e`\n- `query-root|q-r`\n- `closure|c \u003cpackage\u003e`\n- `set-flag|s-f \u003coptions\u003e`\n- `option|o \u003coptions\u003e`\n- `garbage-collect|g-c`\n- `garbage-collect-delete|g-c-d`\n\n\n### \u003ca name=\"channelmanagementcommands\"\u003eChannel management\u003c/a\u003e\n\n- `channel|ch \u003coptions\u003e`\n- `channel-list|ch-l`\n- `channel-add|ch-a \u003curl\u003e \u003cname\u003e`\n- `channel-remove|ch-r \u003cname\u003e`\n- `channel-update|ch-u`\n- `channel-name|ch-n`\n- `root-channel|r-ch \u003coptions\u003e`\n- `root-channel-list|r-ch-l`\n- `root-channel-add|r-ch-a \u003curl\u003e \u003cname\u003e`\n- `root-channel-remove|r-ch-r \u003cname\u003e`\n- `root-channel-update|r-ch-u`\n- `root-channel-name|r-ch-n`\n\n\n### \u003ca name=\"upstreamcommands\"\u003eUpstream commands\u003c/a\u003e\n\n- `env|e \u003coptions\u003e`\n- `build|b \u003coptions\u003e`\n- `query|q \u003cpackage\u003e`\n- `upgrade|U \u003cpackage?\u003e`\n- `upgrade-always|U-a \u003cpackage?\u003e`\n- `install|i \u003cpackage\u003e`\n- `Install|I \u003cpackage\u003e`\n- `query-available|q-a`\n- `compare-versions|c-v`\n- `compare-versions-less-than|c-v-l-t`\n- `compare-versions-equal|c-v-e`\n- `compare-versions-greater-than|c-v-g-t`\n- `describe-available|d-a`\n- `index-available|i-a`\n- `search-available|s-a \u003cpackage\u003e`\n- `view-available|v-a`\n- `profile|p \u003cprofile\u003e`\n\n\n### \u003ca name=\"channelcommands\"\u003eChannel commands\u003c/a\u003e\n\n- `channels-env \u003coptions\u003e`\n- `channels-build|c-b \u003coptions\u003e`\n- `channels-query|c-q \u003cpackage\u003e`\n- `channels-upgrade|c-U \u003cpackage?\u003e`\n- `channels-upgrade-always|c-U-a \u003cpackage?\u003e`\n- `channels-install|c-i \u003cpackage\u003e`\n- `channels-Install|c-I \u003cpackage\u003e`\n- `channels-query-available|c-q-a`\n- `channels-compare-versions|c-c-v`\n- `channels-compare-versions-less-than|c-c-v-l-t`\n- `channels-compare-versions-equal|c-c-v-e`\n- `channels-compare-versions-greater-than|c-c-v-g-t`\n- `channels-describe-available|c-d-a`\n- `channels-index-available|c-i-a`\n- `channels-search-available|c-search|s-a|s \u003cpackage\u003e`\n- `channels-view-available|c-v-a`\n- `channels-profile|c-p \u003cprofile\u003e`\n\n\n### \u003ca name=\"querycommands\"\u003eQuerying packages\u003c/a\u003e\n\n- `query-installed|q-i \u003cpackage\u003e`\n- `query-installed-names|q-i-n \u003cpackage\u003e`\n- `search-installed|s-i \u003cpackage\u003e`\n- `index-installed|i-i`\n- `describe-installed|d-i`\n\n\n### \u003ca name=\"commoncommands\"\u003eCommon commands\u003c/a\u003e\n\n- `uninstall|remove|erase|e \u003cpackage\u003e`\n- `build-index|b-i|index \u003cpackage\u003e`\n- `update|u`\n- `full-update|f-u|complete-update`\n- `full-upgrade|f-U|complete-upgrade`\n- `full-search|f-s \u003cpackage\u003e`\n\n\n## \u003ca name=\"miscellaneouscommands\"\u003eMiscellaneous commands\u003c/a\u003e\n\n- `view-packages|v-p`\n- `make`\n- `nix-version`\n- `nixpkgs-version`\n- `nixos-version`\n- `version`\n- `cleanup`\n\n\n### \u003ca name=\"prefetchcommands\"\u003ePrefetch commands\u003c/a\u003e\n\n- `fetch-url \u003coptions\u003e`\n- `fetch-file \u003coptions\u003e`\n- `fetch-git \u003coptions\u003e`\n- `fetch-zip \u003coptions\u003e`\n- `fetch-hg \u003coptions\u003e`\n- `fetch-svn \u003coptions\u003e`\n- `fetch-bzr \u003coptions\u003e`\n- `fetch-cvs \u003coptions\u003e`\n\n\n\u003ca name=\"usage\"\u003eUsage\u003c/a\u003e\n-------------------------\n\nTo install the latest Firefox:\n\n    barf install firefox\n\nTo install the latest Firefox from channels:\n\n    barf channels-install firefox\n\nTo uninstall it:\n\n    barf e firefox\n\nTo search for upstream packages with the name `firefox`:\n\n    barf search firefox\n\nTo search for channel packages with the name `firefox`:\n\n    barf channels-s firefox\n\nTo search for packages from both upstream and channels, with the name `firefox`:\n\n    barf full-searc firefox\n\nTo display the version of Nix, Nixpkgs, and NixOS:\n\n    barf version\n\nTo view the list of installed packages:\n\n    barf query-installed\n\nTo view the list of installed packages, including description:\n\n    barf describe-installed\n\nTo view the Haskell packages from upstream:\n\n    barf view-packages haskellPackages\n\n\nTo install Firefox from upstream on a different profile:\n\n    barf u-p firefox -iA firefox\n\nthen, to use this version of Firefox:\n\n    PATH=$PATH/.barf/profiles/firefox/bin firefox\n\nOn NixOS, to find out which package has the binary `firefox`:\n\n    barf which firefox\n\nTo get the store path of Firefox:\n\n    barf o-p firefox\n\nTo display the `share/` subdirectory of Firefox, with some options to ls:\n\n    barf ls --color -FAtrl firefox/share\n\nTo look for files in upstream containing the string `firefox`:\n\n    barf find firefox\n\nTo grep the case insensitive string `firefox` in the upstream, displaying the\nname of the matching file:\n\n    barf grep -iH firefox\n\nTo garbage collect:\n\n    barf g-c\n\nTo aggressively garbage collect:\n\n    barf g-c-d\n\nTo subscribe to the `nixos-unstable` channel for the current user:\n\n    barf ch-a https://nixos.org/channels/nixos-unstable nixos\n    barf ch-u\n\nTo subscribe to the `nixos-unstable` channel for root:\n\n    barf r-ch-a https://nixos.org/channels/nixos-unstable nixos\n    barf r-ch-u\n\nTo rebuild NixOS from `/etc/nixos/configuration.nix` then perform switch:\n\n    barf r-s\n\nTo rebuild NixOS from `/etc/nixos/configuration.nix`, perform switch, and\nupgrade:\n\n    barf r-s-u\n\nTo update the user channel, root channel, upstream nixpkgs checkout, and index\ndatabase on NixOS with full sudo access:\n\n    barf f-u\n\nTo perform the above, then upgrade the whole NixOS system:\n\n    barf f-U\n\n\n\u003ca name=\"notes\"\u003eNotes\u003c/a\u003e\n-------------------------\n\nIn order for the `which` command to work on NixOS, put this in\n`/etc/nixos/configuration.nix`:\n\n    programs.command-not-found.enable = true;\n\nTo update barf to the latest version:\n\n    cd ~/common-lisp/barf; git pull --rebase origin master; make install\n\nbarf uses [fd](https://github.com/sharkdp/fd) and\n[ripgrep](https://github.com/BurntSushi/ripgrep) for finding files and text\nstrings.\n","funding_links":[],"categories":["Applications"],"sub_categories":["Development Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febzzry%2Fbarf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febzzry%2Fbarf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febzzry%2Fbarf/lists"}