This repository has been archived by the owner on Aug 5, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmodule.nix
69 lines (61 loc) · 1.96 KB
/
module.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
{
config,
pkgs,
lib,
...
}: let
inherit (lib.options) mkOption;
inherit (lib.types) nullOr bool str strMatching;
env = config.modules.usrEnv;
in {
options.meta = {
hostname = mkOption {
type = str;
default = config.networking.hostName;
readOnly = true;
description = ''
The canonical hostname of the machine.
Is usually used to identify, i.e., name machines internally
or on the same Headscale network. This option must be declared
in {file}`hosts.nix` alongside host system.
'';
};
system = mkOption {
type = str;
default = pkgs.stdenv.system;
readOnly = true;
description = ''
The architecture of the machine.
By default, this is is an alias for {option}`pkgs.stdenv.system` and
{option}`nixpkgs.hostPlatform` in a top-level configuration.
'';
};
nodeAddress = mkOption {
type = nullOr (strMatching "^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$"); # :D?
default = null;
readOnly = true;
description = ''
The node address of the host on an internal network.
This will be used to communicate between machines directly
by using the internal network address instead of hostnames
on, e.g., a Tailscale network.
'';
};
isWayland = mkOption {
type = bool;
# TODO: there must be a better way to do this
default = with env.desktops; (sway.enable || hyprland.enable);
defaultText = "This will default to true if a Wayland compositor has been enabled";
description = ''
Whether to enable Wayland exclusive modules, this contains a wariety
of packages, modules, overlays, XDG portals and so on.
Generally includes:
- Wayland nixpkgs overlay
- Wayland only services
- Wayland only programs
- Wayland compatible versions of packages as opposed
to the defaults
'';
};
};
}