Split prompt and desktop
This allows for headless configurations to be marginally easier.
This commit is contained in:
parent
6c9d93a2c8
commit
7f1c17f151
2 changed files with 18 additions and 11 deletions
12
flake.nix
12
flake.nix
|
@ -13,7 +13,13 @@
|
||||||
outputs = { nixpkgs, home-manager, ... }:
|
outputs = { nixpkgs, home-manager, ... }:
|
||||||
let
|
let
|
||||||
homeManager = { system, specialArgs ? {
|
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 {
|
home-manager.lib.homeManagerConfiguration {
|
||||||
modules = [
|
modules = [
|
||||||
|
@ -28,7 +34,6 @@
|
||||||
# require dotfiles. For now, this is mostly true :)
|
# require dotfiles. For now, this is mostly true :)
|
||||||
x86_64-linux.homeConfigurations.spotlight = homeManager {
|
x86_64-linux.homeConfigurations.spotlight = homeManager {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs.dotfilesOnly = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Similarly (as of writing), all aarch64 Linux devices are headless
|
# Similarly (as of writing), all aarch64 Linux devices are headless
|
||||||
|
@ -36,15 +41,16 @@
|
||||||
# This should likely be dealt with in the future!
|
# This should likely be dealt with in the future!
|
||||||
aarch64-linux.homeConfigurations.spotlight = homeManager {
|
aarch64-linux.homeConfigurations.spotlight = homeManager {
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
specialArgs.dotfilesOnly = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# For all architecture variants of Darwin, we don't want only dotfiles.
|
# For all architecture variants of Darwin, we don't want only dotfiles.
|
||||||
aarch64-darwin.homeConfigurations.spot = homeManager {
|
aarch64-darwin.homeConfigurations.spot = homeManager {
|
||||||
system = "aarch64-darwin";
|
system = "aarch64-darwin";
|
||||||
|
specialArgs.desktop = true;
|
||||||
};
|
};
|
||||||
x86_64-darwin.homeConfigurations.spot = homeManager {
|
x86_64-darwin.homeConfigurations.spot = homeManager {
|
||||||
system = "x86_64-darwin";
|
system = "x86_64-darwin";
|
||||||
|
specialArgs.desktop = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{ config, lib, pkgs, specialArgs, ... }:
|
{ config, lib, pkgs, specialArgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
dotfilesOnly = specialArgs.dotfilesOnly;
|
prompt = specialArgs.prompt or false;
|
||||||
|
desktop = specialArgs.desktop or false;
|
||||||
in {
|
in {
|
||||||
# It's standard convention that Darwin has the username
|
# It's standard convention that Darwin has the username
|
||||||
# "spot" - "spotlight" was reserved by the system at some point.
|
# "spot" - "spotlight" was reserved by the system at some point.
|
||||||
|
@ -24,8 +25,8 @@ in {
|
||||||
userName = "Spotlight";
|
userName = "Spotlight";
|
||||||
userEmail = "spotlight@joscomputing.space";
|
userEmail = "spotlight@joscomputing.space";
|
||||||
# Only specify signing if GPG is otherwise being pulled in;
|
# Only specify signing if GPG is otherwise being pulled in;
|
||||||
# i.e. not in a dotfiles only configuration.
|
# i.e. in a prompt configuration.
|
||||||
signing = lib.mkIf (!dotfilesOnly) {
|
signing = lib.mkIf (prompt) {
|
||||||
key = "6EF6CBB6420B81DA3CCACFEA874AA355B3209BDC";
|
key = "6EF6CBB6420B81DA3CCACFEA874AA355B3209BDC";
|
||||||
signByDefault = true;
|
signByDefault = true;
|
||||||
};
|
};
|
||||||
|
@ -38,14 +39,14 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
# Only include the desktop configuration if not dotfiles only.
|
# Only include the desktop configuration if not dotfiles only.
|
||||||
imports = [
|
imports = (lib.optional (prompt) (
|
||||||
# zsh, etc
|
|
||||||
./editor.nix
|
|
||||||
# vim, etc
|
# vim, etc
|
||||||
|
./editor.nix
|
||||||
|
# zsh, etc
|
||||||
./prompt.nix
|
./prompt.nix
|
||||||
] ++ (lib.optional (!dotfilesOnly)
|
)) ++ (lib.optional (desktop)
|
||||||
./desktop.nix
|
./desktop.nix
|
||||||
);
|
) ++ [];
|
||||||
|
|
||||||
# This value determines the Home Manager release that your
|
# This value determines the Home Manager release that your
|
||||||
# configuration is compatible with. This helps avoid breakage
|
# configuration is compatible with. This helps avoid breakage
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue