copy more hm stuff into modules

This commit is contained in:
xunuwu 2024-08-28 07:56:21 +00:00
parent 114a5eae9d
commit 0eaf4dfd5a
No known key found for this signature in database
9 changed files with 226 additions and 5 deletions

View file

@ -2,5 +2,7 @@
imports = [
./develop
./gaming
./programs
./desktop
];
}

View file

@ -0,0 +1,39 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.xun.desktop;
in {
options.xun.desktop = {
xdg.enable = lib.mkEnableOption "xdg env vars";
};
config = lib.mkMerge [
(lib.mkIf cfg.xdg.enable {
xdg = let
home = config.home.homeDirectory;
in {
enable = true;
cacheHome = config.home.homeDirectory + "/.local/cache";
userDirs = {
enable = true;
desktop = home + "/desktop";
documents = home + "/docs";
download = home + "/down";
music = home + "/music";
pictures = home + "/pics";
publicShare = home + "/share";
videos = home + "/vids";
extraConfig = {
XDG_SCREENSHOTS_DIR = config.xdg.userDirs.pictures + "/screenshots";
};
};
};
home.packages = [pkgs.xdg-utils];
})
];
}

View file

@ -8,6 +8,7 @@
in {
options.xun.develop = {
enable = lib.mkEnableOption "develop";
git.enable = lib.mkEnableOption "git";
nix.enable = lib.mkEnableOption "nix";
tools.enable = lib.mkEnableOption "tools";
docs.enable = lib.mkEnableOption "man caches";
@ -20,6 +21,7 @@ in {
then
(cfg
// {
git.enable = true;
nix.enable = true;
tools.enable = true;
docs.enable = true;
@ -34,6 +36,32 @@ in {
(lib.mkIf conf.tools.enable {
home.packages = with pkgs; [tokei];
})
(lib.mkIf conf.git.enable {
home.packages = with pkgs; [lazygit];
programs.gh.enable = true;
programs.gh-dash.enable = true;
programs.git = {
enable = true;
delta.enable = true;
lfs.enable = true;
ignores = ["*~" ".direnv"];
signing = {
key = "${config.home.homeDirectory}/.ssh/id_ed25519";
signByDefault = true;
};
extraConfig = {
gpg.format = "ssh";
push.autoSetupRemote = true;
};
userEmail = "xunuwu@gmail.com";
userName = "xunuwu";
};
})
(lib.mkIf conf.lsp.c.enable {
home.packages = with pkgs; [clang-tools];
})

View file

@ -9,7 +9,7 @@
in {
options.xun.gaming = {
krunker.enable = lib.mkEnableOption "krunker";
roblox.sobercookie = lib.mkEnableOption "";
roblox.sobercookie.enable = lib.mkEnableOption "sobercookie";
};
config = lib.mkMerge [
(lib.mkIf cfg.krunker.enable {
@ -17,5 +17,10 @@ in {
self.packages.${pkgs.system}.krunker
];
})
(lib.mkIf cfg.roblox.sobercookie.enable {
home.packages = [
self.packages.${pkgs.system}.sobercookie
];
})
];
}

View file

@ -0,0 +1,5 @@
{
imports = [
./terminal
];
}

View file

@ -0,0 +1,131 @@
{
config,
lib,
inputs,
...
}: let
cfg = config.xun.programs.terminal;
in {
imports = [
inputs.nix-index-database.hmModules.nix-index
];
options.xun.programs.terminal = {
direnv.enable = lib.mkEnableOption "direnv";
comma.enable = lib.mkEnableOption "comma";
tmux.enable = lib.mkEnableOption "tmux";
irssi.enable = lib.mkEnableOption "irssi";
shell.zsh = {
enable = lib.mkEnableOption "zsh";
};
};
config = lib.mkMerge [
(lib.mkIf cfg.shell.zsh.enable {
programs.zsh = {
enable = true;
autocd = true;
enableCompletion = true;
autosuggestion.enable = true;
dotDir = ".config/zsh";
defaultKeymap = "emacs";
history = {
expireDuplicatesFirst = true;
path = "${config.xdg.dataHome}/zsh_history";
};
initExtra = ''
unsetopt beep
## KEYBINDS ##
bindkey "^[[1;5D" backward-word
bindkey "^[[1;5C" forward-word
# improve ^w behaviour
WORDCHARS=
# pretty completion menu
zstyle ':completion:*' menu select
# shift-tab in completion menu
bindkey '^[[Z' reverse-menu-complete
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # Case insensitive completion
## MISC ##
setopt extendedglob
# Show completion categories
zstyle ':completion:*:*:*:*:descriptions' format '%F{magenta}<-%d->%f'
## PROMPT ##
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
zstyle ':vcs_info:git:*' formats ' %b '
setopt prompt_subst
PROMPT="%F{blue}[%F{magenta}%n%F{blue}@%F{magenta}%M%F{blue}] %~%f %F{green}\$vcs_info_msg_0_%f%(?..%F{red}| %? )%#%f "
'';
};
})
(lib.mkIf cfg.direnv.enable {
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
})
(lib.mkIf cfg.comma.enable {
programs.nix-index-database.comma.enable = true;
programs.nix-index = {
enableBashIntegration = false;
enableFishIntegration = false;
enableZshIntegration = false;
};
})
(lib.mkIf cfg.tmux.enable {
programs.tmux = {
enable = true;
baseIndex = 1;
clock24 = true;
mouse = true;
escapeTime = 0;
extraConfig = ''
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}";
set -g status-style bg=default
setw -g window-status-current-style fg=#be95ff
set -g status-justify absolute-centre
set -g status-interval 5
set -g status-right "#[fg=#25be6a]#(free -h | awk 'NR==2{print $3\"/\"$2}')"
set -ag status-right "#[fg=default] %a %d %b %H:%M"
'';
};
})
(lib.mkIf cfg.irssi.enable {
# TODO: make more customizable maybe
programs.irssi = {
enable = true;
networks = {
liberachat = {
nick = "wheat";
server = {
address = "irc.libera.chat";
port = 6697;
autoConnect = true;
};
channels = {
nixos.autoJoin = false;
};
};
};
};
})
];
}

View file

@ -10,7 +10,7 @@
"xun@kidney" = [
../.
./kidney
inputs.nix-index-database.hmModules.nix-index
# inputs.nix-index-database.hmModules.nix-index
{
programs.nix-index = {
enableBashIntegration = false;

View file

@ -6,9 +6,9 @@
imports = [
self.homeManagerModules.xun
inputs.small-nvim.homeManagerModules.small-nvim
../../terminal/shell/zsh.nix
../../terminal/programs
../../terminal/programs/lazygit.nix
# ../../terminal/shell/zsh.nix
# ../../terminal/programs
# ../../terminal/programs/lazygit.nix
# ../../develop
# ../../develop/small-misc.nix
];
@ -23,5 +23,15 @@
wakatime.enable = false;
};
develop.enable = true;
desktop = {
xdg.enable = true;
};
programs.terminal = {
shell.zsh.enable = true;
direnv.enable = true;
comma.enable = true;
tmux.enable = true;
irssi.enable = true;
};
};
}

View file

@ -1,3 +1,4 @@
# TODO: move this somewhere more reasonable
{
config,
pkgs,