mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 16:16:50 +01:00
initial commit
This commit is contained in:
commit
b5febd4395
11 changed files with 861 additions and 0 deletions
38
home-manager/modules/fish/conf.d/10_theme.fish
Normal file
38
home-manager/modules/fish/conf.d/10_theme.fish
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
set -gx theme_date_timezone Europe/Copenhagen
|
||||
set -gx theme_date_format "+%a %H:%M"
|
||||
|
||||
function bobthefish_colors -S -d 'Define a custom bobthefish color scheme'
|
||||
|
||||
# Optionally include a base color scheme
|
||||
# __bobthefish_colors default
|
||||
|
||||
# Then override everything you want!
|
||||
# Note that these must be defined with `set -x`
|
||||
set -x color_initial_segment_exit white red --bold
|
||||
set -x color_initial_segment_su white green --bold
|
||||
set -x color_initial_segment_jobs white blue --bold
|
||||
|
||||
set -x color_path 161616 888
|
||||
set -x color_path_basename 161616 white
|
||||
set -x color_path_nowrite magenta black
|
||||
set -x color_path_nowrite_basename magenta black --bold
|
||||
|
||||
set -x color_repo green black
|
||||
set -x color_repo_work_tree black black --bold
|
||||
set -x color_repo_dirty brred black
|
||||
set -x color_repo_staged yellow black
|
||||
|
||||
set -x color_vi_mode_default brblue black --bold
|
||||
set -x color_vi_mode_insert brgreen black --bold
|
||||
set -x color_vi_mode_visual bryellow black --bold
|
||||
|
||||
set -x color_vagrant brcyan black
|
||||
set -x color_k8s magenta white --bold
|
||||
set -x color_username black white --bold
|
||||
set -x color_hostname black white
|
||||
set -x color_rvm brmagenta black --bold
|
||||
set -x color_virtualfish brblue black --bold
|
||||
set -x color_virtualgo brblue black --bold
|
||||
set -x color_desk brblue black --bold
|
||||
set -g theme_display_nix yes
|
||||
end
|
||||
37
home-manager/modules/fish/conf.d/20_alias.fish
Normal file
37
home-manager/modules/fish/conf.d/20_alias.fish
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
if type -q nvim
|
||||
alias vim nvim
|
||||
end
|
||||
|
||||
if type -q docker
|
||||
abbr d "docker"
|
||||
end
|
||||
|
||||
if type -q docker-compose
|
||||
abbr dc "docker-compose"
|
||||
end
|
||||
|
||||
if type -q snap
|
||||
set PYCHARM_SNAP (snap list | grep 'pycharm' | awk '{ print $1 }')
|
||||
set HELM_SNAP (snap list | grep 'helm' | awk '{ print $1 }')
|
||||
if test -n "$HELM_SNAP"
|
||||
alias helm "snap run $HELM_SNAP"
|
||||
end
|
||||
if test -n "$PYCHARM_SNAP"
|
||||
alias pycharm "snap run $PYCHARM_SNAP"
|
||||
end
|
||||
end
|
||||
|
||||
if type -q to
|
||||
abbr z "to"
|
||||
end
|
||||
|
||||
if type -q broot
|
||||
abbr br "broot"
|
||||
end
|
||||
|
||||
if type -q terraform
|
||||
abbr tf "terraform"
|
||||
abbr tfp "terraform plan"
|
||||
abbr tfa "terraform apply"
|
||||
abbr tfi "terraform init"
|
||||
end
|
||||
47
home-manager/modules/fish/conf.d/30_kubectl.fish
Normal file
47
home-manager/modules/fish/conf.d/30_kubectl.fish
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
set __kube_verbs get describe delete edit
|
||||
set __kube_verbs_short g d rm e
|
||||
set __kube_resource pods deployments services ingresses configmaps daemonsets statefulsets namespace namespace
|
||||
set __kube_resource_short p d s i c ds ss n ns
|
||||
|
||||
function __echo_kubeexec;
|
||||
set _flag_namespace (kubectl config view --minify --output 'jsonpath={..namespace}')
|
||||
if test -z "$_flag_namespace"
|
||||
set _flag_namespace default
|
||||
end
|
||||
|
||||
set _flag_pod shop
|
||||
set POD (kubectl get pods --namespace $_flag_namespace 2>/dev/null | grep "^$_flag_pod" | grep Running | head -n1 | awk '{ print $1 }')
|
||||
if test -z "$POD"
|
||||
echo "kubectl exec --namespace $_flag_namespace -it"
|
||||
return
|
||||
end
|
||||
echo "kubectl exec --namespace $_flag_namespace -it $POD --"
|
||||
end
|
||||
|
||||
if type -q kubectl
|
||||
for verb_index in (seq (count $__kube_verbs))
|
||||
abbr "k$__kube_verbs_short[$verb_index]" "kubectl $__kube_verbs[$verb_index]"
|
||||
for res_index in (seq (count $__kube_resource))
|
||||
abbr "k$__kube_verbs_short[$verb_index]$__kube_resource_short[$res_index]" "kubectl $__kube_verbs[$verb_index] $__kube_resource[$res_index]"
|
||||
end
|
||||
end
|
||||
|
||||
abbr k kubectl
|
||||
abbr kl kubectl logs -f
|
||||
abbr kgl kubectl logs -f
|
||||
abbr kaf kubectl apply -f
|
||||
abbr kr kubectl rollout
|
||||
abbr krs kubectl rollout status
|
||||
abbr krr kubectl rollout restart
|
||||
abbr kt kubectl top
|
||||
abbr ktp kubectl top pods
|
||||
abbr ktn kubectl top nodes
|
||||
abbr kpf kubectl port-forward
|
||||
abbr kfp kubectl port-forward
|
||||
|
||||
alias kns "kubectl config view --minify --output 'jsonpath={..namespace}'"
|
||||
abbr ksns "kubectl config set-context --current --namespace"
|
||||
|
||||
abbr kexec --function __echo_kubeexec
|
||||
abbr kmanage "kexec python3 /src/lib/manage.py"
|
||||
end
|
||||
42
home-manager/modules/fish/default.nix
Normal file
42
home-manager/modules/fish/default.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
home.file."${config.home.homeDirectory}/.config/fish/conf.d/" = { source = ./conf.d; recursive = true;};
|
||||
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
plugins = with pkgs.fishPlugins; [
|
||||
{
|
||||
name = "fzf";
|
||||
src = fzf.src;
|
||||
}
|
||||
{
|
||||
name = "bobthefish";
|
||||
src = bobthefish.src;
|
||||
}
|
||||
{
|
||||
name = "to";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "joehillen";
|
||||
repo = "to-fish";
|
||||
rev = "52b151cfe67c00cb64d80ccc6dae398f20364938";
|
||||
hash = "sha256-DfDsU/qY2XdYlkLISIOv02ggHfKEpb+YompNWWjs5/A=";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Init fish from bash
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
initExtra = ''
|
||||
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
|
||||
then
|
||||
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
|
||||
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
95
home-manager/modules/nixvim/default.nix
Normal file
95
home-manager/modules/nixvim/default.nix
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
];
|
||||
|
||||
programs.neovim = {
|
||||
defaultEditor = true;
|
||||
};
|
||||
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
|
||||
options = {
|
||||
number = true;
|
||||
relativenumber = false;
|
||||
tabstop = 4;
|
||||
shiftwidth = 4;
|
||||
expandtab = false;
|
||||
};
|
||||
|
||||
globals.mapleader = " ";
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
key = "jk";
|
||||
action = "<ESC>";
|
||||
mode = "i";
|
||||
}
|
||||
{
|
||||
key = "<leader>o";
|
||||
action = ":NvimTreeToggle<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
colorschemes.base16 = {
|
||||
enable = true;
|
||||
colorscheme = "twilight";
|
||||
};
|
||||
|
||||
plugins = {
|
||||
barbecue.enable = true;
|
||||
nvim-colorizer.enable = true;
|
||||
gitsigns.enable = true;
|
||||
indent-blankline.enable = true;
|
||||
surround.enable = true;
|
||||
bufferline.enable = true;
|
||||
nvim-autopairs.enable = true;
|
||||
lsp-format.enable = true;
|
||||
lightline.enable = true;
|
||||
intellitab.enable = true;
|
||||
which-key.enable = true;
|
||||
|
||||
telescope = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
"<leader>ff" = "find_files";
|
||||
};
|
||||
};
|
||||
|
||||
nvim-tree = {
|
||||
enable = true;
|
||||
filters.custom = [
|
||||
".git"
|
||||
];
|
||||
};
|
||||
|
||||
treesitter = {
|
||||
enable = true;
|
||||
nixGrammars = true;
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers.nil_ls.enable = true;
|
||||
};
|
||||
|
||||
lspkind = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
nvim-cmp = {
|
||||
enable = true;
|
||||
sources = [{ name = "nvim_lsp"; }];
|
||||
mappingPresets = [ "insert" ];
|
||||
mapping = {
|
||||
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue