Closed terlar closed 1 year ago
Hello, thank you for trying out twist.
Twist provides two ways to build ELPA packages:
elpa-packages
file and build packages from source.It is better to build packages from source whenever possible. An archive file can become unavailable when the package updates.
Unfortunately, quite a few packages on GNU ELPA seem to require manual intervention (I guess the GNU ELPA maintainers have a lot of private workarounds for those packages), so the latter process is suitable unless :auto-sync t
is specified. An example configuration which builds your configuration has the following inventory entry which restricts source builds to auto-sync packages:
[
# local packages
# GNU elpa from source
{
name = "gnu";
type = "elpa";
path = inputs.gnu-elpa.outPath + "/elpa-packages";
core-src = inputs.emacs.outPath;
auto-sync-only = true;
exclude = [
"bbdb"
];
}
# melpa and non-gnu
...
# GNU elpa from archive
{
type = "archive";
url = "https://elpa.gnu.org/packages/";
}
# more
...
]
Regarding cycle-quotes
, it is built from the archive. The above configuration should work.
For packages on Non-GNU ELPA, most packages can be built from source. See the inventory configuration in the example repository. It builds your configuration.
I did have this configuration and it didn't work:
emacsFromTwist = pkgs.emacsTwist {
emacsPackage = pkgs.emacsPgtkNativeComp.overrideAttrs (_: {version = "29.0.50";});
initFiles = [(pkgs.tangleOrgBabelFile "init.el" ./init.org {})];
lockDir = ./lock;
inventories = [
{
name = "custom";
type = "melpa";
path = ./recipes;
}
{
name = "gnu";
type = "elpa";
path = gnu-elpa.outPath + "/elpa-packages";
core-src = pkgs.emacsPgtkNativeComp.outPath;
auto-sync-only = true;
}
{
name = "melpa";
type = "melpa";
path = melpa.outPath + "/recipes";
}
{
name = "nongnu";
type = "elpa";
path = nongnu-elpa.outPath + "/elpa-packages";
}
{
name = "gnu-archive";
type = "archive";
url = "https://elpa.gnu.org/packages/";
}
];
};
It seems to be due to the other repos that it would be working in your example?
The packages failing (all from ELPA):
~I have still not managed to build it also ran into API rate-limiting now, so have to wait a bit.~ Just managed after this comment. So had to remove all those mentioned ELPA packages or things depending on those.
Shouldn't these packages be fetched from the gnu-archive
?
You can bypass the rate limiting of GitHub by adding a personal access token to ~/.config/nix/nix.conf.
Yes, those failing packages should be built from archives.
Did you run the following command before you build your config? Sorry for not having prepared a proper documentation.
nix run .#lock --impure
Hmm, that was the last missing piece. I could have sworn I tried to evaluate makeApps {lockDirName = "lock";}
and it failed with the same error, so tried going down the path to fix all those errors first. But now when I ran nix run .#lock --impure
it worked, also with those packages enabled again.
I will play around a bit more and let you know if I run into some other errors. I guess the archive ones are only working when you have a lock file right?
I guess the archive ones are only working when you have a lock file right?
Actually, the archive access depends on the mode of operation. I didn't come up with a better way than this in order to avoid access to remote servers in pure builds.
I assume you don't encounter this problem any more. Closing.
OT So I'm finally getting around to explore this and doing my own take on using this and I'm avoiding emacsmirror. /OT
When I try to run the
emacsTwist
function on my configuration and I guess it tries to look up a package from the elpa inventory it fails when trying to findcycle-quotes
. I checked theelpa-packages
file and noticed("cycle-quotes" :url nil)
and I'm guessing that is the case why it is not found.Reading at the top of this file I see:
I'm guessing
:url nil
, e.g. looking insideexternals/<name>
is not currently supported or do you have any other idea why it would fail finding this specific package?