From 567d7558502a73a14efc149462e75a6375a53605 Mon Sep 17 00:00:00 2001 From: Zuckerberg Date: Fri, 28 Mar 2025 20:16:13 -0700 Subject: [PATCH] If machine role is `personal` set `de.enable = true;` automatically --- README.md | 2 +- common/default.nix | 5 +++++ common/pc/touchpad.nix | 6 +----- machines/howl/default.nix | 2 -- machines/nat/configuration.nix | 3 --- machines/zoidberg/default.nix | 2 -- 6 files changed, 7 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 6b92915..5cb66e0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ - `/common` - common configuration imported into all `/machines` - `/boot` - config related to bootloaders, cpu microcode, and unlocking LUKS root disks over tor - `/network` - config for tailscale, and NixOS container with automatic vpn tunneling via PIA - - `/pc` - config that a graphical desktop computer should have. Use `de.enable = true;` to enable everthing. + - `/pc` - config that a graphical PC should have. Have the `personal` role set in the machine's `properties.nix` to enable everthing. - `/server` - config that creates new nixos services or extends existing ones to meet my needs - `/machines` - all my NixOS machines along with their machine unique configuration for hardware and services - `/kexec` - a special machine for generating minimal kexec images. Does not import `/common` diff --git a/common/default.nix b/common/default.nix index 137c637..7aa02b5 100644 --- a/common/default.nix +++ b/common/default.nix @@ -98,4 +98,9 @@ security.acme.acceptTerms = true; security.acme.defaults.email = "zuckerberg@neet.dev"; + + # Enable Desktop Environment if this is a PC (machine role is "personal") + de.enable = ( + builtins.elem config.networking.hostName config.machines.roles.personal + ); } diff --git a/common/pc/touchpad.nix b/common/pc/touchpad.nix index 7e9f3cc..9eb084c 100644 --- a/common/pc/touchpad.nix +++ b/common/pc/touchpad.nix @@ -1,13 +1,9 @@ { lib, config, pkgs, ... }: let - cfg = config.de.touchpad; + cfg = config.de; in { - options.de.touchpad = { - enable = lib.mkEnableOption "enable touchpad"; - }; - config = lib.mkIf cfg.enable { services.libinput.enable = true; services.libinput.touchpad.naturalScrolling = true; diff --git a/machines/howl/default.nix b/machines/howl/default.nix index 91a4c1c..18cb55f 100644 --- a/machines/howl/default.nix +++ b/machines/howl/default.nix @@ -8,6 +8,4 @@ # don't use remote builders nix.distributedBuilds = lib.mkForce false; - de.enable = true; - de.touchpad.enable = true; } diff --git a/machines/nat/configuration.nix b/machines/nat/configuration.nix index 8285f6d..3baf90f 100644 --- a/machines/nat/configuration.nix +++ b/machines/nat/configuration.nix @@ -9,7 +9,4 @@ networking.hostName = "nat"; networking.interfaces.ens160.useDHCP = true; - - de.enable = true; - de.touchpad.enable = true; } diff --git a/machines/zoidberg/default.nix b/machines/zoidberg/default.nix index b7dbe70..e78da99 100644 --- a/machines/zoidberg/default.nix +++ b/machines/zoidberg/default.nix @@ -5,8 +5,6 @@ ./hardware-configuration.nix ]; - de.enable = true; - # Login DE Option: Steam programs.steam.gamescopeSession.enable = true; # programs.gamescope.capSysNice = true;