initial commit

This commit is contained in:
Nickolaj Jepsen 2024-04-07 17:53:24 +00:00
commit b5febd4395
11 changed files with 861 additions and 0 deletions

50
home-manager/default.nix Normal file
View file

@ -0,0 +1,50 @@
{
pkgs,
inputs,
username,
...
}: {
imports = [
./modules/fish/default.nix
./modules/nixvim/default.nix
];
nixpkgs = {
config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
};
};
home = {
username = username;
homeDirectory = "/home/${username}";
};
home.packages = with pkgs; [
fzf
ripgrep
fd
git
jq
httpie
git
gh
];
programs.git = {
enable = true;
userName = "Nickolaj Jepsen";
userEmail = "nickolaj@fireproof.website";
extraConfig = {
push = {
autoSetupRemote = true;
};
pull = {
rebase = true;
};
};
};
home.stateVersion = "23.11";
}

View 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

View 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

View 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

View 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
'';
};
}

View 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 })";
};
};
};
};
}

8
home-manager/wsl.nix Normal file
View file

@ -0,0 +1,8 @@
{
pkgs,
...
}: {
home.packages = with pkgs; [
nodejs_20
];
}