{"id":18391316,"url":"https://github.com/thblt/borg-nix-shell","last_synced_at":"2025-04-12T09:39:08.300Z","repository":{"id":68387272,"uuid":"102730033","full_name":"thblt/borg-nix-shell","owner":"thblt","description":"Build your Borg packages with Nix-Shell","archived":false,"fork":false,"pushed_at":"2018-10-30T20:12:31.000Z","size":23,"stargazers_count":6,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T01:25:27.626Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thblt.png","metadata":{"files":{"readme":"README.org","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":"2017-09-07T11:39:59.000Z","updated_at":"2023-12-09T11:27:05.000Z","dependencies_parsed_at":"2023-07-28T20:00:59.934Z","dependency_job_id":null,"html_url":"https://github.com/thblt/borg-nix-shell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thblt%2Fborg-nix-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thblt%2Fborg-nix-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thblt%2Fborg-nix-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thblt%2Fborg-nix-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thblt","download_url":"https://codeload.github.com/thblt/borg-nix-shell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248548408,"owners_count":21122692,"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-11-06T01:51:27.564Z","updated_at":"2025-04-12T09:39:08.275Z","avatar_url":"https://github.com/thblt.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: Borg-nix-shell: build Borg packages with Nix-Shell\n\n[[https://github.com/emacscollective/borg][Borg]] is a package manager for Emacs storing packages as Git submodules.  Unlike =package.el=, Borg requires that all packages be built locally.  In most cases, all it takes is byte-compiling a few Emacs-Lisp files, which Borg can do in a totally transparent manner.  But some packages require external build tools or libraries, which may not be available on all systems, or not easily installable.\n\n=Borg-nix-shell= plugs into Borg to run [[https://emacsmirror.net/manual/borg/Git-variables.html#Git-variables][build-steps]] through =nix-shell=, from the [[https://nixos.org][Nix package manager]].\n\n* Usage\n\nAssimilate =borg-nix-shell= (or just copy its contents somewhere in your =init.el=) then:\n\n#+BEGIN_SRC emacs-lisp\n  (setq borg-build-shell-command 'borg-nix-shell-build-command)\n#+END_SRC\n\nThen, for each package requiring it:\n\n - Set =submodules.DRONE.build-nix-shell-packages= to a list of packages to pass to =nix-shell= with the =-p= argument.\n\n - *Or* set =submodules.DRONE.build-nix-shell-file= to the path of a Nix file, which will be passed to =nix-shell= as the last positional argument.\n\n - *Or* set =submodules.DRONE.build-nix-shell-disable= to any value to run the build-steps unmodified.  This has been implemented for packages which provide Nix-aware build systems, like PDF-Tools.\n\nIf none of these variables are provided, =borg-nix-shell= adds an empty =-p= argument to =nix-shell= /unless/ the drone's work tree has a =shell.nix= or =default.nix= at its root, in which case no arguments are added and =nix-shell= should pick the correct file.\n\nAs an example, here's how I configure [[https://github.com/politza/pdf-tools][PDF Tools]]:\n\n#+BEGIN_EXAMPLE\n[submodule \"pdf-tools\"]\n\tpath = lib/pdf-tools\n\turl = git@github.com:politza/pdf-tools.git\n  build-nix-shell-packages = gnumake automake autoconf pkgconfig libpng zlib poppler_gi\n  build-step = make ./server\n#+END_EXAMPLE\n\n* Configuration\n\nThere's a =borg-nix-shell-build-use-pure-shell= variable which determines if =nix-shell= should be passed the =--pure= flag.  It defaults to =t=, and you really, really shouldn't change it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthblt%2Fborg-nix-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthblt%2Fborg-nix-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthblt%2Fborg-nix-shell/lists"}