refractor shell configurations with flake-parts
This commit is contained in:
parent
6f97b24115
commit
11fd8e0440
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
inputs,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
@ -14,7 +15,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.${config.my.shell.type}.shellAliases = inputs.self.lib.mergeAliases inputs.self.lib.commonAliases {
|
||||||
edit = "emacsclient -t";
|
edit = "emacsclient -t";
|
||||||
e = "edit";
|
e = "edit";
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
inputs,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
@ -33,7 +34,7 @@ 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 = {
|
home-manager.users.jawz.programs.${shellType}.shellAliases = inputs.self.lib.mergeAliases inputs.self.lib.commonAliases {
|
||||||
nixformat = ''
|
nixformat = ''
|
||||||
deadnix -e && \
|
deadnix -e && \
|
||||||
nix run nixpkgs#nixfmt-tree && \
|
nix run nixpkgs#nixfmt-tree && \
|
||||||
|
|||||||
@ -17,32 +17,23 @@
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
home-manager.users.jawz.programs.${config.my.shell.type} = {
|
home-manager.users.jawz.programs.${config.my.shell.type} = {
|
||||||
shellAliases = {
|
shellAliases = inputs.self.lib.mergeAliases inputs.self.lib.commonAliases {
|
||||||
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)"'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// (
|
// inputs.self.lib.shellConditional config.my.shell.type ''
|
||||||
if config.my.shell.type == "bash" then
|
list_root=$XDG_CONFIG_HOME/jawz/lists/jawz
|
||||||
{
|
export LW=$list_root/watch.txt
|
||||||
initExtra = ''
|
export LI=$list_root/instant.txt
|
||||||
|
export LC=$list_root/comic.txt
|
||||||
|
'' ''
|
||||||
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
|
||||||
|
|||||||
@ -57,7 +57,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
${shellType} = {
|
${shellType} = {
|
||||||
shellAliases = {
|
shellAliases = inputs.self.lib.mergeAliases inputs.self.lib.commonAliases {
|
||||||
cd = "z";
|
cd = "z";
|
||||||
hh = "hstr";
|
hh = "hstr";
|
||||||
ls = "eza --icons --group-directories-first";
|
ls = "eza --icons --group-directories-first";
|
||||||
@ -70,26 +70,17 @@ in
|
|||||||
uniq --count | sort -rn'';
|
uniq --count | sort -rn'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// (
|
// inputs.self.lib.shellConditional shellType ''
|
||||||
if shellType == "bash" then
|
if command -v fzf-share >/dev/null; then
|
||||||
{
|
source "$(fzf-share)/key-bindings.bash"
|
||||||
initExtra = ''
|
source "$(fzf-share)/completion.bash"
|
||||||
|
fi
|
||||||
|
'' ''
|
||||||
if command -v fzf-share >/dev/null; then
|
if command -v fzf-share >/dev/null; then
|
||||||
source "$(fzf-share)/key-bindings.bash"
|
source "$(fzf-share)/key-bindings.bash"
|
||||||
source "$(fzf-share)/completion.bash"
|
source "$(fzf-share)/completion.bash"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
initContent = ''
|
|
||||||
if command -v fzf-share >/dev/null; then
|
|
||||||
source "$(fzf-share)/key-bindings.bash"
|
|
||||||
source "$(fzf-share)/completion.bash"
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
programs = {
|
programs = {
|
||||||
starship.enable = true;
|
starship.enable = true;
|
||||||
|
|||||||
@ -192,6 +192,12 @@ in
|
|||||||
|> builtins.filter (
|
|> builtins.filter (
|
||||||
name: !(lib.hasPrefix "wg-" name) && name != "vps" && name != "router" && name != hostName
|
name: !(lib.hasPrefix "wg-" name) && name != "vps" && name != "router" && name != hostName
|
||||||
);
|
);
|
||||||
|
shellConditional = shellType: bashContent: zshContent:
|
||||||
|
if shellType == "bash" then
|
||||||
|
{ initExtra = bashContent; }
|
||||||
|
else
|
||||||
|
{ initContent = zshContent; };
|
||||||
|
mergeAliases = baseAliases: extraAliases: baseAliases // extraAliases;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user