The other part of dotfiles
This commit is contained in:
parent
2fbfed0e7a
commit
9f1ba4a64b
25 changed files with 1089 additions and 0 deletions
18
modules/networking/avahi.nix
Normal file
18
modules/networking/avahi.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
cfg = config.avahi;
|
||||
in
|
||||
{
|
||||
options.avahi = {
|
||||
enable = lib.mkEnableOption "Enable Avahi and apply customization module";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
6
modules/networking/default.nix
Normal file
6
modules/networking/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./avahi.nix
|
||||
./tailscale.nix
|
||||
];
|
||||
}
|
||||
39
modules/networking/tailscale.nix
Normal file
39
modules/networking/tailscale.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
cfg = config.tailscale;
|
||||
in
|
||||
{
|
||||
options.tailscale = {
|
||||
enable = lib.mkEnableOption "Enable Tailscale module";
|
||||
|
||||
authKeyFile = lib.mkOption {
|
||||
default = "";
|
||||
type = config.services.tailscale.authKeyFile.type;
|
||||
description = config.services.tailscale.authKeyFile.description;
|
||||
};
|
||||
|
||||
exitNode = lib.mkOption {
|
||||
default = "";
|
||||
description = ''
|
||||
The tailscale IP of the optional exit node.
|
||||
'';
|
||||
};
|
||||
|
||||
extraUpFlags = lib.mkOption {
|
||||
default = "";
|
||||
type = config.services.tailscale.extraUpFlags.type;
|
||||
description = config.services.tailscale.extraUpFlags.description;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
authKeyFile = cfg.authKeyFile;
|
||||
useRoutingFeatures = if cfg.exitNode == "" then "none" else "both";
|
||||
extraUpFlags = [ "--exit-node=${cfg.exitNode}" ] ++ cfg.extraUpFlags;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue