mirror of
https://github.com/nix-community/nix-doom-emacs
synced 2025-08-13 13:13:36 -05:00
Merge pull request #200 from thiagokokada/add-hm-module-check
Add Home-Manager module check
This commit is contained in:
38
.github/workflows/check-build.yml
vendored
38
.github/workflows/check-build.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
id: cache-nix-store
|
||||
with:
|
||||
path: nix-store.dump
|
||||
key: nix-store-${{ hashFiles('flake.*') }}
|
||||
key: nix-store-${{ hashFiles('flake.lock') }}
|
||||
restore-keys: |
|
||||
nix-store-
|
||||
- name: Import /nix/store contents
|
||||
@@ -41,6 +41,40 @@ jobs:
|
||||
if: ${{ !steps.cache-nix-store.outputs.cache-hit }}
|
||||
run: |
|
||||
nix-store --export $(nix-store -qR /nix/store/*-doom-emacs) > nix-store.dump
|
||||
check-home-manager:
|
||||
name: Home-Manager module (x86_64 only)
|
||||
needs: check-emacs
|
||||
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:
|
||||
name: nix-community
|
||||
- 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 Home-Manager module
|
||||
run: |
|
||||
nix build .#checks.x86_64-linux.home-manager-module
|
||||
- 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
|
||||
check-emacsGit:
|
||||
name: Flake Check emacsGit (x86_64 only)
|
||||
runs-on: ubuntu-latest
|
||||
@@ -57,7 +91,7 @@ jobs:
|
||||
id: cache-nix-store-emacsGit
|
||||
with:
|
||||
path: nix-store.dump
|
||||
key: nix-store-emacsGit-${{ hashFiles('flake.*') }}
|
||||
key: nix-store-emacsGit-${{ hashFiles('flake.lock') }}
|
||||
restore-keys: |
|
||||
nix-store-emacsGit-
|
||||
- name: Import /nix/store contents
|
||||
|
46
checks.nix
Normal file
46
checks.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{ system }:
|
||||
{ self, nixpkgs, emacs-overlay, ... }@inputs:
|
||||
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
# we are not using emacs-overlay's flake.nix here,
|
||||
# to avoid unnecessary inputs to be added to flake.lock;
|
||||
# this means we need to import the overlay in a hack-ish way
|
||||
overlays = [ (import emacs-overlay) ];
|
||||
};
|
||||
# we are cloning HM here for the same reason as above, to avoid
|
||||
# an extra additional input to be added to flake
|
||||
home-manager = pkgs.fetchFromGitHub {
|
||||
owner = "nix-community";
|
||||
repo = "home-manager";
|
||||
rev = "8160b3b45b8457d58d2b3af2aeb2eb6f47042e0f";
|
||||
sha256 = "sha256-/aN3p2LaRNVXf7w92GWgXq9H5f23YRQPOvsm3BrBqzU=";
|
||||
};
|
||||
in
|
||||
{
|
||||
home-manager-module = (import "${home-manager}/modules" {
|
||||
inherit pkgs;
|
||||
configuration = {
|
||||
imports = [ self.outputs.hmModule ];
|
||||
home = {
|
||||
username = "nix-doom-emacs";
|
||||
homeDirectory = "/tmp";
|
||||
stateVersion = "22.11";
|
||||
};
|
||||
programs.doom-emacs = {
|
||||
enable = true;
|
||||
doomPrivateDir = ./test/doom.d;
|
||||
};
|
||||
};
|
||||
}).activationPackage;
|
||||
init-example-el = self.outputs.package.${system} {
|
||||
doomPrivateDir = ./test/doom.d;
|
||||
dependencyOverrides = inputs;
|
||||
};
|
||||
init-example-el-emacsGit = self.outputs.package.${system} {
|
||||
doomPrivateDir = ./test/doom.d;
|
||||
dependencyOverrides = inputs;
|
||||
emacsPackages = with pkgs; emacsPackagesFor emacsGit;
|
||||
};
|
||||
}
|
@@ -1,13 +1,13 @@
|
||||
{ # The files would be going to ~/.config/doom (~/.doom.d)
|
||||
doomPrivateDir
|
||||
/* Extra packages to install
|
||||
/* Extra packages to install
|
||||
|
||||
Useful for non-emacs packages containing emacs bindings (e.g.
|
||||
mu4e).
|
||||
|
||||
Example:
|
||||
extraPackages = epkgs: [ pkgs.mu ];
|
||||
*/
|
||||
*/
|
||||
, extraPackages ? epkgs: [ ]
|
||||
/* Extra configuration to source during initialization
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
Only used to get emacs package, if `bundledPackages` is set.
|
||||
*/
|
||||
, emacsPackages
|
||||
/* Overlay to customize emacs (elisp) dependencies
|
||||
/* Overlay to customize emacs (elisp) dependencies
|
||||
|
||||
See overrides.nix for addition examples.
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
buildInputs = esuper.buildInputs ++ [ pkgs.git ];
|
||||
});
|
||||
};
|
||||
*/
|
||||
*/
|
||||
, emacsPackagesOverlay ? self: super: { }
|
||||
/* Use bundled revision of github.com/nix-community/emacs-overlay
|
||||
as `emacsPackages`.
|
||||
|
23
flake.nix
23
flake.nix
@@ -99,28 +99,7 @@
|
||||
package = { dependencyOverrides ? { }, ... }@args:
|
||||
pkgs.callPackage self
|
||||
(args // { dependencyOverrides = (inputs // dependencyOverrides); });
|
||||
}) // eachSystem [ "x86_64-linux" "aarch64-darwin" ] (system: {
|
||||
checks =
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
# we are not using emacs-overlay's flake.nix here,
|
||||
# to avoid unnecessary inputs to be added to flake.lock;
|
||||
# this means we need to import the overlay in a hack-ish way
|
||||
overlays = [ (import emacs-overlay) ];
|
||||
};
|
||||
in
|
||||
{
|
||||
init-example-el = self.outputs.package.${system} {
|
||||
doomPrivateDir = ./test/doom.d;
|
||||
dependencyOverrides = inputs;
|
||||
};
|
||||
init-example-el-emacsGit = self.outputs.package.${system} {
|
||||
doomPrivateDir = ./test/doom.d;
|
||||
dependencyOverrides = inputs;
|
||||
emacsPackages = with pkgs; emacsPackagesFor emacsGit;
|
||||
};
|
||||
};
|
||||
checks = import ./checks.nix { inherit system; } inputs;
|
||||
}) // {
|
||||
hmModule = import ./modules/home-manager.nix inputs;
|
||||
};
|
||||
|
Reference in New Issue
Block a user