Skip to content

Isolate the dev-only flake inputs to improve performance #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/update-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
schedule:
- cron: '0 15 * * 1'
workflow_dispatch:
pull_request:
paths:
- dev/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
60 changes: 60 additions & 0 deletions dev/flake-module.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{ inputs, ... }:
{
perSystem =
{
system,
pkgs,
self',
lib,
...
}:
let
emacsPackages = inputs.emacs-ci.packages.${system};
in
{
_module.args.pkgs = inputs.nixpkgs.legacyPackages.${system}.extend inputs.twist.overlays.default;

devShells = {
default = pkgs.mkShell { buildInputs = [ pkgs.just ]; };
};

packages = {
default = pkgs.linkFarm "default" (
[
{
name = "default.nix";
path = pkgs.writeText "emacs-builtins-default-nix" ''{${
lib.concatMapStrings (name: "${name} = import ./${name}.nix;\n") (builtins.attrNames emacsPackages)
}}'';
}
]
++ (lib.mapAttrsToList (emacsName: emacsPackage: {
name = "${emacsName}.nix";
path =
pkgs.runCommand "build-${emacsName}-builtins-nix"
{
buildInputs = [ emacsPackage ];
}
''
EMACS_VERSION="$(emacs --version \
| grep -F "GNU Emacs" \
| grep -oE "[[:digit:]]+(:?\.[[:digit:]]+)+")"
echo >>$out '{'
echo >>$out " version = \"''${EMACS_VERSION}\";"
echo >>$out ' libraries = ['
sed -e 's/^/"/' -e 's/$/"/' ${
(pkgs.emacsTwist {
inherit emacsPackage;
initFiles = [ ];
lockDir = null;
inventories = [ ];
}).builtinLibraryList
} >>$out
echo >>$out ' ];'
echo >>$out '}'
'';
}) emacsPackages)
);
};
};
}
Loading