Compare commits

..

No commits in common. "0beab15f24bda98e5d46f40109a04d8e7c617d1e" and "bb08c527902c3b81e9f5b1e42f4c70963f92f7e6" have entirely different histories.

7 changed files with 64 additions and 142 deletions

View File

@ -2,19 +2,35 @@
inputs, inputs,
config, config,
pkgs, pkgs,
lib,
osConfig,
... ...
}: }:
let {
home.stateVersion = "23.05";
programs = {
direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
git = {
enable = true;
userName = "Danilo Reyes";
userEmail = "CaptainJawZ@protonmail.com";
};
bash =
let
inherit (pkgs) fd fzf; inherit (pkgs) fd fzf;
inherit (inputs.jawz-scripts.packages.x86_64-linux) pokemon-colorscripts; inherit (inputs.jawz-scripts.packages.x86_64-linux) pokemon-colorscripts;
shellType = osConfig.my.shell.type; in
commonInit = '' {
${pokemon-colorscripts}/bin/pokemon-colorscripts -r --no-title enable = true;
export command_timeout=60 historyFile = "\${XDG_STATE_HOME}/bash/history";
''; historyControl = [
commonAliases = { "erasedups"
"ignorespace"
"ignoredups"
];
shellAliases = {
cp = "cp -i"; cp = "cp -i";
mv = "mv -i"; mv = "mv -i";
mkdir = "mkdir -p"; mkdir = "mkdir -p";
@ -34,44 +50,11 @@ let
cd /srv/pool/scrapping/JawZ/gallery-dl && cd /srv/pool/scrapping/JawZ/gallery-dl &&
xdg-open "$(${fd}/bin/fd . ./ Husbands wikifeet -tdirectory -d 1 | ${fzf}/bin/fzf -i)"''; xdg-open "$(${fd}/bin/fd . ./ Husbands wikifeet -tdirectory -d 1 | ${fzf}/bin/fzf -i)"'';
}; };
in
{
home.stateVersion = "23.05";
programs = {
direnv = {
enable = true;
enableBashIntegration = shellType == "bash";
enableZshIntegration = shellType == "zsh";
nix-direnv.enable = true;
};
git = {
enable = true;
userName = "Danilo Reyes";
userEmail = "CaptainJawZ@protonmail.com";
};
bash = lib.mkIf (shellType == "bash") {
enable = true;
historyFile = "\${XDG_STATE_HOME}/bash/history";
shellAliases = commonAliases;
enableVteIntegration = true; enableVteIntegration = true;
initExtra = commonInit; initExtra = ''
historyControl = [ ${pokemon-colorscripts}/bin/pokemon-colorscripts -r --no-title
"erasedups" export command_timeout=60
"ignorespace" '';
"ignoredups"
];
};
zsh = lib.mkIf (shellType == "zsh") {
enable = true;
dotDir = ".config/zsh";
shellAliases = commonAliases;
initContent = commonInit;
history = {
path = "\${XDG_STATE_HOME}/zsh/history";
expireDuplicatesFirst = true;
ignoreSpace = true;
ignoreAllDups = true;
};
}; };
}; };
xdg = { xdg = {

View File

@ -1,10 +1,8 @@
{ {
pkgs, pkgs,
config,
... ...
}: }:
let let
shellType = config.my.shell.type;
krita-thumbnailer = pkgs.writeTextFile { krita-thumbnailer = pkgs.writeTextFile {
name = "krita-thumbnailer"; name = "krita-thumbnailer";
destination = "/share/thumbnailers/kra.thumbnailer"; destination = "/share/thumbnailers/kra.thumbnailer";
@ -40,8 +38,7 @@ in
ghostty = { ghostty = {
enable = true; enable = true;
package = pkgs.ghostty; package = pkgs.ghostty;
enableBashIntegration = shellType == "bash"; enableBashIntegration = true;
enableZshIntegration = shellType == "zsh";
installBatSyntax = true; installBatSyntax = true;
installVimSyntax = true; installVimSyntax = true;
}; };

View File

@ -14,7 +14,7 @@
"doom/templates/programming.org".source = ../../dotfiles/doom/templates/programming.org; "doom/templates/programming.org".source = ../../dotfiles/doom/templates/programming.org;
}; };
services.lorri.enable = true; services.lorri.enable = true;
programs.${config.my.shell.type}.shellAliases = { programs.bash.shellAliases = {
edit = "emacsclient -t"; edit = "emacsclient -t";
e = "edit"; e = "edit";
}; };

View File

@ -5,7 +5,6 @@
... ...
}: }:
let let
shellType = config.my.shell.type;
packages = builtins.attrValues { packages = builtins.attrValues {
inherit (pkgs) inherit (pkgs)
nixfmt-rfc-style # formatting nixfmt-rfc-style # formatting
@ -32,12 +31,5 @@ in
}; };
config = lib.mkIf config.my.dev.nix.enable { config = lib.mkIf config.my.dev.nix.enable {
users.users.jawz = { inherit packages; }; users.users.jawz = { inherit packages; };
home-manager.users.jawz.programs.${shellType}.shellAliases = {
nixformat = ''
nix run unstable#deadnix -- -e && \
nix run unstable#nixfmt-tree && \
nix run unstable#statix fix
'';
};
}; };
} }

