change shell config to module, and ghostty also.

This commit is contained in:
ulic-youthlic 2025-01-11 16:27:01 +08:00
parent 19d80c007f
commit 414972925c
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
8 changed files with 176 additions and 89 deletions

View file

@ -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 = {

View file

@ -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;
};
}

View file

@ -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

View file

@ -1,9 +0,0 @@
{
config,
...
}:
{
xdg.configFile."ghostty/config" = {
source = config.lib.file.mkOutOfStoreSymlink ./config/config;
};
}

View file

@ -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;
};
};
}

61
home/modules/ghostty.nix Normal file
View file

@ -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;
})
];
});
}

View file

@ -22,11 +22,19 @@
cfg = config.youthlic.programs.gpg;
in
lib.mkIf cfg.enable {
services.gpg-agent = {
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;

View file

@ -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;
};
};
})
];
}