dotfiles/nixos/flake/system/network.nix.org
2025-03-05 22:17:31 -06:00

55 lines
1.3 KiB
Org Mode

#+title: Network Configuration
Open the network configuration.
#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes
{ config, lib, pkgs, ... }:
{
#+end_src
This system is called =nixos=.
#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes
networking.hostName = "nixos";
#+end_src
I use NetworkManager to configure my network.
#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes
networking.networkmanager.enable = true;
#+end_src
Enable Bluetooth at boot.
#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
services.blueman.enable = true;
#+end_src
Enable printing.
#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes
services.printing.enable = true;
#+end_src
Enable SSH.
#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes
services.openssh.enable = true;
#+end_src
Set up my firewall.
#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes
networking.firewall = {
allowedTCPPorts = [ ];
allowedUDPPorts = [ ];
};
environment.etc = {
"openvpn/update-resolv-conf" = {
source = ./update-resolv-conf.sh;
mode = "0700";
};
};
#+end_src
Close the network configuration.
#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes
}
#+end_src