From b48cc7774a4c35d4222f17e9332da845bad85418 Mon Sep 17 00:00:00 2001
From: Oliver Davies <oliver@oliverdavies.dev>
Date: Mon, 23 Dec 2024 00:28:59 +0000
Subject: [PATCH] Change desktop to headless

---
 flake.nix                                | 12 ++++++++----
 nix/home/opdavies/default.nix            |  6 +++---
 nix/hosts/lemp11/configuration.nix       |  6 +++---
 nix/hosts/t490/configuration.nix         |  6 +++---
 nix/lib/shared/home-manager-packages.nix |  5 ++---
 5 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/flake.nix b/flake.nix
index 46b1a8df..98a23bab 100644
--- a/flake.nix
+++ b/flake.nix
@@ -34,6 +34,8 @@
       username = "opdavies";
 
       specialArgs = {
+        headless = false;
+
         inherit
           inputs
           outputs
@@ -59,7 +61,6 @@
       nixosConfigurations = {
         lemp11 = nixpkgs.lib.nixosSystem {
           specialArgs = specialArgs // {
-            desktop = true;
             hostname = "lemp11";
           };
 
@@ -68,7 +69,6 @@
 
         t490 = nixpkgs.lib.nixosSystem {
           specialArgs = specialArgs // {
-            desktop = true;
             hostname = "t490";
           };
 
@@ -81,7 +81,11 @@
         };
 
         hetznix = nixpkgs.lib.nixosSystem {
-          inherit specialArgs system;
+          inherit system;
+
+          specialArgs = specialArgs // {
+            headless = true;
+          };
 
           modules = [
             disko.nixosModules.disko
@@ -95,7 +99,7 @@
           inherit pkgs;
 
           extraSpecialArgs = specialArgs // {
-            desktop = false;
+            headless = true;
             hostname = "PW05CH3L";
           };
 
diff --git a/nix/home/opdavies/default.nix b/nix/home/opdavies/default.nix
index 678f3e06..fc09077e 100644
--- a/nix/home/opdavies/default.nix
+++ b/nix/home/opdavies/default.nix
@@ -1,6 +1,6 @@
 {
   config,
-  desktop,
+  headless ? false,
   hostname,
   inputs,
   outputs,
@@ -44,7 +44,7 @@ let
 
   shared-packages = import "${self}/nix/lib/shared/home-manager-packages.nix" {
     inherit
-      desktop
+      headless
       inputs
       pkgs
       username
@@ -56,7 +56,7 @@ in
 
   home.packages =
     shared-packages
-    ++ pkgs.lib.optionals desktop (
+    ++ pkgs.lib.optionals (!headless) (
       with pkgs;
       [
         build-glove80
diff --git a/nix/hosts/lemp11/configuration.nix b/nix/hosts/lemp11/configuration.nix
index cfb4e800..5ebb4bfe 100644
--- a/nix/hosts/lemp11/configuration.nix
+++ b/nix/hosts/lemp11/configuration.nix
@@ -1,9 +1,9 @@
 {
+  headless ? false,
   hostname,
   inputs,
   outputs,
   pkgs,
-  desktop ? false,
   self,
   system,
   username,
@@ -27,7 +27,7 @@
         hostname
         inputs
         outputs
-        desktop
+        headless
         self
         system
         username
@@ -178,7 +178,7 @@
       yt-dlp
       ytfzf
     ]
-    ++ pkgs.lib.optionals desktop [
+    ++ pkgs.lib.optionals (!headless) [
       acpi
       arandr
       brightnessctl
diff --git a/nix/hosts/t490/configuration.nix b/nix/hosts/t490/configuration.nix
index 54477981..68a5f8c3 100644
--- a/nix/hosts/t490/configuration.nix
+++ b/nix/hosts/t490/configuration.nix
@@ -1,9 +1,9 @@
 {
+  headless ? false,
   hostname,
   inputs,
   outputs,
   pkgs,
-  desktop ? false,
   self,
   system,
   username,
@@ -21,7 +21,7 @@
         hostname
         inputs
         outputs
-        desktop
+        headless
         self
         system
         username
@@ -170,7 +170,7 @@
       yt-dlp
       ytfzf
     ]
-    ++ pkgs.lib.optionals desktop [
+    ++ pkgs.lib.optionals (!headless) [
       acpi
       arandr
       brightnessctl
diff --git a/nix/lib/shared/home-manager-packages.nix b/nix/lib/shared/home-manager-packages.nix
index 174f0a12..8fad645e 100644
--- a/nix/lib/shared/home-manager-packages.nix
+++ b/nix/lib/shared/home-manager-packages.nix
@@ -1,6 +1,5 @@
 {
-  desktop,
-  inputs,
+  headless,
   pkgs,
   username,
   ...
@@ -70,7 +69,7 @@ with pkgs;
   deliver
   run
 ]
-++ pkgs.lib.optionals desktop [
+++ pkgs.lib.optionals (!headless) [
   # Scripts.
   _timer
   export-video-list