parent
4a2ad39114
commit
49dc072b81
56 changed files with 684 additions and 506 deletions
modules/server
|
@ -2,11 +2,16 @@
|
|||
inherit (lib) mkOption types;
|
||||
in {
|
||||
imports = [
|
||||
./sshd.nix
|
||||
./tailscale.nix
|
||||
./sshd
|
||||
./tailscale
|
||||
];
|
||||
|
||||
options.roles.server = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
description = ''
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
cfg = config.roles.server;
|
||||
in {
|
||||
config = mkIf cfg.sshd.enable {
|
||||
config = mkIf (cfg.enable && cfg.sshd.enable) {
|
||||
services = {
|
||||
openssh = {
|
||||
enable = true;
|
||||
|
@ -29,5 +29,5 @@ in {
|
|||
};
|
||||
|
||||
# For accurate stack trace
|
||||
_file = ./sshd.nix;
|
||||
_file = ./default.nix;
|
||||
}
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
cfg = config.roles.server;
|
||||
in {
|
||||
config = mkIf cfg.tailscale.enable {
|
||||
config = mkIf (cfg.enable && cfg.tailscale.enable) {
|
||||
services = {
|
||||
tailscale = {
|
||||
enable = true;
|
||||
|
@ -48,5 +48,5 @@ in {
|
|||
};
|
||||
|
||||
# For accurate stack trace
|
||||
_file = ./tailscale.nix;
|
||||
_file = ./default.nix;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue