-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdeploy.nix
46 lines (40 loc) · 1.16 KB
/
deploy.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
{ inputs, ... }:
let
inherit (inputs) self deploy-rs nixpkgs;
inherit (nixpkgs) lib;
genNode = hostName: nixosCfg:
let
inherit (self.hosts.${hostName}) address hostPlatform remoteBuild sshOpts;
inherit (deploy-rs.lib.${hostPlatform}) activate;
in
{
inherit remoteBuild sshOpts;
hostname = address;
profiles.system.path = activate.nixos nixosCfg;
};
genNixOnDroid = hostName: nixosCfg:
let
inherit (self.hosts.${hostName}) address hostPlatform remoteBuild sshOpts;
inherit (deploy-rs.lib.${hostPlatform}) activate;
pixel6 = nixosCfg.activationPackage;
in
{
inherit remoteBuild sshOpts;
hostname = address;
# to prevent using sudo
sshUser = "nix-on-droid";
user = "nix-on-droid";
profiles.system.path = activate.custom
pixel6
(pixel6 + "/activate");
};
in
{
# XXX: auto-rollback is too noisy since any service failing will cause it to
# go haywire.
autoRollback = false;
magicRollback = true;
user = "root";
nodes = lib.mapAttrs genNode self.nixosConfigurations //
lib.mapAttrs genNixOnDroid self.nixondroidConfigurations;
}