summaryrefslogtreecommitdiffstats
path: root/modules/hardware/network.nix
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2024-01-07 12:00:08 -0500
committerJon Santmyer <jon@jonsantmyer.com>2024-01-07 12:00:08 -0500
commit7b79203f54853733d4fae88943829d0e24e6e49f (patch)
treea352d199fad7453332b9308a6295164157729f27 /modules/hardware/network.nix
parent184bd30bcb303104a4981ac742d8f8961c5477e7 (diff)
downloadnix-config-7b79203f54853733d4fae88943829d0e24e6e49f.tar.gz
nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.tar.bz2
nix-config-7b79203f54853733d4fae88943829d0e24e6e49f.zip
massive overhaul
Diffstat (limited to 'modules/hardware/network.nix')
-rw-r--r--modules/hardware/network.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/hardware/network.nix b/modules/hardware/network.nix
new file mode 100644
index 0000000..8c54349
--- /dev/null
+++ b/modules/hardware/network.nix
@@ -0,0 +1,27 @@
+{
+ config,
+ options,
+ lib,
+ ...
+}: let
+ networkConfig = config.modules.hardware.network;
+ device = config.modules.device;
+in {
+ options.modules.hardware.network = {
+ enable = lib.mkOption {
+ type = lib.types.bool;
+ default = true;
+ };
+ };
+
+ config = lib.mkIf (networkConfig.enable) {
+ networking = {
+ hostName = device.name;
+ hostId = builtins.substring 0 8 (
+ builtins.hashString "md5" config.networking.hostName
+ );
+ networkmanager.enable = true;
+ };
+ user.extraGroups = ["networkmanager"];
+ };
+}