Compare commits
No commits in common. "0beab15f24bda98e5d46f40109a04d8e7c617d1e" and "bb08c527902c3b81e9f5b1e42f4c70963f92f7e6" have entirely different histories.
0beab15f24
...
bb08c52790
@ -2,46 +2,14 @@
|
||||
inputs,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (pkgs) fd fzf;
|
||||
inherit (inputs.jawz-scripts.packages.x86_64-linux) pokemon-colorscripts;
|
||||
shellType = osConfig.my.shell.type;
|
||||
commonInit = ''
|
||||
${pokemon-colorscripts}/bin/pokemon-colorscripts -r --no-title
|
||||
export command_timeout=60
|
||||
'';
|
||||
commonAliases = {
|
||||
cp = "cp -i";
|
||||
mv = "mv -i";
|
||||
mkdir = "mkdir -p";
|
||||
mkcd = "(){ mkdir -p \"$1\" && cd \"$1\" }";
|
||||
copy = "xclip -selection clipboard";
|
||||
cdp = "pwd | copy";
|
||||
cfp = "(){ readlink -f \"$1\" | copy }";
|
||||
".." = "cd ..";
|
||||
"..." = "cd ../..";
|
||||
".3" = "cd ../../..";
|
||||
".4" = "cd ../../../..";
|
||||
".5" = "cd ../../../../..";
|
||||
c = "cat";
|
||||
sc = "systemctl --user";
|
||||
jc = "journalctl --user -xefu";
|
||||
open-gallery = ''
|
||||
cd /srv/pool/scrapping/JawZ/gallery-dl &&
|
||||
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";
|
||||
enableBashIntegration = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
git = {
|
||||
@ -49,30 +17,45 @@ in
|
||||
userName = "Danilo Reyes";
|
||||
userEmail = "CaptainJawZ@protonmail.com";
|
||||
};
|
||||
bash = lib.mkIf (shellType == "bash") {
|
||||
enable = true;
|
||||
historyFile = "\${XDG_STATE_HOME}/bash/history";
|
||||
shellAliases = commonAliases;
|
||||
enableVteIntegration = true;
|
||||
initExtra = commonInit;
|
||||
historyControl = [
|
||||
"erasedups"
|
||||
"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;
|
||||
bash =
|
||||
let
|
||||
inherit (pkgs) fd fzf;
|
||||
inherit (inputs.jawz-scripts.packages.x86_64-linux) pokemon-colorscripts;
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
historyFile = "\${XDG_STATE_HOME}/bash/history";
|
||||
historyControl = [
|
||||
"erasedups"
|
||||
"ignorespace"
|
||||
"ignoredups"
|
||||
];
|
||||
shellAliases = {
|
||||
cp = "cp -i";
|
||||
mv = "mv -i";
|
||||
mkdir = "mkdir -p";
|
||||
mkcd = "(){ mkdir -p \"$1\" && cd \"$1\" }";
|
||||
copy = "xclip -selection clipboard";
|
||||
cdp = "pwd | copy";
|
||||
cfp = "(){ readlink -f \"$1\" | copy }";
|
||||
".." = "cd ..";
|
||||
"..." = "cd ../..";
|
||||
".3" = "cd ../../..";
|
||||
".4" = "cd ../../../..";
|
||||
".5" = "cd ../../../../..";
|
||||
c = "cat";
|
||||
sc = "systemctl --user";
|
||||
jc = "journalctl --user -xefu";
|
||||
open-gallery = ''
|
||||
cd /srv/pool/scrapping/JawZ/gallery-dl &&
|
||||
xdg-open "$(${fd}/bin/fd . ./ Husbands wikifeet -tdirectory -d 1 | ${fzf}/bin/fzf -i)"'';
|
||||
};
|
||||
enableVteIntegration = true;
|
||||
initExtra = ''
|
||||
${pokemon-colorscripts}/bin/pokemon-colorscripts -r --no-title
|
||||
export command_timeout=60
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
xdg = {
|
||||
enable = true;
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
shellType = config.my.shell.type;
|
||||
krita-thumbnailer = pkgs.writeTextFile {
|
||||
name = "krita-thumbnailer";
|
||||
destination = "/share/thumbnailers/kra.thumbnailer";
|
||||
@ -40,8 +38,7 @@ in
|
||||
ghostty = {
|
||||
enable = true;
|
||||
package = pkgs.ghostty;
|
||||
enableBashIntegration = shellType == "bash";
|
||||
enableZshIntegration = shellType == "zsh";
|
||||
enableBashIntegration = true;
|
||||
installBatSyntax = true;
|
||||
installVimSyntax = true;
|
||||
};
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
"doom/templates/programming.org".source = ../../dotfiles/doom/templates/programming.org;
|
||||
};
|
||||
services.lorri.enable = true;
|
||||
programs.${config.my.shell.type}.shellAliases = {
|
||||
programs.bash.shellAliases = {
|
||||
edit = "emacsclient -t";
|
||||
e = "edit";
|
||||
};
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
shellType = config.my.shell.type;
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
nixfmt-rfc-style # formatting
|
||||
@ -32,12 +31,5 @@ in
|
||||
};
|
||||
config = lib.mkIf config.my.dev.nix.enable {
|
||||
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
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@ -16,33 +16,21 @@
|
||||
inherit (inputs.jawz-scripts.packages.x86_64-linux) download;
|
||||
in
|
||||
{
|
||||
home-manager.users.jawz.programs.${config.my.shell.type} = {
|
||||
shellAliases = {
|
||||
dl = "${download}/bin/download -u jawz -i";
|
||||
comic = ''dl "$(cat "$LC" | fzf --multi --exact -i)"'';
|
||||
gallery = ''dl "$(cat "$LW" | fzf --multi --exact -i)"'';
|
||||
home-manager.users.jawz = {
|
||||
programs.bash = {
|
||||
shellAliases = {
|
||||
dl = "${download}/bin/download -u jawz -i";
|
||||
comic = ''dl "$(cat "$LC" | fzf --multi --exact -i)"'';
|
||||
gallery = ''dl "$(cat "$LW" | fzf --multi --exact -i)"'';
|
||||
};
|
||||
initExtra = ''
|
||||
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
|
||||
'';
|
||||
};
|
||||
}
|
||||
// (
|
||||
if config.my.shell.type == "bash" then
|
||||
{
|
||||
initExtra = ''
|
||||
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
|
||||
'';
|
||||
}
|
||||
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 = {
|
||||
services =
|
||||
let
|
||||
|
||||
@ -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";
|
||||
};
|
||||
}
|
||||
@ -5,9 +5,6 @@
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
shellType = config.my.shell.type;
|
||||
in
|
||||
{
|
||||
options.my.shell.tools.enable = lib.mkEnableOption "shell tools and utilities";
|
||||
config = lib.mkIf config.my.shell.tools.enable {
|
||||
@ -19,10 +16,15 @@ in
|
||||
};
|
||||
zoxide = {
|
||||
enable = true;
|
||||
enableBashIntegration = shellType == "bash";
|
||||
enableZshIntegration = shellType == "zsh";
|
||||
enableBashIntegration = true;
|
||||
};
|
||||
${shellType} = {
|
||||
bash = {
|
||||
initExtra = ''
|
||||
if command -v fzf-share >/dev/null; then
|
||||
source "$(fzf-share)/key-bindings.bash"
|
||||
source "$(fzf-share)/completion.bash"
|
||||
fi
|
||||
'';
|
||||
shellAliases = {
|
||||
cd = "z";
|
||||
hh = "hstr";
|
||||
@ -35,27 +37,7 @@ in
|
||||
tr '[:upper:]' '[:lower:]' | sort |
|
||||
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 = {
|
||||
enable = true;
|
||||
config.pager = "less -FR";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user