wip(home): refactor home modules *WILL NOT BUILD*
This commit is contained in:
parent
2033810429
commit
6a591ecbf7
115 changed files with 1028 additions and 791 deletions
18
home/modules/console/tools/bat.nix
Normal file
18
home/modules/console/tools/bat.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.ooknet.tools.bat;
|
||||
in
|
||||
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
config = {
|
||||
theme = "base16";
|
||||
pager = "less -FR";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
14
home/modules/console/tools/btop.nix
Normal file
14
home/modules/console/tools/btop.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.ooknet.tools.btop;
|
||||
in
|
||||
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
programs.btop = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
14
home/modules/console/tools/default.nix
Normal file
14
home/modules/console/tools/default.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
imports = [
|
||||
./bat.nix
|
||||
./eza.nix
|
||||
./btop.nix
|
||||
./direnv.nix
|
||||
./fzf.nix
|
||||
./nixIndex.nix
|
||||
./git.nix
|
||||
./starship.nix
|
||||
./utils.nix
|
||||
./ssh.nix
|
||||
];
|
||||
}
|
||||
15
home/modules/console/tools/direnv.nix
Normal file
15
home/modules/console/tools/direnv.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.ooknet.tools.direnv;
|
||||
in
|
||||
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
14
home/modules/console/tools/eza.nix
Normal file
14
home/modules/console/tools/eza.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.ooknet.tools.eza;
|
||||
in
|
||||
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
25
home/modules/console/tools/fzf.nix
Normal file
25
home/modules/console/tools/fzf.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, config, osConfig, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
admin = osConfig.ooknet.host.admin;
|
||||
cfg = config.ooknet.tools.fzf;
|
||||
in
|
||||
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
fzf = {
|
||||
enable = true;
|
||||
enableFishIntegration = mkIf (admin.shell == "fish") true;
|
||||
defaultCommand = "rg --files --hidden";
|
||||
changeDirWidgetOptions = [
|
||||
"--preview 'eza --icons -L 3 -T --color always {} | head -200'"
|
||||
"--exact"
|
||||
];
|
||||
fileWidgetCommand = "rg --files";
|
||||
fileWidgetOptions = [
|
||||
"--preview 'bat --color=always {}'"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
26
home/modules/console/tools/git.nix
Normal file
26
home/modules/console/tools/git.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ pkgs, config, lib, osConfig, ... }:
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.ooknet.tools.git;
|
||||
admin = osConfig.ooknet.host.admin;
|
||||
in
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
package = pkgs.gitAndTools.gitFull;
|
||||
userName = admin.gitName;
|
||||
userEmail = admin.gitEmail;
|
||||
extraConfig = {
|
||||
gpg."ssh".program = "${pkgs._1password-gui}/bin/op-ssh-sign";
|
||||
};
|
||||
ignores = [ ".direnv" "result" ];
|
||||
lfs.enable = true;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
lazygit
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
21
home/modules/console/tools/nixIndex.nix
Normal file
21
home/modules/console/tools/nixIndex.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ lib, config, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.ooknet.tools.nixIndex;
|
||||
in
|
||||
|
||||
{
|
||||
imports = [ inputs.nix-index-db.hmModules.nix-index ];
|
||||
config = mkIf cfg.enable {
|
||||
programs = {
|
||||
nix-index = {
|
||||
enable = true;
|
||||
symlinkToCacheHome = true;
|
||||
};
|
||||
command-not-found.enable = false;
|
||||
nix-index-database.comma.enable = true;
|
||||
};
|
||||
home.sessionVariables.NIX_AUTO_RUN = "1";
|
||||
};
|
||||
}
|
||||
22
home/modules/console/tools/ssh.nix
Normal file
22
home/modules/console/tools/ssh.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ lib, config, osConfig, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.ooknet.tools.ssh;
|
||||
admin = osConfig.ooknet.host.admin;
|
||||
in
|
||||
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
extraConfig = /* config */''
|
||||
Host *
|
||||
IdentityAgent "~/.1password/agent.sock"
|
||||
'';
|
||||
};
|
||||
programs.fish.interactiveShellInit = mkIf (admin.shell == "fish") /* fish */ ''
|
||||
set -gx SSH_AUTH_SOCK ~/.1password/agent.sock
|
||||
'';
|
||||
};
|
||||
}
|
||||
76
home/modules/console/tools/starship.nix
Normal file
76
home/modules/console/tools/starship.nix
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.ooknet.tools.starship;
|
||||
inherit (lib) concatStrings mkIf;
|
||||
in
|
||||
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format = concatStrings [
|
||||
"$username"
|
||||
"$hostname"
|
||||
"$nix_shell"
|
||||
"$shlvl"
|
||||
"$directory"
|
||||
"$git_branch"
|
||||
"$git_commit"
|
||||
"$git_state"
|
||||
"$git_status"
|
||||
"$jobs"
|
||||
"$character"
|
||||
];
|
||||
|
||||
directory = {
|
||||
truncation_length = 0;
|
||||
truncate_to_repo = true;
|
||||
};
|
||||
|
||||
fill = {
|
||||
symbol = " ";
|
||||
disabled = false;
|
||||
};
|
||||
|
||||
character = {
|
||||
error_symbol = "[](bold red)";
|
||||
success_symbol = "[](bold green)";
|
||||
vimcmd_symbol = "[](bold yellow)";
|
||||
vimcmd_visual_symbol = "[](bold cyan)";
|
||||
vimcmd_replace_symbol = "[](bold purple)";
|
||||
vimcmd_replace_one_symbol = "[](bold purple)";
|
||||
};
|
||||
|
||||
aws.symbol = " ";
|
||||
conda.symbol = " ";
|
||||
dart.symbol = " ";
|
||||
directory.read_only = " ";
|
||||
docker_context.symbol = " ";
|
||||
elixir.symbol = " ";
|
||||
elm.symbol = " ";
|
||||
gcloud.symbol = " ";
|
||||
git_branch.symbol = " ";
|
||||
golang.symbol = " ";
|
||||
hg_branch.symbol = " ";
|
||||
java.symbol = " ";
|
||||
julia.symbol = " ";
|
||||
memory_usage.symbol = " ";
|
||||
nim.symbol = " ";
|
||||
nodejs.symbol = " ";
|
||||
package.symbol = " ";
|
||||
perl.symbol = " ";
|
||||
php.symbol = " ";
|
||||
python.symbol = " ";
|
||||
ruby.symbol = " ";
|
||||
rust.symbol = " ";
|
||||
scala.symbol = " ";
|
||||
shlvl.symbol = "";
|
||||
swift.symbol = " ";
|
||||
terraform.symbol = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
48
home/modules/console/tools/utils.nix
Normal file
48
home/modules/console/tools/utils.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
cfg = config.ooknet.console.utility.tools;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
bc # Calculator
|
||||
|
||||
# file utility
|
||||
duf
|
||||
du-dust
|
||||
fd
|
||||
ripgrep
|
||||
|
||||
# archive
|
||||
zip
|
||||
unzip
|
||||
unrar
|
||||
|
||||
# file transfer
|
||||
wget
|
||||
httpie # Better curl
|
||||
|
||||
# resource manager
|
||||
powertop
|
||||
|
||||
#shell scripting
|
||||
gum
|
||||
# audio ctrl
|
||||
pamixer
|
||||
|
||||
diffsitter # Better diff
|
||||
jq # JSON pretty printer and manipulator
|
||||
comma # Install and run with ","
|
||||
tldr # Community maintained help pages
|
||||
progress
|
||||
killall
|
||||
acpi
|
||||
|
||||
# Notifications
|
||||
libnotify
|
||||
|
||||
# Nix tooling
|
||||
alejandra
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue