From 7f1c17f1516824bb039d095db151c07d595c2ae6 Mon Sep 17 00:00:00 2001 From: Spotlight Date: Sun, 10 Sep 2023 22:39:18 -0500 Subject: [PATCH] Split prompt and desktop This allows for headless configurations to be marginally easier. --- flake.nix | 12 +++++++++--- home/home.nix | 17 +++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index 8ca3ab0..a729616 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,13 @@ outputs = { nixpkgs, home-manager, ... }: let homeManager = { system, specialArgs ? { - dotfilesOnly = false; + # Whether to configure the zsh prompt. + prompt = true; + + # Whether to also install several useful cli tools and desktop applications. + # + # (This primarily focuses around macOS - please use and adopt at your own risk.) + desktop = false; } }: home-manager.lib.homeManagerConfiguration { modules = [ @@ -28,7 +34,6 @@ # require dotfiles. For now, this is mostly true :) x86_64-linux.homeConfigurations.spotlight = homeManager { system = "x86_64-linux"; - specialArgs.dotfilesOnly = true; }; # Similarly (as of writing), all aarch64 Linux devices are headless @@ -36,15 +41,16 @@ # This should likely be dealt with in the future! aarch64-linux.homeConfigurations.spotlight = homeManager { system = "aarch64-linux"; - specialArgs.dotfilesOnly = true; }; # For all architecture variants of Darwin, we don't want only dotfiles. aarch64-darwin.homeConfigurations.spot = homeManager { system = "aarch64-darwin"; + specialArgs.desktop = true; }; x86_64-darwin.homeConfigurations.spot = homeManager { system = "x86_64-darwin"; + specialArgs.desktop = true; }; }; }; diff --git a/home/home.nix b/home/home.nix index e99870a..0df849f 100644 --- a/home/home.nix +++ b/home/home.nix @@ -1,7 +1,8 @@ { config, lib, pkgs, specialArgs, ... }: let - dotfilesOnly = specialArgs.dotfilesOnly; + prompt = specialArgs.prompt or false; + desktop = specialArgs.desktop or false; in { # It's standard convention that Darwin has the username # "spot" - "spotlight" was reserved by the system at some point. @@ -24,8 +25,8 @@ in { userName = "Spotlight"; userEmail = "spotlight@joscomputing.space"; # Only specify signing if GPG is otherwise being pulled in; - # i.e. not in a dotfiles only configuration. - signing = lib.mkIf (!dotfilesOnly) { + # i.e. in a prompt configuration. + signing = lib.mkIf (prompt) { key = "6EF6CBB6420B81DA3CCACFEA874AA355B3209BDC"; signByDefault = true; }; @@ -38,14 +39,14 @@ in { }; # Only include the desktop configuration if not dotfiles only. - imports = [ - # zsh, etc - ./editor.nix + imports = (lib.optional (prompt) ( # vim, etc + ./editor.nix + # zsh, etc ./prompt.nix - ] ++ (lib.optional (!dotfilesOnly) + )) ++ (lib.optional (desktop) ./desktop.nix - ); + ) ++ []; # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage