forked from vlaci/nix-doom-emacs
-
Notifications
You must be signed in to change notification settings - Fork 43
/
checks.nix
62 lines (61 loc) · 2.21 KB
/
checks.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ system }:
{ self, nixpkgs, emacs-overlay, ... }@inputs:
let
inherit (self.outputs.packages.${system}) doom-emacs-example;
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 = builtins.fetchTarball {
url = "https://github.com/nix-community/home-manager/tarball/c485669ca529e01c1505429fa9017c9a93f15559";
sha256 = "1zdclkqg1zg06x986q4s03h574djbk8vyrhyqar9yzk61218vmij";
};
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 = doom-emacs-example;
init-example-el-emacsGit = doom-emacs-example.override {
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)";
}
];
};
}