From bf3ae9c4d0b512fd99263b0c81b27bd7bb45ef89 Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Sun, 21 Jul 2024 12:41:21 -0700 Subject: [PATCH] macos: extract macos option globally --- home/modules/alacritty.nix | 6 +++--- home/modules/fish.nix | 7 +++---- home/modules/macos.nix | 7 +++++++ hosts/little-lightning/home.nix | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 home/modules/macos.nix diff --git a/home/modules/alacritty.nix b/home/modules/alacritty.nix index 792d828..bfea4fd 100644 --- a/home/modules/alacritty.nix +++ b/home/modules/alacritty.nix @@ -2,11 +2,11 @@ let cfg = config.snowhawk.alacritty; + macos = config.snowhawk.macos.enable; in { options.snowhawk.alacritty = { enable = lib.mkEnableOption "alacritty home-manager module"; - macos = lib.mkEnableOption "macos specific tweaks"; }; config = lib.mkIf cfg.enable { @@ -15,8 +15,8 @@ in settings = { window = { opacity = 0.98; - decorations = lib.mkIf cfg.macos "buttonless"; - option_as_alt = lib.mkIf cfg.macos "Both"; + decorations = lib.mkIf macos "buttonless"; + option_as_alt = lib.mkIf macos "Both"; }; colors = { primary.background = "#050505"; diff --git a/home/modules/fish.nix b/home/modules/fish.nix index 13ddb99..d121da4 100644 --- a/home/modules/fish.nix +++ b/home/modules/fish.nix @@ -2,16 +2,15 @@ let cfg = config.snowhawk.fish; + macos = config.snowhawk.macos.enable; in { options.snowhawk.fish = { enable = lib.mkEnableOption "fish"; - - macos = lib.mkEnableOption "macos specific tweaks"; }; config = lib.mkIf cfg.enable { - programs.bash = lib.mkIf (!cfg.macos) { + programs.bash = lib.mkIf (!macos) { enable = true; initExtra = '' if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] @@ -22,7 +21,7 @@ in ''; }; - programs.zsh = lib.mkIf cfg.macos { + programs.zsh = lib.mkIf macos { enable = true; initExtra = '' if [[ $(${pkgs.procps}/bin/ps $(${pkgs.procps}/bin/ps -p $$ -co "ppid=") -co "comm=") != "fish" && -z ''${BASH_EXECUTION_STRING} ]] diff --git a/home/modules/macos.nix b/home/modules/macos.nix new file mode 100644 index 0000000..67f58c5 --- /dev/null +++ b/home/modules/macos.nix @@ -0,0 +1,7 @@ +{ lib, ... }: + +{ + options.snowhawk.macos = { + enable = lib.mkEnableOption "macos"; + }; +} diff --git a/hosts/little-lightning/home.nix b/hosts/little-lightning/home.nix index 9430b6b..0c5e07d 100644 --- a/hosts/little-lightning/home.nix +++ b/hosts/little-lightning/home.nix @@ -15,9 +15,9 @@ }; snowhawk.alacritty = { enable = true; - macos = true; }; - snowhawk.fish.macos = true; + + snowhawk.macos.enable = true; programs.alacritty.settings = { font.size = lib.mkForce 16.0;