format
This commit is contained in:
@@ -15,9 +15,11 @@
|
||||
description = "The shell to use system-wide (bash or zsh)";
|
||||
};
|
||||
config = {
|
||||
users.users = lib.mkMerge (map (user: {
|
||||
${user}.shell = pkgs.${config.my.shell.type};
|
||||
}) (inputs.self.lib.normalizeUsers config.my.toggleUsers.shell));
|
||||
users.users = lib.mkMerge (
|
||||
map (user: {
|
||||
${user}.shell = pkgs.${config.my.shell.type};
|
||||
}) (inputs.self.lib.normalizeUsers config.my.toggleUsers.shell)
|
||||
);
|
||||
programs.zsh.enable = config.my.shell.type == "zsh";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,13 +8,15 @@
|
||||
{
|
||||
options.my.shell.exercism.enable = lib.mkEnableOption "Exercism coding practice platform";
|
||||
config = lib.mkIf config.my.shell.exercism.enable {
|
||||
users.users = let
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
exercism # learn to code
|
||||
bats # testing system, required by Exercism
|
||||
;
|
||||
};
|
||||
in inputs.self.lib.mkUserPackages lib config.my.toggleUsers.shell packages;
|
||||
users.users =
|
||||
let
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
exercism # learn to code
|
||||
bats # testing system, required by Exercism
|
||||
;
|
||||
};
|
||||
in
|
||||
inputs.self.lib.mkUserPackages lib config.my.toggleUsers.shell packages;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,14 +8,16 @@
|
||||
{
|
||||
options.my.shell.multimedia.enable = lib.mkEnableOption "multimedia CLI tools and codecs";
|
||||
config = lib.mkIf config.my.shell.multimedia.enable {
|
||||
sops.secrets."gallery-dl/secrets" = let
|
||||
# Use first user for secret ownership
|
||||
user = inputs.self.lib.getFirstUser config.my.toggleUsers.shell;
|
||||
in {
|
||||
sopsFile = ../../secrets/gallery.yaml;
|
||||
owner = user;
|
||||
mode = "0400";
|
||||
};
|
||||
sops.secrets."gallery-dl/secrets" =
|
||||
let
|
||||
# Use first user for secret ownership
|
||||
user = inputs.self.lib.getFirstUser config.my.toggleUsers.shell;
|
||||
in
|
||||
{
|
||||
sopsFile = ../../secrets/gallery.yaml;
|
||||
owner = user;
|
||||
mode = "0400";
|
||||
};
|
||||
home-manager.users = inputs.self.lib.mkHomeManagerUsers lib config.my.toggleUsers.shell (user: {
|
||||
programs = {
|
||||
yt-dlp = {
|
||||
@@ -42,14 +44,16 @@
|
||||
};
|
||||
};
|
||||
});
|
||||
users.users = let
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
ffmpeg # not ffmpreg, the coolest video conversion tool!
|
||||
imagemagick # photoshop what??
|
||||
ffpb # make ffmpeg encoding... a bit fun
|
||||
;
|
||||
};
|
||||
in inputs.self.lib.mkUserPackages lib config.my.toggleUsers.shell packages;
|
||||
users.users =
|
||||
let
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
ffmpeg # not ffmpreg, the coolest video conversion tool!
|
||||
imagemagick # photoshop what??
|
||||
ffpb # make ffmpeg encoding... a bit fun
|
||||
;
|
||||
};
|
||||
in
|
||||
inputs.self.lib.mkUserPackages lib config.my.toggleUsers.shell packages;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,78 +13,78 @@ in
|
||||
config = lib.mkIf config.my.shell.tools.enable {
|
||||
home-manager.users = inputs.self.lib.mkHomeManagerUsers lib config.my.toggleUsers.shell (user: {
|
||||
programs = {
|
||||
hstr.enable = true;
|
||||
htop = {
|
||||
enable = true;
|
||||
package = pkgs.htop-vim;
|
||||
};
|
||||
eza = {
|
||||
enable = true;
|
||||
git = true;
|
||||
icons = "auto";
|
||||
};
|
||||
zoxide = {
|
||||
enable = true;
|
||||
enableBashIntegration = shellType == "bash";
|
||||
enableZshIntegration = shellType == "zsh";
|
||||
};
|
||||
bat = {
|
||||
enable = true;
|
||||
config.pager = "less -FR";
|
||||
extraPackages = builtins.attrValues {
|
||||
inherit (pkgs.bat-extras)
|
||||
batman # man pages
|
||||
batpipe # piping
|
||||
batgrep # ripgrep
|
||||
batdiff # this is getting crazy!
|
||||
batwatch # probably my next best friend
|
||||
prettybat # trans your sourcecode!
|
||||
;
|
||||
hstr.enable = true;
|
||||
htop = {
|
||||
enable = true;
|
||||
package = pkgs.htop-vim;
|
||||
};
|
||||
};
|
||||
password-store = {
|
||||
enable = false;
|
||||
package = pkgs.gopass;
|
||||
settings = {
|
||||
PASSWORD_STORE_AUTOCLIP = "true";
|
||||
PASSWORD_STORE_AUTOIMPORT = "false";
|
||||
PASSWORD_STORE_CLIPTIMEOUT = "45";
|
||||
PASSWORD_STORE_EXPORTKEYS = "false";
|
||||
PASSWORD_STORE_NOPAGER = "false";
|
||||
PASSWORD_STORE_NOTIFICATIONS = "false";
|
||||
PASSWORD_STORE_PARSING = "true";
|
||||
PASSWORD_STORE_PATH = "/home/${user}/.local/share/pass";
|
||||
PASSWORD_STORE_SAFECONTENT = "true";
|
||||
eza = {
|
||||
enable = true;
|
||||
git = true;
|
||||
icons = "auto";
|
||||
};
|
||||
};
|
||||
${shellType} = {
|
||||
shellAliases = inputs.self.lib.mergeAliases inputs.self.lib.commonAliases {
|
||||
cd = "z";
|
||||
hh = "hstr";
|
||||
ls = "eza --icons --group-directories-first";
|
||||
rm = "trash";
|
||||
b = "bat";
|
||||
f = "fzf --multi --exact -i";
|
||||
unique-extensions = ''
|
||||
fd -tf | rev | cut -d. -f1 | rev |
|
||||
tr '[:upper:]' '[:lower:]' | sort |
|
||||
uniq --count | sort -rn'';
|
||||
zoxide = {
|
||||
enable = true;
|
||||
enableBashIntegration = shellType == "bash";
|
||||
enableZshIntegration = shellType == "zsh";
|
||||
};
|
||||
}
|
||||
//
|
||||
inputs.self.lib.shellConditional shellType
|
||||
''
|
||||
if command -v fzf-share >/dev/null; then
|
||||
source "$(fzf-share)/key-bindings.bash"
|
||||
source "$(fzf-share)/completion.bash"
|
||||
fi
|
||||
''
|
||||
''
|
||||
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";
|
||||
extraPackages = builtins.attrValues {
|
||||
inherit (pkgs.bat-extras)
|
||||
batman # man pages
|
||||
batpipe # piping
|
||||
batgrep # ripgrep
|
||||
batdiff # this is getting crazy!
|
||||
batwatch # probably my next best friend
|
||||
prettybat # trans your sourcecode!
|
||||
;
|
||||
};
|
||||
};
|
||||
password-store = {
|
||||
enable = false;
|
||||
package = pkgs.gopass;
|
||||
settings = {
|
||||
PASSWORD_STORE_AUTOCLIP = "true";
|
||||
PASSWORD_STORE_AUTOIMPORT = "false";
|
||||
PASSWORD_STORE_CLIPTIMEOUT = "45";
|
||||
PASSWORD_STORE_EXPORTKEYS = "false";
|
||||
PASSWORD_STORE_NOPAGER = "false";
|
||||
PASSWORD_STORE_NOTIFICATIONS = "false";
|
||||
PASSWORD_STORE_PARSING = "true";
|
||||
PASSWORD_STORE_PATH = "/home/${user}/.local/share/pass";
|
||||
PASSWORD_STORE_SAFECONTENT = "true";
|
||||
};
|
||||
};
|
||||
${shellType} = {
|
||||
shellAliases = inputs.self.lib.mergeAliases inputs.self.lib.commonAliases {
|
||||
cd = "z";
|
||||
hh = "hstr";
|
||||
ls = "eza --icons --group-directories-first";
|
||||
rm = "trash";
|
||||
b = "bat";
|
||||
f = "fzf --multi --exact -i";
|
||||
unique-extensions = ''
|
||||
fd -tf | rev | cut -d. -f1 | rev |
|
||||
tr '[:upper:]' '[:lower:]' | sort |
|
||||
uniq --count | sort -rn'';
|
||||
};
|
||||
}
|
||||
//
|
||||
inputs.self.lib.shellConditional shellType
|
||||
''
|
||||
if command -v fzf-share >/dev/null; then
|
||||
source "$(fzf-share)/key-bindings.bash"
|
||||
source "$(fzf-share)/completion.bash"
|
||||
fi
|
||||
''
|
||||
''
|
||||
if command -v fzf-share >/dev/null; then
|
||||
source "$(fzf-share)/key-bindings.bash"
|
||||
source "$(fzf-share)/completion.bash"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
});
|
||||
programs = {
|
||||
@@ -96,23 +96,25 @@ in
|
||||
vimAlias = true;
|
||||
};
|
||||
};
|
||||
users.users = let
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
ripgrep # modern grep
|
||||
dust # rusty du similar to gdu
|
||||
fd # modern find, faster searches
|
||||
fzf # fuzzy finder! super cool and useful
|
||||
gdu # disk-space utility checker, somewhat useful
|
||||
tealdeer # man for retards
|
||||
trash-cli # oop! did not meant to delete that
|
||||
jq # json parser
|
||||
yq # yaml parser
|
||||
smartmontools # check hard drie health
|
||||
rmlint # amazing dupe finder that integrates well with BTRFS
|
||||
;
|
||||
};
|
||||
in inputs.self.lib.mkUserPackages lib config.my.toggleUsers.shell packages;
|
||||
users.users =
|
||||
let
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
ripgrep # modern grep
|
||||
dust # rusty du similar to gdu
|
||||
fd # modern find, faster searches
|
||||
fzf # fuzzy finder! super cool and useful
|
||||
gdu # disk-space utility checker, somewhat useful
|
||||
tealdeer # man for retards
|
||||
trash-cli # oop! did not meant to delete that
|
||||
jq # json parser
|
||||
yq # yaml parser
|
||||
smartmontools # check hard drie health
|
||||
rmlint # amazing dupe finder that integrates well with BTRFS
|
||||
;
|
||||
};
|
||||
in
|
||||
inputs.self.lib.mkUserPackages lib config.my.toggleUsers.shell packages;
|
||||
environment.variables = {
|
||||
HISTFILE = "\${XDG_STATE_HOME}/bash/history";
|
||||
LESSHISTFILE = "-";
|
||||
|
||||
Reference in New Issue
Block a user