View File

@ -16,33 +16,21 @@
inherit (inputs.jawz-scripts.packages.x86_64-linux) download; inherit (inputs.jawz-scripts.packages.x86_64-linux) download;
in in
{ {
home-manager.users.jawz.programs.${config.my.shell.type} = { home-manager.users.jawz = {
programs.bash = {
shellAliases = { shellAliases = {
dl = "${download}/bin/download -u jawz -i"; dl = "${download}/bin/download -u jawz -i";
comic = ''dl "$(cat "$LC" | fzf --multi --exact -i)"''; comic = ''dl "$(cat "$LC" | fzf --multi --exact -i)"'';
gallery = ''dl "$(cat "$LW" | fzf --multi --exact -i)"''; gallery = ''dl "$(cat "$LW" | fzf --multi --exact -i)"'';
}; };
}
// (
if config.my.shell.type == "bash" then
{
initExtra = '' initExtra = ''
list_root=$XDG_CONFIG_HOME/jawz/lists/jawz list_root=$XDG_CONFIG_HOME/jawz/lists/jawz
export LW=$list_root/watch.txt export LW=$list_root/watch.txt
export LI=$list_root/instant.txt export LI=$list_root/instant.txt
export LC=$list_root/comic.txt export LC=$list_root/comic.txt
''; '';
} };
else };
{
initContent = ''
list_root=$XDG_CONFIG_HOME/jawz/lists/jawz
export LW=$list_root/watch.txt
export LI=$list_root/instant.txt
export LC=$list_root/comic.txt
'';
}
);
systemd.user = { systemd.user = {
services = services =
let let

View File

@ -1,20 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
options.my.shell.type = lib.mkOption {
type = lib.types.enum [
"bash"
"zsh"
];
default = "bash";
description = "The shell to use system-wide (bash or zsh)";
};
config = {
users.users.jawz.shell = pkgs.${config.my.shell.type};
programs.zsh.enable = config.my.shell.type == "zsh";
};
}

View File

@ -5,9 +5,6 @@
inputs, inputs,
... ...
}: }:
let
shellType = config.my.shell.type;
in
{ {
options.my.shell.tools.enable = lib.mkEnableOption "shell tools and utilities"; options.my.shell.tools.enable = lib.mkEnableOption "shell tools and utilities";
config = lib.mkIf config.my.shell.tools.enable { config = lib.mkIf config.my.shell.tools.enable {
@ -19,10 +16,15 @@ in
}; };
zoxide = { zoxide = {
enable = true; enable = true;
enableBashIntegration = shellType == "bash"; enableBashIntegration = true;
enableZshIntegration = shellType == "zsh";
}; };
${shellType} = { bash = {
initExtra = ''
if command -v fzf-share >/dev/null; then
source "$(fzf-share)/key-bindings.bash"
source "$(fzf-share)/completion.bash"
fi
'';
shellAliases = { shellAliases = {
cd = "z"; cd = "z";
hh = "hstr"; hh = "hstr";
@ -35,27 +37,7 @@ in
tr '[:upper:]' '[:lower:]' | sort | tr '[:upper:]' '[:lower:]' | sort |
uniq --count | sort -rn''; uniq --count | sort -rn'';
}; };
} };
// (
if shellType == "bash" then
{
initExtra = ''
if command -v fzf-share >/dev/null; then
source "$(fzf-share)/key-bindings.bash"
source "$(fzf-share)/completion.bash"
fi
'';
}
else
{
initContent = ''
if command -v fzf-share >/dev/null; then
source "$(fzf-share)/key-bindings.bash"
source "$(fzf-share)/completion.bash"
fi
'';
}
);
bat = { bat = {
enable = true; enable = true;
config.pager = "less -FR"; config.pager = "less -FR";