diff --git a/home/david/configurations/Tytonidae/default.nix b/home/david/configurations/Tytonidae/default.nix index 7e6dc8c..f66a3c6 100644 --- a/home/david/configurations/Tytonidae/default.nix +++ b/home/david/configurations/Tytonidae/default.nix @@ -9,10 +9,8 @@ { imports = [ ./starship - ./fish ./firefox.nix ./foot - ./ghostty ./niri ./zed.nix ]; @@ -25,6 +23,9 @@ name = "ulic-youthlic"; signKey = "C6FCBD7F49E1CBBABD6661F7FC02063F04331A95"; }; + fish.enable = true; + bash.enable = true; + ghostty.enable = true; }; xdg.userDirs = { diff --git a/home/david/configurations/Tytonidae/fish/default.nix b/home/david/configurations/Tytonidae/fish/default.nix deleted file mode 100644 index 5538972..0000000 --- a/home/david/configurations/Tytonidae/fish/default.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ ... }: -{ - programs = { - bash = { - enable = true; - }; - fish = { - enable = true; - functions = { - __fish_command_not_found_handler = { - body = "__fish_default_command_not_found_handler $argv[1]"; - onEvent = "fish_command_not_found"; - }; - fish_greeting = { - body = '' - fastfetch - ''; - }; - }; - }; - fastfetch.enable = true; - starship = { - enableFishIntegration = true; - enable = true; - }; - zoxide = { - enableFishIntegration = true; - enable = true; - }; - yazi = { - enableFishIntegration = true; - enable = true; - }; - fzf = { - enableFishIntegration = true; - enable = true; - }; - eza = { - enableFishIntegration = true; - enable = true; - }; - # zellij = { - # enable = true; - # enableFishIntegration = true; - # }; - direnv = { - enable = true; - nix-direnv.enable = true; - }; - }; - services = { - gpg-agent.enableFishIntegration = true; - }; -} diff --git a/home/david/configurations/Tytonidae/ghostty/config/config b/home/david/configurations/Tytonidae/ghostty/config/config deleted file mode 100644 index 2dbade5..0000000 --- a/home/david/configurations/Tytonidae/ghostty/config/config +++ /dev/null @@ -1,19 +0,0 @@ -font-family = FiraCode Nerd Font -font-feature = "calt=1" -font-feature = "clig=1" -font-feature = "liga=1" -font-feature = "cv01" -font-feature = "cv02" -font-feature = "cv06" -font-feature = "zero" -font-feature = "onum" -font-feature = "cv17" -font-feature = "ss05" -font-feature = "ss03" -font-feature = "cv16" -font-feature = "cv31" -font-feature = "cv29" -font-feature = "cv30" -font-size = 17 -theme = ayu -background-opacity = 0.8 diff --git a/home/david/configurations/Tytonidae/ghostty/default.nix b/home/david/configurations/Tytonidae/ghostty/default.nix deleted file mode 100644 index 28dae3f..0000000 --- a/home/david/configurations/Tytonidae/ghostty/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - config, - ... -}: -{ - xdg.configFile."ghostty/config" = { - source = config.lib.file.mkOutOfStoreSymlink ./config/config; - }; -} diff --git a/home/modules/default.nix b/home/modules/default.nix index 6969b1e..e289214 100644 --- a/home/modules/default.nix +++ b/home/modules/default.nix @@ -9,6 +9,8 @@ ./helix ./gpg ./git.nix + ./shell + ./ghostty.nix ]; options = { @@ -21,4 +23,10 @@ ''; }; }; + config = { + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + }; } diff --git a/home/modules/ghostty.nix b/home/modules/ghostty.nix new file mode 100644 index 0000000..f884d23 --- /dev/null +++ b/home/modules/ghostty.nix @@ -0,0 +1,61 @@ +{ + pkgs, + config, + lib, + ... +}: +{ + options = { + youthlic.programs.ghostty = { + enable = lib.mkOption { + type = lib.types.bool; + example = false; + default = true; + description = '' + whether enable ghostty + ''; + }; + }; + }; + config = + let + cfg = config.youthlic.programs.ghostty; + in + (lib.mkIf cfg.enable { + programs.ghostty = lib.mkMerge [ + { + enable = true; + package = pkgs.ghostty; + settings = { + font-family = "FiraCode Nerd Font"; + font-feature = [ + "calt=1" + "clig=1" + "liga=1" + "cv01" + "cv02" + "cv06" + "zero" + "onum" + "cv17" + "ss05" + "ss03" + "cv16" + "cv31" + "cv29" + "cv30" + ]; + font-size = 17; + theme = "ayu"; + background-opacity = 0.8; + }; + } + (lib.mkIf config.youthlic.programs.fish.enable { + enableFishIntegration = true; + }) + (lib.mkIf config.youthlic.programs.bash.enable { + enableBashIntegration = true; + }) + ]; + }); +} diff --git a/home/modules/gpg/default.nix b/home/modules/gpg/default.nix index 39391eb..c811e58 100644 --- a/home/modules/gpg/default.nix +++ b/home/modules/gpg/default.nix @@ -22,11 +22,19 @@ cfg = config.youthlic.programs.gpg; in lib.mkIf cfg.enable { - services.gpg-agent = { - enable = true; - enableSshSupport = true; - pinentryPackage = pkgs.pinentry-all; - }; + services.gpg-agent = lib.mkMerge [ + { + enable = true; + enableSshSupport = true; + pinentryPackage = pkgs.pinentry-all; + } + (lib.mkIf config.youthlic.programs.fish.enable { + enableFishIntegration = true; + }) + (lib.mkIf config.youthlic.programs.bash.enable { + enableBashIntegration = true; + }) + ]; programs.gpg = { enable = true; mutableKeys = true; diff --git a/home/modules/shell/default.nix b/home/modules/shell/default.nix new file mode 100644 index 0000000..f8369b9 --- /dev/null +++ b/home/modules/shell/default.nix @@ -0,0 +1,91 @@ +{ config, lib, ... }: +let + inherit (lib) mkOption mkIf mkMerge; + inherit (lib.types) bool; + fish-cfg = config.youthlic.programs.fish; + bash-cfg = config.youthlic.programs.bash; + cfg-helper = + conf: + mkMerge [ + conf + (mkIf fish-cfg.enable { + enableFishIntegration = true; + }) + (mkIf bash-cfg.enable { + enableBashIntegration = true; + }) + ]; +in +{ + options = { + youthlic.programs = { + fish = { + enable = mkOption { + type = bool; + default = true; + description = '' + whether to use fish shell + ''; + example = false; + }; + }; + bash = { + enable = mkOption { + type = bool; + default = true; + description = '' + whether to use bash shell + ''; + example = false; + }; + }; + }; + }; + config = mkMerge [ + { + programs = { + starship = cfg-helper { + enable = true; + }; + zoxide = cfg-helper { + enable = true; + }; + yazi = cfg-helper { + enable = true; + }; + fzf = cfg-helper { + enable = true; + }; + eza = cfg-helper { + enable = true; + }; + }; + } + (mkIf fish-cfg.enable { + programs = { + fish = { + enable = true; + functions = { + __fish_command_not_found_handler = { + body = "__fish_default_command_not_found_handler $argv[1]"; + onEvent = "fish_command_not_found"; + }; + fish_greeting = { + body = '' + fastfetch + ''; + }; + }; + }; + fastfetch.enable = true; + }; + }) + (mkIf bash-cfg.enable { + programs = { + bash = { + enable = true; + }; + }; + }) + ]; +}