-
Notifications
You must be signed in to change notification settings - Fork 2
/
hive.nix
62 lines (55 loc) · 2.49 KB
/
hive.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
let
selectNixfile = import ./select-nixfile.nix;
nixpkgsConfig = import ./nixpkgs-config.nix;
in
{
meta = {
# Override to pin the Nixpkgs version (recommended). This option
# accepts one of the following:
# - A path to a Nixpkgs checkout
# - The Nixpkgs lambda (e.g., import <nixpkgs>)
# - An initialized Nixpkgs attribute set
nixpkgs = selectNixfile nixpkgsConfig.default;
# You can also override Nixpkgs by node!
nodeNixpkgs = builtins.mapAttrs (n: v: selectNixfile v) nixpkgsConfig;
# If your Colmena host has nix configured to allow for remote builds
# (for nix-daemon, your user being included in trusted-users)
# you can set a machines file that will be passed to the underlying
# nix-store command during derivation realization as a builders option.
# For example, if you support multiple orginizations each with their own
# build machine(s) you can ensure that builds only take place on your
# local machine and/or the machines specified in this file.
# machinesFile = ./machines.client-a;
};
defaults = { lib, config, name, ... }: {
# This module will be imported by all hosts
imports = [
./common.nix
];
# The name and nodes parameters are supported in Colmena,
# allowing you to reference configurations in other nodes.
networking.hostName = name;
# I can't imagine a scenario where I wouldn't want the closure to be built
# on the machine itself.
deployment.buildOnTarget = true;
# Allow desktop machines to be managed locally
deployment.allowLocalDeployment = config.custom.desktop.enable;
deployment.targetUser = null; # Don't specify
deployment.targetHost = config.lib.custom.concatDomain [
(lib.toLower name)
config.custom.acme.primaryDomain
];
# By default, Colmena will replace unknown remote profile
# (unknown means the profile isn't in the nix store on the
# host running Colmena) during apply (with the default goal,
# boot, and switch).
# If you share a hive with others, or use multiple machines,
# and are not careful to always commit/push/pull changes
# you can accidentaly overwrite a remote profile so in those
# scenarios you might want to change this default to false.
# deployment.replaceUnknownProfiles = true;
};
}
// builtins.mapAttrs
(n: v: { ... }: { imports = [ v ]; }) # TODO set deployment.targetHost based on hostname # actually, do that in some custom module, you have the name input anyways
(import ./configs)