some refactoring

This commit is contained in:
cnst
2024-10-19 11:09:45 +02:00
parent 946125fb09
commit 2cbe3a0ff9
15 changed files with 204 additions and 26 deletions

View File

@@ -49,6 +49,8 @@
inputs.nixpkgs-lib.follows = "nixpkgs"; inputs.nixpkgs-lib.follows = "nixpkgs";
}; };
nur.url = "github:nix-community/NUR";
# Hyprland environment # Hyprland environment
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
hyprland-contrib = { hyprland-contrib = {
@@ -86,7 +88,7 @@
}; };
}; };
# Cachyos # Chaotic
chaotic.url = "https://flakehub.com/f/chaotic-cx/nyx/*.tar.gz"; chaotic.url = "https://flakehub.com/f/chaotic-cx/nyx/*.tar.gz";
# Miscellaneous # Miscellaneous
@@ -100,8 +102,6 @@
}; };
}; };
nur.url = "github:nix-community/NUR";
anyrun.url = "github:anyrun-org/anyrun"; anyrun.url = "github:anyrun-org/anyrun";
microfetch.url = "github:NotAShelf/microfetch"; microfetch.url = "github:NotAShelf/microfetch";
agenix.url = "github:ryantm/agenix"; agenix.url = "github:ryantm/agenix";

View File

@@ -13,11 +13,14 @@
./home/gaming/steam ./home/gaming/steam
./home/terminal/alacritty ./home/cli/alacritty
./home/terminal/foot ./home/cli/bash
./home/terminal/kitty ./home/cli/foot
./home/terminal/wezterm ./home/cli/jujutsu
./home/terminal/zellij ./home/cli/kitty
./home/cli/wezterm
./home/cli/zellij
./home/cli/zsh
./home/userd/blueman-applet ./home/userd/blueman-applet
./home/userd/copyq ./home/userd/copyq

View File

