-
Notifications
You must be signed in to change notification settings - Fork 0
/
operations.nix
84 lines (79 loc) · 2.26 KB
/
operations.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
self,
treefmt-nix,
machines,
server-deploy,
uptime-deploy,
}:
with machines;
let
fmt-module =
{ ... }:
{
projectRootFile = "flake.nix";
programs = {
prettier.enable = true;
stylish-haskell.enable = true;
nixfmt.enable = true;
};
};
format =
let
fmtr = treefmt-nix.lib.evalModule common.pkgs fmt-module;
in
fmtr.config.build.wrapper;
# Dead code
update = hci-inputs: {
effects.outputs.auto-update = {
outputs.hci-effects = common.pkgs.hci-effects.flakeUpdate {
autoMergeMethod = "merge";
gitRemote = hci-inputs.primaryRepo.remoteHttpUrl;
};
when.dayOfMonth = [ 1 ];
};
};
jobs =
hci-inputs:
let
qdhomeshell = "${laptop.drv-name-prefix}:homeshell";
packages = self.packages.${machines.common.system};
in
{
${laptop.hostname}.outputs = {
operating-system = packages.${machines.laptop.hostname};
# home-configuration =
# self.homeConfigurations."${laptop.username}@${laptop.hostname}".activationPackage;
};
# ${phone.hostname}.outputs = {
# os_disk-image = packages."${phone.hostname}-disk-image";
# os_boot-partition = packages."${phone.hostname}-boot-partition";
# };
${server.hostname}.outputs =
with hci-inputs;
if ref == "refs/heads/main" then
{ effects.deployment = server-deploy { inherit ref; }; }
else
{
operating-system = packages.${machines.server.hostname};
website = packages.website;
};
${uptime.hostname}.outputs =
with hci-inputs;
if ref == "refs/heads/main" then
{ hci-effects.deployment = uptime-deploy { inherit ref; }; }
else
{ operating-system = packages.${machines.uptime.hostname}; };
"${ubuntu.drv-name-prefix}:hm".outputs.home-configuration =
self.homeConfigurations."${ubuntu.drv-name-prefix}".activationPackage;
developers.outputs = self.devShells.${common.system};
};
in
{
herculesCI = hci-inputs: {
ciSystems = [ common.system ];
onPush = jobs hci-inputs;
# onSchedule = update hci-inputs;
};
formatter.${common.system} = format;
checks.${common.system}.formatted = format;
}