!SlMumQZnFjwLRjWFbW:nixos.org

Nix + Doom Emacs

225 Members
Running Doom Emacs with Nix | You probably want https://github.com/nix-community/nix-doom-emacs49 Servers

Load older messages


SenderMessageTime
7 Sep 2023
@JoelMcCracken:matrix.orgJoelMcCrackenyeah i don't know14:03:33
@JoelMcCracken:matrix.orgJoelMcCracken

i imagine it would work like:

  • a user picks a package to install from a list
  • nix installs it
  • emacs loads it within the running process
14:05:37
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred)mhm, it's essentially tearing out the parts of straight&emacs that do network I/O into their own emacs, running inside a nix build14:06:42
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred)which works happily for the top-level imperative emacs usecase (editing your config before rebuilding) but you want to have all of these prefetched in the build process once you're ready to deploy it to your 'prod' machine14:07:22
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred)recursive nix isn't actually a hard dependency-- we can crudely and inefficiently emulate it, but it would make this much more streamlined since it would run through approximately the same codepath in both imperative/Nix sandbox 14:08:44
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred) * recursive nix isn't actually a hard dependency-- we can crudely and inefficiently emulate it, but it would make this much more streamlined since it would run through approximately the same codepath in both the imperative/Nix sandbox usecases14:08:49
@JoelMcCracken:matrix.orgJoelMcCrackenyeah 14:08:55
@JoelMcCracken:matrix.orgJoelMcCrackenwell it depends, what you mean specifically by recursive nix i guess14:09:27
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred)what do you mean by "nix installs it" though? installs it where. i'd think nix gives some store paths or an elisp payload and emacs evals it into the running process14:09:42
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred) like this at runtime but also for the elisp path variable 14:10:15
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred) * like this but at runtime but also for the elisp path variable 14:10:24
@JoelMcCracken:matrix.orgJoelMcCracken

TBD, but my thought was:

  • somehow emacs/nix figures out what the speicifc package should be, versions etc.
  • nix then builds this package, maybe via a standard "emacsWithPackages" or something like that; somehow nix would know how to call its own build process
14:11:05
@JoelMcCracken:matrix.orgJoelMcCracken
  • once this is all built, it can just be added to load-path and then loaded
14:11:33
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred)yes! 14:12:19
@JoelMcCracken:matrix.orgJoelMcCrackenbut yeahwe should be able to share a lot of all of this code14:12:20
@JoelMcCracken:matrix.orgJoelMcCrackenit would be v nice if elpaca had some design input from us14:13:08
@JoelMcCracken:matrix.orgJoelMcCrackenso that we could just interface with it instead of having to hack it14:13:25
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred) my thought was, main Emacs goes "I want this straight recipe (package! blabla :pin "whatever")" and system()s a nix-build --argstr recipe "…", then there's another little Emacs spawned inside the Nix sandbox which is a FOD and has network access, so it goes on fetching that package and then brings the output back through Nix to the main Emacs 14:14:07
@JoelMcCracken:matrix.orgJoelMcCrackenyep14:14:25
@JoelMcCracken:matrix.orgJoelMcCrackentho, FOD?14:14:42
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred)fixed-output derivation, a sorta precondition to getting network access in the nix sandbox14:14:56
@JoelMcCracken:matrix.orgJoelMcCrackenic14:15:03
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred) you know, the hash option you set when you use fetchFromSomething 14:15:06
@JoelMcCracken:matrix.orgJoelMcCrackenk14:15:12
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred) * you know, the hash attr you set when you use fetchFromSomething 14:15:14
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred)i like this (:14:15:42
@JoelMcCracken:matrix.orgJoelMcCrackenyea it sounds cool14:15:52
@JoelMcCracken:matrix.orgJoelMcCrackentho first step would be to get the regular build step working so14:16:11
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred)i think we should work on extracting the "install recipe with straight and get a package" bit out from doom's big mess14:25:16
@ckie:ckie.devckie (they/them; limited keyboard usage, voice preferred)ref for FOD btw: https://nixos.org/manual/nix/unstable/language/advanced-attributes.html?highlight=outputHash#adv-attr-outputHash14:27:27

Show newer messages


Back to Room ListRoom Version: 9