@@ -4,10 +4,10 @@
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.terminal.alacritty; cfg = config.home.cli.alacritty;
in { in {
options = { options = {
home.terminal.alacritty.enable = mkEnableOption "Enables firefox"; home.cli.alacritty.enable = mkEnableOption "Enables firefox";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.alacritty = { programs.alacritty = {

View File

@@ -0,0 +1,17 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.cli.bash;
in {
options = {
home.cli.bash.enable = mkEnableOption "Enables bash";
};
config = mkIf cfg.enable {
programs.bash = {
enable = true;
};
};
}

View File

@@ -5,10 +5,10 @@
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.terminal.foot; cfg = config.home.cli.foot;
in { in {
options = { options = {
home.terminal.foot.enable = mkEnableOption "Enables foot terminal"; home.cli.foot.enable = mkEnableOption "Enables foot cli";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.foot = { programs.foot = {
@@ -162,7 +162,7 @@ in {
# font-increase=Control+plus Control+equal Control+KP_Add # font-increase=Control+plus Control+equal Control+KP_Add
# font-decrease=Control+minus Control+KP_Subtract # font-decrease=Control+minus Control+KP_Subtract
# font-reset=Control+0 Control+KP_0 # font-reset=Control+0 Control+KP_0
# spawn-terminal=Control+Shift+n # spawn-cli=Control+Shift+n
# minimize=none # minimize=none
# maximize=none # maximize=none
# fullscreen=none # fullscreen=none

View File

@@ -0,0 +1,53 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.cli.jujutsu;
in {
options = {
home.cli.jujutsu.enable = mkEnableOption "Enables jujutsu";
};
config = mkIf cfg.enable {
programs.jujutsu = {
enable = true;
settings = {
user = {
name = config.programs.git.userName;
email = config.programs.git.userEmail;
};
# ui = {
# diff-editor = lib.mkIf config.programs.neovim.enable [
# "nvim"
# "-c"
# "DiffEditor $left $right $output"
# ];
# pager = "less -FRX";
# };
# signing = let
# gitCfg = config.programs.git.extraConfig;
# in {
# backend = "gpg";
# sign-all = gitCfg.commit.gpgSign;
# key = gitCfg.user.signing.key;
# };
templates = {
draft_commit_description = ''
concat(
description,
indent("JJ: ", concat(
"\n",
"Change summary:\n",
indent(" ", diff.summary()),
"\n",
"Full change:\n",
indent(" ", diff.git()),
)),
)
'';
};
};
};
};
}

View File

@@ -4,10 +4,10 @@
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.terminal.kitty; cfg = config.home.cli.kitty;
in { in {
options = { options = {
home.terminal.kitty.enable = mkEnableOption "Enables kitty terminal"; home.cli.kitty.enable = mkEnableOption "Enables kitty cli";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.kitty = { programs.kitty = {

View File

@@ -9,10 +9,10 @@
weztermPkg = pkgs.wezterm; weztermPkg = pkgs.wezterm;
# weztermFlake = inputs.wezterm.packages.${pkgs.system}.default; # weztermFlake = inputs.wezterm.packages.${pkgs.system}.default;
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.terminal.wezterm; cfg = config.home.cli.wezterm;
in { in {
options = { options = {
home.terminal.wezterm.enable = mkEnableOption "Enables wezterm terminal"; home.cli.wezterm.enable = mkEnableOption "Enables wezterm cli";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.wezterm = { programs.wezterm = {

View File

@@ -4,10 +4,10 @@
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.terminal.zellij; cfg = config.home.cli.zellij;
in { in {
options = { options = {
home.terminal.zellij.enable = mkEnableOption "Enables zellij"; home.cli.zellij.enable = mkEnableOption "Enables zellij";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.zellij = { programs.zellij = {

View File

@@ -0,0 +1,96 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.cli.zsh;
inherit (lib.meta) getExe;
inherit (pkgs) eza bat;
in {
options = {
home.cli.zsh.enable = mkEnableOption "Enables zsh home configuration";
};
config = mkIf cfg.enable {
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
cat = "${getExe bat} --style=plain";
ls = "${getExe eza} -h --git --icons --color=auto --group-directories-first -s extension";
la = "${getExe eza} -lah --tree";
tree = "${getExe eza} --tree --icons=always";
extract = "extract.sh";
usermodules = "$EDITOR /home/$USER/.nix-config/users/$USER/modules.nix";
umod = "$EDITOR /home/$USER/.nix-config/users/$USER/modules.nix";
systemmodules = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix";
smod = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix";
nixcleanboot = "sudo nix run /home/$USER/.nix-config#cleanup-boot";
nixclean = "nh clean all --keep 3";
nixdev = "nix develop ~/.nix-config -c $SHELL";
nixconfig = "cd /home/$USER/.nix-config/";
ll = "ls -l";
nixupdate = "nh os switch -v -H $HOST";
nixup = "nh os switch -H $HOST";
flakeupdate = "nh os switch -u -v -H $HOST";
flakeup = "nh os switch -u -H $HOST";
".." = "cd ..";
"..." = "cd ../../";
"...." = "cd ../../../";
"....." = "cd ../../../../";
"......" = "cd ../../../../../";
};
history = {
size = 1000;
path = "${config.xdg.dataHome}/zsh/history";
};
oh-my-zsh = {
enable = true;
plugins = [
"git"
];
theme = "robbyrussell";
};
profileExtra = ''
export PATH="$HOME/.local/bin:$PATH"
'';
initExtraFirst = ''
autoload -U colors && colors
'';
initExtra = ''
ZSH_THEME_GIT_PROMPT_PREFIX="%F{143}(%F{167}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%f "
ZSH_THEME_GIT_PROMPT_DIRTY="%F{143}) %F{202}%1{%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%F{143})"
ZSH_THEME_RUBY_PROMPT_PREFIX="%F{167}"
ZSH_THEME_RUBY_PROMPT_SUFFIX="%f"
# Check if we're in a nix-shell or nix develop environment
if [[ -n "$IN_NIX_SHELL" ]]; then
PROMPT='%F{red}DEV%f%F{143}%~%f $(git_prompt_info)$(virtualenv_prompt_info)
%F{143}$ '
else
PROMPT='%F{143}%~%f $(git_prompt_info)$(virtualenv_prompt_info)
%F{143}$ '
fi
RPROMPT='$(ruby_prompt_info)'
VIRTUAL_ENV_DISABLE_PROMPT=0
ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX=" %F{66}🐍 "
ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX="%f"
ZSH_THEME_VIRTUALENV_PREFIX=$ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX
ZSH_THEME_VIRTUALENV_SUFFIX=$ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=241'
microfetch
'';
};
};
}

View File

@@ -7,7 +7,7 @@
cfg = config.system.utils.zsh; cfg = config.system.utils.zsh;
in { in {
options = { options = {
system.utils.zsh.enable = mkEnableOption "Enables android tools"; system.utils.zsh.enable = mkEnableOption "Enables zsh shell";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.zsh.enable = cfg.enable; programs.zsh.enable = cfg.enable;

View File

@@ -10,7 +10,7 @@ in {
[ [
./modules.nix ./modules.nix
./git.nix ./git.nix
./shell.nix # ./shell.nix
] ]
++ lib.optionals isCnixpad [./cpmodules.nix]; ++ lib.optionals isCnixpad [./cpmodules.nix];

View File

@@ -42,13 +42,19 @@
# enable = false; # enable = false;
# }; # };
}; };
terminal = { cli = {
alacritty = { alacritty = {
enable = true; enable = true;
}; };
bash = {
enable = true;
};
foot = { foot = {
enable = true; enable = true;
}; };
jujutsu = {
enable = false;
};
kitty = { kitty = {
enable = true; enable = true;
}; };
@@ -58,6 +64,9 @@
zellij = { zellij = {
enable = false; enable = false;
}; };
zsh = {
enable = true;
};
}; };
userd = { userd = {
blueman-applet = { blueman-applet = {

View File

@@ -20,8 +20,8 @@ in {
la = "${getExe eza} -lah --tree"; la = "${getExe eza} -lah --tree";
tree = "${getExe eza} --tree --icons=always"; tree = "${getExe eza} --tree --icons=always";
extract = "extract.sh"; extract = "extract.sh";
usermodules = "$EDITOR /home/$USER/.nix-config/home/users/$USER/modules.nix"; usermodules = "$EDITOR /home/$USER/.nix-config/users/$USER/modules.nix";
umod = "$EDITOR /home/$USER/.nix-config/home/users/$USER/modules.nix"; umod = "$EDITOR /home/$USER/.nix-config/users/$USER/modules.nix";
systemmodules = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix"; systemmodules = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix";
smod = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix"; smod = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix";
nixcleanboot = "sudo nix run /home/$USER/.nix-config#cleanup-boot"; nixcleanboot = "sudo nix run /home/$USER/.nix-config#cleanup-boot";

View File

@@ -20,8 +20,8 @@ in {
la = "${getExe eza} -lah --tree"; la = "${getExe eza} -lah --tree";
tree = "${getExe eza} --tree --icons=always"; tree = "${getExe eza} --tree --icons=always";
extract = "extract.sh"; extract = "extract.sh";
usermodules = "$EDITOR /home/$USER/.nix-config/home/users/$USER/modules.nix"; usermodules = "$EDITOR /home/$USER/.nix-config/users/$USER/modules.nix";
umod = "$EDITOR /home/$USER/.nix-config/home/users/$USER/modules.nix"; umod = "$EDITOR /home/$USER/.nix-config/users/$USER/modules.nix";
systemmodules = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix"; systemmodules = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix";
smod = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix"; smod = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix";
nixcleanboot = "sudo nix run /home/$USER/.nix-config#cleanup-boot"; nixcleanboot = "sudo nix run /home/$USER/.nix-config#cleanup-boot";