diff --git a/modules/nix/network/default.nix b/modules/nix/network/default.nix new file mode 100644 index 0000000..4783c4c --- /dev/null +++ b/modules/nix/network/default.nix @@ -0,0 +1,23 @@ +{ + host, + lib, + ... +}: +{ + networking = { + hostName = host; + + nameservers = lib.mkDefault [ + "1.1.1.1" + "1.0.0.1" + "10.50.80.53" + "10.50.80.54" + ]; + }; + + services.resolved.enable = lib.mkDefault false; + + security.pki.certificateFiles = [ + ./root_ca.crt + ]; +} diff --git a/modules/nix/network/root_ca.crt b/modules/nix/network/root_ca.crt new file mode 100644 index 0000000..5985efb --- /dev/null +++ b/modules/nix/network/root_ca.crt @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE----- +MIIBszCCAVqgAwIBAgIRAPCAxajuCEmnXKploQS+KAkwCgYIKoZIzj0EAwIwODEW +MBQGA1UEChMNTW9vbnMgSG9tZSBDQTEeMBwGA1UEAxMVTW9vbnMgSG9tZSBDQSBS +b290IENBMB4XDTI1MTIwNjE4MDgwN1oXDTM1MTIwNDE4MDgwN1owODEWMBQGA1UE +ChMNTW9vbnMgSG9tZSBDQTEeMBwGA1UEAxMVTW9vbnMgSG9tZSBDQSBSb290IENB +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEDw2M0NQMju2zN5ZXwsYaTieWggId +XmRSXjOHW4/pBEI11xk1GkMFbeVmppr1cbcNmbB+fmxoFa+oKguhFDSsdaNFMEMw +DgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwHQYDVR0OBBYEFGuC +UGL5CxdamFfBVC8xH306Wo6xMAoGCCqGSM49BAMCA0cAMEQCIBqWCNWBuwhWDYoi +fpqOqz2HSChOsKCIAgfTJlUUgSlSAiALekUJ+4M+L4/vP4GpkrSovuQ7JOMXV44+ +30Pcx4AoJg== +-----END CERTIFICATE----- + diff --git a/modules/nix/network/wifi.nix b/modules/nix/network/wifi.nix new file mode 100644 index 0000000..dd6281c --- /dev/null +++ b/modules/nix/network/wifi.nix @@ -0,0 +1,24 @@ +_: { + networking = { + networkmanager = { + enable = true; + + dns = "none"; + wifi.powersave = false; + wifi.backend = "wpa_supplicant"; + settings = { + "device"."wifi.scan-rand-mac-address" = "no"; + "connection"."wifi.cloned-mac-address" = "permanent"; + }; + }; + wireless.iwd.enable = false; + }; + + boot.extraModprobeConfig = '' + options cfg80211 ieee80211_regdom=JP + options iwlwifi power_save=0 + options iwlwifi uapsd_disable=1 + ''; + + programs.nm-applet.enable = true; +} diff --git a/modules/nix/user.nix b/modules/nix/user.nix new file mode 100644 index 0000000..ee24a2c --- /dev/null +++ b/modules/nix/user.nix @@ -0,0 +1,21 @@ +{ + userName, + inputs, + ... +}: +{ + imports = [ inputs.home-manager.nixosModules.home-manager ]; + + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + backupFileExtension = "backup"; + users.moons = { + home = { + username = userName; + homeDirectory = "/home/${userName}"; + stateVersion = "26.05"; + }; + }; + }; +} diff --git a/profiles/base.nix b/profiles/base.nix index 19a03c7..c22cfec 100644 --- a/profiles/base.nix +++ b/profiles/base.nix @@ -5,6 +5,9 @@ ../modules/nix/caches.nix ../modules/nix/gc.nix ../modules/nix/hardware + ../modules/nix/user.nix + ../modules/nix/network + ]; + home-manager.users.${userName}.imports = [ ]; - home-manager.users.${userName}.imports = [ ]; } diff --git a/profiles/laptop.nix b/profiles/laptop.nix index dcf88a0..466a1ef 100644 --- a/profiles/laptop.nix +++ b/profiles/laptop.nix @@ -4,6 +4,7 @@ ./gui.nix ../modules/nix/bluetooth.nix ../modules/nix/fingerprint.nix + ../modules/nix/network/wifi.nix ]; home-manager.users.${userName}.imports = [ ]; }