feat: inital public commit
This commit is contained in:
57
host/max/home/browser.nix
Normal file
57
host/max/home/browser.nix
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
profiles = {
|
||||
personal = {
|
||||
id = 0;
|
||||
name = "1. Personal";
|
||||
isDefault = true;
|
||||
settings = {
|
||||
"browser.search.defaultenginename" = "ddg";
|
||||
"browser.search.order.1" = "ddg";
|
||||
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||
};
|
||||
search = {
|
||||
force = true;
|
||||
default = "ddg";
|
||||
order = [ "ddg" "google" ];
|
||||
};
|
||||
userChrome = builtins.readFile ./browser/userChrome.css;
|
||||
};
|
||||
work = {
|
||||
id = 1;
|
||||
name = "2. Work";
|
||||
settings = {
|
||||
"browser.search.defaultenginename" = "ddg";
|
||||
"browser.search.order.1" = "ddg";
|
||||
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||
};
|
||||
search = {
|
||||
force = true;
|
||||
default = "ddg";
|
||||
order = [ "ddg" "google" ];
|
||||
};
|
||||
userChrome = builtins.readFile ./browser/userChrome.css;
|
||||
};
|
||||
school = {
|
||||
id = 2;
|
||||
name = "3. School";
|
||||
settings = {
|
||||
"browser.search.defaultenginename" = "ddg";
|
||||
"browser.search.order.1" = "ddg";
|
||||
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||
};
|
||||
search = {
|
||||
force = true;
|
||||
default = "ddg";
|
||||
order = [ "ddg" "google" ];
|
||||
};
|
||||
userChrome = builtins.readFile ./browser/userChrome.css;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
6
host/max/home/browser/userChrome.css
Normal file
6
host/max/home/browser/userChrome.css
Normal file
@@ -0,0 +1,6 @@
|
||||
.browserContainer > findbar {
|
||||
top: 0 !important;
|
||||
position: fixed !important;
|
||||
width: 1000px !important;
|
||||
right: 0 !important;
|
||||
}
|
||||
15
host/max/home/desktop.nix
Normal file
15
host/max/home/desktop.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ lib, ... }: {
|
||||
programs.plasma = {
|
||||
enable = true;
|
||||
workspace = { wallpaper = "/home/max/bg.jpg"; };
|
||||
|
||||
kwin = { virtualDesktops = { number = 9; }; };
|
||||
|
||||
input = {
|
||||
keyboard = {
|
||||
options = [ "caps:escape" ];
|
||||
layouts = [ { layout = "us"; } { layout = "cn"; } ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
29
host/max/home/git.nix
Normal file
29
host/max/home/git.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
publicGitEmail = "22125083+k2on@users.noreply.github.com";
|
||||
publicKey = "/home/max/.ssh/id_maxkey.pub";
|
||||
in
|
||||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Max Koon";
|
||||
userEmail = publicGitEmail;
|
||||
extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
|
||||
commit.gpgsign = true;
|
||||
gpg.format = "ssh";
|
||||
user.signing.key = publicKey;
|
||||
gpg.ssh.allowedSignersFile = "/home/max/.ssh/allowed_signers";
|
||||
};
|
||||
|
||||
signing = {
|
||||
signByDefault = true;
|
||||
key = publicKey;
|
||||
};
|
||||
};
|
||||
|
||||
home.file.".ssh/allowed_signers".text = ''
|
||||
${publicGitEmail} ${lib.fileContents ../keys/id_maxkey.pub}
|
||||
'';
|
||||
}
|
||||
262
host/max/home/nvim.nix
Normal file
262
host/max/home/nvim.nix
Normal file
@@ -0,0 +1,262 @@
|
||||
{ pkgs, ... }: {
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
|
||||
colorschemes.one.enable = true;
|
||||
|
||||
globals = {
|
||||
mapleader = " ";
|
||||
maplocalleader = " ";
|
||||
};
|
||||
|
||||
clipboard = {
|
||||
providers.wl-copy.enable = true;
|
||||
register = "unnamedplus";
|
||||
};
|
||||
|
||||
opts = {
|
||||
background = "light";
|
||||
relativenumber = true;
|
||||
cursorline = true;
|
||||
number = true;
|
||||
|
||||
signcolumn = "yes";
|
||||
|
||||
updatetime = 250;
|
||||
|
||||
list = true;
|
||||
listchars.__raw = "{ tab = '» ', trail = '·', nbsp = '␣' }";
|
||||
|
||||
};
|
||||
|
||||
extraConfigLua = ''
|
||||
require('stay-centered').setup({ enable = true })
|
||||
require('mini.ai').setup()
|
||||
'';
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<Esc>";
|
||||
action = "<cmd>nohlsearch<CR>";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>a";
|
||||
action.__raw = "function() require'harpoon':list():add() end";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-e>";
|
||||
action.__raw =
|
||||
"function() require'harpoon'.ui:toggle_quick_menu(require'harpoon':list()) end";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-j>";
|
||||
action.__raw = "function() require'harpoon':list():select(1) end";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-k>";
|
||||
action.__raw = "function() require'harpoon':list():select(2) end";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-l>";
|
||||
action.__raw = "function() require'harpoon':list():select(3) end";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-;>";
|
||||
action.__raw = "function() require'harpoon':list():select(4) end";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>b";
|
||||
action = "<cmd>Neotree<CR>";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>l";
|
||||
action = "<cmd>Neotree reveal<CR>";
|
||||
}
|
||||
];
|
||||
|
||||
diagnostic.settings.virtual_text = true;
|
||||
|
||||
userCommands.W.command = "w";
|
||||
|
||||
plugins = {
|
||||
|
||||
sleuth.enable = true;
|
||||
lastplace.enable = true;
|
||||
|
||||
gitsigns.enable = true;
|
||||
highlight-colors.enable = true;
|
||||
todo-comments.enable = true;
|
||||
# smear-cursor.enable = true;
|
||||
goyo.enable = true;
|
||||
|
||||
treesitter = {
|
||||
enable = true;
|
||||
settings = {
|
||||
ensureInstalled =
|
||||
[ "typescript" "rust" "php" "blade" "python" "nix" ];
|
||||
|
||||
highlight = { enable = true; };
|
||||
|
||||
indent = { enable = true; };
|
||||
};
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = true;
|
||||
|
||||
servers = {
|
||||
ts_ls.enable = true;
|
||||
rust_analyzer = {
|
||||
enable = true;
|
||||
installCargo = true;
|
||||
installRustc = true;
|
||||
};
|
||||
clangd.enable = true;
|
||||
tailwindcss.enable = true;
|
||||
phpactor.enable = true;
|
||||
pylsp.enable = true;
|
||||
pyright.enable = true;
|
||||
nixd.enable = true;
|
||||
};
|
||||
|
||||
keymaps = {
|
||||
extra = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "gd";
|
||||
action.__raw = "require('telescope.builtin').lsp_definitions";
|
||||
options = { desc = "LSP: [G]oto [D]efinition"; };
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gr";
|
||||
action.__raw = "require('telescope.builtin').lsp_references";
|
||||
options = { desc = "LSP: [G]oto [R]eferences"; };
|
||||
}
|
||||
];
|
||||
|
||||
lspBuf = {
|
||||
"<leader>." = {
|
||||
mode = [ "n" "x" ];
|
||||
action = "code_action";
|
||||
desc = "Code action";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
lazydev.enable = true;
|
||||
luasnip.enable = true;
|
||||
|
||||
telescope = {
|
||||
enable = true;
|
||||
|
||||
extensions = {
|
||||
fzf-native.enable = true;
|
||||
ui-select.enable = true;
|
||||
};
|
||||
|
||||
keymaps = {
|
||||
"<leader>sf" = {
|
||||
mode = "n";
|
||||
action = "find_files";
|
||||
options = { desc = "[S]earch [F]iles"; };
|
||||
};
|
||||
"<leader>sk" = {
|
||||
mode = "n";
|
||||
action = "live_grep";
|
||||
options = { desc = "[S]earch [S]tring"; };
|
||||
};
|
||||
};
|
||||
settings = {
|
||||
extensions.__raw =
|
||||
"{ ['ui-select'] = { require('telescope.themes').get_dropdown() } }";
|
||||
};
|
||||
};
|
||||
|
||||
cmp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
snippet = {
|
||||
expand = ''
|
||||
function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
completion = { completeopt = "menu,menuone,noinsert"; };
|
||||
formatting = {
|
||||
format = ''require("nvim-highlight-colors").format'';
|
||||
};
|
||||
mapping = {
|
||||
"<CR>" = "cmp.mapping.confirm { select = true }";
|
||||
"<Tab>" = "cmp.mapping.select_next_item()";
|
||||
"<S-Tab>" = "cmp.mapping.select_prev_item()";
|
||||
"<Down>" = "cmp.mapping.select_next_item()";
|
||||
"<Up>" = "cmp.mapping.select_prev_item()";
|
||||
"<C-j>" = "cmp.mapping.select_next_item()";
|
||||
"<C-k>" = "cmp.mapping.select_prev_item()";
|
||||
};
|
||||
sources = [
|
||||
{
|
||||
name = "lazydev";
|
||||
|
||||
group_index = 0;
|
||||
}
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "luasnip"; }
|
||||
{ name = "path"; }
|
||||
{ name = "nvim_lsp_signature_help"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
harpoon = {
|
||||
enable = true;
|
||||
settings.settings = { save_on_toggle = true; };
|
||||
};
|
||||
neo-tree = {
|
||||
enable = true;
|
||||
extraOptions = {
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
visible = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
wakatime.enable = true;
|
||||
autoclose.enable = true;
|
||||
ts-autotag.enable = true;
|
||||
spider = {
|
||||
enable = true;
|
||||
extraOptions = {
|
||||
subwordMovement = true;
|
||||
skipInsignificantPunctuation = false;
|
||||
};
|
||||
keymaps = {
|
||||
motions = {
|
||||
"w" = "w";
|
||||
"e" = "e";
|
||||
"b" = "b";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
extraPlugins = with pkgs.vimPlugins; [ stay-centered-nvim mini-ai ];
|
||||
|
||||
};
|
||||
}
|
||||
19
host/max/home/sops.nix
Normal file
19
host/max/home/sops.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ ... }:
|
||||
{
|
||||
sops = {
|
||||
|
||||
age.keyFile = "/home/max/.config/sops/age/keys.txt";
|
||||
|
||||
defaultSopsFile = ../../../secrets/sops/host/max/default.yaml;
|
||||
validateSopsFiles = false;
|
||||
|
||||
secrets = {
|
||||
"ssh_keys/max" = {
|
||||
path = "/home/max/.ssh/id_maxkey";
|
||||
};
|
||||
"waka_config" = {
|
||||
path = "/home/max/.wakatime.cfg";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
45
host/max/home/ssh.nix
Normal file
45
host/max/home/ssh.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
|
||||
extraConfig = ''
|
||||
Host m1
|
||||
HostName m1
|
||||
User admin
|
||||
|
||||
Host surface
|
||||
HostName surface
|
||||
User admin
|
||||
|
||||
Host ark
|
||||
HostName ark
|
||||
User admin
|
||||
|
||||
Host pi
|
||||
HostName 192.168.0.143
|
||||
User admin
|
||||
|
||||
Host ssh.koon.us
|
||||
HostName ssh.koon.us
|
||||
ProxyCommand cloudflared access ssh --hostname %h
|
||||
User git
|
||||
|
||||
AddKeysToAgent yes
|
||||
'';
|
||||
|
||||
matchBlocks = {
|
||||
"git" = {
|
||||
host = "github.com";
|
||||
user = "git";
|
||||
identityFile = [
|
||||
"~/.ssh/id_maxkey"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.file = {
|
||||
".ssh/id_maxkey.pub".source = ../keys/id_maxkey.pub;
|
||||
};
|
||||
}
|
||||
69
host/max/home/terminal.nix
Normal file
69
host/max/home/terminal.nix
Normal file
@@ -0,0 +1,69 @@
|
||||
{ pkgs, ... }: {
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
theme = "one_light";
|
||||
settings = {
|
||||
font = {
|
||||
normal.family = "Monocraft";
|
||||
size = 10;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.lf = { enable = true; };
|
||||
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
mouse = true;
|
||||
keyMode = "vi";
|
||||
shell = "${pkgs.zsh}/bin/zsh";
|
||||
extraConfig = ''
|
||||
set -g status-style bg=white
|
||||
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
'';
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion = {
|
||||
enable = true;
|
||||
highlight = "fg=#bbbbbb";
|
||||
};
|
||||
syntaxHighlighting.enable = true;
|
||||
dotDir = ".config/zsh";
|
||||
autocd = true;
|
||||
|
||||
# initExtra = builtins.readFile ./zsh-nix-shell.zsh;
|
||||
|
||||
shellAliases = {
|
||||
ll = "ls -la --color";
|
||||
v = "nvim";
|
||||
vi = "nvim";
|
||||
vim = "nvim";
|
||||
|
||||
k = "kubectl";
|
||||
|
||||
tt = "tt --theme one-light -n 10";
|
||||
|
||||
bible = "nvim ~/bible.txt -R";
|
||||
notes = "nvim ~/notes";
|
||||
home = "sudo nvim /etc/nixos/home.nix";
|
||||
wttr = "curl wttr.in/Clemson";
|
||||
|
||||
docx-to-pdf = "libreoffice --headless --convert-to pdf";
|
||||
};
|
||||
|
||||
plugins = [{
|
||||
name = "vi-mode";
|
||||
src = pkgs.zsh-vi-mode;
|
||||
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
|
||||
}];
|
||||
};
|
||||
|
||||
programs.starship = { enable = true; };
|
||||
}
|
||||
Reference in New Issue
Block a user