-
Notifications
You must be signed in to change notification settings - Fork 5
/
test.nix
62 lines (50 loc) · 1.53 KB
/
test.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
{ pkgs, ... }:
let
helloWorld = pkgs.writeScriptBin "helloWorld" ''
#!${pkgs.stdenv.shell}
set -euxo pipefail
mkdir -p /home/bbigras/
touch /tmp/bleh.rs
mkdir -p /home/bbigras/Dropbox/emacs
touch /home/bbigras/Dropbox/emacs/custom-server.el
sudo -i -u bbigras /home/bbigras/.nix-profile/bin/emacs -l /home/bbigras/.emacs.d/early-init.el --batch -l /home/bbigras/.emacs.d/init.el --eval "(progn (setq lsp-restart 'ignore) (find-file \"/tmp/bleh.rs\") )"
sudo -i -u bbigras /home/bbigras/.nix-profile/bin/emacs -l /home/bbigras/.emacs.d/early-init.el --batch -l /home/bbigras/.emacs.d/init.el --eval "(progn (setq lsp-restart 'ignore) (find-file \"/tmp/bleh.rs\") )" 2>&1 | (! grep -q Error)
'';
in
{
name = "nix-matrix-yggdrasil-test";
nodes.server = {
imports = [
(import (import ./nix).home-manager)
];
nixpkgs = {
overlays = [
(import (import ./nix).emacs-overlay)
];
};
environment.systemPackages = with pkgs; [
rust-analyzer
helloWorld
];
users.users.bbigras = {
createHome = true;
isNormalUser = true;
};
home-manager.useGlobalPkgs = true;
home-manager.users.bbigras =
{ pkgs, ... }:
{
# imports = [ ./users/bbigras/dev/emacs.nix ];
programs.emacs = {
enable = true;
init.enable = true;
package = pkgs.emacsGit;
};
};
};
testScript = ''
server.start()
server.wait_for_unit("multi-user.target")
server.succeed("helloWorld")
'';
}