refactor(home): homeModules -> ooknet
This commit is contained in:
parent
b81c929a0b
commit
1d1cb3092f
104 changed files with 214 additions and 255 deletions
|
|
@ -6,7 +6,7 @@
|
|||
# ./nvim
|
||||
];
|
||||
|
||||
options.homeModules.console.editor = {
|
||||
options.ooknet.console.editor = {
|
||||
helix = {
|
||||
enable = lib.mkEnableOption "Enable helix text editor";
|
||||
default = lib.mkOption {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{ inputs, config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.homeModules.console.editor.helix;
|
||||
cfg = config.ooknet.console.editor.helix;
|
||||
inherit (config) colorscheme;
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
|
||||
let
|
||||
cfg = config.homeModules.console.editor.helix;
|
||||
cfg = config.ooknet.console.editor.helix;
|
||||
in
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
let
|
||||
inherit (config.colorscheme) palette;
|
||||
cfg = config.homeModules.console.editor.nvim;
|
||||
cfg = config.ooknet.console.editor.nvim;
|
||||
in
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.homeModules.console.editor.nvim;
|
||||
cfg = config.ooknet.console.editor.nvim;
|
||||
in
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
./lualine.nix
|
||||
];
|
||||
|
||||
options.homeModules.console.editor.nvim.plugins = {
|
||||
options.ooknet.console.editor.nvim.plugins = {
|
||||
indentBlankline = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.homeModules.console.editor.nvim.plugins;
|
||||
cfg = config.ooknet.console.editor.nvim.plugins;
|
||||
in
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.homeModules.console.editor.nvim.plugins;
|
||||
cfg = config.ooknet.console.editor.nvim.plugins;
|
||||
in
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.homeModules.console.editor.nvim.plugins;
|
||||
cfg = config.ooknet.console.editor.nvim.plugins;
|
||||
in
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
let
|
||||
inherit (config.colorscheme) palette;
|
||||
cfg = config.homeModules.console.editor.nvim;
|
||||
cfg = config.ooknet.console.editor.nvim;
|
||||
in
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
# ./ranger
|
||||
];
|
||||
|
||||
options.homeModules.console.fileManager = {
|
||||
options.ooknet.console.fileManager = {
|
||||
lf = {
|
||||
enable = lib.mkEnableOption "Enable lf file manager";
|
||||
default = lib.mkOption {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
# - ripdrag support
|
||||
# - color parity with eza
|
||||
let
|
||||
cfg = config.homeModules.console.fileManager.lf;
|
||||
cfg = config.ooknet.console.fileManager.lf;
|
||||
in
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
./tmux
|
||||
];
|
||||
|
||||
options.homeModules.console.multiplexer = {
|
||||
options.ooknet.console.multiplexer = {
|
||||
zellij = {
|
||||
enable = lib.mkEnableOption "Enable zellij multiplexer";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.homeModules.console.multiplexer.tmux;
|
||||
cfg = config.ooknet.console.multiplexer.tmux;
|
||||
inherit (config.colorscheme) palette;
|
||||
in
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
inherit (config.colorscheme) palette;
|
||||
cfg = config.homeModules.console.multiplexer.zellij;
|
||||
cfg = config.ooknet.console.multiplexer.zellij;
|
||||
in
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,12 +1,5 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
./starship
|
||||
./starship.nix
|
||||
];
|
||||
|
||||
options.homeModules.console.prompt = {
|
||||
starship = {
|
||||
enable = lib.mkEnableOption "Enable starship prompt";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
77
home/modules/console/prompt/starship.nix
Normal file
77
home/modules/console/prompt/starship.nix
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.ooknet.console.prompt.starship;
|
||||
inherit (lib) concatStrings mkEnableOption mkIf;
|
||||
in
|
||||
|
||||
{
|
||||
options.ooknet.console.prompt.starship.enable = mkEnableOption "";
|
||||
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 = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.homeModules.console.prompt.starship;
|
||||
in
|
||||
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format =
|
||||
let
|
||||
git = "$git_branch$git_commit$git_state$git_status";
|
||||
cloud = "$aws$gcloud$openstack";
|
||||
in
|
||||
''
|
||||
($nix_shell)$directory(${git})(- ${cloud})$jobs$character
|
||||
'';
|
||||
|
||||
fill = {
|
||||
symbol = " ";
|
||||
disabled = false;
|
||||
};
|
||||
|
||||
# Core
|
||||
username = {
|
||||
format = "[$user]($style)";
|
||||
show_always = true;
|
||||
};
|
||||
hostname = {
|
||||
format = "[@$hostname]($style) ";
|
||||
ssh_only = false;
|
||||
style = "bold green";
|
||||
};
|
||||
shlvl = {
|
||||
format = "[$shlvl]($style) ";
|
||||
style = "bold cyan";
|
||||
threshold = 2;
|
||||
repeat = true;
|
||||
disabled = false;
|
||||
};
|
||||
cmd_duration = {
|
||||
format = "took [$duration]($style) ";
|
||||
};
|
||||
|
||||
directory = {
|
||||
format = "[$path]($style)( [$read_only]($read_only_style)) ";
|
||||
};
|
||||
nix_shell = {
|
||||
format = "[($name \\(develop\\) <- )$symbol]($style) ";
|
||||
impure_msg = "";
|
||||
symbol = " ";
|
||||
style = "bold red";
|
||||
};
|
||||
|
||||
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)";
|
||||
};
|
||||
|
||||
time = {
|
||||
format = "\\\[[$time]($style)\\\]";
|
||||
disabled = false;
|
||||
};
|
||||
|
||||
# Cloud
|
||||
gcloud = {
|
||||
format = "on [$symbol$active(/$project)(\\($region\\))]($style)";
|
||||
};
|
||||
aws = {
|
||||
format = "on [$symbol$profile(\\($region\\))]($style)";
|
||||
};
|
||||
|
||||
# Icon changes only \/
|
||||
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 = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.homeModules.console.shell.bash;
|
||||
cfg = config.ooknet.console.shell.bash;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
./zsh
|
||||
];
|
||||
|
||||
options.homeModules.console.shell = {
|
||||
options.ooknet.console.shell = {
|
||||
fish = {
|
||||
enable = lib.mkEnableOption "Enable fish configuration";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
cfg = config.homeModules.console.shell.fish;
|
||||
cfg = config.ooknet.console.shell.fish;
|
||||
inherit (lib) mkIf;
|
||||
hasPackage = pname: lib.any (p: p ? pname && p.pname == pname) config.home.packages;
|
||||
hasEza = hasPackage "eza";
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.homeModules.console.shell.zsh;
|
||||
cfg = config.ooknet.console.shell.zsh;
|
||||
in
|
||||
|
||||
{
|
||||
options.homeModules.console.shell.zsh.enable = mkEnableOption "";
|
||||
options.ooknet.console.shell.zsh.enable = mkEnableOption "";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.zsh = {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
./ssh
|
||||
];
|
||||
|
||||
options.homeModules.console.utility = {
|
||||
options.ooknet.console.utility = {
|
||||
nixIndex = {
|
||||
enable = lib.mkEnableOption "Enable nixIndex configuration";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
cfg = config.homeModules.console.utility.git;
|
||||
cfg = config.ooknet.console.utility.git;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
cfg = config.homeModules.console.utility.nixIndex;
|
||||
cfg = config.ooknet.console.utility.nixIndex;
|
||||
update-script = pkgs.writeShellApplication {
|
||||
name = "fetch-nix-index-database";
|
||||
runtimeInputs = with pkgs; [ wget coreutils ];
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
cfg = config.homeModules.console.utility.ssh;
|
||||
hasFish = mkIf config.homeModules.console.shell.fish.enable;
|
||||
cfg = config.ooknet.console.utility.ssh;
|
||||
hasFish = mkIf config.ooknet.console.shell.fish.enable;
|
||||
inherit (lib) mkIf;
|
||||
in
|
||||
|
||||
|
|
@ -16,9 +16,8 @@ in
|
|||
IdentityAgent "~/.1password/agent.sock"
|
||||
'';
|
||||
};
|
||||
programs.fish.interactiveShellInit = hasFish ''
|
||||
programs.fish.interactiveShellInit = hasFish /* fish */ ''
|
||||
set -gx SSH_AUTH_SOCK ~/.1password/agent.sock
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
cfg = config.homeModules.console.utility.tools;
|
||||
cfg = config.ooknet.console.utility.tools;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
|
@ -61,7 +61,7 @@ in
|
|||
};
|
||||
fzf = {
|
||||
enable = true;
|
||||
enableFishIntegration = lib.mkIf config.homeModules.console.shell.fish.enable true;
|
||||
enableFishIntegration = lib.mkIf config.ooknet.console.shell.fish.enable true;
|
||||
defaultCommand = "rg --files --hidden";
|
||||
changeDirWidgetOptions = [
|
||||
"--preview 'eza --icons -L 3 -T --color always {} | head -200'"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue