From 455f8dadccc48eae14c0db64f73697981202518b Mon Sep 17 00:00:00 2001 From: Tasia Iso Date: Mon, 22 Apr 2024 21:24:54 +0200 Subject: [PATCH] b --- common/base.nix | 4 ++-- common/components/de/plasma6.nix | 9 +++++++++ common/components/{wm => dm}/greetd.nix | 0 common/components/{wm => dm}/sddm.nix | 0 common/components/networking.nix | 9 +-------- common/components/packages.nix | 8 ++++++-- common/components/security.nix | 2 +- common/hardware/bluetooth.nix | 4 ++++ common/hardware/tpm2.nix | 5 +++++ common/hardware/wifi.nix | 10 ++++++++++ common/hardware/wireless.nix | 6 ++++++ hosts/new-new-phoenix/configuration.nix | 16 ++++++---------- 12 files changed, 50 insertions(+), 23 deletions(-) rename common/components/{wm => dm}/greetd.nix (100%) rename common/components/{wm => dm}/sddm.nix (100%) create mode 100644 common/hardware/bluetooth.nix create mode 100644 common/hardware/tpm2.nix create mode 100644 common/hardware/wifi.nix create mode 100644 common/hardware/wireless.nix diff --git a/common/base.nix b/common/base.nix index f53a7b8..8a94615 100644 --- a/common/base.nix +++ b/common/base.nix @@ -46,7 +46,7 @@ }) config.nix.registry; - nixpkgs = { + nixpkgs = { overlays = [ outputs.overlays.additions outputs.overlays.modifications @@ -60,7 +60,7 @@ programs.gnupg.agent = { enable = true; enableSSHSupport = true; - }; + }; services = { fwupd.enable = true; diff --git a/common/components/de/plasma6.nix b/common/components/de/plasma6.nix index a105358..c73ca5b 100644 --- a/common/components/de/plasma6.nix +++ b/common/components/de/plasma6.nix @@ -3,6 +3,15 @@ ./plasma-packages.nix ]; + services.displayManager = { + sddm = { + enable = true; + wayland.enable = true; + }; + + defaultSession = "plasma"; + }; + services.desktopManager.plasma6.enable = true; # Use ksshaskpass to access stored secrets diff --git a/common/components/wm/greetd.nix b/common/components/dm/greetd.nix similarity index 100% rename from common/components/wm/greetd.nix rename to common/components/dm/greetd.nix diff --git a/common/components/wm/sddm.nix b/common/components/dm/sddm.nix similarity index 100% rename from common/components/wm/sddm.nix rename to common/components/dm/sddm.nix diff --git a/common/components/networking.nix b/common/components/networking.nix index 98b676a..a6a61ff 100644 --- a/common/components/networking.nix +++ b/common/components/networking.nix @@ -2,14 +2,7 @@ networking = { networkmanager = { enable = true; - wifi = { - powersave = true; - scanRandMacAddress = true; - # XXX https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1091 - #backend = "iwd"; - # Generate a random MAC for each WiFi and associate the two permanently. - macAddress = "stable"; - }; + # Randomize MAC for every ethernet connetion ethernet.macAddress = "random"; connectionConfig = { diff --git a/common/components/packages.nix b/common/components/packages.nix index 2d1816b..e7160b9 100644 --- a/common/components/packages.nix +++ b/common/components/packages.nix @@ -1,4 +1,8 @@ -{pkgs, ...}: { +{ + pkgs, + lib, + ... +}: { # Unfree packages that can be installes regardless of whether "allow-unfree.nix" is imported nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ @@ -28,4 +32,4 @@ ffmpeg usbutils ]; -} \ No newline at end of file +} diff --git a/common/components/security.nix b/common/components/security.nix index 6f84217..09b5625 100644 --- a/common/components/security.nix +++ b/common/components/security.nix @@ -2,4 +2,4 @@ # sudo and nix can only be used by the wheel group nix.settings.allowed-users = ["@wheel"]; security.sudo.execWheelOnly = true; -} \ No newline at end of file +} diff --git a/common/hardware/bluetooth.nix b/common/hardware/bluetooth.nix new file mode 100644 index 0000000..2d3f51c --- /dev/null +++ b/common/hardware/bluetooth.nix @@ -0,0 +1,4 @@ +{ + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = false; +} diff --git a/common/hardware/tpm2.nix b/common/hardware/tpm2.nix new file mode 100644 index 0000000..e703b8e --- /dev/null +++ b/common/hardware/tpm2.nix @@ -0,0 +1,5 @@ +{ + security.tpm2.enable = true; + security.tpm2.pkcs11.enable = true; # expose /run/current-system/sw/lib/libtpm2_pkcs11.so + security.tpm2.tctiEnvironment.enable = true; # TPM2TOOLS_TCTI and TPM2_PKCS11_TCTI env variables +} diff --git a/common/hardware/wifi.nix b/common/hardware/wifi.nix new file mode 100644 index 0000000..7c48436 --- /dev/null +++ b/common/hardware/wifi.nix @@ -0,0 +1,10 @@ +{ + networking.networkmanager.wifi = { + powersave = true; + scanRandMacAddress = true; + # https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1091 + # backend = "iwd"; + # Generate a random MAC for each WiFi and associate the two permanently. + macAddress = "stable"; + }; +} diff --git a/common/hardware/wireless.nix b/common/hardware/wireless.nix new file mode 100644 index 0000000..8913f86 --- /dev/null +++ b/common/hardware/wireless.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./wifi.nix + ./bluetooth.nix + ] +} \ No newline at end of file diff --git a/hosts/new-new-phoenix/configuration.nix b/hosts/new-new-phoenix/configuration.nix index 35d1ac5..a6d54ff 100644 --- a/hosts/new-new-phoenix/configuration.nix +++ b/hosts/new-new-phoenix/configuration.nix @@ -15,15 +15,18 @@ in { ../../common/locales/fr-keymap.nix ../../common/hardware/intel-cpu.nix + ../../common/hardware/tpm2.nix + ../../common/hardware/wireless.nix ../../common/hardware/nvidia-gpu.nix ../../common/hardware/nvidia-gpu-offload.nix ../../common/hardware/ssd.nix ../../common/hardware/btrfs.nix ../../common/hardware/latest-kernel.nix - ../../common/de/greetd.nix - ../../common/de/plasma6.nix - ../../common/de/hyprland.nix + ../../common/components/de/sddm.nix + # ../../common/components/de/greetd.nix + ../../common/components/de/plasma6.nix + ../../common/components/de/hyprland.nix ../../common/programs/steam.nix ../../common/services/syncthing.nix @@ -87,13 +90,6 @@ in { # ]; - security.tpm2.enable = true; - security.tpm2.pkcs11.enable = true; # expose /run/current-system/sw/lib/libtpm2_pkcs11.so - security.tpm2.tctiEnvironment.enable = true; # TPM2TOOLS_TCTI and TPM2_PKCS11_TCTI env variables - - hardware.bluetooth.enable = true; - hardware.bluetooth.powerOnBoot = false; - services.blueman.enable = true; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion