mirror of
https://github.com/nix-community/nix-doom-emacs
synced 2025-08-11 13:07:28 -05:00
Fix args and README; add check for doomPackageDir change
This commit is contained in:
35
.github/workflows/check-build.yml
vendored
35
.github/workflows/check-build.yml
vendored
@ -108,3 +108,38 @@ jobs:
|
|||||||
if: ${{ !steps.cache-nix-store-emacsGit.outputs.cache-hit }}
|
if: ${{ !steps.cache-nix-store-emacsGit.outputs.cache-hit }}
|
||||||
run: |
|
run: |
|
||||||
nix-store --export $(nix-store -qR /nix/store/*-doom-emacs) > nix-store.dump
|
nix-store --export $(nix-store -qR /nix/store/*-doom-emacs) > nix-store.dump
|
||||||
|
check-splitdir:
|
||||||
|
name: Flake Check splitdir (x86_64 only)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
# Nix Flakes doesn't work on shallow clones
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: cachix/install-nix-action@v17
|
||||||
|
with:
|
||||||
|
extra_nix_config: |
|
||||||
|
extra-substituters = https://nix-community.cachix.org
|
||||||
|
extra-trusted-public-keys = nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
|
||||||
|
- name: Retrieve /nix/store archive
|
||||||
|
uses: actions/cache@v3
|
||||||
|
id: cache-nix-store
|
||||||
|
with:
|
||||||
|
path: nix-store.dump
|
||||||
|
key: nix-store-${{ hashFiles('flake.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
nix-store-
|
||||||
|
- name: Import /nix/store contents
|
||||||
|
if: ${{ steps.cache-nix-store.outputs.cache-hit }}
|
||||||
|
run: |
|
||||||
|
if [[ -f nix-store.dump ]]; then
|
||||||
|
nix-store --import < nix-store.dump || true
|
||||||
|
rm nix-store.dump
|
||||||
|
fi
|
||||||
|
- name: Run checks in emacs
|
||||||
|
run: |
|
||||||
|
nix build .#checks.x86_64-linux.init-example-el-splitdir
|
||||||
|
- name: Export /nix/store contents
|
||||||
|
if: ${{ !steps.cache-nix-store.outputs.cache-hit }}
|
||||||
|
run: |
|
||||||
|
nix-store --export $(nix-store -qR /nix/store/*-doom-emacs) > nix-store.dump
|
||||||
|
22
checks.nix
22
checks.nix
@ -41,4 +41,26 @@ in
|
|||||||
dependencyOverrides = inputs;
|
dependencyOverrides = inputs;
|
||||||
emacsPackages = with pkgs; emacsPackagesFor emacsGit;
|
emacsPackages = with pkgs; emacsPackagesFor emacsGit;
|
||||||
};
|
};
|
||||||
|
init-example-el-splitdir = self.outputs.package.${system} {
|
||||||
|
dependencyOverrides = inputs;
|
||||||
|
doomPrivateDir = pkgs.linkFarm "my-doom-packages" [
|
||||||
|
{ name = "config.el"; path = ./test/doom.d/config.el; }
|
||||||
|
{ name = "init.el"; path = ./test/doom.d/init.el; }
|
||||||
|
# Should *not* fail because we're building our straight environment
|
||||||
|
# using the doomPackageDir, not the doomPrivateDir.
|
||||||
|
{
|
||||||
|
name = "packages.el";
|
||||||
|
path = pkgs.writeText "packages.el" "(package! not-a-valid-package)";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
doomPackageDir = pkgs.linkFarm "my-doom-packages" [
|
||||||
|
# straight needs a (possibly empty) `config.el` file to build
|
||||||
|
{ name = "config.el"; path = pkgs.emptyFile; }
|
||||||
|
{ name = "init.el"; path = ./test/doom.d/init.el; }
|
||||||
|
{
|
||||||
|
name = "packages.el";
|
||||||
|
path = pkgs.writeText "packages.el" "(package! inheritenv)";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
13
default.nix
13
default.nix
@ -13,11 +13,14 @@
|
|||||||
# straight needs a (possibly empty) `config.el` file to build
|
# straight needs a (possibly empty) `config.el` file to build
|
||||||
{ name = "config.el"; path = pkgs.emptyFile; }
|
{ name = "config.el"; path = pkgs.emptyFile; }
|
||||||
{ name = "init.el"; path = ./doom.d/init.el; }
|
{ name = "init.el"; path = ./doom.d/init.el; }
|
||||||
{ name = "packages.el"; path = pkgs.writeText "(package! inheritenv)"; }
|
{
|
||||||
|
name = "packages.el";
|
||||||
|
path = pkgs.writeText "packages.el" "(package! inheritenv)";
|
||||||
|
}
|
||||||
{ name = "modules"; path = ./my-doom-module; }
|
{ name = "modules"; path = ./my-doom-module; }
|
||||||
];
|
];
|
||||||
*/
|
*/
|
||||||
, doomPackageDir ? null
|
, doomPackageDir ? doomPrivateDir
|
||||||
/* Extra packages to install
|
/* Extra packages to install
|
||||||
|
|
||||||
Useful for non-emacs packages containing emacs bindings (e.g.
|
Useful for non-emacs packages containing emacs bindings (e.g.
|
||||||
@ -123,8 +126,6 @@ let
|
|||||||
# Bundled version of `emacs-overlay`
|
# Bundled version of `emacs-overlay`
|
||||||
emacs-overlay = import (lock "emacs-overlay") pkgs pkgs;
|
emacs-overlay = import (lock "emacs-overlay") pkgs pkgs;
|
||||||
|
|
||||||
doomPackageInstallDir = if doomPackageDir == null then doomPrivateDir else doomPackageDir;
|
|
||||||
|
|
||||||
# Stage 2: install dependencies and byte-compile prepared source
|
# Stage 2: install dependencies and byte-compile prepared source
|
||||||
doomLocal = let
|
doomLocal = let
|
||||||
straight-env = pkgs.callPackage (lock "nix-straight") {
|
straight-env = pkgs.callPackage (lock "nix-straight") {
|
||||||
@ -146,7 +147,7 @@ let
|
|||||||
phases = [ "installPhase" ];
|
phases = [ "installPhase" ];
|
||||||
nativeBuildInputs = [ git ];
|
nativeBuildInputs = [ git ];
|
||||||
preInstall = ''
|
preInstall = ''
|
||||||
export DOOMDIR=${doomPackageInstallDir}
|
export DOOMDIR=${doomPackageDir}
|
||||||
export DOOMLOCALDIR=$(mktemp -d)/local/
|
export DOOMLOCALDIR=$(mktemp -d)/local/
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
@ -164,7 +165,7 @@ let
|
|||||||
phases = [ "installPhase" ];
|
phases = [ "installPhase" ];
|
||||||
nativeBuildInputs = [ git ];
|
nativeBuildInputs = [ git ];
|
||||||
preInstall = ''
|
preInstall = ''
|
||||||
export DOOMDIR=${doomPackageInstallDir}
|
export DOOMDIR=${doomPackageDir}
|
||||||
export DOOMLOCALDIR=$out/
|
export DOOMLOCALDIR=$out/
|
||||||
|
|
||||||
# Create a bogus $HOME directory because gccEmacs is known to require
|
# Create a bogus $HOME directory because gccEmacs is known to require
|
||||||
|
Reference in New Issue
Block a user