More wireless networking to module
This commit is contained in:
parent
61bdd78444
commit
30e88a3859
@ -29,21 +29,6 @@
|
|||||||
|
|
||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
|
|
||||||
age.secrets."passwords/networks.age" = {
|
|
||||||
file = "${inputs.secrets}/passwords/networks.age";
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
wireless = {
|
|
||||||
enable = true;
|
|
||||||
interfaces = [ "wlan0" ];
|
|
||||||
environmentFile = config.age.secrets."passwords/networks.age".path;
|
|
||||||
networks = {
|
|
||||||
"Apollo 600 Mbps".psk = "@PSK_APOLLO@";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -109,6 +94,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
|
networking = {
|
||||||
|
wireless = {
|
||||||
|
enable = true;
|
||||||
|
interfaces = [ "wlan0" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
services = {
|
services = {
|
||||||
borgmatic = {
|
borgmatic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
./editors/neovim
|
./editors/neovim
|
||||||
./editors/vscode.nix
|
./editors/vscode.nix
|
||||||
./networking/tailscale.nix
|
./networking/tailscale.nix
|
||||||
|
./networking/wireless.nix
|
||||||
./security/gpg.nix
|
./security/gpg.nix
|
||||||
./security/pass.nix
|
./security/pass.nix
|
||||||
./services/borgmatic
|
./services/borgmatic
|
||||||
|
36
modules/networking/wireless.nix
Normal file
36
modules/networking/wireless.nix
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{ config, lib, pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let cfg = config.modules.networking.wireless;
|
||||||
|
in {
|
||||||
|
options.modules.networking.wireless = {
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = mdDoc "Automatically connect to known networks";
|
||||||
|
};
|
||||||
|
interfaces = mkOption {
|
||||||
|
default = [ ]; # All interfaces
|
||||||
|
example = [ "wlan0" ];
|
||||||
|
description = mdDoc "Interfaces for `wpa_supplicant` to bind to";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
age.secrets."passwords/networks" = {
|
||||||
|
file = "${inputs.secrets}/passwords/networks.age";
|
||||||
|
};
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
wireless = {
|
||||||
|
enable = true;
|
||||||
|
interfaces = cfg.interfaces;
|
||||||
|
environmentFile = config.age.secrets.passwords/networks.path;
|
||||||
|
networks = {
|
||||||
|
"Apollo 600 Mbps".psk = "@PSK_APOLLO@";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user