diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml new file mode 100644 index 0000000..eb8b30f --- /dev/null +++ b/.config/alacritty/alacritty.yml @@ -0,0 +1,77 @@ +window: + decorations: none + startup_mode: Maximized + +font: + normal: + family: Iosevka Term SS09 + style: Regular + + bold: + family: Iosevka Term SS09 + style: Semibold + + italic: + family: Iosevka Term Curly Slab + style: Light Italic + + bold_italic: + family: Iosevka SS15 + style: Extralight Italic + + size: 10 + + offset: + x: 0 + y: 3 + + glyph_offset: + x: 0 + y: 2 + +cursor: + # Values for `style`: + # - ▇ Block + # - _ Underline + # - | Beam + style: Block + vi_mode_style: Beam + unfocused_hollow: true + thickness: 0.15 + +mouse: + hide_when_typing: true + # url: + # launcher: + # program: /home/dln/bin/url-copy + +colors: + primary: + background: '#fcfcfc' + foreground: '#000000' + + normal: + black: '#212121' + red: '#b7141e' + green: '#457b23' + yellow: '#f5971d' + blue: '#134eb2' + magenta: '#550087' + cyan: '#0e707c' + white: '#eeeeee' + bright: + black: '#424242' + red: '#e83a3f' + green: '#7aba39' + yellow: '#fee92e' + blue: '#53a4f3' + magenta: '#a94dbb' + cyan: '#26bad1' + white: '#d8d8d8' + +key_bindings: +- { key: V, mods: Alt, action: Paste } +- { key: C, mods: Alt, action: Copy } +- { key: V, mods: Shift|Alt, action: Paste } +- { key: C, mods: Shift|Alt, action: Copy } +- { key: Return, mods: Alt, action: ToggleFullscreen } diff --git a/.config/bat/config b/.config/bat/config new file mode 100644 index 0000000..609fc6e --- /dev/null +++ b/.config/bat/config @@ -0,0 +1,3 @@ +--italic-text=always +--plain +--theme=ansi diff --git a/.config/chrome-beta-flags.conf b/.config/chrome-beta-flags.conf new file mode 100644 index 0000000..e77a043 --- /dev/null +++ b/.config/chrome-beta-flags.conf @@ -0,0 +1 @@ +--enable-features=OzonePlatform --ozone-platform=wayland diff --git a/.config/efm-langserver/config.yaml b/.config/efm-langserver/config.yaml new file mode 100644 index 0000000..a7b4c56 --- /dev/null +++ b/.config/efm-langserver/config.yaml @@ -0,0 +1,14 @@ +version: 2 +root-markers: +- .git/ + +tools: + clang-format: &clang-format + format-command: 'clang-format -style="{BasedOnStyle: Google, IndentWidth: 2, AlignConsecutiveDeclarations: true, AlignConsecutiveAssignments: true, ColumnLimit: 0}"' + format-stdin: true + +languages: + proto: + - <<: *clang-format + + diff --git a/.config/environment.d/difftastic.conf b/.config/environment.d/difftastic.conf new file mode 100644 index 0000000..b58731b --- /dev/null +++ b/.config/environment.d/difftastic.conf @@ -0,0 +1 @@ +DFT_BACKGROUND=light diff --git a/.config/environment.d/docker.conf b/.config/environment.d/docker.conf new file mode 100644 index 0000000..1747f14 --- /dev/null +++ b/.config/environment.d/docker.conf @@ -0,0 +1 @@ +DOCKER_HOST=unix://${XDG_RUNTIME_DIR}/podman/podman.sock diff --git a/.config/environment.d/golang.conf b/.config/environment.d/golang.conf new file mode 100644 index 0000000..ecea26b --- /dev/null +++ b/.config/environment.d/golang.conf @@ -0,0 +1 @@ +GOPROXY=https://athens.aarn.shelman.io diff --git a/.config/environment.d/mozilla.conf b/.config/environment.d/mozilla.conf new file mode 100644 index 0000000..e165145 --- /dev/null +++ b/.config/environment.d/mozilla.conf @@ -0,0 +1,2 @@ +MOZ_ENABLE_WAYLAND=1 +MOZ_DISABLE_RDD_SANDBOX=1 diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf new file mode 100644 index 0000000..2532559 --- /dev/null +++ b/.config/fontconfig/fonts.conf @@ -0,0 +1,35 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> +<fontconfig> + <alias> + <family>serif</family> + <prefer> + <family>Noto Color Emoji</family> + </prefer> + </alias> + <alias> + <family>sans-serif</family> + <prefer> + <family>Noto Color Emoji</family> + </prefer> + </alias> + <alias> + <family>monospace</family> + <prefer> + <family>Noto Color Emoji</family> + </prefer> + </alias> + <!-- + <dir>~/.fonts</dir> + <match target="font"> + <edit mode="assign" name="hinting"> + <bool>true</bool> + </edit> + </match> + <match target="font"> + <edit mode="assign" name="hintstyle"> + <const>hintmedium</const> + </edit> + </match> + --> +</fontconfig> diff --git a/.config/gitui/theme.ron b/.config/gitui/theme.ron new file mode 100644 index 0000000..45a81d3 --- /dev/null +++ b/.config/gitui/theme.ron @@ -0,0 +1,23 @@ +( + selected_tab: Reset, + command_fg: Rgb(2, 119, 189), + selection_bg: Rgb(225, 245, 254), + selection_fg: Reset, + cmdbar_extra_lines_bg: Rgb(2, 136, 209), + cmdbar_bg: Reset, + disabled_fg: Rgb(109, 76, 65), + diff_line_add: Rgb(56, 142, 60), + diff_line_delete: Rgb(230, 74, 25), + diff_file_added: Rgb(56, 142, 60), + diff_file_removed: Rgb(230, 74, 25), + diff_file_moved: Rgb(156, 39, 176), + diff_file_modified: Rgb(255, 111, 0), + commit_hash: Magenta, + commit_time: Rgb(0, 131, 143), + commit_author: Green, + danger_fg: Red, + push_gauge_bg: Blue, + push_gauge_fg: Reset, + tag_fg: LightMagenta, + branch_fg: LightBlue +) diff --git a/.config/k9s/skin.yml b/.config/k9s/skin.yml new file mode 100644 index 0000000..81ecb20 --- /dev/null +++ b/.config/k9s/skin.yml @@ -0,0 +1,100 @@ +# K9s Gruvbox Light Skin Contributed by [@indiebrain](https://github.com/indiebrain) +foreground: &foreground default +background: &background default +current_line: ¤t_line "#ebdbb2" +selection: &selection "#3c3735" +comment: &comment "#bdad93" +cyan: &cyan "#78ad79" +green: &green "#989719" +orange: &orange "#d79920" +magenta: &magenta "#b16185" +blue: &blue "#448488" +red: &red "#cc231c" + +k9s: + body: + fgColor: *foreground + bgColor: *background + logoColor: *blue + prompt: + fgColor: *foreground + bgColor: *background + suggestColor: *orange + info: + fgColor: *magenta + sectionColor: *foreground + help: + fgColor: *foreground + bgColor: *background + keyColor: *magenta + numKeyColor: *blue + sectionColor: *green + dialog: + fgColor: *foreground + bgColor: *background + buttonFgColor: *foreground + buttonBgColor: *magenta + buttonFocusFgColor: white + buttonFocusBgColor: *cyan + labelFgColor: *orange + fieldFgColor: *foreground + frame: + border: + fgColor: *selection + focusColor: *current_line + menu: + fgColor: *foreground + keyColor: *magenta + numKeyColor: *magenta + crumbs: + fgColor: *foreground + bgColor: *comment + activeColor: *blue + status: + newColor: *cyan + modifyColor: *blue + addColor: *green + errorColor: *red + highlightColor: *orange + killColor: *comment + completedColor: *comment + title: + fgColor: *foreground + bgColor: *background + highlightColor: *orange + counterColor: *blue + filterColor: *magenta + views: + charts: + bgColor: background + defaultDialColors: + - *blue + - *red + defaultChartColors: + - *blue + - *red + table: + fgColor: *foreground + bgColor: *background + cursorFgColor: *foreground + cursorBgColor: *current_line + header: + fgColor: *foreground + bgColor: *background + sorterColor: *selection + xray: + fgColor: *foreground + bgColor: *background + cursorColor: *current_line + graphicColor: *blue + showIcons: false + yaml: + keyColor: *magenta + colonColor: *blue + valueColor: *foreground + logs: + fgColor: *foreground + bgColor: *background + indicator: + fgColor: *foreground + bgColor: *background diff --git a/.config/nvim/.netrwhist b/.config/nvim/.netrwhist new file mode 100644 index 0000000..823f9b5 --- /dev/null +++ b/.config/nvim/.netrwhist @@ -0,0 +1,12 @@ +let g:netrw_dirhistmax =10 +let g:netrw_dirhistcnt =4 +let g:netrw_dirhist_4='/home/dln/src/github.com/tocaboca/Toca-Days/Infrastructure/Helm' +let g:netrw_dirhist_3='/home/dln/src/github.com/tocaboca/Toca-Days/Infrastructure/Helm/days' +let g:netrw_dirhist_2='/home/dln/src/github.com/tocaboca/toca-days-prod/blessings' +let g:netrw_dirhist_1='/home/dln/src/github.com/tocaboca/toca-infrastructure/flux/k8s/infra/tenants/toca-studio/clusters/studio' +let g:netrw_dirhist_0='/home/dln/src/github.com/tocaboca/toca-infrastructure/linkerd/gateway' +let g:netrw_dirhist_9='/home/dln/src/github.com/tocaboca/toca-infrastructure/cluster/terraform' +let g:netrw_dirhist_8='/home/dln/src/github.com/shelmangroup/tf-infra/lab001/vms/modules/fcos_vault_agent' +let g:netrw_dirhist_7='/tmp/squid/etc' +let g:netrw_dirhist_6='/tmp/squid' +let g:netrw_dirhist_5='/tmp/squid/etc' diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..74740c5 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,2 @@ +require("config.options") +require("config.lazy") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..c11e5be --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,56 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "6821b3ae27a57f1f3cf8ed030e4a55d70d0c4e43" }, + "catppuccin": { "branch": "main", "commit": "7c392fb5f27daa6addee050f7b7522718e8d9357" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "8fcc934a52af96120fe26358985c10c035984b53" }, + "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, + "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-tmux": { "branch": "main", "commit": "984772716f66d8ee88535a6bf3f94c4b4e1301f5" }, + "colorbuddy.vim": { "branch": "master", "commit": "cdb5b0654d3cafe61d2a845e15b2b4b0e78e752a" }, + "copilot-cmp": { "branch": "master", "commit": "92535dfd9c430b49ca7d9a7da336c5db65826b65" }, + "copilot.lua": { "branch": "master", "commit": "b41d4c9c7d4f5e0272bcf94061b88e244904c56f" }, + "gitsigns.nvim": { "branch": "main", "commit": "76b71f74ce002119fce322df13bd21cc52c1d112" }, + "go.nvim": { "branch": "master", "commit": "7d7b081bf3d3113d1d487d83a5436bd1e7215ff5" }, + "hlargs.nvim": { "branch": "main", "commit": "2a7f9878326cdfd0eb8c91ad543c07680c976227" }, + "inc-rename.nvim": { "branch": "main", "commit": "21c23c379342a731a0c90f226601ec0434627b26" }, + "indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" }, + "kanagawa": { "branch": "master", "commit": "4c8d48726621a7f3998c7ed35b2c2535abc22def" }, + "lazy.nvim": { "branch": "main", "commit": "26d121ea13bee96b079403cee6598f04969d4983" }, + "lspkind-nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, + "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, + "lush.nvim": { "branch": "main", "commit": "b1e8eb1da3fee95ef31515a73c9eff9bf251088d" }, + "marks.nvim": { "branch": "master", "commit": "76aca5069c5ce5c0099e30168649e6393e494f26" }, + "neogen": { "branch": "main", "commit": "93d997dbddfe084e77ba4541c54a7b8bfd754fb1" }, + "noice.nvim": { "branch": "main", "commit": "d8a1f3056ad713b5d471048f8d029264828e22c0" }, + "nui.nvim": { "branch": "main", "commit": "0dc148c6ec06577fcf06cbab3b7dac96d48ba6be" }, + "null-ls.nvim": { "branch": "main", "commit": "689cdd78f70af20a37b5309ebc287ac645ae4f76" }, + "nvim-cmp": { "branch": "main", "commit": "01f697a68905f9dcae70960a9eb013695a17f9a2" }, + "nvim-dap": { "branch": "master", "commit": "5b986edc95cf7b37da1db91a5c149daa3ac008d2" }, + "nvim-dap-go": { "branch": "main", "commit": "b4ded7de579b4e2a85c203388233b54bf1028816" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "8db23ea51203b5f00ad107a0cef7e0b2d7a0476c" }, + "nvim-lsp-ts-utils": { "branch": "main", "commit": "0a6a16ef292c9b61eac6dad00d52666c7f84b0e7" }, + "nvim-lspconfig": { "branch": "master", "commit": "3b08f2edc461314b9051edf26348f8af3fe33e63" }, + "nvim-navic": { "branch": "master", "commit": "7e9d2b2b601149fecdccd11b516acb721e571fe6" }, + "nvim-osc52": { "branch": "main", "commit": "0abf3267090905accf348d19951640e3b95755c3" }, + "nvim-treesitter": { "branch": "master", "commit": "9dd1b9c09707bf1cdd565b999c79ac6461602591" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "4b30081d2736e09f90c890a8a7adfe4df36f5b36" }, + "nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "a0f89563ba36b3bacd62cf967b46beb4c2c29e52" }, + "nvim-web-devicons": { "branch": "master", "commit": "c2c2317f356c8b7da0252f5da758f71bb60bb6b2" }, + "packer.nvim": { "branch": "master", "commit": "1d0cf98a561f7fd654c970c49f917d74fafe1530" }, + "playground": { "branch": "master", "commit": "4044b53c4d4fcd7a78eae20b8627f78ce7dc6f56" }, + "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" }, + "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, + "stylua-nvim": { "branch": "main", "commit": "ce59a353f02938cba3e0285e662fcd3901cd270f" }, + "telescope-dap.nvim": { "branch": "master", "commit": "313d2ea12ae59a1ca51b62bf01fc941a983d9c9c" }, + "telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" }, + "telescope-github.nvim": { "branch": "master", "commit": "ee95c509901c3357679e9f2f9eaac3561c811736" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "62ea5e58c7bbe191297b983a9e7e89420f581369" }, + "telescope.nvim": { "branch": "master", "commit": "a3f17d3baf70df58b9d3544ea30abe52a7a832c2" }, + "trouble.nvim": { "branch": "main", "commit": "67337644e38144b444d026b0df2dc5fa0038930f" }, + "vim-cue": { "branch": "master", "commit": "bd1a62303d096aa24fe4160a475645087f8770b3" }, + "vim-illuminate": { "branch": "master", "commit": "49062ab1dd8fec91833a69f0a1344223dd59d643" }, + "zenbones.nvim": { "branch": "main", "commit": "910b8c240c6aaf5263db038db81c538602c766c3" } +} \ No newline at end of file diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..553c853 --- /dev/null +++ b/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,35 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath }) + vim.fn.system({ "git", "-C", lazypath, "checkout", "tags/stable" }) -- last stable release +end +vim.opt.runtimepath:prepend(lazypath) + +require("lazy").setup({ + import = "plugins", + defaults = { lazy = true }, + checker = { enabled = true }, + install = { + missing = true, + colorscheme = { "zenbones" }, + }, + performance = { + cache = { + enabled = true, + }, + rtp = { + disabled_plugins = { + "gzip", + "matchit", + "matchparen", + "netrwPlugin", + "rplugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, + debug = false, +}) diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua new file mode 100644 index 0000000..462c084 --- /dev/null +++ b/.config/nvim/lua/config/options.lua @@ -0,0 +1,71 @@ +vim.cmd([[set undofile]]) +vim.cmd([[set completeopt-=preview]]) +vim.cmd([[set viewoptions-=options]]) +vim.g.mapleader = "," +vim.o.hidden = true +vim.o.mouse = "a" +vim.o.splitbelow = true +vim.o.splitright = true +vim.o.ttimeout = true +vim.o.ttimeoutlen = 50 +vim.o.updatetime = 100 +vim.o.autochdir = false +vim.o.backupdir = "/home/dln/.local/share/nvim/backup/" +vim.o.backup = true +vim.g.netrw_dirhistmax = 0 +vim.o.clipboard = "unnamedplus" +vim.g.do_filetype_lua = 1 +vim.o.spell = false +vim.o.spelllang = "en_us" +vim.opt.winbar = nil + +--- Indent +vim.o.autoindent = true +vim.o.breakindent = true +vim.o.expandtab = true +vim.o.smartindent = true +vim.o.joinspaces = false +vim.o.listchars = "extends:›,precedes:‹,nbsp:·,tab:→ ,trail:·" +vim.wo.foldlevel = 99 +vim.wo.linebreak = true +vim.wo.list = true +vim.o.shiftwidth = 2 +vim.o.tabstop = 2 +vim.o.softtabstop = 2 + +--- Search +vim.cmd("set path+=**") +vim.cmd("set wildignore+=/var/*,*.so,*.swp,*.zip,*.tar,*.pyc") +vim.o.ignorecase = true +vim.o.smartcase = true +vim.o.wildmode = "longest:full,full" + +if vim.fn.executable("rg") then + vim.o.grepprg = "rg --vimgrep --no-heading --smart-case" +end + +--- Completion +vim.cmd("set shortmess+=c") +vim.o.completeopt = "menuone,noinsert,noselect" + +--- Appearance +vim.o.scrolloff = 7 +vim.o.showmode = false +vim.o.sidescrolloff = 5 +vim.o.termguicolors = true +vim.wo.cursorline = true +vim.wo.number = true +vim.wo.signcolumn = "yes" +vim.o.laststatus = 3 +vim.o.cmdheight = 1 +-- vim.o.statusline = "═" +-- vim.o.title = true +-- vim.o.titlestring = "%F%m %r %y" +vim.o.fillchars = "stl: ,stlnc: ,eob:🮙" +-- vim.wo.foldmethod = "expr" +-- vim.wo.foldexpr = "nvim_treesitter#foldexpr()" +vim.g.netrw_dirhistmax = 0 + +--- Key mappings +vim.keymap.set("n", "<C-l>", ':let @/=""<CR>') -- clear search +vim.keymap.set("n", ",L", ":luafile %<CR>") -- Reload lua file diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua new file mode 100644 index 0000000..c52f363 --- /dev/null +++ b/.config/nvim/lua/plugins/cmp.lua @@ -0,0 +1,83 @@ +local M = { + "hrsh7th/nvim-cmp", + dependencies = { + "andersevenrud/cmp-tmux", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-emoji", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "hrsh7th/cmp-nvim-lsp-signature-help", + "onsails/lspkind-nvim", + }, + event = "InsertEnter", +} + +function M.config() + local cmp = require("cmp") + + local has_words_before = function() + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + vim.o.completeopt = "menuone,noselect" + + cmp.setup({ + completion = { + completeopt = "menu,menuone,noinsert", + }, + + formatting = { + format = require("lspkind").cmp_format(), + }, + + window = { + completion = cmp.config.window.bordered({ + winhighlight = "Normal:PMenu,FloatBorder:PMenuBorder,CursorLine:PMenuSel,Search:None", + }), + documentation = cmp.config.window.bordered({ + winhighlight = "Normal:PMenu,FloatBorder:PMenu,CursorLine:PMenuSel,Search:None", + }), + }, + + mapping = { + ["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), + ["<Down>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), + ["<C-d>"] = cmp.mapping.scroll_docs(-2), + ["<C-u>"] = cmp.mapping.scroll_docs(2), + ["<C-e>"] = cmp.mapping({ + i = cmp.mapping.abort(), + c = cmp.mapping.close(), + }), + -- ["<CR>"] = cmp.mapping(cmp.mapping.confirm({ select = false }), { "i", "c" }), + -- ["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), + ["<CR>"] = cmp.mapping(cmp.mapping.confirm({ select = true })), + ["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), {}), + }, + + -- experimental = { + -- ghost_text = { + -- hl_group = "LspCodeLens", + -- }, + -- }, + + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "nvim_lsp_signature_help" }, + { name = "buffer" }, + { name = "copilot" }, + { + name = "tmux", + priority = 2, + option = { + all_panes = true, + trigger_characters = {}, + }, + }, + { name = "emoji" }, + }), + }) +end + +return M diff --git a/.config/nvim/lua/plugins/copilot.lua b/.config/nvim/lua/plugins/copilot.lua new file mode 100644 index 0000000..24a6f6a --- /dev/null +++ b/.config/nvim/lua/plugins/copilot.lua @@ -0,0 +1,54 @@ +local M = { + "zbirenbaum/copilot.lua", + event = { "VeryLazy" }, + dependencies = { + { + "zbirenbaum/copilot-cmp", + config = function() + require("copilot_cmp").setup() + end, + }, + }, +} + +function M.config() + require("copilot").setup({ + panel = { + enabled = true, + auto_refresh = false, + keymap = { + jump_prev = "[[", + jump_next = "]]", + accept = "<CR>", + refresh = "gr", + open = "<M-CR>", + }, + }, + suggestion = { + enabled = true, + auto_trigger = true, + debounce = 75, + keymap = { + accept = "<C-j>", + next = "<M-]>", + prev = "<M-[>", + dismiss = "<C-]>", + }, + }, + filetypes = { + yaml = false, + markdown = false, + help = false, + gitcommit = false, + gitrebase = false, + hgcommit = false, + svn = false, + cvs = false, + ["."] = false, + }, + copilot_node_command = "node", -- Node version must be < 18 + server_opts_overrides = {}, + }) +end + +return M diff --git a/.config/nvim/lua/plugins/dap.lua b/.config/nvim/lua/plugins/dap.lua new file mode 100644 index 0000000..c31328f --- /dev/null +++ b/.config/nvim/lua/plugins/dap.lua @@ -0,0 +1,53 @@ +return { + "mfussenegger/nvim-dap", + dependencies = { + { + "theHamsta/nvim-dap-virtual-text", + config = function() + require("nvim-dap-virtual-text").setup({ + commented = true, + }) + end, + }, + { + "leoluz/nvim-dap-go", + config = function() + require("dap-go").setup() + end, + }, + }, + keys = { + { "DD", ":lua require'dap'.toggle_breakpoint()<cr>", desc = "Toggle Breakpoint" }, + { "Dc", ":lua require'dap'.continue()<cr>", desc = "Continue" }, + { "Di", ":lua require'dap'.step_into()<cr>", desc = "Step Into" }, + { "Do", ":lua require'dap'.step_over()<cr>", desc = "Step Over" }, + { "DO", ":lua require'dap'.step_out()<cr>", desc = "Step Out" }, + { "Dh", ":lua require'dap.ui.widgets'.hover()<cr>", desc = "Hover" }, + { "Dr", ":lua require'dap'.repl.toggle({height = 5})<cr>", desc = "Toogle Repl" }, + }, + config = function() + require("dap") + require("dap.ext.vscode").load_launchjs() + + vim.fn.sign_define( + "DapBreakpoint", + { text = "", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" } + ) + vim.fn.sign_define( + "DapBreakpointCondition", + { text = "ﳁ", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" } + ) + vim.fn.sign_define( + "DapBreakpointRejected", + { text = "", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" } + ) + vim.fn.sign_define( + "DapLogPoint", + { text = "", texthl = "DapLogPoint", linehl = "DapLogPoint", numhl = "DapLogPoint" } + ) + vim.fn.sign_define( + "DapStopped", + { text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" } + ) + end, +} diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..779414a --- /dev/null +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,38 @@ +local M = { + "lewis6991/gitsigns.nvim", +} + +function M.config() + require("gitsigns").setup({ + numhl = true, + signs = { + add = { hl = "GitSignsAdd", text = "▌", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, + change = { + hl = "GitSignsChange", + text = "▌", + numhl = "GitSignsChangeNr", + linehl = "GitSignsChangeLn", + }, + delete = { + hl = "GitSignsDelete", + text = "▖", + numhl = "GitSignsDeleteNr", + linehl = "GitSignsDeleteLn", + }, + topdelete = { + hl = "GitSignsDelete", + text = "▘", + numhl = "GitSignsDeleteNr", + linehl = "GitSignsDeleteLn", + }, + changedelete = { + hl = "GitSignsChange", + text = "~", + numhl = "GitSignsChangeNr", + linehl = "GitSignsChangeLn", + }, + }, + }) +end + +return M diff --git a/.config/nvim/lua/plugins/illuminate.lua b/.config/nvim/lua/plugins/illuminate.lua new file mode 100644 index 0000000..bc4afcc --- /dev/null +++ b/.config/nvim/lua/plugins/illuminate.lua @@ -0,0 +1,9 @@ +local M = { + "RRethy/vim-illuminate", + event = "BufReadPost", + config = function() + require("illuminate").configure({ delay = 200 }) + end, +} + +return M diff --git a/.config/nvim/lua/plugins/indent-blankline.lua b/.config/nvim/lua/plugins/indent-blankline.lua new file mode 100644 index 0000000..b9f11e1 --- /dev/null +++ b/.config/nvim/lua/plugins/indent-blankline.lua @@ -0,0 +1,44 @@ +local M = { + "lukas-reineke/indent-blankline.nvim", + event = "BufReadPre", + config = { + buftype_exclude = { "terminal", "nofile" }, + filetype_exclude = { + "help", + "neogitstatus", + "NvimTree", + "neo-tree", + "Trouble", + }, + char = "│", + -- char = "┊", + char_highlight_list = { "Indent1", "Indent2", "Indent3", "Indent4", "Indent5", "Indent6" }, + use_treesitter_scope = false, + show_trailing_blankline_indent = false, + show_current_context = true, + context_patterns = { + "class", + "return", + "function", + "method", + "^if", + "^while", + "jsx_element", + "^for", + "^object", + "^table", + "block", + "arguments", + "if_statement", + "else_clause", + "jsx_element", + "jsx_self_closing_element", + "try_statement", + "catch_clause", + "import_statement", + "operation_type", + }, + }, +} + +return M diff --git a/.config/nvim/lua/plugins/lsp-config.lua b/.config/nvim/lua/plugins/lsp-config.lua new file mode 100644 index 0000000..089690f --- /dev/null +++ b/.config/nvim/lua/plugins/lsp-config.lua @@ -0,0 +1,241 @@ +local M = { + "neovim/nvim-lspconfig", + event = "VeryLazy", +} + +function M.config() + local lspconfig = require("lspconfig") + + local capabilities = require("cmp_nvim_lsp").default_capabilities() + + vim.keymap.set("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>") + vim.keymap.set("i", "<C-k>", "<Cmd>lua vim.lsp.buf.signature_help()<CR>") + vim.keymap.set("n", "1gd", "<Cmd>lua vim.lsp.buf.type_definition()<CR>") + vim.keymap.set("n", "gf", "<Cmd>lua vim.lsp.buf.format()<CR>") + vim.keymap.set("n", "[d", "<Cmd>lua vim.lsp.diagnostic.goto_prev()<CR>") + vim.keymap.set("n", "]d", "<Cmd>lua vim.lsp.diagnostic.goto_next()<CR>") + vim.keymap.set("n", "gwa", "<Cmd>lua vim.lsp.buf.add_workspace_folder()<CR>") + vim.keymap.set("n", "gwr", "<Cmd>lua vim.lsp.buf.add_workspace_folder()<CR>") + vim.keymap.set("n", "gwl", "<Cmd>lua vim.lsp.buf.add_workspace_folder()<CR>") + + vim.cmd([[autocmd BufWritePre * lua vim.lsp.buf.format({sync = true})]]) + + local border = { + { "🭽", "FloatBorder" }, + { "▔", "FloatBorder" }, + { "🭾", "FloatBorder" }, + { "▕", "FloatBorder" }, + { "🭿", "FloatBorder" }, + { "▁", "FloatBorder" }, + { "🭼", "FloatBorder" }, + { "▏", "FloatBorder" }, + } + + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border }) + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = border }) + vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + update_in_insert = false, + virtual_text = false, + }) + + local signs = { Error = "🔥", Warn = "⚠️ ", Hint = "💡", Info = "💡" } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) + end + + local function on_attach(client, bufnr) + require("nvim-navic").attach(client, bufnr) + end + + -- simple setups -- + local servers = { + "bashls", + "bufls", + "dockerls", + "gopls", + "jsonls", + -- "sql", + "pyright", + "lua_ls", + "terraformls", + "yamlls", + } + + for _, lsp in ipairs(servers) do + lspconfig[lsp].setup({ on_attach = on_attach }) + end + + local efm_prettier = { + formatCommand = "prettier --stdin-filepath ${INPUT}", + formatStdin = true, + } + + lspconfig.gopls.setup({ + on_attach = on_attach, + settings = { + gopls = { + directoryFilters = { + "-bazel-bin", + "-bazel-out", + "-bazel-testlogs", + "-proto", + }, + }, + }, + }) + + lspconfig.lua_ls.setup({ + on_attach = function(client, bufnr) + on_attach(client, bufnr) + vim.cmd([[autocmd BufWritePre <buffer> lua require'stylua-nvim'.format_file()]]) + end, + settings = { + Lua = { + completion = { kewordSnippet = "Disable" }, + diagnostics = { + enable = true, + globals = { "renoise", "use", "vim" }, + }, + runtime = { + version = "LuaJIT", + path = { "?.lua", "?/init.lua", "?/?.lua" }, + }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + maxPreload = 2000, + preloadFileSize = 1000, + checkThirdParty = false, + }, + }, + }, + }) + + lspconfig.terraformls.setup({}) + + local yaml_is_k8s = function(bufnr) + local lines = vim.api.nvim_buf_get_lines(bufnr, 0, 50, false) -- Stop after the first 50 lines + for _, l in pairs(lines) do + if string.find(l, "apiVersion") ~= nil then + return true + end + end + return false + end + + lspconfig.cssls.setup({ + cmd = { "vscode-css-languageserver", "--stdio" }, + capabilities = capabilities, + }) + + lspconfig.cssmodules_ls.setup({}) + + lspconfig.html.setup({ + cmd = { "vscode-html-languageserver", "--stdio" }, + filetypes = { "html" }, + init_options = { + configurationSection = { "html", "css", "javascript" }, + embeddedLanguages = { + css = true, + javascript = true, + }, + }, + settings = {}, + }) + + lspconfig.yamlls.setup({ + settings = { + yaml = { + format = { enable = true, singleQuote = true }, + schemaStore = { enable = true, url = "https://json.schemastore.org" }, + schemas = { + -- ["https://json.schemastore.org/github-workflow"] = "*.github/workflows/*", + ["https://json.schemastore.org/kustomization.json"] = "kustomization.yaml", + -- ["https://json.schemastore.org/ansible-role-2.9.json"] = "*/tasks/*.y*ml", + kubernetes = { + "clusterrolebinding.yaml", + "clusterrole-contour.yaml", + "clusterrole.yaml", + "configmap.yaml", + "cronjob.yaml", + "daemonset.yaml", + "deployment-*.yaml", + "deployment.yaml", + "*-deployment.yaml", + "hpa.yaml", + "ingress.yaml", + "job.yaml", + "namespace.yaml", + "pvc.yaml", + "rbac.yaml", + "rolebinding.yaml", + "role.yaml", + "sa.yaml", + "secret.yaml", + "serviceaccounts.yaml", + "service-account.yaml", + "serviceaccount.yaml", + "service-*.yaml", + "service.yaml", + "*-service.yaml", + "statefulset.yaml", + }, + }, + + validate = true, + }, + }, + }) + + require("lspconfig").tsserver.setup({ + root_dir = vim.loop.cwd, + }) + + -- npm install -g typescript typescript-language-server + -- require("lspconfig").tsserver.setup({ + -- on_attach = function(client, bufnr) + -- client.resolved_capabilities.document_formatting = false + -- on_attach(client) + + -- local ts_utils = require("nvim-lsp-ts-utils") + + -- ts_utils.setup({ + -- debug = false, + -- disable_commands = false, + -- enable_import_on_completion = false, + -- import_all_timeout = 5000, -- ms + + -- -- eslint + -- eslint_enable_code_actions = true, + -- eslint_enable_disable_comments = true, + -- eslint_bin = "eslint_d", + -- eslint_config_fallback = nil, + -- eslint_enable_diagnostics = true, + + -- -- formatting + -- enable_formatting = true, + -- formatter = "prettier", + -- formatter_config_fallback = nil, + + -- -- parentheses completion + -- complete_parens = false, + -- signature_help_in_parens = false, + + -- -- update imports on file move + -- update_imports_on_move = true, + -- require_confirmation_on_move = true, + -- watch_dir = nil, + -- }) + + -- ts_utils.setup_client(client) + + -- vim.api.nvim_buf_set_keymap(bufnr, "n", "<Leader>co", ":TSLspOrganize<CR>", { silent = true }) + -- vim.api.nvim_buf_set_keymap(bufnr, "n", "qq", ":TSLspFixCurrent<CR>", { silent = true }) + -- vim.api.nvim_buf_set_keymap(bufnr, "n", "<Leader>cR", ":TSLspRenameFile<CR>", { silent = true }) + -- vim.api.nvim_buf_set_keymap(bufnr, "n", "<Leader>ci", ":TSLspImportAll<CR>", { silent = true }) + -- end, + -- }) + -- +end + +return M diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..2b40678 --- /dev/null +++ b/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,50 @@ +local M = { + "nvim-lualine/lualine.nvim", + dependencies = { "kyazdani42/nvim-web-devicons" }, + event = "VeryLazy", +} + +local function clock() + return os.date("%H:%M") +end + +function M.config() + local lualine = require("lualine") + + lualine.setup({ + options = { + globalstatus = true, + theme = "onedark", + component_separators = { left = "╲", right = "╱" }, + section_separators = { left = "", right = "" }, + }, + sections = { + lualine_c = { + { + "filename", + path = 1, + file_status = true, + }, + { + function() + local navic = require("nvim-navic") + local ret = navic.get_location() + return ret:len() > 2000 and "navic error" or ret + end, + cond = function() + if package.loaded["nvim-navic"] then + local navic = require("nvim-navic") + return navic.is_available() + end + end, + color = { fg = "#ff8f00" }, + }, + }, + lualine_x = { "filetype" }, + lualine_y = { "location" }, + lualine_z = { clock }, + }, + }) +end + +return M diff --git a/.config/nvim/lua/plugins/marks.lua b/.config/nvim/lua/plugins/marks.lua new file mode 100644 index 0000000..6226ae3 --- /dev/null +++ b/.config/nvim/lua/plugins/marks.lua @@ -0,0 +1,37 @@ +local M = { + "chentoast/marks.nvim", + event = "VeryLazy", +} + +function M.config() + local marks = require("marks") + marks.setup({ + + default_mappings = true, + -- which builtin marks to show. default {} + -- builtin_marks = { ".", "<", ">", "^" }, + + cyclic = true, + force_write_shada = false, + + -- marks, and bookmarks. + -- can be either a table with all/none of the keys, or a single number, in which case + -- the priority applies to all marks. + -- default 10. + -- sign_priority = { lower=10, upper=15, builtin=8, bookmark=20 }, + -- + -- disables mark tracking for specific filetypes. default {} + excluded_filetypes = {}, + + -- marks.nvim allows you to configure up to 10 bookmark groups, each with its own + -- sign/virttext. Bookmarks can be used to group together positions and quickly move + -- across multiple buffers. default sign is '!@#$%^&*()' (from 0 to 9), and + -- default virt_text is "". + bookmark_1 = { + sign = "⚑", + virt_text = "", + }, + }) +end + +return M diff --git a/.config/nvim/lua/plugins/misc.lua b/.config/nvim/lua/plugins/misc.lua new file mode 100644 index 0000000..24391dd --- /dev/null +++ b/.config/nvim/lua/plugins/misc.lua @@ -0,0 +1,116 @@ +return { + + "tjdevries/colorbuddy.vim", + "wbthomason/packer.nvim", + "jose-elias-alvarez/nvim-lsp-ts-utils", + "jjo/vim-cue", + "ckipp01/stylua-nvim", + + { + "m-demare/hlargs.nvim", + event = "VeryLazy", + enabled = true, + config = { + excluded_argnames = { + usages = { + lua = { "self", "use" }, + }, + }, + }, + }, + + { + "folke/trouble.nvim", + cmd = { "TroubleToggle", "Trouble" }, + config = { + auto_open = false, + use_diagnostic_signs = true, + }, + keys = { + { "<leader>xx", "<cmd>TroubleToggle<cr>" }, + { "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>" }, + { "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>" }, + { "<leader>xl", "<cmd>TroubleToggle loclist<cr>" }, + { "<leader>xq", "<cmd>TroubleToggle quickfix<cr>" }, + { "gR", "<cmd>TroubleToggle lsp_references<cr>" }, + }, + }, + + { + "danymat/neogen", + keys = { + { + "<leader>cc", + function() + require("neogen").generate({}) + end, + desc = "Neogen Comment", + }, + }, + opts = { snippet_engine = "luasnip" }, + }, + + { + "smjonas/inc-rename.nvim", + cmd = "IncRename", + config = true, + keys = { + { "<Leader>rn", ":IncRename " }, + }, + }, + + { + "SmiteshP/nvim-navic", + config = function() + vim.g.navic_silence = true + require("nvim-navic").setup({ separator = " ", highlight = true, depth_limit = 5 }) + end, + }, + + { + "numToStr/Comment.nvim", + keys = { + { "<C-_>", "<Plug>(comment_toggle_linewise_current)" }, + { "<C-_>", "<Plug>(comment_toggle_linewise_visual)", mode = "v" }, + }, + dependencies = { + "JoosepAlviste/nvim-ts-context-commentstring", + }, + config = function() + require("Comment").setup({ + pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), + }) + end, + }, + + { + "ray-x/go.nvim", + config = function() + require("go").setup({ + comment_placeholder = "", + icons = { breakpoint = "🧘", currentpos = "🏃" }, + dap_debug_gui = false, + }) + vim.cmd("autocmd FileType go nmap <Leader>c :lua require('go.comment').gen()<cr>") + vim.cmd("autocmd BufWritePre *.go :silent! lua require('go.format').gofmt()") + vim.cmd("autocmd BufWritePre (InsertLeave?) <buffer> lua vim.lsp.buf.formatting_sync(nil,500)") + end, + }, + + { + "onsails/lspkind-nvim", + config = function() + require("lspkind").init({}) + end, + }, + + -- { + -- url = "https://git.sr.ht/~whynothugo/lsp_lines.nvim", + -- config = function() + -- require("lsp_lines").setup() + -- vim.diagnostic.config({ + -- virtual_text = false, + -- }) + -- end, + -- }, +} diff --git a/.config/nvim/lua/plugins/noice.lua b/.config/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..7d49f14 --- /dev/null +++ b/.config/nvim/lua/plugins/noice.lua @@ -0,0 +1,19 @@ +local M = { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", + }, +} + +function M.config() + require("noice").setup({ + presets = { + inc_rename = true, + long_message_to_split = true, + lsp_doc_border = true, + }, + }) +end + +return M diff --git a/.config/nvim/lua/plugins/null-ls.lua b/.config/nvim/lua/plugins/null-ls.lua new file mode 100644 index 0000000..f8bab18 --- /dev/null +++ b/.config/nvim/lua/plugins/null-ls.lua @@ -0,0 +1,40 @@ +local M = { + "jose-elias-alvarez/null-ls.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, +} + +function M.config() + local null_ls = require("null-ls") + local builtins = require("null-ls.builtins") + + null_ls.setup({ + sources = { + builtins.formatting.black, + builtins.formatting.buf, + builtins.formatting.cue_fmt, + builtins.formatting.shfmt, + builtins.formatting.sqlfluff, + builtins.formatting.buildifier, + builtins.formatting.prettierd, + builtins.completion.spell, + builtins.code_actions.eslint_d, + builtins.diagnostics.buf.with({ + args = { "lint", "--disable-symlinks", "--path", "$FILENAME" }, + cwd = function() + local file_dir = vim.fn.expand("%:p:h") .. ";" + local buf_yaml = vim.fn.findfile("buf.yaml", file_dir) + if buf_yaml then + return vim.fn.fnamemodify(buf_yaml, ":h") + end + end, + }), + builtins.diagnostics.buildifier, + builtins.diagnostics.cue_fmt, + builtins.diagnostics.golangci_lint, + builtins.diagnostics.eslint_d, + }, + debug = true, + }) +end + +return M diff --git a/.config/nvim/lua/plugins/osc52.lua b/.config/nvim/lua/plugins/osc52.lua new file mode 100644 index 0000000..b788cde --- /dev/null +++ b/.config/nvim/lua/plugins/osc52.lua @@ -0,0 +1,18 @@ +local M = { + "ojroques/nvim-osc52", +} + +function M.config() + local osc52 = require("osc52") + osc52.setup({ + max_length = 0, -- Maximum length of selection (0 for no limit) + silent = false, -- Disable message on successful copy + trim = false, -- Trim text before copy + }) + + vim.keymap.set("n", "<leader>c", require("osc52").copy_operator, { expr = true }) + vim.keymap.set("n", "<leader>cc", "<leader>c_", { remap = true }) + vim.keymap.set("x", "<leader>c", require("osc52").copy_visual) +end + +return M diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..cb54946 --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,110 @@ +local function project_files() + require("telescope.builtin").find_files({ + cwd = require("lspconfig.util").root_pattern(".git")(vim.fn.expand("%:p")), + }) +end + +local M = { + "nvim-telescope/telescope.nvim", + lazy = false, + dependencies = { + "nvim-lua/popup.nvim", + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope-fzy-native.nvim", + "nvim-telescope/telescope-github.nvim", + "nvim-telescope/telescope-dap.nvim", + "nvim-telescope/telescope-ui-select.nvim", + }, +} + +function M.config() + local telescope = require("telescope") + local actions = require("telescope.actions") + local previewers = require("telescope.previewers") + + vim.keymap.set("n", "<leader>b", '<cmd>lua require("telescope.builtin").buffers()<CR>') + vim.keymap.set("n", "<leader>f", '<cmd>lua require("telescope.builtin").oldfiles()<CR>') + vim.keymap.set("n", "<space>", '<cmd>lua require("telescope.builtin").oldfiles({cwd_only=true})<CR>') + vim.keymap.set("n", "<leader><space>", '<cmd>lua require("telescope.builtin").oldfiles()<CR>') + vim.keymap.set("n", "<leader>d", '<cmd>lua require("telescope.builtin").diagnostics({bufnr=0})<CR>') + vim.keymap.set("n", "<leader>e", '<cmd>lua require("telescope.builtin").git_files()<CR>') + vim.keymap.set("n", "<leader>g", '<cmd>lua require("telescope.builtin").git_status()<CR>') + vim.keymap.set("n", "<leader>a", '<cmd>lua require("telescope.builtin").lsp_code_actions()<CR>') + vim.keymap.set("n", "<leader>m", '<cmd>lua require("telescope.builtin").marks()<CR>') + vim.keymap.set("n", "<leader>s", '<cmd>lua require("telescope.builtin").lsp_document_symbols()<CR>') + vim.keymap.set("n", "<leader>t", '<cmd>lua require("telescope.builtin").treesitter()<CR>') + vim.keymap.set("n", "<leader>/", '<cmd>lua require("telescope.builtin").live_grep()<CR>') + vim.keymap.set("n", "<leader>.", '<cmd>lua require("telescope.builtin").file_browser()<CR>') + vim.keymap.set("n", "<leader>p", '<cmd>lua require("telescope.builtin").registers()<CR>') + vim.keymap.set("n", "ga", "<cmd>lua vim.lsp.buf.code_action()<CR>") + vim.keymap.set("n", "gr", '<cmd>lua require("telescope.builtin").lsp_references()<CR>') + vim.keymap.set("n", "gd", '<cmd>lua require("telescope.builtin").lsp_definitions()<CR>') + vim.keymap.set("n", "g/", '<cmd>lua require("telescope.builtin").lsp_document_symbols()<CR>') + vim.keymap.set( + "n", + "g?", + '<cmd>lua require("telescope.builtin").lsp_workspace_symbols({query=(vim.bo.filetype == "go" and "\'" or "")})<CR>' + ) + vim.keymap.set("n", "ge", '<cmd>lua require("telescope.builtin").lsp_document_diagnostics()<CR>') + vim.keymap.set("n", "Db", '<cmd>lua require("telescope").extensions.dap.list_breakpoints()<CR>') + vim.keymap.set("n", "Dcc", '<cmd>lua require("telescope").extensions.dap.commands()<CR>') + vim.keymap.set("n", "Df", '<cmd>lua require("telescope").extensions.dap.frames()<CR>') + vim.keymap.set("n", "Dv", '<cmd>lua require("telescope").extensions.dap.variables()<CR>') + + -- Setup + telescope.setup({ + defaults = { + layout_strategy = "flex", + -- layout_defaults = {flip_columns = 160}, + layout_config = { + preview_cutoff = 10, + prompt_position = "bottom", + mirror = true, + }, + mappings = { + i = { + ["<CR>"] = actions.select_default + actions.center, + ["<esc>"] = actions.close, + ["<tab>"] = actions.add_selection, + }, + }, + color_devicons = true, + file_previewer = previewers.vim_buffer_cat.new, + grep_previewer = previewers.vim_buffer_vimgrep.new, + qflist_previewer = previewers.vim_buffer_qflist.new, + }, + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({ + -- even more opts + }), + }, + }, + }) + + local layout_strategies = require("telescope.pickers.layout_strategies") + local config = require("telescope.config") + + layout_strategies.flex = function(self, max_columns, max_lines) + local layout_config = self.layout_config or {} + + local flip_columns = layout_config.flip_columns or 160 -- Here's why. + local flip_lines = layout_config.flip_lines or 20 + + if max_columns < flip_columns and max_lines > flip_lines then + self.layout_config = (config.values.layout_defaults or {})["vertical"] + return layout_strategies.vertical(self, max_columns, max_lines) + else + self.layout_config = (config.values.layout_defaults or {})["horizontal"] + return layout_strategies.horizontal(self, max_columns, max_lines) + end + end + + -- Extensions + telescope.load_extension("dap") + telescope.load_extension("fzy_native") + telescope.load_extension("gh") + telescope.load_extension("ui-select") +end + +return M diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..662c3c3 --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,124 @@ +return { + { "nvim-treesitter/playground", cmd = "TSPlaygroundToggle" }, + + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + event = "BufReadPost", + dependencies = { + "nvim-treesitter/nvim-treesitter-textobjects", + "windwp/nvim-ts-autotag", + }, + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "bash", + "c", + "cmake", + "cpp", + "css", + "diff", + "dockerfile", + "gdscript", + "git_rebase", + "gitcommit", + "gitignore", + "go", + "gomod", + "graphql", + "help", + "hcl", + "html", + "http", + "java", + "javascript", + "jsdoc", + "json", + "jsonc", + "kotlin", + "latex", + "lua", + "make", + "markdown", + "markdown_inline", + "meson", + "ninja", + "php", + "proto", + "python", + "query", + "regex", + "rego", + "rust", + "scss", + "sql", + "svelte", + "teal", + "toml", + "tsx", + "typescript", + "vhs", + "vim", + "vue", + "wgsl", + "yaml", + "zig", + }, + highlight = { + enable = true, + use_languagetree = true, + }, + indent = { + enable = false, + }, + context_commentstring = { enable = true, enable_autocmd = false }, + playground = { + enable = true, + disable = {}, + updatetime = 25, + persist_queries = false, + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "ss", + node_incremental = "sq", + scope_incremental = "sd", + node_decremental = "sa", + }, + }, + query_linter = { + enable = true, + use_virtual_text = true, + lint_events = { "BufWrite", "CursorHold" }, + }, + textobjects = { + move = { + enable = true, + goto_next_start = { + ["]]"] = "@function.outer", + ["]m"] = "@class.outer", + }, + goto_next_end = { + ["]["] = "@function.outer", + ["]M"] = "@class.outer", + }, + goto_previous_start = { + ["[["] = "@function.outer", + ["[m"] = "@class.outer", + }, + goto_previous_end = { + ["[]"] = "@function.outer", + ["[M"] = "@class.outer", + }, + }, + }, + --- nvim-ts-autotag --- + autotag = { + enable = true, + filetypes = { "html", "javascriptreact", "xml" }, + }, + }) + end, + }, +} diff --git a/.config/rg/rg.conf b/.config/rg/rg.conf new file mode 100644 index 0000000..a09bccf --- /dev/null +++ b/.config/rg/rg.conf @@ -0,0 +1,10 @@ +--glob=!/.git/ +--glob=!/.terraform/ +--pretty +--colors=column:fg:100,181,246 +--colors=line:fg:100,181,246 +--colors=path:fg:26,35,126 +--colors=path:style:bold +--colors=match:style:nobold +--colors=match:bg:255,235,59 +--colors=match:fg:0,0,0 diff --git a/.config/sapling/sapling.conf b/.config/sapling/sapling.conf new file mode 100644 index 0000000..c5a3c75 --- /dev/null +++ b/.config/sapling/sapling.conf @@ -0,0 +1,22 @@ +[ui] +username =Daniel Lundin <daniel@arity.se> + +[alias] +sw = switch +switch = !sl sl -M -T ':\033[31m{node|short} \033[1;33m{bookmarks}{if(bookmarks, " ")}{remotenames} {if(github_pull_request_number, "\033[1;37;41m PR #{github_pull_request_number} ")}\033[0;3;32m {date|age} \033[35;1;3mby {author|user} - \033[0;34;3m{desc|firstline}\033[0m' | sed -E -e '/31m[0-9abcdef]{12}/!d' -e 's/.+ ://' | fzf-tmux -p 90%,50% -y 0 --ansi --color=light | sed "s/ .*//" | xargs -r -n1 sl go && sl log -r . -T status + +l = ll +ll = log -G -T '\033[31m{node|short} \033[3;32m{date|age} \033[35;1;3mby {author|person}\n \033[0;34;3m{desc|firstline}\033[0m\n\n' + +[pager] +pager = delta --hunk-header-style "line-number file" --line-numbers --max-line-distance 0.9 --syntax-theme GitHub --inspect-raw-lines=false + +[color] +sl.public = color70 bold +sl.draft = color208 bold +sl.current = color99 bold +sl.diff = red bold + +[committemplate] +emptymsg = "" + diff --git a/.config/starship.toml b/.config/starship.toml new file mode 100644 index 0000000..b3b8fbf --- /dev/null +++ b/.config/starship.toml @@ -0,0 +1,61 @@ +add_newline = false + +format = """\ +$hostname\ +$directory\ +$git_branch\ +$git_commit\ +$git_state\ +$git_status\ +${custom.sl_status}\ +($character)\ +""" + +right_format = """\ +""" + +[custom.sl_status] +command = '''~/bin/starship-sl-status''' +when = true +style = "italic fg:#79AE6F" +format = '[(🌱 $output )]($style)' + +[character] +success_symbol = "%" +error_symbol = "[%](bold red)" + +[line_break] +disabled = true + +[directory] +fish_style_pwd_dir_length = 1 +truncation_length = 1 +truncate_to_repo = false +style = "italic bold" + +[git_branch] +format = "[$symbol$branch]($style)" +style = "fg:#559955" +symbol = " " +truncation_length = 16 +truncation_symbol = "" + +[git_commit] +format = "[ $hash$tag]($style) " +style = "fg:#559955" + +[git_state] +style = "" + +[git_status] +format = '([\[$all_status$ahead_behind\]]($style))' +style = "dimmed" + +[hostname] +ssh_only = false +format = "[$hostname](bold italic):" +disabled = false + +[kubernetes] +disabled = false +style = "" diff --git a/.config/systemd/user/dbus-notification-proxy.service b/.config/systemd/user/dbus-notification-proxy.service new file mode 100644 index 0000000..1b96cce --- /dev/null +++ b/.config/systemd/user/dbus-notification-proxy.service @@ -0,0 +1,9 @@ +[Unit] +Description=dbus proxy for desktop notifications + +[Service] +ExecStart=/usr/bin/xdg-dbus-proxy "$DBUS_SESSION_BUS_ADDRESS" %t/bus-notification --filter --talk=org.freedesktop.Notifications +Restart=always + +[Install] +WantedBy=default.target diff --git a/.config/systemd/user/tmux.service b/.config/systemd/user/tmux.service new file mode 100644 index 0000000..fc4806c --- /dev/null +++ b/.config/systemd/user/tmux.service @@ -0,0 +1,10 @@ +[Unit] +Description=Run tmux server + +[Service] +Restart=always +StartLimitIntervalSec=0 +ExecStart=/usr/bin/tmux -D -u + +[Install] +WantedBy=default.target diff --git a/.config/vconsole/personal.map b/.config/vconsole/personal.map new file mode 100644 index 0000000..1740bb1 --- /dev/null +++ b/.config/vconsole/personal.map @@ -0,0 +1,3 @@ +include "linux-with-two-alt-keys" +keycode 58 = Control + diff --git a/.config/wezterm/wezterm.lua b/.config/wezterm/wezterm.lua new file mode 100644 index 0000000..73fd9df --- /dev/null +++ b/.config/wezterm/wezterm.lua @@ -0,0 +1,158 @@ +local wezterm = require("wezterm") + +function font_with_fallback(name, params) + local names = { name, "Noto Color Emoji", "Iosevka Nerd Font Mono" } + return wezterm.font_with_fallback(names, params) +end + +local themeShelmanDark = { + colors = { + foreground = "#ded9ce", + background = "#171a23", + cursor_bg = "#FB8C00", + cursor_border = "#FB8C00", + split = "#444444", + ansi = { "#000000", "#ff605a", "#b1e869", "#ead89c", "#5da9f6", "#e86aff", "#82fff6", "#ded9ce" }, + brights = { "#313131", "#f58b7f", "#dcf88f", "#eee5b2", "#a5c7ff", "#ddaaff", "#b6fff9", "#fefffe" }, + tab_bar = { + background = "#000000", + active_tab = { bg_color = "#171a23", fg_color = "#c0b070", intensity = "Normal" }, + inactive_tab = { bg_color = "#000000", fg_color = "#c0c0c0", intensity = "Half" }, + inactive_tab_hover = { bg_color = "#333333", fg_color = "#909090", italic = true }, + }, + }, + + tab_bar_style = { + active_tab_left = wezterm.format({ + { Background = { Color = "#171a23" } }, + { Foreground = { Color = "#000000" } }, + { Text = " " }, + }), + active_tab_right = wezterm.format({ + { Background = { Color = "#171a23" } }, + { Foreground = { Color = "#000000" } }, + { Text = " " }, + }), + inactive_tab_left = wezterm.format({ + { Background = { Color = "#000000" } }, + { Foreground = { Color = "#171a23" } }, + { Text = " " }, + }), + inactive_tab_right = wezterm.format({ + { Background = { Color = "#000000" } }, + { Foreground = { Color = "#171a23" } }, + { Text = "▕" }, + }), + inactive_tab_hover_left = wezterm.format({ + { Background = { Color = "#333333" } }, + { Foreground = { Color = "#ffffff" } }, + { Text = " " }, + }), + inactive_tab_hover_right = wezterm.format({ + { Background = { Color = "#333333" } }, + { Foreground = { Color = "#ffffff" } }, + { Text = " " }, + }), + }, +} + +local themeShelmanLight = { + colors = { + foreground = "#000000", + background = "#fcfcfc", + cursor_bg = "#EA526F", + cursor_fg = "#ffffff", + cursor_border = "#cc0000", + split = "#444444", + selection_bg = "#FFCA28", + ansi = { "#212121", "#b7141e", "#457b23", "#f5971d", "#134eb2", "#550087", "#0e707c", "#eeeeee" }, + brights = { "#424242", "#e83a3f", "#7aba39", "#fee92e", "#53a4f3", "#a94dbb", "#26bad1", "#d8d8d8" }, + }, +} + +return { + colors = themeShelmanLight.colors, + font = font_with_fallback("Iosevka Shelman SS09", { weight = "Regular" }), + font_rules = { + { + italic = false, + intensity = "Half", + font = font_with_fallback("Iosevka Shelman SS09", { weight = "Thin" }), + }, + { + italic = true, + intensity = "Normal", + font = font_with_fallback("Iosevka Shelman Curly Slab", { weight = "Light", italic = true }), + }, + { + italic = true, + intensity = "Bold", + font = font_with_fallback("Iosevka Shelman SS15", { weight = "ExtraLight", italic = true }), + }, + { + intensity = "Bold", + font = font_with_fallback("Iosevka Shelman SS09", { weight = "DemiBold" }), + }, + }, + freetype_load_target = "Light", + freetype_render_target = "HorizontalLcd", + --freetype_load_flags = "NO_HINTING", + --custom_block_glyphs = false, + + warn_about_missing_glyphs = false, + bold_brightens_ansi_colors = false, + allow_square_glyphs_to_overflow_width = "Always", + + font_size = 10.5, + line_height = 1.0, + cell_width = 0.9, + + initial_cols = 128, + initial_rows = 45, + use_resize_increments = false, + + window_background_opacity = 0.93, + window_padding = { + left = "0", + right = "0", + top = "0", + bottom = "0", + }, + window_decorations = "RESIZE", + window_frame = { + border_left_width = "2px", + border_right_width = "2px", + border_bottom_height = "2px", + border_top_height = "2px", + border_left_color = "#cccccc", + border_right_color = "#cccccc", + border_bottom_color = "#cccccc", + border_top_color = "#cccccc", + }, + + default_cursor_style = "SteadyBlock", + cursor_thickness = "3px", + cursor_blink_rate = 300, + + enable_wayland = true, + enable_tab_bar = false, + tab_bar_at_bottom = true, + show_tab_index_in_tab_bar = true, + enable_scroll_bar = false, + scrollback_lines = 5000, + alternate_buffer_wheel_scroll_speed = 2, + check_for_updates = false, + status_update_interval = 100, + audible_bell = "Disabled", + term = "wezterm", + + disable_default_key_bindings = true, + keys = { + { key = "c", mods = "ALT|SHIFT", action = wezterm.action({ CopyTo = "ClipboardAndPrimarySelection" }) }, + { key = "v", mods = "ALT|SHIFT", action = "Paste" }, + { key = "0", mods = "CTRL", action = "ResetFontSize" }, + { key = "-", mods = "CTRL", action = "DecreaseFontSize" }, + { key = "=", mods = "CTRL", action = "IncreaseFontSize" }, + { key = "Enter", mods = "ALT", action = "ToggleFullScreen" }, + }, +} diff --git a/.envrc b/.envrc deleted file mode 100644 index 0f94eed..0000000 --- a/.envrc +++ /dev/null @@ -1,2 +0,0 @@ -# shellcheck shell=bash -use flake diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..d5d82e1 --- /dev/null +++ b/.gitconfig @@ -0,0 +1,123 @@ +[core] +excludesfile = "~/.gitignore" +pager = delta --line-numbers --max-line-distance 0.9 +compression = 0 +looseCompression = 0 + +[user] +useConfigOnly = true + +[column] +ui = auto + +[push] +default = tracking + +[branch "main"] +rebase = true + +[branch "master"] +rebase = true + +[alias] +b = branch -va +cl = clone --filter=blob:none +d = diff --stat -p -C +ds = diff --staged --stat -p -C +dt = difftool +patch = !git --no-pager diff --no-color +co = checkout +st = status -sb +pullr = pull --rebase + +sl = branchless smartlog +sync = branchless sync +sw = branchless switch + +gerrit-new = !git fetch origin main && git checkout --detach origin/main +gerrit-push = !git push origin HEAD:refs/for/main +gerrit-push-wip = !git push origin HEAD:refs/for/main%wip +gerrit-push-ready = !git push origin HEAD:refs/for/main%ready +gerrit-replace = !git commit --amend -a && git push origin HEAD:refs/for/main +gerrit-config = !git fetch origin refs/meta/config:refs/remotes/origin/meta/config && git checkout FETCH_HEAD +gerrit-config-push = !git push origin HEAD:refs/meta/config +gp = gerrit-push +gpw = gerrit-push-wip +gpr = gerrit-push-ready + +ll = log --graph --date=relative --topo-order --pretty='format:%C(yellow)%h%C(yellow)%d %Cblue%ar %Cgreenby %an%Creset -- %s' +lla = log --graph --date=relative --topo-order --pretty='format:%Cgreen%h %Cblue%ar %Credby %an%Creset -- %s' --all + +guilt = "!f(){ git log --pretty='format:%an <%ae>' $@ | sort | uniq -c | sort -rn; }; f" +serve = daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/ + +identity = "! git config user.name \"$(git config user.$1.name)\"; git config user.email \"$(git config user.$1.email)\"; git config user.signingkey \"$(git config user.$1.signingkey)\"; :" + +[color] +ui = auto +branch = auto +diff = auto +status = auto + +[apply] +whitespace = nowarn + +[pack] +threads = 0 + +[blame] +date = relative + +[delta] +syntax-theme = GitHub +hunk-header-style = line-number syntax + +[hub] +protocol = git + +[http] +cookiefile = /home/dln/.gitcookies + +[interactive] +diffFilter = delta --color-only --features=interactive + +[credential] +helper = store + +[commit] +gpgsign = false + +[user] +name = Daniel Lundin +email = daniel@arity.se + +[init] +defaultBranch = main + +; [url "git@github.com:"] +; insteadOf = https://github.com/ + +[lfs] +concurrenttransfers = 32 + +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true + +[diff] + tool = difft + # external = difft + +[difftool] + prompt = false + +[difftool "difft"] + cmd = difft --display inline "$LOCAL" "$REMOTE" +[scalar] + repo = /tmp/k2/src +[maintenance] + repo = /tmp/k2/src +[fetch] + showForcedUpdates = true diff --git a/.gitignore b/.gitignore index c4a847d..4bb6205 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,14 @@ -/result +*~ +*.a +*.class +/.idea +*.iml +*.ipr +*.iwr +*.iws +*.la +*.o +*.pyc +*.so +*.swp + diff --git a/.gnupg/gpg-agent.conf b/.gnupg/gpg-agent.conf new file mode 100644 index 0000000..db49aaf --- /dev/null +++ b/.gnupg/gpg-agent.conf @@ -0,0 +1,4 @@ +enable-ssh-support +default-cache-ttl 3600 +max-cache-ttl 3600 +extra-socket /run/user/1000/gnupg/S.gpg-agent.extra diff --git a/.gnupg/gpg.conf b/.gnupg/gpg.conf new file mode 100644 index 0000000..50f74df --- /dev/null +++ b/.gnupg/gpg.conf @@ -0,0 +1,2 @@ +#use-agent +keyid-format LONG diff --git a/.inputrc b/.inputrc new file mode 100644 index 0000000..062ffe5 --- /dev/null +++ b/.inputrc @@ -0,0 +1,11 @@ +set meta-flag on +set convert-meta off +set output-meta on +set completion-ignore-case on +set visible-stats on +set show-all-if-ambiguous on +set completion-query-items 150 + +#"\C-p": history-search-backward +#"\C-n": history-search-forward + diff --git a/.local/share/applications/firefox-arity.desktop b/.local/share/applications/firefox-arity.desktop new file mode 100644 index 0000000..c417974 --- /dev/null +++ b/.local/share/applications/firefox-arity.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Name=Firefox (Arity) +GenericName=Web Browser +Comment=Browse the Web +Exec=firefox %u -P Arity --name firefox-arity +Icon=firefox +Terminal=false +Type=Application +MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; +StartupWMClass=firefox-arity +Categories=Network;WebBrowser; +Keywords=web;browser;internet; diff --git a/.local/share/applications/firefox-work.desktop b/.local/share/applications/firefox-work.desktop new file mode 100644 index 0000000..805a7a9 --- /dev/null +++ b/.local/share/applications/firefox-work.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Name=Firefox (Work) +GenericName=Web Browser +Comment=Browse the Web +Exec=firefox %u -P Work --new-instance --name firefox-work +Icon=firefox +Terminal=false +Type=Application +MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; +StartupWMClass=firefox-work +Categories=Network;WebBrowser; +Keywords=web;browser;internet; diff --git a/.local/share/applications/google-chrome-beta-client.desktop b/.local/share/applications/google-chrome-beta-client.desktop new file mode 100644 index 0000000..cd2f598 --- /dev/null +++ b/.local/share/applications/google-chrome-beta-client.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=Client Chrome +StartupWMClass=Google-chrome-beta-client +Exec=/usr/bin/google-chrome-beta %U --user-data-dir=.config/Google-chrome-beta-client --class=Google-chrome-beta-client +StartupNotify=true +Terminal=false +Icon=google-chrome-beta +Type=Application +Categories=Network;WebBrowser; +MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https; diff --git a/.local/share/applications/google-chrome-beta-private.desktop b/.local/share/applications/google-chrome-beta-private.desktop new file mode 100644 index 0000000..581a1ba --- /dev/null +++ b/.local/share/applications/google-chrome-beta-private.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=Private Chrome +StartupWMClass=Google-chrome-beta-private +Exec=/usr/bin/google-chrome-beta %U --user-data-dir=.config/Google-chrome-beta-private --class=Google-chrome-beta-private +StartupNotify=true +Terminal=false +Icon=google-chrome-beta +Type=Application +Categories=Netprivate;WebBrowser; +MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https; diff --git a/.local/share/applications/google-chrome-beta-work.desktop b/.local/share/applications/google-chrome-beta-work.desktop new file mode 100644 index 0000000..9912349 --- /dev/null +++ b/.local/share/applications/google-chrome-beta-work.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=Work Chrome +StartupWMClass=Google-chrome-beta-work +Exec=/usr/bin/google-chrome-beta %U --user-data-dir=.config/Google-chrome-beta-work --class=Google-chrome-beta-work +StartupNotify=true +Terminal=false +Icon=google-chrome-beta +Type=Application +Categories=Network;WebBrowser; +MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https; diff --git a/.local/share/applications/meet.desktop b/.local/share/applications/meet.desktop new file mode 100644 index 0000000..4dca9eb --- /dev/null +++ b/.local/share/applications/meet.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Version=1.0 +Name=Google Meet +StartupWMClass=meet.google.com +Exec=/usr/bin/google-chrome-stable --profile-directory='Profile 1' --app=https://meet.google.com +Terminal=false +Icon=camera-video +Type=Application +Categories=Network;Office diff --git a/.local/share/applications/plex.desktop b/.local/share/applications/plex.desktop new file mode 100644 index 0000000..49d5d49 --- /dev/null +++ b/.local/share/applications/plex.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Version=1.0 +Name=plex +StartupWMClass=plex.aarn.shelman.io +Exec=/usr/bin/google-chrome-stable --profile-directory='Profile 2' --app=https://plex.home:32400/web/index.html +Terminal=false +Icon=google-chrome +Type=Application +Categories=Audio; diff --git a/.local/share/applications/spotify.desktop b/.local/share/applications/spotify.desktop new file mode 100644 index 0000000..4359bc1 --- /dev/null +++ b/.local/share/applications/spotify.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Application +Name=Spotify +GenericName=Music Player +Icon=spotify-client +TryExec=spotify +Exec=spotify --force-device-scale-factor=2 %U +Terminal=false +MimeType=x-scheme-handler/spotify; +Categories=Audio;Music;Player;AudioVideo; +StartupWMClass=spotify diff --git a/.local/share/applications/wezterm-dln-dev-secondary.desktop b/.local/share/applications/wezterm-dln-dev-secondary.desktop new file mode 100644 index 0000000..6d7b938 --- /dev/null +++ b/.local/share/applications/wezterm-dln-dev-secondary.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=wezterm-dln-dev-secondary +GenericName=wezterm-dln-dev-secondary +StartupWMClass=org.wezfurlong.wezterm +Type=Application +TryExec=/usr/bin/wezterm +Icon=org.wezfurlong.wezterm +Terminal=false +Categories=System;TerminalEmulator; +Exec=/usr/bin/wezterm --config 'default_prog={"ssh", "-q", "dln-dev", "--", "tmux", "-u", "new-session", "-As1", "-t0"}' --config font_size=9 --config=window_background_opacity=0.4 start --class=wezterm-dln-dev-secondary diff --git a/.local/share/applications/wezterm-dln-dev.desktop b/.local/share/applications/wezterm-dln-dev.desktop new file mode 100644 index 0000000..aa25828 --- /dev/null +++ b/.local/share/applications/wezterm-dln-dev.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=wezterm-dln-dev +GenericName=wezterm-dln-dev +StartupWMClass=org.wezfurlong.wezterm +Type=Application +TryExec=/usr/bin/wezterm +Icon=org.wezfurlong.wezterm +Terminal=false +Categories=System;TerminalEmulator; +Exec=/usr/bin/wezterm --config 'default_prog={"ssh", "-q", "dln-dev", "--", "tmux", "-u", "new", "-As0"}' start --class=wezterm-dln-dev +#Exec=/usr/bin/wezterm --config 'default_prog={"ssh", "-q", "dln-dev"}' start --class=wezterm-dln-dev diff --git a/.local/share/applications/wezterm-local.desktop b/.local/share/applications/wezterm-local.desktop new file mode 100644 index 0000000..5275fe7 --- /dev/null +++ b/.local/share/applications/wezterm-local.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=wezterm-local +GenericName=wezterm-local +StartupWMClass=wezterm-local +Type=Application +TryExec=/usr/bin/wezterm +Icon=org.wezfurlong.wezterm +Terminal=false +Categories=System;TerminalEmulator; +Exec=/usr/bin/wezterm start --class=wezterm-local diff --git a/.local/share/applications/youtube-music.desktop b/.local/share/applications/youtube-music.desktop new file mode 100644 index 0000000..a6d0926 --- /dev/null +++ b/.local/share/applications/youtube-music.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Version=1.0 +Name=YouTube Music (provar) +StartupWMClass=music.youtube.com +Exec=/usr/bin/google-chrome-stable --user-data-dir=$HOME/.config/google-chrome --profile-directory='Profile 2' --app=https://music.youtube.com --class=music.youtube.com +Terminal=false +Icon=google-chrome +Type=Application +Categories=Audio; diff --git a/.ssh/config b/.ssh/config new file mode 100644 index 0000000..0f4ff61 --- /dev/null +++ b/.ssh/config @@ -0,0 +1,31 @@ +ForwardAgent yes +ServerAliveInterval 15 +ServerAliveCountMax 3 +ControlMaster auto +ControlPath ~/.ssh/control:%h:%p:%r +ControlPersist 1200 +Ciphers aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr +AddressFamily inet +RequestTty yes +PreferredAuthentications=publickey + +Host gitlab.com +IdentityAgent /dev/null +PKCS11Provider /usr/lib/pkcs11/libtpm2_pkcs11.so + +Host 10.1.100.16 +Host dln-dev +Hostname 10.1.100.16 +IdentityAgent ${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh +ForwardAgent yes +ForwardX11 no +ExitOnForwardFailure yes +Compression yes +LocalForward 127.0.0.1:3000 127.0.0.1:3000 +LocalForward 127.0.0.1:3011 127.0.0.1:3011 +LocalForward 127.0.0.1:8000 127.0.0.1:8000 +LocalForward 127.0.0.1:8080 127.0.0.1:8080 +# RemoteForward ${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent ${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.extra +RemoteForward ${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh ${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh +# RemoteForward ${XDG_RUNTIME_DIR}/gnupg/S.scdaemon ${XDG_RUNTIME_DIR}/gnupg/S.scdaemon +RemoteForward ${XDG_RUNTIME_DIR}/bus-notification ${XDG_RUNTIME_DIR}/bus-notification diff --git a/.ssh/rc b/.ssh/rc new file mode 100755 index 0000000..7cdde35 --- /dev/null +++ b/.ssh/rc @@ -0,0 +1,3 @@ +if [[ -S "$SSH_AUTH_SOCK" && ! -h "$SSH_AUTH_SOCK" ]]; then + ln -sf "$SSH_AUTH_SOCK" $HOME/.ssh/ssh_auth_sock; +fi diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..297c1f2 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,84 @@ +set -g prefix ^o + +set -g base-index 1 +set -g display-panes-time 3000 +set -s escape-time 10 +set -g status on +set -g status-interval 30 +set -g focus-events on +set -g allow-passthrough on +setw -g alternate-screen on +setw -g aggressive-resize on +setw -g automatic-rename off +setw -g mode-keys vi +set-option -g mouse on + +# clipboard +set -g set-clipboard on +bind-key ] paste-buffer -p + +set -g update-environment "BUILDCOMMAND GOPACKAGESDRIVER XAUTHORITY DISPLAY WINDOWID SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION" +set -g default-command zsh +set -g history-limit 10000 + +set -g default-terminal "wezterm" +set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # Underline color + +# Key bindings +bind -n M-Left select-pane -L +bind -n M-Right select-pane -R +bind -n M-Up select-pane -U +bind -n M-Down select-pane -D +bind -n M-1 select-window -t nvim +bind -n M-2 select-window -t 2 +bind -n M-3 select-window -t 3 +bind -n M-4 select-window -t 4 +bind -n M-5 select-window -t 5 +bind -n M-6 select-window -t 6 +bind -n M-7 select-window -t 7 +bind -n M-8 select-window -t 8 +bind -n M-9 select-window -t 9 +bind -n M-0 select-window -t 10 +bind -n M-m send-keys -t 9 q C-u "clear; tmux clear-history -t 9" C-m C-p C-p C-p C-m +bind C-o send-keys C-o +bind r source-file ~/.tmux.conf +bind -n C-Right next-window +bind -n C-Left previous-window +bind C-s set-option -g status +bind K confirm kill-server +bind C-k clear-history +bind -n C-l send-keys C-l \; clear-history +bind-key -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 1 scroll-up +bind-key -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 1 scroll-down +bind-key / copy-mode \; send-key ? +bind-key P 'capture-pane' \; capture-pane -S - \; save-buffer /tmp/tmux \; delete-buffer +bind-key -n C-\\ copy-mode \; send -X search-backward " % "\; send -X search-again +bind -n M-g display-popup -S 'bg=#F1F8E9,fg=#689F38' -s 'bg=#F1F8E9' -h '90%' -w '90%' -b rounded -d '#{pane_current_path}' -E "gitui" +bind -n M-e display-popup -S 'bg=#E3F2FD,fg=#0288D1' -s 'bg=#E3F2FD' -h '40%' -w '90%' -y 0 -b rounded -d '#{pane_current_path}' -e FZF=fzf -E "~/bin/tmux-edit-helper" +bind -n M-m display-popup -S 'bg=#FFF8E1,fg=#FF6F00' -s 'bg=#FFF8E1' -h '90%' -w '90%' -b rounded -d '#{pane_current_path}' -E "~/bin/tmux-build-helper" + +setw -g window-status-format "" +setw -g window-status-current-format "" +setw -g window-status-separator "" +set -g status-style "fg=#cc0000,dotted-underscore,italics" +set -g status-position top +set -g status-left-length 0 +set -g status-right-length 0 +set -g status-left '[#I] #{pane_current_path}' +set -g status-right '%F | %R' +set -g status off +set -g set-titles on +set -g set-titles-string "#H - #T" + +new -s0 -n 1 nvim --listen $XDG_RUNTIME_DIR/nvim.sock +new-window -n 2 +new-window -n 3 +new-window -n 4 +new-window -n 5 +new-window -n 6 +new-window -n 7 +new-window -n 8 +new-window -n 9 +new-window -n 0 + +# vim:set ft=tmux: diff --git a/.vault b/.vault new file mode 100644 index 0000000..6f129db --- /dev/null +++ b/.vault @@ -0,0 +1,2 @@ +#token_helper = "/home/dln/bin/vault-token-helper" + diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..43cb2f9 --- /dev/null +++ b/.zshrc @@ -0,0 +1,247 @@ +if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then + print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" + command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" + command git clone --depth=1 https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \ + print -P "%F{33} %F{34}Installation successful.%f%b" || \ + print -P "%F{160} The clone has failed.%f%b" +fi + +source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" +autoload -Uz _zinit +(( ${+_comps} )) && _comps[zinit]=_zinit + +zi ice wait lucid +zi load zsh-users/zsh-completions +zi ice wait lucid +zi load zsh-users/zsh-syntax-highlighting +zi ice wait lucid +zi load zsh-users/zsh-history-substring-search + +## History +HISTSIZE=50000 +SAVEHIST=50000 +HISTFILE=~/.zsh_history +setopt append_history +setopt extended_history +setopt hist_expire_dups_first +setopt hist_fcntl_lock +setopt hist_ignore_all_dups +setopt hist_ignore_space +setopt HIST_IGNORE_SPACE +setopt hist_lex_words +setopt hist_reduce_blanks +setopt hist_save_no_dups +setopt hist_subst_pattern +setopt hist_verify +setopt share_history +export HISTORY_IGNORE="(ls *|cd *|rm *|pwd|reboot|exit|e *|*AWS*|*SECRET*|*PASSWORD*|*TOKEN*|*API*|*KEY*|*PASS*|*SECRETS*|*SECRET_KEY*|*SECRET_TOKEN*|*SECRET_KEY_BASE*|*SECRET_TOKEN_BASE*)" + + +## zsh settings +setopt pipe_fail +setopt auto_pushd +setopt no_beep +setopt no_rm_star_silent +setopt extended_glob +setopt ksh_glob +setopt null_glob + +## Autosuggest +# ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#D7CCC8,italic" +# ZSH_AUTOSUGGEST_USE_ASYNC=1 +# ZSH_AUTOSUGGEST_STRATEGY=(history completion) + +export PATH=$HOME/bin:$PATH + +redraw-prompt() { + local precmd + for precmd in $precmd_functions; do + $precmd + done + zle reset-prompt +} +zle -N redraw-prompt + +_jump() { + _dir=$(fre --sorted | fzf-tmux --no-sort -p 90%,40% -y 0) + [ -n "$_dir" ] && pushd $_dir >>/dev/null + zle && zle redraw-prompt +} +zle -N _jump + +fre_chpwd() { + fre --add "$(pwd)" +} +typeset -gaU chpwd_functions +chpwd_functions+=fre_chpwd + +_cwd_gitroot() { + _gitroot=$(git rev-parse --show-toplevel 2>/dev/null || sl root 2>/dev/null || pwd) + _dir=$((echo "$_gitroot" && fd -td . "$_gitroot") | fzf-tmux -p 90%,40% -y 0) + [ -n "$_dir" ] && cd $_dir + zle && zle redraw-prompt +} +zle -N _cwd_gitroot + +## Keybindings +bindkey -e +bindkey '^[[A' history-beginning-search-backward +bindkey '^[[B' history-beginning-search-forward +bindkey '^P' history-beginning-search-backward +bindkey '^N' history-beginning-search-forward +bindkey '^g' _jump +bindkey '^_' _cwd_gitroot + + +## Gnupg / gpg / ssh / yubikey +export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + + +## Pager +export LESS="--mouse --wheel-lines=1 -nRXF" + +## Clipboard OSC 52 + function clip { echo -en "\x1b]52;c;$(base64 -w0)\x07" } + +## Aliases +alias c='cut -c-${COLUMNS}' +alias e='tmux-edit-helper' +alias dotgit='git --work-tree $HOME --git-dir $HOME/.dot_git' +alias l=bat +alias lw='bat --wrap=never' +alias ls=exa +alias tail='tail -n $LINES' +alias timestamp='TZ=Z date "+%Y%m%dT%H%M%SZ"' +alias tree='exa --tree' +alias v=vgrep +alias ve='env EDITOR= vgrep -s' +alias xc=clip +alias w="history -1 | sed -e 's/[0-9]* //' | xargs viddy -n1" + +## ripgrep +export RIPGREP_CONFIG_PATH=${HOME}/.config/rg/rg.conf + +# "auto paging" +rg() { + /usr/bin/rg -p "$@" | bat +} + +fix_cursor() { + echo -ne '\e[5 q' +} + +precmd_functions+=(fix_cursor) + + +## Prompt +eval "$(starship init zsh)" + +## vim +export EDITOR=nvim + +## fzf +export FZF_TMUX=1 +export FZF_COMPLETION_TRIGGER=";" +export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git' +. /usr/share/fzf/completion.zsh +. /usr/share/fzf/key-bindings.zsh + +## direnv +eval "$(direnv hook zsh)" + +## pyenv +export PYENV_ROOT="$HOME/.pyenv" +command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" +export PATH="/home/dln/.pyenv/shims:${PATH}" +export PYENV_SHELL=zsh +# command pyenv rehash 2>/dev/null # this is slow +pyenv() { + local command + command="${1:-}" + if [ "$#" -gt 0 ]; then + shift + fi + + case "$command" in + activate|deactivate|rehash|shell) + eval "$(pyenv "sh-$command" "$@")" + ;; + *) + command pyenv "$command" "$@" + ;; + esac +} + +## eksctl +if [ ! -f "${fpath[1]}/_eksctl" ]; then + command -v eksctl >/dev/null 2>&1 && eksctl completion zsh > "${fpath[1]}/_eksctl" +fi + +## Kubernetes +if [ ! -f "${fpath[1]}/_kubectl" ]; then + command -v kubectl >/dev/null 2>&1 && kubectl completion zsh > "${fpath[1]}/_kubectl" +fi +export PATH=$HOME/.krew/bin:$PATH + +## bazel +if [ ! -f "${fpath[1]}/_bazel" ]; then + curl -sLo "${fpath[1]}/_bazel" https://raw.githubusercontent.com/bazelbuild/bazel/master/scripts/zsh_completion/_bazel +fi + +## sapling +if [ ! -f "${fpath[1]}/_sl" ]; then + # See: https://github.com/facebook/sapling/pull/369 + curl -sLo "${fpath[1]}/_sl" https://github.com/facebook/sapling/raw/d6157db1ebc0868cf70805756e32541bd681bac2/eden/scm/contrib/zsh_completion_sl +fi + +## Tekton cli +if [ ! -f "${fpath[1]}/_tkn" ]; then + command -v tkn >/dev/null 2>&1 && tkn completion zsh > "${fpath[1]}/_tkn" +fi + +## kapp +if [ ! -f "${fpath[1]}/_kapp" ]; then + command -v kapp >/dev/null 2>&1 && kapp completion zsh --tty=false > "${fpath[1]}/_kapp" +fi + +## kn +if [ ! -f "${fpath[1]}/_kn" ]; then + command -v kn >/dev/null 2>&1 && kn completion zsh > "${fpath[1]}/_kn" +fi + +## talos cli +if [ ! -f "${fpath[1]}/_talosctl" ]; then + command -v talosctl >/dev/null 2>&1 && talosctl completion zsh > "${fpath[1]}/_talosctl" +fi + +## Google Cloud +[ -f /opt/google-cloud-sdk/completion.zsh.inc ] && source /opt/google-cloud-sdk/completion.zsh.inc + +## Golang +export PATH=$HOME/go/bin:$PATH +GOPROXY=https://athens.aarn.shelman.io + +## Ansible +export ANSIBLE_NOCOWS=1 + +## Docker +export DOCKER_BUILDKIT=1 + +autoload -Uz compinit +compinit + +autoload -Uz compdef + +PROG=tea _CLI_ZSH_AUTOCOMPLETE_HACK=1 source "/home/dln/.config/tea/autocomplete.zsh" + +## AWS +autoload -U +X bashcompinit && bashcompinit +complete -o nospace -C /usr/bin/mcli mcli +complete -C '/usr/bin/aws_completer' aws + + +# The next line updates PATH for the Google Cloud SDK. +if [ -f '/home/dln/google-cloud-sdk/path.zsh.inc' ]; then . '/home/dln/google-cloud-sdk/path.zsh.inc'; fi + +# The next line enables shell command completion for gcloud. +if [ -f '/home/dln/google-cloud-sdk/completion.zsh.inc' ]; then . '/home/dln/google-cloud-sdk/completion.zsh.inc'; fi diff --git a/README.md b/README.md deleted file mode 100644 index 2ffa21f..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Configuration and various sundries - -IT in a box. diff --git a/bin/git-wtf b/bin/git-wtf new file mode 100755 index 0000000..e407eae --- /dev/null +++ b/bin/git-wtf @@ -0,0 +1,364 @@ +#!/usr/bin/env ruby + +HELP = <<EOS +git-wtf displays the state of your repository in a readable, easy-to-scan +format. It's useful for getting a summary of how a branch relates to a remote +server, and for wrangling many topic branches. + +git-wtf can show you: +- How a branch relates to the remote repo, if it's a tracking branch. +- How a branch relates to integration branches, if it's a feature branch. +- How a branch relates to the feature branches, if it's an integration + branch. + +git-wtf is best used before a git push, or between a git fetch and a git +merge. Be sure to set color.ui to auto or yes for maximum viewing pleasure. +EOS + +KEY = <<EOS +KEY: +() branch only exists locally +{} branch only exists on a remote repo +[] branch exists locally and remotely + +x merge occurs both locally and remotely +~ merge occurs only locally + (space) branch isn't merged in + +(It's possible for merges to occur remotely and not locally, of course, but +that's a less common case and git-wtf currently doesn't display anything +special for it.) +EOS + +USAGE = <<EOS +Usage: git wtf [branch+] [options] + +If [branch] is not specified, git-wtf will use the current branch. The possible +[options] are: + + -l, --long include author info and date for each commit + -a, --all show all branches across all remote repos, not just + those from origin + -A, --all-commits show all commits, not just the first 5 + -s, --short don't show commits + -k, --key show key + -r, --relations show relation to features / integration branches + --dump-config print out current configuration and exit + +git-wtf uses some heuristics to determine which branches are integration +branches, and which are feature branches. (Specifically, it assumes the +integration branches are named "master", "next" and "edge".) If it guesses +incorrectly, you will have to create a .git-wtfrc file. + +To start building a configuration file, run "git-wtf --dump-config > +.git-wtfrc" and edit it. The config file is a YAML file that specifies the +integration branches, any branches to ignore, and the max number of commits to +display when --all-commits isn't used. git-wtf will look for a .git-wtfrc file +starting in the current directory, and recursively up to the root. + +IMPORTANT NOTE: all local branches referenced in .git-wtfrc must be prefixed +with heads/, e.g. "heads/master". Remote branches must be of the form +remotes/<remote>/<branch>. +EOS + +COPYRIGHT = <<EOS +git-wtf Copyright 2008--2009 William Morgan <wmorgan at the masanjin dot nets>. +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the Free +Software Foundation, either version 3 of the License, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +more details. + +You can find the GNU General Public License at: http://www.gnu.org/licenses/ +EOS + +require 'yaml' +CONFIG_FN = ".git-wtfrc" + +class Numeric; def pluralize s; "#{to_s} #{s}" + (self != 1 ? "s" : "") end end + +if ARGV.delete("--help") || ARGV.delete("-h") + puts USAGE + exit +end + +## poor man's trollop +$long = ARGV.delete("--long") || ARGV.delete("-l") +$short = ARGV.delete("--short") || ARGV.delete("-s") +$all = ARGV.delete("--all") || ARGV.delete("-a") +$all_commits = ARGV.delete("--all-commits") || ARGV.delete("-A") +$dump_config = ARGV.delete("--dump-config") +$key = ARGV.delete("--key") || ARGV.delete("-k") +$show_relations = ARGV.delete("--relations") || ARGV.delete("-r") +ARGV.each { |a| abort "Error: unknown argument #{a}." if a =~ /^--/ } + +## search up the path for a file +def find_file fn + while true + return fn if File.exist? fn + fn2 = File.join("..", fn) + return nil if File.expand_path(fn2) == File.expand_path(fn) + fn = fn2 + end +end + +want_color = `git config color.wtf` +want_color = `git config color.ui` if want_color.empty? +$color = case want_color.chomp + when "true"; true + when "auto"; $stdout.tty? +end + +def red s; $color ? "\033[31m#{s}\033[0m" : s end +def green s; $color ? "\033[32m#{s}\033[0m" : s end +def yellow s; $color ? "\033[33m#{s}\033[0m" : s end +def cyan s; $color ? "\033[36m#{s}\033[0m" : s end +def grey s; $color ? "\033[1;30m#{s}\033[0m" : s end +def purple s; $color ? "\033[35m#{s}\033[0m" : s end + +## the set of commits in 'to' that aren't in 'from'. +## if empty, 'to' has been merged into 'from'. +def commits_between from, to + if $long + `git log --pretty=format:"- %s [#{yellow "%h"}] (#{purple "%ae"}; %ar)" #{from}..#{to}` + else + `git log --pretty=format:"- %s [#{yellow "%h"}]" #{from}..#{to}` + end.split(/[\r\n]+/) +end + +def show_commits commits, prefix=" " + if commits.empty? + puts "#{prefix} none" + else + max = $all_commits ? commits.size : $config["max_commits"] + max -= 1 if max == commits.size - 1 # never show "and 1 more" + commits[0 ... max].each { |c| puts "#{prefix}#{c}" } + puts grey("#{prefix}... and #{commits.size - max} more (use -A to see all).") if commits.size > max + end +end + +def ahead_behind_string ahead, behind + [ahead.empty? ? nil : "#{ahead.size.pluralize 'commit'} ahead", + behind.empty? ? nil : "#{behind.size.pluralize 'commit'} behind"]. + compact.join("; ") +end + +def widget merged_in, remote_only=false, local_only=false, local_only_merge=false + left, right = case + when remote_only; %w({ }) + when local_only; %w{( )} + else %w([ ]) + end + middle = case + when merged_in && local_only_merge; green("~") + when merged_in; green("x") + else " " + end + print left, middle, right +end + +def show b + have_both = b[:local_branch] && b[:remote_branch] + + pushc, pullc, oosync = if have_both + [x = commits_between(b[:remote_branch], b[:local_branch]), + y = commits_between(b[:local_branch], b[:remote_branch]), + !x.empty? && !y.empty?] + end + + if b[:local_branch] + puts "Local branch: " + green(b[:local_branch].sub(/^heads\//, "")) + + if have_both + if pushc.empty? + puts "#{widget true} in sync with remote" + else + action = oosync ? "push after rebase / merge" : "push" + puts "#{widget false} NOT in sync with remote (you should #{action})" + show_commits pushc unless $short + end + end + end + + if b[:remote_branch] + puts "Remote branch: #{cyan b[:remote_branch]} (#{b[:remote_url]})" + + if have_both + if pullc.empty? + puts "#{widget true} in sync with local" + else + action = pushc.empty? ? "merge" : "rebase / merge" + puts "#{widget false} NOT in sync with local (you should #{action})" + show_commits pullc unless $short + end + end + end + + puts "\n#{red "WARNING"}: local and remote branches have diverged. A merge will occur unless you rebase." if oosync +end + +def show_relations b, all_branches + ibs, fbs = all_branches.partition { |name, br| $config["integration-branches"].include?(br[:local_branch]) || $config["integration-branches"].include?(br[:remote_branch]) } + if $config["integration-branches"].include? b[:local_branch] + puts "\nFeature branches:" unless fbs.empty? + fbs.each do |name, br| + next if $config["ignore"].member?(br[:local_branch]) || $config["ignore"].member?(br[:remote_branch]) + next if br[:ignore] + local_only = br[:remote_branch].nil? + remote_only = br[:local_branch].nil? + name = if local_only + purple br[:name] + elsif remote_only + cyan br[:name] + else + green br[:name] + end + + ## for remote_only branches, we'll compute wrt the remote branch head. otherwise, we'll + ## use the local branch head. + head = remote_only ? br[:remote_branch] : br[:local_branch] + + remote_ahead = b[:remote_branch] ? commits_between(b[:remote_branch], head) : [] + local_ahead = b[:local_branch] ? commits_between(b[:local_branch], head) : [] + + if local_ahead.empty? && remote_ahead.empty? + puts "#{widget true, remote_only, local_only} #{name} #{local_only ? "(local-only) " : ""}is merged in" + elsif local_ahead.empty? + puts "#{widget true, remote_only, local_only, true} #{name} merged in (only locally)" + else + behind = commits_between head, (br[:local_branch] || br[:remote_branch]) + ahead = remote_only ? remote_ahead : local_ahead + puts "#{widget false, remote_only, local_only} #{name} #{local_only ? "(local-only) " : ""}is NOT merged in (#{ahead_behind_string ahead, behind})" + show_commits ahead unless $short + end + end + else + puts "\nIntegration branches:" unless ibs.empty? # unlikely + ibs.sort_by { |v, br| v }.each do |v, br| + next if $config["ignore"].member?(br[:local_branch]) || $config["ignore"].member?(br[:remote_branch]) + next if br[:ignore] + local_only = br[:remote_branch].nil? + remote_only = br[:local_branch].nil? + name = remote_only ? cyan(br[:name]) : green(br[:name]) + + ahead = commits_between v, (b[:local_branch] || b[:remote_branch]) + if ahead.empty? + puts "#{widget true, local_only} merged into #{name}" + else + #behind = commits_between b[:local_branch], v + puts "#{widget false, local_only} NOT merged into #{name} (#{ahead.size.pluralize 'commit'} ahead)" + show_commits ahead unless $short + end + end + end +end + +#### EXECUTION STARTS HERE #### + +## find config file and load it +$config = { "integration-branches" => %w(heads/master heads/next heads/edge), "ignore" => [], "max_commits" => 5 }.merge begin + fn = find_file CONFIG_FN + if fn && (h = YAML::load_file(fn)) # yaml turns empty files into false + h["integration-branches"] ||= h["versions"] # support old nomenclature + h + else + {} + end +end + +if $dump_config + puts $config.to_yaml + exit +end + +## first, index registered remotes +remotes = `git config --get-regexp ^remote\.\*\.url`.split(/[\r\n]+/).inject({}) do |hash, l| + l =~ /^remote\.(.+?)\.url (.+)$/ or next hash + hash[$1] ||= $2 + hash +end + +## next, index followed branches +branches = `git config --get-regexp ^branch\.`.split(/[\r\n]+/).inject({}) do |hash, l| + case l + when /branch\.(.*?)\.remote (.+)/ + name, remote = $1, $2 + + hash[name] ||= {} + hash[name].merge! :remote => remote, :remote_url => remotes[remote] + when /branch\.(.*?)\.merge ((refs\/)?heads\/)?(.+)/ + name, remote_branch = $1, $4 + hash[name] ||= {} + hash[name].merge! :remote_mergepoint => remote_branch + end + hash +end + +## finally, index all branches +remote_branches = {} +`git show-ref`.split(/[\r\n]+/).each do |l| + sha1, ref = l.chomp.split " refs/" + + if ref =~ /^heads\/(.+)$/ # local branch + name = $1 + next if name == "HEAD" + branches[name] ||= {} + branches[name].merge! :name => name, :local_branch => ref + elsif ref =~ /^remotes\/(.+?)\/(.+)$/ # remote branch + remote, name = $1, $2 + remote_branches["#{remote}/#{name}"] = true + next if name == "HEAD" + ignore = !($all || remote == "origin") + + branch = name + if branches[name] && branches[name][:remote] == remote + # nothing + else + name = "#{remote}/#{branch}" + end + + branches[name] ||= {} + branches[name].merge! :name => name, :remote => remote, :remote_branch => "#{remote}/#{branch}", :remote_url => remotes[remote], :ignore => ignore + end +end + +## assemble remotes +branches.each do |k, b| + next unless b[:remote] && b[:remote_mergepoint] + b[:remote_branch] = if b[:remote] == "." + b[:remote_mergepoint] + else + t = "#{b[:remote]}/#{b[:remote_mergepoint]}" + remote_branches[t] && t # only if it's still alive + end +end + +show_dirty = ARGV.empty? +targets = if ARGV.empty? + [`git symbolic-ref HEAD`.chomp.sub(/^refs\/heads\//, "")] +else + ARGV.map { |x| x.sub(/^heads\//, "") } +end.map { |t| branches[t] or abort "Error: can't find branch #{t.inspect}." } + +targets.each do |t| + show t + show_relations t, branches if $show_relations || t[:remote_branch].nil? +end + +modified = show_dirty && `git ls-files -m` != "" +uncommitted = show_dirty && `git diff-index --cached HEAD` != "" + +if $key + puts + puts KEY +end + +puts if modified || uncommitted +puts "#{red "NOTE"}: working directory contains modified files." if modified +puts "#{red "NOTE"}: staging area contains staged but uncommitted files." if uncommitted + +# the end! diff --git a/bin/gren b/bin/gren new file mode 100755 index 0000000..2dff535 --- /dev/null +++ b/bin/gren @@ -0,0 +1,16 @@ +#!/bin/sh +set -ex + +if [[ -z "$1" ]]; then + echo "Usage: $0 <branch name>" + exit 1 +fi + +hub sync + +if git rev-parse --verify --quiet $1; then + git checkout $1 +else + git checkout -b $1 main + git push -u origin $1 +fi diff --git a/bin/ktail b/bin/ktail new file mode 100755 index 0000000..2969226 --- /dev/null +++ b/bin/ktail @@ -0,0 +1,5 @@ +#!/bin/bash +kubectl get pod --output json \ + | jq -r '[.items[].metadata.labels]|map(to_entries[]|(.key) + "=" + .value)|unique|.[]' \ + | fzf \ + | xargs kubectl tail "$@" -l diff --git a/bin/ktoolbox b/bin/ktoolbox new file mode 120000 index 0000000..fcc985d --- /dev/null +++ b/bin/ktoolbox @@ -0,0 +1 @@ +/home/dln/src/github.com/dln/ktoolbox/ktoolbox \ No newline at end of file diff --git a/bin/pw b/bin/pw new file mode 100755 index 0000000..642ad2a --- /dev/null +++ b/bin/pw @@ -0,0 +1,46 @@ +#!/bin/bash +# +# Author: Daniel Lundin <dln@arity.se> +# +# Convenience script to hide sensitive variables on the command line. +# Uses keyctl to store secrets in the keyring. +# +# Example usage: mycommand --user=foo --password=$(pw mypass) + +set -eo pipefail + +purge=0 +ttl=${PW_TTL:-259200} + +usage() { echo "Usage: $0 [-t SECONDS] [-f] SECRET_NAME" 1>&2; exit 1; } + +while getopts ":ft:" o; do + case "${o}" in + f) + purge=1 + ;; + t) + ttl=${OPTARG} + ;; + *) + usage + ;; + esac +done +shift $((OPTIND-1)) + +var="$1" +shift || usage +[ -z "$1" ] || usage + +key="pw.${var}" + +if [ "${purge}" == "1" ]; then + keyctl purge user "${key}" >>/dev/null 2>&1 || true +fi + +out=$(systemd-ask-password --accept-cached --keyname="${key}" "${var}:") +key_id=$(keyctl request user "${key}" 2>/dev/null) +keyctl timeout "$key_id" "$ttl" + +printf "%s" "$out" diff --git a/bin/starship-sl-status b/bin/starship-sl-status new file mode 100755 index 0000000..8a80026 --- /dev/null +++ b/bin/starship-sl-status @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -xfeuo pipefail + +state="${XDG_RUNTIME_DIR}/starship-sl-status" +checkout="${state}.checkout" +status="${state}.data" + +if [[ "$PWD" != $(readlink -f "$state")* ]]; then + rm -f "$state" + root="$(sl root 2>/dev/null || true)" + ln -s "$root" "$state" + if [[ -z "${root}" ]]; then + echo >"${status}" + echo >"${checkout}" + exit 0 + fi +fi + +saved_cid=$(cat "${checkout}" 2>/dev/null || true) +root_cid=$(cat "${state}/.sl/checkoutidentifier" || true) +if [[ ${root_cid} != "${saved_cid}" ]]; then + echo "${root_cid}" >"${checkout}" + sl log -r . -T '{if(github_pull_request_number, "#{github_pull_request_number} @ ", if(bookmarks, "{bookmarks} @ "))}{node|short}{if(remotenames, ":{remotenames}")}' >"${status}" +fi + +cat "$status" || true diff --git a/bin/tmux-build-helper b/bin/tmux-build-helper new file mode 100755 index 0000000..e27347c --- /dev/null +++ b/bin/tmux-build-helper @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -ef -o pipefail +eval "$(direnv export bash)" +eval "${BUILD_COMMAND:-echo 'BUILD_COMMAND not set'}" | bat --paging=always diff --git a/bin/tmux-edit-helper b/bin/tmux-edit-helper new file mode 100755 index 0000000..1742e56 --- /dev/null +++ b/bin/tmux-edit-helper @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +set -fe -o pipefail + +eval "$(direnv export bash)" + +if [ -n "$1" ]; then + _file=$(readlink -f "$@") +else + FZF=${FZF:-"fzf-tmux -p 90%,50% -y 0"} + _root=$(git rev-parse --show-toplevel 2>/dev/null || sl root 2>/dev/null || pwd) + _store=$(echo "$_root" | sha1sum | cut -d ' ' -f 1) + _file=$( ( (fre --store_name "$_store" --sorted | xargs -n 100 ls -d 2>/dev/null || true) && fd --type f --hidden --follow --exclude .git --exclude .sl --ignore-file "${_root}/.gitignore" . "$_root") | cat -n | sort -k2 -k1n | uniq -f1 | sort -nk1,1 | cut -f2- | sed -e "s#^${_root}/##" | $FZF --no-sort) + _file="${_root}/${_file}" + fre --store_name "$_store" --add "$_file" +fi + +tmux select-window -t nvim 2>/dev/null || + tmux new-window -S -n nvim \ + -e "BUILD_COMMAND=$BUILD_COMMAND" \ + -e "GOPACKAGESDRIVER=$GOPACKAGESDRIVER" \ + -e "GOFLAGS=$GOFLAGS" \ + nvim --listen "$XDG_RUNTIME_DIR/nvim.sock" + +nvim --server "$XDG_RUNTIME_DIR/nvim.sock" --remote "$_file" diff --git a/bin/tmux-nvr b/bin/tmux-nvr new file mode 100755 index 0000000..12e869f --- /dev/null +++ b/bin/tmux-nvr @@ -0,0 +1,5 @@ +#!/bin/bash +tmux select-window -t1 +FILE="$1" +shift +exec nvr --remote "$@" $(readlink -f "$FILE") diff --git a/bin/tpm2-pkcs11-init-ssh.sh b/bin/tpm2-pkcs11-init-ssh.sh new file mode 100755 index 0000000..b66fb8d --- /dev/null +++ b/bin/tpm2-pkcs11-init-ssh.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -e + +store=$1 +if [ -z "$store" ]; then + echo "Usage: $0 [store-name]" + exit 1 +fi + +export TPM2_PKCS11_STORE=$HOME/.local/share/tpm2-pkcs11/${store} + +echo "=> Initializing store ${TPM2_PKCS11_STORE}" +mkdir -p $TPM2_PKCS11_STORE +tpm2_ptool init +tpm2_ptool addtoken --pid=1 --label=ssh --sopin="$(systemd-ask-password SOPIN)" --userpin="$(systemd-ask-password USERPIN)" + +echo +echo "=> Adding SSH key" +tpm2_ptool addkey --label=ssh --algorithm=ecc256 --userpin="$(systemd-ask-password USERPIN)" + +echo +echo "Store path: $TPM2_PKCS11_STORE" +echo "SSH public key:" +ssh-keygen -D /usr/lib/pkcs11/libtpm2_pkcs11.so 2>>/dev/null diff --git a/bin/url-copy b/bin/url-copy new file mode 100755 index 0000000..281715e --- /dev/null +++ b/bin/url-copy @@ -0,0 +1,2 @@ +#!/bin/bash +echo "$@" | xclip -selection clipboard diff --git a/bin/vault-token-helper.sh b/bin/vault-token-helper.sh new file mode 100755 index 0000000..bac9855 --- /dev/null +++ b/bin/vault-token-helper.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +# Vault Token helper for the Linux key retention service. +# +# Since version 2.6, the Linux kernel has included a efficiently store +# authentication data on a per thread, per process, per user, or per session +# bases. +# +# Linux Key Management Utilities (keyutils) provides `keyctl` to control +# the facility from the shell. +# +# see https://www.kernel.org/doc/Documentation/security/keys/core.rst +# see https://www.kernel.org/doc/Documentation/security/keys.txt +# see https://lwn.net/Articles/210502/ +# see https://www.ibm.com/developerworks/library/l-key-retention/index.html +# +# Vault allows an external programs to be configured as a token helper +# that can get, store, and erase tokens on behalf of the Vault client. +# +# see https://www.vaultproject.io/docs/commands/token-helper.html +# +# To use this script, make it executable and set your ~/.vault file to +# contain: +# +# token_helper = "/path/to/vault-token-helper.sh" + +# Exit on error. +set -o errexit +# Exit on error inside any functions or subshells. +set -o errtrace +# Do not allow use of undefined vars. +set -o nounset +# Catch the error if any piped command fails. +set -o pipefail + +desc=VAULT_TOKEN:${VAULT_ADDR} + +case $1 in +get) + # If the key is not set, keyctl returns "request_key: Required key not available" + # on stderr and exits with a non-zero status. The implied + key_id=$(keyctl request user ${desc} || echo '') + [ -z ${key_id} ] && exit 0 + keyctl pipe ${key_id} +;; +store) + # Vault sends the token on stdin but there is no linebreak, so EOF is reached + # which causes read to return a non-zero status. + read -r token || true + echo -n ${token} | keyctl padd user ${desc} @u +;; +erase) + keyctl purge user ${desc} +;; +esac diff --git a/common/base.nix b/common/base.nix deleted file mode 100644 index 9207bf3..0000000 --- a/common/base.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ pkgs, ... }: - -{ - boot = { - loader.systemd-boot.enable = true; - loader.efi.canTouchEfiVariables = true; - kernelPackages = pkgs.linuxPackages_zen; - initrd.systemd.enable = true; - - binfmt.emulatedSystems = [ "aarch64-linux" ]; - }; - - # Temporary files - boot.tmp.useTmpfs = true; - systemd.services.nix-daemon = { - environment.TMPDIR = "/var/tmp"; - }; - - system.switch = { - enable = false; - enableNg = true; - }; - - services.fstrim.enable = true; - services.fwupd.enable = true; - - time.timeZone = "Europe/Stockholm"; - - environment.systemPackages = with pkgs; [ - btrfs-progs - btrfs-snap - git - glibcLocales - qemu_kvm - qemu-utils - vim - zstd - ]; - - # Use fish, but not in /etc/passwd . See https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell - programs.bash = { - interactiveShellInit = '' - 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 - ''; - shellInit = '' - export NIX_LD=$(nix eval --impure --raw --expr 'let pkgs = import <nixpkgs> {}; NIX_LD = pkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker"; in NIX_LD') - ''; - }; - - services.avahi = { - nssmdns4 = true; - enable = true; - ipv4 = true; - ipv6 = true; - publish = { - enable = true; - addresses = true; - workstation = true; - }; - }; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; -} diff --git a/common/default.nix b/common/default.nix deleted file mode 100644 index fcbbc87..0000000 --- a/common/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - imports = [ - ./base.nix - ./desktop.nix - ./hardening.nix - ./laptop.nix - ./nix.nix - ./plymouth.nix - ./podman.nix - ]; -} diff --git a/common/desktop.nix b/common/desktop.nix deleted file mode 100644 index cf16871..0000000 --- a/common/desktop.nix +++ /dev/null @@ -1,104 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -let - inherit (lib) mkIf mkEnableOption; - cfg = config.patagia.podman; -in -{ - options.patagia.desktop.enable = mkEnableOption "Desktop environment and common applications"; - - config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ gnome-ssh-askpass4 ]; - - # Excluding some GNOME applications from the default install - environment.gnome.excludePackages = ( - with pkgs; - [ - atomix # puzzle game - baobab # disk usage analyzer - cheese # webcam tool - epiphany # web browser - geary # email reader - gnome-clocks - gnome-connections - gnome-disk-utility - gnome-logs - gnome-music - gnome-photos - gnome-terminal - gnome-tour - snapshot - hitori # sudoku game - iagno # go game - simple-scan - tali # poker game - yelp # help viewer - ] - ); - - fonts = { - fontDir.enable = true; - fontconfig = { - allowBitmaps = false; - antialias = true; - defaultFonts = { - monospace = [ "Berkeley Mono" ]; - serif = [ "Liberation Serif" ]; - sansSerif = [ "Inter" ]; - }; - hinting.enable = true; - hinting.style = "slight"; - }; - packages = with pkgs; [ - inter - liberation_ttf - monaspace - nerd-fonts.symbols-only - noto-fonts - noto-fonts-cjk-sans - noto-fonts-color-emoji - ubuntu_font_family - ]; - }; - - programs.ssh.askPassword = "${pkgs.gnome-ssh-askpass4}/bin/gnome-ssh-askpass4"; - programs.ssh.startAgent = true; - - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - }; - - services.gnome.gnome-keyring.enable = true; - - services.printing.enable = true; - - services.displayManager.defaultSession = "gnome"; - - services.xserver = { - enable = true; - displayManager.gdm.enable = true; - displayManager.gdm.autoSuspend = false; - desktopManager.gnome.enable = true; - xkb.layout = "se"; - xkb.variant = "us"; - }; - - services.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; - }; -} diff --git a/common/hardening.nix b/common/hardening.nix deleted file mode 100644 index 4095ce0..0000000 --- a/common/hardening.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - nix.settings.allowed-users = [ - "@wheel" - "root" - ]; - - boot.specialFileSystems = lib.mkIf ( - !config.security.rtkit.enable && !config.security.polkit.enable - ) { "/proc".options = [ "hidepid=2" ]; }; - - boot.kernel.sysctl."kernel.dmesg_restrict" = 1; - - environment.systemPackages = [ pkgs.doas-sudo-shim ]; - - security = { - doas = { - enable = true; - extraRules = [ - { - groups = [ "wheel" ]; - keepEnv = true; - persist = true; - } - ]; - }; - sudo.enable = false; - }; - - services.openssh = { - settings.PasswordAuthentication = false; - settings.KbdInteractiveAuthentication = false; - # prevents mutable /home/$user/.ssh/authorized_keys from being loaded to ensure that all user keys are config managed - # authorizedKeysFiles = lib.mkForce [ "/etc/ssh/authorized_keys.d/%u" ]; - }; - - users.users.root.hashedPassword = "!"; -} diff --git a/common/laptop.nix b/common/laptop.nix deleted file mode 100644 index 2e0d6da..0000000 --- a/common/laptop.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -let - inherit (lib) mkIf mkEnableOption; -in -{ - options.patagia.laptop.enable = mkEnableOption "Laptop tools and configuration"; - - config = mkIf config.patagia.laptop.enable { - environment.systemPackages = with pkgs; [ gnomeExtensions.battery-health-charging ]; - - services.fprintd.enable = true; - }; -} diff --git a/common/nix.nix b/common/nix.nix deleted file mode 100644 index da49b67..0000000 --- a/common/nix.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: - -{ - nix = - let - flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; - in - { - settings = { - auto-optimise-store = true; - experimental-features = "nix-command flakes"; - flake-registry = ""; - # Workaround for https://github.com/NixOS/nix/issues/9574 - nix-path = config.nix.nixPath; - substituters = [ - "https://cache-nixos-org.aarn.patagia.net/" - ]; - trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ]; - extra-substituters = [ - "https://nix-community.cachix.org" - ]; - extra-trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - ]; - }; - channel.enable = false; - registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; - nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; - }; - - nixpkgs = { - overlays = [ - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - ]; - config.allowUnfree = true; - }; - - programs.nh = { - enable = true; - clean.enable = true; - clean.extraArgs = "--keep-since 14d --keep 5"; - }; - programs.nix-ld.enable = true; - - environment.systemPackages = with pkgs; [ - nvd - ]; -} diff --git a/common/plymouth.nix b/common/plymouth.nix deleted file mode 100644 index ecca293..0000000 --- a/common/plymouth.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -let - inherit (lib) mkIf mkEnableOption; - cfg = config.patagia.plymouth; -in -{ - options.patagia.plymouth.enable = mkEnableOption "Fancy boot splash"; - - config = mkIf cfg.enable { - boot = { - consoleLogLevel = 0; - initrd.verbose = false; - - # Hide the OS choice for bootloaders. - # It's still possible to open the bootloader list by pressing any key - # It will just not appear on screen unless a key is pressed - loader.timeout = 0; - - kernelParams = [ - "quiet" - "splash" - "boot.shell_on_fail" - "loglevel=3" - "rd.systemd.show_status=false" - "rd.udev.log_level=3" - "udev.log_priority=3" - ]; - - plymouth = { - enable = true; - theme = "spinner_alt"; - themePackages = with pkgs; [ - (adi1090x-plymouth-themes.override { selected_themes = [ "spinner_alt" ]; }) - ]; - }; - }; - - }; -} diff --git a/common/podman.nix b/common/podman.nix deleted file mode 100644 index 717facf..0000000 --- a/common/podman.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -let - inherit (lib) mkIf mkEnableOption; - cfg = config.patagia.podman; -in -{ - options.patagia.podman.enable = mkEnableOption "Podman"; - - config = mkIf cfg.enable { - environment.extraInit = '' - if [ -z "$DOCKER_HOST" -a -n "$XDG_RUNTIME_DIR" ]; then - export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock" - fi - ''; - - virtualisation = { - containers = { - enable = true; - storage.settings = { - storage = { - driver = "overlay"; - runroot = "/run/containers/storage"; - graphroot = "/var/lib/containers/storage"; - rootless_storage_path = "/tmp/containers-$USER"; - options.overlay.mountopt = "nodev,metacopy=on"; - }; - }; - }; - - oci-containers.backend = "podman"; - podman = { - enable = true; - dockerCompat = true; - }; - }; - }; -} diff --git a/files/config/fish/config.fish b/files/config/fish/config.fish deleted file mode 100644 index 4bb823b..0000000 --- a/files/config/fish/config.fish +++ /dev/null @@ -1,54 +0,0 @@ -# Bindings -bind \cg __zoxide_zi_repaint -bind \cJ forward-char -bind \cn history-prefix-search-forward -bind \cp history-prefix-search-backward -bind \e\[109\;5u execute # C-m in ghostty - -# Settings -set fish_greeting -set fish_emoji_width 2 - -# Colors -set fish_color_command --bold -set fish_color_comment --italics --dim -set fish_color_autosuggestion 1f67f9 --italics --bold -set fish_color_cancel -set fish_color_command --bold -set fish_color_comment --italics --dim -set fish_color_cwd normal -set fish_color_cwd_root normal -set fish_color_end -set fish_color_error -set fish_color_escape -set fish_color_gray 6c7086 -set fish_color_history_current -set fish_color_host normal -set fish_color_host_remote yellow -set fish_color_keyword -set fish_color_match -set fish_color_normal normal -set fish_color_operator -set fish_color_option -set fish_color_param normal -set fish_color_quote --italics -set fish_color_redirection -set fish_color_search_match -r -set fish_color_selection -r -set fish_color_status normal -set fish_color_string normal -set fish_color_user normal -set fish_color_valid_path -set fish_pager_color_background -set fish_pager_color_completion normal -set fish_pager_color_description --dim -set fish_pager_color_prefix --underline -set fish_pager_color_progress --dim -set fish_pager_color_secondary_background -set fish_pager_color_secondary_completion -set fish_pager_color_secondary_description -set fish_pager_color_secondary_prefix -set fish_pager_color_selected_background -r -set fish_pager_color_selected_completion -set fish_pager_color_selected_description -set fish_pager_color_selected_prefix diff --git a/files/config/fish/semantic-prompt.fish b/files/config/fish/semantic-prompt.fish deleted file mode 100644 index 2656f40..0000000 --- a/files/config/fish/semantic-prompt.fish +++ /dev/null @@ -1,55 +0,0 @@ -## Semantic prompt (for Wezterm) - -set _fishprompt_aid "fish"$fish_pid -set _fishprompt_started 0 -# empty if running; or a numeric exit code; or CANCEL -set _fishprompt_postexec "" - -functions -c fish_prompt _fishprompt_saved_prompt -set _fishprompt_prompt_count 0 -set _fishprompt_disp_count 0 -function _fishprompt_start --on-event fish_prompt - set _fishprompt_prompt_count (math $_fishprompt_prompt_count + 1) - # don't use post-exec, because it is called *before* omitted-newline output - if [ -n "$_fishprompt_postexec" ] - printf "\033]133;D;%s;aid=%s\007" "$_fishprompt_postexec" $_fishprompt_aid - end - printf "\033]133;A;aid=%s;cl=m\007" $_fishprompt_aid -end - -function fish_prompt - set _fishprompt_disp_count (math $_fishprompt_disp_count + 1) - printf "\033]133;P;k=i\007%b\033]133;B\007" (string join "\n" (_fishprompt_saved_prompt)) - set _fishprompt_started 1 - set _fishprompt_postexec "" -end - -function _fishprompt_preexec --on-event fish_preexec - if [ "$_fishprompt_started" = 1 ] - printf "\033]133;C;\007" - end - set _fishprompt_started 0 -end - -function _fishprompt_postexec --on-event fish_postexec - set _fishprompt_postexec $status - _fishprompt_start -end - -function __fishprompt_cancel --on-event fish_cancel - set _fishprompt_postexec CANCEL - _fishprompt_start -end - -function _fishprompt_exit --on-process %self - if [ "$_fishprompt_started" = 1 ] - printf "\033]133;Z;aid=%s\007" $_fishprompt_aid - end -end - -if functions -q fish_right_prompt - functions -c fish_right_prompt _fishprompt_saved_right_prompt - function fish_right_prompt - printf "\033]133;P;k=r\007%b\033]133;B\007" (string join "\n" (_fishprompt_saved_right_prompt)) - end -end diff --git a/files/config/fish/vcs.fish b/files/config/fish/vcs.fish deleted file mode 100644 index 0fa3e43..0000000 --- a/files/config/fish/vcs.fish +++ /dev/null @@ -1,70 +0,0 @@ - -function __jj_in_repo - jj --ignore-working-copy --quiet root >>/dev/null 2>&1 -end - -function vcs_root - jj workspace root --ignore-working-copy 2>/dev/null || git rev-parse --show-toplevel 2>/dev/null || pwd -end - -function vcs_broot - br (vcs_root) - commandline -f repaint -end - -function vcs_jump - set _dir (vcs_root) - if [ "$_dir" = "$PWD" ] - set _dir (br -f --conf "$HOME/.config/broot/conf.toml") - end - [ -n "$_dir" ] && pushd $_dir >>/dev/null - commandline -f repaint -end - -function vcs_status - if __jj_in_repo - echo - printf '\e[38;5;240m\u2504%.0s\e[0m' (seq 1 (tput cols)) '\n' - jj show --stat - printf '\e[38;5;240m\u2504%.0s\e[0m' (seq 1 (tput cols)) '\n' - jj log --ignore-working-copy --limit=20 -T builtin_log_comfortable -r "(main..@) | (main..@)-" - else - git status -sb - end - commandline -f repaint -end - -function vcs_diff - if __jj_in_repo - jj show $argv - else - git diff --stat -p -C --color-words $argv - end - commandline -f repaint -end - - -function vcs_log - if __jj_in_repo - jj log --ignore-working-copy $argv - else - git diff --stat -p -C --color-words $argv - end - commandline -f repaint -end - -# Abbreviations - -abbr -a d vcs_diff -abbr -a s vcs_status - -# Bindings -bind \c_ vcs_jump -bind \ea vcs_log -bind \ee vcs_broot -bind \eS vcs_diff -bind \es vcs_status - -# jj completions - -COMPLETE=fish jj | source diff --git a/files/scripts/git-signing-key b/files/scripts/git-signing-key deleted file mode 100755 index 9c49d31..0000000 --- a/files/scripts/git-signing-key +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -ssh-add -L | awk '/^sk-ssh-/ { print "key::" $1 " " $2 }' diff --git a/files/scripts/test-term.sh b/files/scripts/test-term.sh deleted file mode 100755 index e702886..0000000 --- a/files/scripts/test-term.sh +++ /dev/null @@ -1,294 +0,0 @@ -echo -ne '\e[0mnormal\e[0m\t\t\t' -echo -e '\e[7m reverse \e[0m' - -echo -ne '\e[2mdim\e[0m\t\t\t' -echo -e '\e[7;2m reverse dim \e[0m' - -echo -ne '\e[1mbold\e[0m\t\t\t' -echo -e '\e[7;1m reverse bold \e[0m' - -echo -ne '\e[3mitalic\e[0m\t\t\t' -echo -e '\e[7;3m reverse italic \e[0m' - -echo -ne '\e[2;3mdim italic\e[0m\t\t' -echo -e '\e[7;2;3m reverse dim italic \e[0m' - -echo -ne '\e[1;3mbold italic\e[0m\t\t' -echo -e '\e[7;1;3m reverse bold italic \e[0m' - -echo -echo -e '\e[4munderline\e[0m' -echo -e '\e[3;4mitalic underline\e[0m' -echo -e '\e[4:1mthis is also underline \e[0m' -echo -e '\e[21mdouble underline \e[0m' -echo -e '\e[4:2mthis is also double underline \e[0m' -echo -e '\e[4:3mcurly underline \e[0m' -echo -e '\e[21m\e[58;5;42m256-color underline \e[0m' -echo -e '\e[4:3m\e[58;2;240;143;104mtruecolor underline (*)\e[0m' -echo -e "\e[58:2::255:0:0m\e[4:1msingle underline \e[0m" -echo -e "\e[4:2mdouble underline \e[58:2::255:0:0m and with color\e[0m" -echo -e "\e[4:3mcurly underline \e[58:2::255:0:0m and with color\e[0m" -echo -e "\e[4:4mdotted underline \e[58:2::255:0:0m and with color\e[0m" -echo -e "\e[4:5mdashed underline \e[58:2::255:0:0m and with color\e[0m" - -echo -echo -e '\e[5mblink \e[0m' -echo -e '\e[8minvisible\e[0m <- invisible (but copy-pasteable)' -echo -e '\e[9mstrikethrough\e[0m' -echo -e '\e[53moverline \e[0m' -echo -e '\e[51mframed \e[0m' -echo -e '\e[52mencircled \e[0m' - -echo -e '\e[31mred\e[0m' -echo -e '\e[91mbright red\e[0m' -echo -e '\e[38:5:42m256-color, de jure standard (ITU-T T.416)\e[0m' -echo -e '\e[38;5;42m256-color, de facto standard (commonly used)\e[0m' -echo -e '\e[38:2::240:143:104mtruecolor, de jure standard (ITU-T T.416) \e[0m' -echo -e '\e[38;2;240;143;104mtruecolor, de facto standard (commonly used)\e[0m' - -echo -e '\e[46mcyan background\e[0m' -echo -e '\e[106mbright cyan background\e[0m' -echo -e '\e[48:5:42m256-color background, de jure standard (ITU-T T.416)\e[0m' -echo -e '\e[48;5;42m256-color background, de facto standard (commonly used)\e[0m' -echo -e '\e[48:2::240:143:104mtruecolor background, de jure standard (ITU-T T.416) \e[0m' -echo -e '\e[48:2:240:143:104mtruecolor background, rarely used incorrect format (might be removed at some point)\e[0m' -echo -e '\e[48;2;240;143;104mtruecolor background, de facto standard (commonly used)\e[0m' - -echo -echo "Emoji: 🚀 💩 😁 🍖 🔥 🔷 ❤️ " - -echo -echo "Nerdfonts: " -echo " " - -echo -echo "Geometrical:" -echo -e '◆ ◇ ◈ ● ○ ◉ ◎ ◍ ◌' -echo -e '■ □ ▢ ▣ ▤ ▥ ▦ ▧ ▨ ▩' -echo -e '◧ ◨ ◩ ◪ ◫ ◬ ◭ ◮ △ ▲ ▱ ▰ ▽ ▼ ▾ ▿' -echo -e '◠ ◡ ◢ ◣ ◤ ◥ ◦ ◧ ◨ ◩ ◪ ◫ ◬ ◭ ◮ ◯ ◰ ◱ ◲ ◳ ◴ ◵ ◶ ◷ ◸ ◹ ◺ ◻ ◼ ◽ ◾ ◿' - -echo "Arrows:" -echo -e '▲ ▶ ▼ ◀ △ ▷ ▽ ◁' -echo -e '← → ↑ ↓ ↔ ↔ ↕ ↖ ↗ ↙ ↘ ↠ ↣ ↦ ↧ ↨ ↩ ↪ ↫ ↬ ↭ ↮ ↯ ↰ ↱ ↲ ↳ ↴ ↵ ↶ ↷ ↸ ↹ ↺ ↻ ↼ ↽ ↾ ↿ ↼ ↽ ↾ ↿' -echo -e '⇄ ↔ ⇀ ⇂ ⇄ ⇆ ⇌ ⇎ ⇐ ⇑ ⇓ ⇕ ⇖ ⇗ ⇘ ⇙ ⇚ ⇛ ⇜ ⇝ ⇞ ⇟' - -echo -echo "Blocks:" -echo -e '▄ ▀ ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ ▀ ▔ ▏ ▎ ▍ ▌ ▋ ▊ ▉ ▐ ▕ ▖ ▗ ▘ ▙ ▚ ▛ ▜ ▝ ▞ ▟ ░ ▒ ▓ 🮘 🮙 🮐 ' -echo -e '▄ ▀ ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ ▀ ▔ ▏ ▎ ▍ ▌ ▋ ▊ ▉ ▐ ▕ ▖ ▗ ▘ ▙ ▚ ▛ ▜ ▝ ▞ ▟ ░ ▒ ▓ 🮘 🮙 🮐 ' -echo -e '▄ ▀ ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ ▀ ▔ ▏ ▎ ▍ ▌ ▋ ▊ ▉ ▐ ▕ ▖ ▗ ▘ ▙ ▚ ▛ ▜ ▝ ▞ ▟ ░ ▒ ▓ 🮘 🮙 🮐 ' -echo -echo -e '───── ━━━━━ ┄┄┄┄┄ ┅┅┅┅┅ ┈┈┈┈┈ ┉┉┉┉┉ ╌╌╌╌╌ ╍╍╍╍╍ │ ┃ ┆ ┇ ┊ ┋ ╎ ╏ ║ ╵ ╷ ╹ ╻ ' -echo -e '───── ━━━━━ ┄┄┄┄┄ ┅┅┅┅┅ ┈┈┈┈┈ ┉┉┉┉┉ ╌╌╌╌╌ ╍╍╍╍╍ │ ┃ ┆ ┇ ┊ ┋ ╎ ╏ ║ ╵ ╷ ╹ ╻ ' -echo -e '───── ━━━━━ ┄┄┄┄┄ ┅┅┅┅┅ ┈┈┈┈┈ ┉┉┉┉┉ ╌╌╌╌╌ ╍╍╍╍╍ │ ┃ ┆ ┇ ┊ ┋ ╎ ╏ ║ ╵ ╷ ╹ ╻ ' -echo -echo -e '╭──────────────╮ ┌─┬─┬─┬─┐ ╔═╦═╦═╦═╗ ┏━┳━┳━┳━┓ ' -echo -e '│ border chars │ │ ├─┼─┤ │ ║ ╠═╬═╣ ║ ┃ ┣━╋━┫ ┃ ' -echo -e '╰──────────────╯ └─┴─┴─┴─┘ ╚═╩═╩═╩═╝ ┗━┻━┻━┻━┛ ' - -echo -echo "Ligatures:" -echo "-<< -< -<- <-- <--- <<- <- -> ->> --> ---> ->- >- >>- <-> <--> <---> <----> <!--" -echo "=<< =< =<= <== <=== <<= <= => =>> ==> ===> =>= >= >>= <=> <==> <===> <====> <!---" -echo "[| |] {| |} <=< >=> <~~ <~ ~> ~~> :: ::: \/ /\ == != /= ~= <> === !== =/= =!= :>" -echo ":= :- :+ <* <*> *> <| <|> |> <. <.> .> +: -: =: <***> __ (* comm *) ++ +++ |- -|" - -echo -echo 24-bit colors: - -# This file was originally taken from iterm2 https://github.com/gnachman/iTerm2/blob/master/tests/24-bit-color.sh -# -# This file echoes a bunch of 24-bit color codes -# to the terminal to demonstrate its functionality. -# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m -# The background escape sequence is ^[48;2;<r>;<g>;<b>m -# <r> <g> <b> range from 0 to 255 inclusive. -# The escape sequence ^[0m returns output to default - -setBackgroundColor() { - printf '\x1b[48;2;%s;%s;%sm' $1 $2 $3 -} - -resetOutput() { - echo -en "\x1b[0m\n" -} - -# Gives a color $1/255 % along HSV -# Who knows what happens when $1 is outside 0-255 -# Echoes "$red $green $blue" where -# $red $green and $blue are integers -# ranging between 0 and 255 inclusive -rainbowColor() { - let h=$1/43 - let f=$1-43*$h - let t=$f*255/43 - let q=255-t - - if [ $h -eq 0 ]; then - echo "255 $t 0" - elif [ $h -eq 1 ]; then - echo "$q 255 0" - elif [ $h -eq 2 ]; then - echo "0 255 $t" - elif [ $h -eq 3 ]; then - echo "0 $q 255" - elif [ $h -eq 4 ]; then - echo "$t 0 255" - elif [ $h -eq 5 ]; then - echo "255 0 $q" - else - # execution should never reach here - echo "0 0 0" - fi -} - -for i in $(seq 0 127); do - setBackgroundColor $i 0 0 - echo -en " " -done -resetOutput -for i in $(seq 255 -1 128); do - setBackgroundColor $i 0 0 - echo -en " " -done -resetOutput - -for i in $(seq 0 127); do - setBackgroundColor 0 $i 0 - echo -n " " -done -resetOutput -for i in $(seq 255 -1 128); do - setBackgroundColor 0 $i 0 - echo -n " " -done -resetOutput - -for i in $(seq 0 127); do - setBackgroundColor 0 0 $i - echo -n " " -done -resetOutput -for i in $(seq 255 -1 128); do - setBackgroundColor 0 0 $i - echo -n " " -done -resetOutput - -for i in $(seq 0 127); do - setBackgroundColor $(rainbowColor $i) - echo -n " " -done -resetOutput -for i in $(seq 255 -1 128); do - setBackgroundColor $(rainbowColor $i) - echo -n " " -done -resetOutput - - -## Color test - -# Tom Hale, 2016. MIT Licence. -# Print out 256 colours, with each number printed in its corresponding colour -# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163 - -set -eu # Fail on errors or undeclared variables - -printable_colours=256 - -# Return a colour that contrasts with the given colour -# Bash only does integer division, so keep it integral -function contrast_colour { - local r g b luminance - colour="$1" - - if (( colour < 16 )); then # Initial 16 ANSI colours - (( colour == 0 )) && printf "15" || printf "0" - return - fi - - # Greyscale # rgb_R = rgb_G = rgb_B = (number - 232) * 10 + 8 - if (( colour > 231 )); then # Greyscale ramp - (( colour < 244 )) && printf "15" || printf "0" - return - fi - - # All other colours: - # 6x6x6 colour cube = 16 + 36*R + 6*G + B # Where RGB are [0..5] - # See http://stackoverflow.com/a/27165165/5353461 - - # r=$(( (colour-16) / 36 )) - g=$(( ((colour-16) % 36) / 6 )) - # b=$(( (colour-16) % 6 )) - - # If luminance is bright, print number in black, white otherwise. - # Green contributes 587/1000 to human perceived luminance - ITU R-REC-BT.601 - (( g > 2)) && printf "0" || printf "15" - return - - # Uncomment the below for more precise luminance calculations - - # # Calculate percieved brightness - # # See https://www.w3.org/TR/AERT#color-contrast - # # and http://www.itu.int/rec/R-REC-BT.601 - # # Luminance is in range 0..5000 as each value is 0..5 - # luminance=$(( (r * 299) + (g * 587) + (b * 114) )) - # (( $luminance > 2500 )) && printf "0" || printf "15" -} - -# Print a coloured block with the number of that colour -function print_colour { - local colour="$1" contrast - contrast=$(contrast_colour "$1") - printf "\e[48;5;%sm" "$colour" # Start block of colour - printf "\e[38;5;%sm%3d" "$contrast" "$colour" # In contrast, print number - printf "\e[0m " # Reset colour -} - -# Starting at $1, print a run of $2 colours -function print_run { - local i - for (( i = "$1"; i < "$1" + "$2" && i < printable_colours; i++ )) do - print_colour "$i" - done - printf " " -} - -# Print blocks of colours -function print_blocks { - local start="$1" i - local end="$2" # inclusive - local block_cols="$3" - local block_rows="$4" - local blocks_per_line="$5" - local block_length=$((block_cols * block_rows)) - - # Print sets of blocks - for (( i = start; i <= end; i += (blocks_per_line-1) * block_length )) do - printf "\n" # Space before each set of blocks - # For each block row - for (( row = 0; row < block_rows; row++ )) do - # Print block columns for all blocks on the line - for (( block = 0; block < blocks_per_line; block++ )) do - print_run $(( i + (block * block_length) )) "$block_cols" - done - (( i += block_cols )) # Prepare to print the next row - printf "\n" - done - done -} - -echo -echo "ANSI 4-bit colors:" -echo - -print_run 0 16 # The first 16 colours are spread over the whole spectrum - -echo -echo -echo "ANSI 8-bit colors:" - -print_blocks 16 231 6 6 3 # 6x6x6 colour cube between 16 and 231 inclusive -print_blocks 232 255 12 2 1 # Not 50, but 24 Shades of Grey diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 6fed401..0000000 --- a/flake.lock +++ /dev/null @@ -1,322 +0,0 @@ -{ - "nodes": { - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": [ - "neovim-nightly-overlay", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1743550720, - "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "c621e8422220273271f52058f618c94e405bb0f5", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_2": { - "inputs": { - "nixpkgs-lib": [ - "neovim-nightly-overlay", - "hercules-ci-effects", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1743550720, - "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "c621e8422220273271f52058f618c94e405bb0f5", - "type": "github" - }, - "original": { - "id": "flake-parts", - "type": "indirect" - } - }, - "git-hooks": { - "inputs": { - "flake-compat": "flake-compat_2", - "gitignore": "gitignore", - "nixpkgs": [ - "neovim-nightly-overlay", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1746537231, - "narHash": "sha256-Wb2xeSyOsCoTCTj7LOoD6cdKLEROyFAArnYoS+noCWo=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "fa466640195d38ec97cf0493d6d6882bc4d14969", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "neovim-nightly-overlay", - "git-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "hercules-ci-effects": { - "inputs": { - "flake-parts": "flake-parts_2", - "nixpkgs": [ - "neovim-nightly-overlay", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1744693102, - "narHash": "sha256-1Z4WPGVky4w3lrhrgs89OKsLzPdtkbi1bPLNFWsoLfY=", - "owner": "hercules-ci", - "repo": "hercules-ci-effects", - "rev": "5b6cec51c9ec095a0d3fd4c8eeb53eb5c59ae33e", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "hercules-ci-effects", - "type": "github" - } - }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1746981801, - "narHash": "sha256-+Bfr0KqZV6gZdA7e2kupeoawozaLIHLuiPtC54uxbFc=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "ff915842e4a2e63c4c8c5c08c6870b9d5b3c3ee9", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, - "neovim-nightly-overlay": { - "inputs": { - "flake-compat": "flake-compat", - "flake-parts": "flake-parts", - "git-hooks": "git-hooks", - "hercules-ci-effects": "hercules-ci-effects", - "neovim-src": "neovim-src", - "nixpkgs": "nixpkgs", - "treefmt-nix": "treefmt-nix" - }, - "locked": { - "lastModified": 1746949292, - "narHash": "sha256-w+CMyUXreTh/GgSztmmYiAF6GlaWhTs3gZTRGucLrOI=", - "owner": "nix-community", - "repo": "neovim-nightly-overlay", - "rev": "ce841a39a6bb2cc3d0f6df8934cb8f2e08de9e92", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "neovim-nightly-overlay", - "type": "github" - } - }, - "neovim-src": { - "flake": false, - "locked": { - "lastModified": 1746913368, - "narHash": "sha256-w6NOqbjPWqpLee8vOGpDb3YQrwtpf2lkPXH0JqXYgHo=", - "owner": "neovim", - "repo": "neovim", - "rev": "bee45fc0e7801396951cd156c82953cbadc256b9", - "type": "github" - }, - "original": { - "owner": "neovim", - "repo": "neovim", - "type": "github" - } - }, - "nix-index-database": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1746934494, - "narHash": "sha256-3n6i+F0sDASjkhbvgFDpPDZGp7z19IrRtjfF9TwJpCA=", - "owner": "nix-community", - "repo": "nix-index-database", - "rev": "e9b21b01e4307176b9718a29ac514838e7f6f4ff", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nix-index-database", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1746576598, - "narHash": "sha256-FshoQvr6Aor5SnORVvh/ZdJ1Sa2U4ZrIMwKBX5k2wu0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b3582c75c7f21ce0b429898980eddbbf05c68e55", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1746810718, - "narHash": "sha256-VljtYzyttmvkWUKTVJVW93qAsJsrBbgAzy7DdnJaQfI=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "0c0bf9c057382d5f6f63d54fd61f1abd5e1c2f63", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1746576598, - "narHash": "sha256-FshoQvr6Aor5SnORVvh/ZdJ1Sa2U4ZrIMwKBX5k2wu0=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "b3582c75c7f21ce0b429898980eddbbf05c68e55", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1746663147, - "narHash": "sha256-Ua0drDHawlzNqJnclTJGf87dBmaO/tn7iZ+TCkTRpRc=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "dda3dcd3fe03e991015e9a74b22d35950f264a54", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "home-manager": "home-manager", - "neovim-nightly-overlay": "neovim-nightly-overlay", - "nix-index-database": "nix-index-database", - "nixpkgs": "nixpkgs_2", - "nixpkgs-stable": "nixpkgs-stable", - "nixpkgs-unstable": "nixpkgs-unstable" - } - }, - "treefmt-nix": { - "inputs": { - "nixpkgs": [ - "neovim-nightly-overlay", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1746216483, - "narHash": "sha256-4h3s1L/kKqt3gMDcVfN8/4v2jqHrgLIe4qok4ApH5x4=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "29ec5026372e0dec56f890e50dbe4f45930320fd", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index 0918288..0000000 --- a/flake.nix +++ /dev/null @@ -1,90 +0,0 @@ -{ - description = "NixOS configuration"; - - nixConfig = { - substituters = [ - "https://cache-nixos-org.aarn.patagia.net/" - ]; - extra-substituters = [ - "https://nix-community.cachix.org" - ]; - extra-trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - ]; - }; - - inputs = { - neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; - nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11"; - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - - nix-index-database.url = "github:nix-community/nix-index-database"; - nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; - - home-manager.url = "github:nix-community/home-manager"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; - }; - - outputs = - inputs@{ - self, - nix-index-database, - nixpkgs, - nixpkgs-unstable, - home-manager, - ... - }: - let - inherit (self) outputs; - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - - mkHost = - modules: - nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs outputs; - }; - modules = [ ./common ] ++ modules; - }; - - mkHome = - modules: - home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs-unstable.legacyPackages.${system}; - extraSpecialArgs = { - inherit inputs outputs; - }; - modules = [ - ./home/common - nix-index-database.hmModules.nix-index - ] ++ modules; - }; - in - { - overlays = import ./overlays { inherit inputs outputs; }; - - devShell.${system} = pkgs.mkShell { - packages = with pkgs; [ - just - nh - nil - nixd - nixfmt-rfc-style - ]; - }; - - nixosConfigurations = { - dinky = mkHost [ ./hosts/dinky ]; - nemo = mkHost [ ./hosts/nemo ]; - pearl = mkHost [ ./hosts/pearl ]; - }; - - homeConfigurations = { - "dln@dinky" = mkHome [ ./home/dln/dinky.nix ]; - "dln@nemo" = mkHome [ ./home/dln/nemo.nix ]; - "dln@pearl" = mkHome [ ./home/dln/pearl.nix ]; - }; - }; -} diff --git a/home/common/atuin.nix b/home/common/atuin.nix deleted file mode 100644 index 991dcec..0000000 --- a/home/common/atuin.nix +++ /dev/null @@ -1,80 +0,0 @@ -{ lib, pkgs, ... }: -{ - programs.atuin = { - enable = true; - enableFishIntegration = true; - settings = { - ctrl_n_shortcuts = true; - enter_accept = true; - filter_mode_shell_up_key_binding = "session"; - history_filter = [ ]; - inline_height = 8; - prefers_reduced_motion = true; - search_mode_shell_up_key_binding = "prefix"; - show_help = false; - style = "compact"; - sync_address = "https://atuin.patagia.net"; - sync.records = true; - - daemon = { - enabled = true; - socket_path = "/run/user/1000/atuin.socket"; # FIXME: remove hard coded uid - systemd_socket = true; - }; - - stats.common_subcommands = [ - "cargo" - "git" - "go" - "jj" - "just" - "kubectl" - "nix" - "npm" - "pnpm" - "talosctl" - "task" - "yarn" - ]; - - stats.common_prefix = [ - "doas" - "sudo" - ]; - }; - }; - - systemd.user.services.atuin-daemon = { - Unit = { - Description = "atuin shell history daemon"; - Requires = [ "atuin-daemon.socket" ]; - }; - Service = { - ExecStart = "${lib.getExe pkgs.atuin} daemon"; - Environment = [ "ATUIN_LOG=info" ]; - Restart = "on-failure"; - RestartSteps = 5; - RestartMaxDelaySec = 10; - }; - Install = { - Also = [ "atuin-daemon.socket" ]; - WantedBy = [ "default.target" ]; - }; - }; - - systemd.user.sockets.atuin-daemon = { - Unit = { - Description = "Unix socket activation for atuin shell history daemon"; - }; - - Socket = { - ListenStream = "%t/atuin.socket"; - SocketMode = "0600"; - RemoveOnStop = true; - }; - - Install = { - WantedBy = [ "sockets.target" ]; - }; - }; -} diff --git a/home/common/broot.nix b/home/common/broot.nix deleted file mode 100644 index 133b3e7..0000000 --- a/home/common/broot.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - programs.broot = { - enable = true; - enableFishIntegration = true; - settings = { - content_search_max_file_size = "10MB"; - enable_kitty_keyboard = lib.mkForce true; - icon_theme = "nerdfont"; - lines_before_match_in_preview = 1; - lines_after_match_in_preview = 1; - quit_on_last_cancel = true; - show_selection_mark = true; - special_paths = { - "~/media" = { - list = "never"; - sum = "never"; - }; - "~/.config" = { - show = "always"; - }; - "trav" = { - show = "always"; - list = "always"; - sum = "never"; - }; - }; - true_colors = true; - - verbs = [ - { - invocation = "broot_home"; - key = "ctrl-7"; - external = "br $HOME"; - from_shell = true; - leave_broot = true; - } - { - invocation = "edit"; - key = "enter"; - shortcut = "e"; - external = "edit {file}"; - apply_to = "text_file"; - from_shell = true; - leave_broot = true; - } - { - invocation = "nvim"; - key = "enter"; - apply_to = "text_file"; - external = "edit {file}"; - from_shell = true; - leave_broot = true; - } - ]; - }; - }; -} diff --git a/home/common/default.nix b/home/common/default.nix deleted file mode 100644 index c5112bd..0000000 --- a/home/common/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib, ... }: -{ - imports = [ - ./atuin.nix - ./broot.nix - ./devel.nix - ./fish.nix - ./ghostty.nix - ./gnome.nix - ./k8s.nix - ./nix.nix - ./nvim - ./scripts.nix - ./ssh.nix - ./tmux.nix - ./utils.nix - ./vcs.nix - ./web.nix - ./wezterm.nix - ]; - - options.patagia.desktop.enable = lib.mkEnableOption "Desktop environment"; - options.patagia.laptop.enable = lib.mkEnableOption "Laptop"; - options.patagia.oled.enable = lib.mkEnableOption "Darker darks on oled screens"; -} diff --git a/home/common/devel.nix b/home/common/devel.nix deleted file mode 100644 index 910900e..0000000 --- a/home/common/devel.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ - age-plugin-fido2-hmac - comma - dogdns - file - just - nix-output-monitor - passage - rage - ]; - - home.sessionVariables = { - GOPROXY = "https://athena.patagia.net"; - }; -} diff --git a/home/common/fish.nix b/home/common/fish.nix deleted file mode 100644 index e5d1c45..0000000 --- a/home/common/fish.nix +++ /dev/null @@ -1,130 +0,0 @@ -{ lib, pkgs, ... }: -{ - programs.fish = { - enable = true; - - plugins = [ - { - name = "transient"; - src = pkgs.fishPlugins.transient-fish.src; - } - ]; - - functions = { - confirm = { - description = "Ask for confirmation"; - argumentNames = [ "message" ]; - body = '' - read -l -p 'printf "\\e[31;1m$message\\e[0m (y/N) "' confirm - test "$confirm" = 'y' - ''; - }; - - poweroff = { - description = "Wraps poweroff to first prompt for confirmation"; - wraps = "poweroff"; - body = ''confirm "⚠ Really poweroff $(hostname)?" && command poweroff $argv''; - }; - - reboot = { - description = "Wraps reboot to first prompt for confirmation"; - wraps = "reboot"; - body = ''confirm "⚠ Really reboot $(hostname)?" && command reboot $argv''; - }; - - shutdown = { - description = "Wraps shutdown to first prompt for confirmation"; - wraps = "shutdown"; - body = ''confirm "⚠ Really shutdown $(hostname)?" && command shutdown $argv''; - }; - - e = { - description = "Open a file in already running nvim"; - argumentNames = [ "file" ]; - body = '' - nvim-remote --remote (readlink -f "$file") - ''; - }; - - jl.body = '' - jj log --color=always --no-graph -T builtin_log_oneline -r 'all()' | fzf --ansi --reverse --wrap --preview 'jj show --tool=difftu {1}' --preview-window=down,70% --color=light - ''; - - __zoxide_zi_repaint.body = '' - __zoxide_zi - commandline -f repaint - ''; - - fish_jj_prompt.body = '' - if not command -sq jj || not jj root --quiet &>/dev/null - return 1 - end - - jj log --ignore-working-copy --no-graph --color never -r @ -T ' - surround( - " \e[2;3m", - "\e[0m", - separate( - " ", - surround( - "\e[0;2;3m", - "\e[0m", - coalesce( - surround( - "\e[1;2;3m❝", - "❞\e[0m", - if( - description.first_line().substr(0, 80).starts_with(description.first_line()), - description.first_line().substr(0, 80), - description.first_line().substr(0, 79) ++ "…" - ) - ), - "…" - ), - ), - surround("\e[0;1;95m ", "\e[0;2;3m", change_id.shortest()), - surround("\e[0;35m ", "\e[0m", bookmarks.join("╱")), - surround("\e[0;34m ", "\e[0;2;3m", commit_id.shortest()), - if(conflict, ""), - if(empty, ""), - if(divergent, ""), - if(hidden, ""), - ) - ) - ' - ''; - - fish_prompt.body = '' - echo -e "\033[s\033[$LINES;1H\033[1;2;38;5;238m$(string pad -c '┄' -w $COLUMNS (fish_jj_prompt || fish_vcs_prompt))\033[0m\033[u" - string join "" -- (set_color --dim) (prompt_hostname) ':' (prompt_pwd --full-length-dirs=4) (set_color --bold normal) ' ❯ ' (set_color normal) - ''; - - transient_prompt_func.body = '' - echo - string join "" -- (set_color --bold) '❯ ' (set_color normal) - ''; - - rg.body = '' - if status is-interactive - command rg -p $argv --json | delta - else - command rg $argv - end - ''; - }; - - interactiveShellInit = lib.concatStringsSep "\n" [ - (builtins.readFile ../../files/config/fish/config.fish) - (builtins.readFile ../../files/config/fish/semantic-prompt.fish) - (builtins.readFile ../../files/config/fish/vcs.fish) - ]; - - shellAbbrs = { - l = "bat"; - top = "btm --basic --enable_cache_memory --battery"; - ts = "TZ=Z date '+%Y%m%dT%H%M%SZ'"; - w = "viddy $history[1]"; - xc = "fish_clipboard_copy"; - }; - }; -} diff --git a/home/common/ghostty.nix b/home/common/ghostty.nix deleted file mode 100644 index fea939a..0000000 --- a/home/common/ghostty.nix +++ /dev/null @@ -1,93 +0,0 @@ -{ - config, - lib, - ... -}: -{ - config = lib.mkIf config.patagia.desktop.enable { - programs.ghostty = { - enable = true; - enableFishIntegration = true; - settings = { - font-size = 11; - font-family = "Berkeley Mono"; - font-family-italic = "Monaspace Radon Var"; - font-family-bold-italic = "Monaspace Krypton Var"; - font-style = "Regular"; - font-style-bold = "Bold"; - font-style-italic = "Italic"; - font-style-bold-italic = "ExtraLight"; - font-synthetic-style = false; - - adjust-cursor-thickness = 4; - adjust-underline-position = 3; - adjust-underline-thickness = -1; - - mouse-hide-while-typing = true; - unfocused-split-opacity = 0.8; - unfocused-split-fill = "#056157"; - - shell-integration = "fish"; - - gtk-tabs-location = "hidden"; - gtk-titlebar = false; - gtk-titlebar-hide-when-maximized = true; - window-height = 60; - window-width = 160; - window-padding-balance = true; - window-padding-color = "extend"; - window-theme = "system"; - theme = "light:PatagiaLight,dark:PatagiaDark"; - - keybind = [ - "alt+shift+c=copy_to_clipboard" - "alt+shift+v=paste_from_clipboard" - "ctrl+i=text:\\x09" - "ctrl+m=text:\\x0D" - "ctrl+tab=goto_split:previous" - "alt+`=goto_split:previous" - "ctrl+[=text:\\x1B" - "super+enter=toggle_fullscreen" - ]; - }; - themes = { - PatagiaDark = { - background = "#14151a"; - foreground = "#b7bec7"; - cursor-color = "#e7e7b7"; - selection-background = "#84979f"; - selection-foreground = "#000000"; - }; - PatagiaLight = { - background = "#fefeff"; - foreground = "#222222"; - cursor-color = "#aa0000"; - selection-background = "#ffe6a4"; - selection-foreground = "#483600"; - }; - }; - }; - - xdg.desktopEntries = { - ghostty-secondary = { - categories = [ - "System" - "TerminalEmulator" - ]; - exec = '' - ghostty --class=com.mitchellh.ghostty-secondary --background-opacity=0.8 --font-style="UltraCondensed" --font-style-bold="Bold UltraCondensed" --font-style-italic="UltraCondensed Oblique" -e bash - ''; - genericName = "Secondary Ghostty"; - icon = "com.mitchellh.ghostty"; - name = "Secondary Ghostty"; - settings = { - StartupWMClass = "com.mitchellh.ghostty-secondary"; - TryExec = "ghostty"; - }; - terminal = false; - type = "Application"; - }; - }; - - }; -} diff --git a/home/common/gnome.nix b/home/common/gnome.nix deleted file mode 100644 index c2e64a7..0000000 --- a/home/common/gnome.nix +++ /dev/null @@ -1,179 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib.hm.gvariant; -{ - config = lib.mkIf config.patagia.desktop.enable { - home.packages = with pkgs; [ - gnome-contacts - gnome-shell-extensions - gnome-tweaks - gnome-pomodoro - gnomeExtensions.desktop-clock - gnomeExtensions.emoji-copy - gnomeExtensions.just-perfection - gnomeExtensions.night-light-slider - ]; - - dconf.settings = { - "org/gnome/desktop/wm/keybindings" = { - close = [ "<Super>q" ]; - toggle-on-all-workspaces = [ "<Super>s" ]; - toggle-maximized = [ "<Super>m" ]; - maximize-vertically = [ "<Super>Up" ]; - minimize = [ "<Super>comma" ]; - move-to-center = [ "<Super>c" ]; - switch-applications = [ "<Super>Tab" ]; - switch-group = [ "<Super>Above_Tab" ]; - switch-windows = [ "<Alt>Tab" ]; - move-to-workspace-1 = [ "<Shift>F1" ]; - move-to-workspace-2 = [ "<Shift>F2" ]; - move-to-workspace-3 = [ "<Shift>F3" ]; - move-to-workspace-4 = [ "<Shift>F4" ]; - move-to-workspace-5 = [ "<Shift>F5" ]; - move-to-workspace-6 = [ "<Shift>F6" ]; - move-to-workspace-7 = [ "<Shift>F7" ]; - move-to-workspace-8 = [ "<Shift>F8" ]; - move-to-workspace-9 = [ "<Shift>F9" ]; - switch-to-workspace-1 = [ "F1" ]; - switch-to-workspace-2 = [ "F2" ]; - switch-to-workspace-3 = [ "F3" ]; - switch-to-workspace-4 = [ "F4" ]; - switch-to-workspace-5 = [ "F5" ]; - switch-to-workspace-6 = [ "F6" ]; - switch-to-workspace-7 = [ "F7" ]; - switch-to-workspace-8 = [ "F8" ]; - switch-to-workspace-9 = [ "F9" ]; - }; - - "org/gnome/desktop/input-sources" = { - mru-sources = [ - (mkTuple [ - "xkb" - "us" - ]) - ]; - sources = [ - (mkTuple [ - "xkb" - "se+us" - ]) - ]; - xkb-options = [ "caps:ctrl_modifier" ]; - }; - - "org/gnome/desktop/interface" = { - enable-animations = false; - enable-hot-corners = false; - show-battery-percentage = true; - font-name = "Inter Variable 11"; - document-font-name = "Inter Variable 11"; - monospace-font-name = "Berkeley Mono 11"; - toolkit-accessibility = false; - }; - - "org/gnome/desktop/search-providers" = { - disabled = [ - "org.gnome.Contacts.desktop" - "org.gnome.Nautilus.desktop" - "org.gnome.Calendar.desktop" - "org.gnome.clocks.desktop" - "org.gnome.Epiphany.desktop" - ]; - sort-order = [ - "org.gnome.Contacts.desktop" - "org.gnome.Documents.desktop" - "org.gnome.Nautilus.desktop" - "org.gnome.Settings.desktop" - "org.gnome.Calculator.desktop" - "org.gnome.Calendar.desktop" - "org.gnome.clocks.desktop" - "org.gnome.seahorse.Application.desktop" - "org.gnome.Weather.desktop" - "org.gnome.Characters.desktop" - ]; - }; - - "org/gnome/desktop/wm/preferences" = { - focus-mode = "sloppy"; - num-workspaces = 10; - resize-with-right-button = true; - }; - - "org/gnome/GWeather4" = { - temperature-unit = "centigrade"; - }; - - "org/gnome/Weather" = { - locations = [ - (mkVariant (mkTuple [ - (mkUint32 2) - (mkVariant (mkTuple [ - "Stockholm-Arlanda Airport" - "ESSA" - false - [ - (mkTuple [ - 1.0410888988146176 - 0.31328660073298215 - ]) - ] - [ - (mkTuple [ - 1.0410888988146176 - 0.31328660073298215 - ]) - ] - ])) - ])) - ]; - }; - - "org/gnome/desktop/calendar" = { - show-weekdate = true; - }; - - "org/gnome/mutter" = { - center-new-windows = false; - edge-tiling = true; - }; - - "org/gnome/settings-daemon/plugins/color" = { - night-light-schedule-automatic = false; - night-light-schedule-from = 0.0; - night-light-schedule-to = 0.0; - night-light-temperature = mkUint32 3575; - }; - - "org/gnome/shell" = { - enabled-extensions = [ - "emoji-copy@felipeftn" - "just-perfection-desktop@just-perfection" - ]; - }; - - "org/gnome/shell/extensions/emoji-copy" = { - emoji-keybind = [ "<Super>e" ]; - }; - - "org/gnome/shell/extensions/just-perfection" = { - animation = 0; - notification-banner-position = 2; - osd-position = 6; - panel = false; - panel-in-overview = true; - startup-status = 0; - switcher-popup-delay = false; - top-panel-position = 0; - }; - - "org/gnome/tweaks" = { - show-extensions-notice = false; - }; - - }; - }; -} diff --git a/home/common/k8s.nix b/home/common/k8s.nix deleted file mode 100644 index 53820e9..0000000 --- a/home/common/k8s.nix +++ /dev/null @@ -1,176 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ - kail - kapp - krew - kubectl - kubectl-cnpg - kubectl-neat - kubectl-view-secret - kubectx - kubelogin-oidc - kubernetes-helm - kustomize - ]; - - programs.k9s = { - enable = true; - settings.k9s = { - liveViewAutoRefresh = false; - refreshRate = 2; - maxConnRetry = 5; - readOnly = false; - noExitOnCtrlC = false; - skipLatestRevCheck = false; - disablePodCounting = false; - imageScans.enable = false; - logger = { - tail = 100; - buffer = 5000; - sinceSeconds = -1; - textWrap = false; - showTime = false; - }; - shellPod.image = "alpine:3"; - thresholds = { - cpu = { - critical = 90; - warn = 70; - }; - memory = { - critical = 90; - warn = 70; - }; - }; - ui = { - crumbsless = true; - defaultsToFullScreen = true; - enableMouse = false; - headless = true; - logoless = true; - noIcons = false; - reactive = false; - skin = "dieter"; - }; - }; - - views = { - views = { - "v1/pods" = { - columns = [ - "NAME" - "PF" - "READY" - "STATUS" - "NODE" - "AGE" - "RESTARTS" - "IP" - "CPU" - "MEM" - "CPU/R:L" - "MEM/R:L" - "%CPU/R" - "%CPU/L" - "%MEM/R" - "%MEM/L" - ]; - }; - }; - }; - - skins.dieter.k9s = { - body = { - fgColor = "default"; - bgColor = "default"; - logoColor = "default"; - }; - prompt = { - fgColor = "default"; - bgColor = "default"; - suggestColor = "default"; - }; - info = { - fgColor = "default"; - sectionColor = "default"; - }; - dialog = { - fgColor = "default"; - bgColor = "default"; - buttonFgColor = "default"; - buttonBgColor = "default"; - buttonFocusFgColor = "white"; - buttonFocusBgColor = "darkblue"; - labelFgColor = "default"; - fieldFgColor = "default"; - }; - frame = { - border = { - fgColor = "default"; - focusColor = "default"; - }; - menu = { - fgColor = "default"; - keyColor = "default"; - numKeyColor = "default"; - }; - crumbs = { - fgColor = "default"; - bgColor = "default"; - activeColor = "default"; - }; - status = { - newColor = "default"; - modifyColor = "default"; - addColor = "default"; - errorColor = "red"; - highlightColor = "default"; - killColor = "default"; - completedColor = "default"; - }; - title = { - fgColor = "default"; - bgColor = "default"; - highlightColor = "default"; - counterColor = "default"; - filterColor = "default"; - }; - }; - views = { - table = { - fgColor = "default"; - bgColor = "default"; - cursorFgColor = "teal"; - cursorBgColor = "darkblue"; - header = { - fgColor = "default"; - bgColor = "default"; - sorterColor = "blue"; - }; - }; - xray = { - fgColor = "default"; - bgColor = "default"; - cursorColor = "blue"; - graphicColor = "blue"; - }; - yaml = { - keyColor = "default"; - colonColor = "default"; - valueColor = "default"; - }; - logs = { - fgColor = "default"; - bgColor = "default"; - indicator = { - fgColor = "default"; - bgColor = "default"; - toggleOnColor = "default"; - toggleOffColor = "default"; - }; - }; - }; - }; - }; -} diff --git a/home/common/nix.nix b/home/common/nix.nix deleted file mode 100644 index b1976e0..0000000 --- a/home/common/nix.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - pkgs, - outputs, - ... -}: -{ - nixpkgs = { - config.allowUnfree = true; - overlays = [ - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - ]; - }; - - programs.home-manager.enable = true; - - systemd.user.startServices = "sd-switch"; -} diff --git a/home/common/nvim/blink-cmp.lua b/home/common/nvim/blink-cmp.lua deleted file mode 100644 index ea0124d..0000000 --- a/home/common/nvim/blink-cmp.lua +++ /dev/null @@ -1,81 +0,0 @@ -require 'blink-cmp'.setup({ - keymap = { - preset = 'enter', - ['<Tab>'] = { 'select_next', 'fallback' }, - ['<S-Tab>'] = { 'select_prev', 'fallback' }, - ['<PageDown>'] = { 'scroll_documentation_down', 'fallback' }, - ['<PageUp>'] = { 'scroll_documentation_up', 'fallback' }, - }, - completion = { - accept = { - auto_brackets = { enabled = true, }, - }, - - documentation = { - auto_show = true, - auto_show_delay_ms = 800, - window = { border = 'rounded', }, - }, - - ghost_text = { enabled = false }, - - list = { - selection = { - preselect = false, - auto_insert = false - }, - }, - - menu = { - auto_show = true, - border = 'rounded', - direction_priority = { 'n', 's' }, - draw = { - components = { - kind_icon = { - ellipsis = false, - text = function(ctx) - local kind_icon, _, _ = require('mini.icons').get('lsp', ctx.kind) - return kind_icon - end, - -- Optionally, you may also use the highlights from mini.icons - highlight = function(ctx) - local _, hl, _ = require('mini.icons').get('lsp', ctx.kind) - return hl - end, - } - } - } - } - }, - - fuzzy = { - prebuilt_binaries = { - download = false - }, - }, - - signature = { - enabled = true, - window = { border = 'rounded', }, - }, - - cmdline = { - sources = {}, - }, - - sources = { - default = { - 'lsp', - 'emoji', - }, - providers = { - emoji = { - module = "blink-emoji", - name = "Emoji", - score_offset = 1, - opts = { insert = true }, - } - }, - }, -}) diff --git a/home/common/nvim/default.nix b/home/common/nvim/default.nix deleted file mode 100644 index b6091c0..0000000 --- a/home/common/nvim/default.nix +++ /dev/null @@ -1,152 +0,0 @@ -{ - inputs, - lib, - pkgs, - ... -}: -let - nvim-remote = pkgs.writeShellApplication { - name = "nvim-remote"; - text = '' - _sess=$(echo -n "$USER@''${SSH_CONNECTION:-$HOSTNAME}" | tr -c '[:alnum:]@.' '_') - _nvim_sock="''${XDG_RUNTIME_DIR:-/tmp}/nvim.$_sess.sock" - exec nvim --listen "$_nvim_sock" --server "$_nvim_sock" "$@" - ''; - }; -in -{ - imports = [ - ./treesitter.nix - ]; - - home.packages = [ nvim-remote ]; - - programs.man.generateCaches = false; - - programs.neovim = { - enable = true; - package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default; - defaultEditor = true; - viAlias = true; - vimAlias = true; - withNodeJs = false; - withPython3 = false; - withRuby = false; - - extraLuaConfig = lib.fileContents ./init.lua; - - extraPackages = with pkgs; [ - codeium - lua-language-server - nixd - shellcheck - shfmt - stylua - ]; - - plugins = with pkgs.vimPlugins; [ - blink-compat - blink-emoji-nvim - friendly-snippets - go-nvim - targets-vim - ts-comments-nvim - - { - plugin = pkgs.vimUtils.buildVimPlugin { - name = "direnv-nvim"; - src = pkgs.fetchFromGitHub { - owner = "actionshrimp"; - repo = "direnv.nvim"; - rev = "main"; - hash = "sha256-7NcVskgAurbIuEVIXxHvXZfYQBOEXLURGzllfVEQKNE="; - }; - }; - type = "lua"; - config = '' - require('direnv-nvim').setup { - type = "dir" - } - ''; - } - { - plugin = nvim-lspconfig; - type = "lua"; - config = lib.fileContents ./lsp.lua; - } - - { - plugin = blink-cmp; - type = "lua"; - config = lib.fileContents ./blink-cmp.lua; - } - - { - plugin = pkgs.vimUtils.buildVimPlugin { - name = "inlay-hints"; - src = pkgs.fetchFromGitHub { - owner = "MysticalDevil"; - repo = "inlay-hints.nvim"; - rev = "3259b54f3b954b4d8260f3ee49ceabe978ea5636"; - hash = "sha256-99KCGoPowa4PA1jkCm4ZbbgrFl84NWnKQMgkfy8KS5E="; - }; - }; - type = "lua"; - config = '' - require('inlay-hints').setup { - autocmd = { enable = false }, - } - ''; - } - - { - plugin = pkgs.vimUtils.buildVimPlugin { - name = "neocodeium"; - src = pkgs.fetchFromGitHub { - owner = "monkoose"; - repo = "neocodeium"; - rev = "511ae8a76561a6352f845169bcb6c906fd1892bb"; # 2025-04-19 - hash = "sha256-7y4iCfCP1Ht9+Q4b11+PTRsjNaJEIGaeBzJnzYwFIqw="; - }; - doCheck = false; - }; - type = "lua"; - config = '' - local neocodeium =require('neocodeium') - neocodeium.setup({ - show_label = false, - debounce = true, - silent = false, - }) - vim.keymap.set("i", "<C-j>", neocodeium.accept, { remap = true }) - vim.keymap.set("i", "<A-f>", neocodeium.accept, { remap = true }) - vim.keymap.set("i", "<C-h>", neocodeium.cycle_or_complete, { remap = true }) - ''; - } - - { - plugin = pkgs.vimUtils.buildVimPlugin { - name = "dieter-nvim"; - src = ./dieter; - }; - type = "lua"; - config = '' - vim.cmd.colorscheme "dieter-nocolor" - ''; - } - - { - plugin = mini-nvim; - type = "lua"; - config = lib.fileContents ./mini.lua; - } - - { - plugin = rustaceanvim; - type = "lua"; - config = lib.fileContents ./rust.lua; - } - - ]; - }; -} diff --git a/home/common/nvim/dieter/colors/dieter-nocolor.lua b/home/common/nvim/dieter/colors/dieter-nocolor.lua deleted file mode 100644 index 6f016e4..0000000 --- a/home/common/nvim/dieter/colors/dieter-nocolor.lua +++ /dev/null @@ -1,2 +0,0 @@ -package.loaded["dieter"] = nil -require("dieter").setup_nocolor() diff --git a/home/common/nvim/dieter/colors/dieter.lua b/home/common/nvim/dieter/colors/dieter.lua deleted file mode 100644 index 5dd7a50..0000000 --- a/home/common/nvim/dieter/colors/dieter.lua +++ /dev/null @@ -1,2 +0,0 @@ -package.loaded["dieter"] = nil -require("dieter").setup() diff --git a/home/common/nvim/dieter/lua/dieter/hsl.lua b/home/common/nvim/dieter/lua/dieter/hsl.lua deleted file mode 100644 index 1d1b287..0000000 --- a/home/common/nvim/dieter/lua/dieter/hsl.lua +++ /dev/null @@ -1,71 +0,0 @@ --- https://github.com/EmmanuelOga/columns/blob/master/utils/color.lua - -local M = {} - ---- Converts an HSL color value to RGB. Conversion formula ---- adapted from http://en.wikipedia.org/wiki/HSL_color_space. ---- Assumes h, s, and l are contained in the set [0, 1] and ---- returns r, g, and b in the set [0, 255]. ---- ---- @param h number The hue ---- @param s number The saturation ---- @param l number The lightness ---- @return number, number, number # The RGB representation -function M.hslToRgb(h, s, l) - --- @type number, number, number - local r, g, b - - if s == 0 then - r, g, b = l, l, l -- achromatic - else - --- @param p number - --- @param q number - --- @param t number - local function hue2rgb(p, q, t) - if t < 0 then - t = t + 1 - end - if t > 1 then - t = t - 1 - end - if t < 1 / 6 then - return p + (q - p) * 6 * t - end - if t < 1 / 2 then - return q - end - if t < 2 / 3 then - return p + (q - p) * (2 / 3 - t) * 6 - end - return p - end - - --- @type number - local q - if l < 0.5 then - q = l * (1 + s) - else - q = l + s - l * s - end - local p = 2 * l - q - - r = hue2rgb(p, q, h + 1 / 3) - g = hue2rgb(p, q, h) - b = hue2rgb(p, q, h - 1 / 3) - end - - return r * 255, g * 255, b * 255 -end - ---- Converts an HSL color value to RGB in Hex representation. ---- @param h number The hue ---- @param s number The saturation ---- @param l number The lightness ---- @return string # The hex representation -function M.hslToHex(h, s, l) - local r, g, b = M.hslToRgb(h / 360, s / 100, l / 100) - - return string.format("#%02x%02x%02x", r, g, b) -end - -return M diff --git a/home/common/nvim/dieter/lua/dieter/init.lua b/home/common/nvim/dieter/lua/dieter/init.lua deleted file mode 100644 index 6c5eebb..0000000 --- a/home/common/nvim/dieter/lua/dieter/init.lua +++ /dev/null @@ -1,293 +0,0 @@ -local hsl = require("dieter.hsl").hslToHex - -local colors = { - light = { - background = "NONE", - foreground = "NONE", - - accent1 = hsl(12, 100, 50), - - dimmed = hsl(0, 0, 80), - dimmed_subtle = hsl(0, 0, 20), - - highlight_subtle = hsl(0, 0, 94), - highlight = hsl(0, 0, 90), - highlight_intense = hsl(42, 100, 30), - - dialog_fg = hsl(230, 13, 10), - dialog_bg = hsl(50, 15, 95), - dialog_border = hsl(50, 25, 75), - - string = hsl(96, 50, 33), - comment = hsl(360, 66, 40), - comment_error = hsl(2, 85, 40), - - suggestion = hsl(220, 95, 55), - - diagnostic_error = hsl(347, 80, 45), - diagnostic_warning = hsl(30, 100, 50), - diagnostic_info = hsl(145, 80, 30), - diagnostic_hint = hsl(145, 80, 30), - - popup_error_bg = hsl(0, 90, 99), - popup_warning_bg = hsl(27, 90, 99), - popup_info_bg = hsl(112, 90, 99), - popup_hint_bg = hsl(112, 90, 99), - - add = hsl(84, 50, 80), - add_quarter = hsl(84, 80, 95), - change = hsl(41, 80, 80), - change_quarter = hsl(224, 100, 85), - delete = hsl(350, 100, 40), - - selection = hsl(270, 45, 92), - - search_bg = hsl(43, 100, 8), - search_fg = hsl(43, 100, 85), - - cmp_bg = hsl(218, 30, 97), - cmp_fg = hsl(218, 30, 13), - cmp_selected_fg = hsl(218, 50, 8), - cmp_selected_bg = hsl(218, 30, 85), - - doc_bg = hsl(200, 30, 90), - doc_fg = hsl(220, 80, 10), - }, - - dark = { - background = "NONE", - foreground = "NONE", - - accent1 = hsl(202, 57, 57), -- Blue - accent2 = hsl(40, 57, 57), -- Yellow - - dimmed = hsl(212, 19, 25), - dimmed_subtle = hsl(212, 19, 50), - - highlight_subtle = hsl(212, 27, 11), - highlight = hsl(212, 27, 18), - highlight_intense = hsl(58, 100, 60), - - dialog_fg = hsl(191, 15, 75), - dialog_bg = "NONE", - - string = hsl(90, 30, 60), - comment = hsl(216, 30, 55), - comment_error = hsl(2, 85, 50), - func = hsl(40, 57, 87), - member = hsl(213, 45, 75), - punc = hsl(213, 45, 50), - - suggestion = hsl(158, 66, 40), - - diagnostic_error = hsl(353, 100, 45), - diagnostic_warning = hsl(30, 100, 50), - diagnostic_info = hsl(176, 80, 60), - diagnostic_hint = hsl(210, 74, 60), - - popup_error_bg = hsl(0, 95, 7), - popup_warning_bg = hsl(27, 95, 7), - popup_info_bg = hsl(112, 95, 7), - popup_hint_bg = hsl(112, 95, 7), - - add = hsl(100, 100, 12), - add_quarter = hsl(84, 80, 15), - change = hsl(41, 100, 15), - change_quarter = hsl(224, 100, 15), - delete = hsl(350, 100, 40), - delete_quarter = hsl(350, 100, 15), - - selection = hsl(218, 90, 20), - - search_bg = hsl(43, 100, 8), - search_fg = hsl(43, 100, 85), - - cmp_bg = hsl(218, 30, 13), - cmp_fg = hsl(218, 30, 80), - cmp_selected_bg = hsl(218, 30, 25), - cmp_selected_fg = hsl(218, 50, 80), - - doc_bg = hsl(220, 80, 10), - doc_fg = hsl(200, 30, 60), - }, - -} - -local setupGroups = function(c) - - return { - Normal = { fg = c.foreground, bg = c.background }, - - Constant = { link = "NormalNC" }, - Delimiter = { link = "NormalNC" }, - Function = { fg = c.func }, - Identifier = { link = "NormalNC" }, - Keyword = { fg = c.foreground, bold = true }, - Operator = { link = "NormalNC" }, - Special = { link = "NormalNC" }, - Type = { link = "NormalNC" }, - - MsgArea = { fg = c.dimmed_subtle }, - StatusLine = { fg = c.dimmed, bg = c.dimmed_subtle }, - - String = { fg = c.string }, - - Visual = { bg = c.selection }, - - Search = { bg = c.search_bg, fg = c.search_fg }, - CurSearch = { link = "Search" }, - - Comment = { fg = c.comment, italic = true }, - CommentError = { fg = c.comment_error, italic = true }, - ["@comment.note"] = { link = "Comment" }, - ["@comment.todo"] = { link = "CommentError" }, - ["@comment.error"] = { link = "CommentError" }, - ["@comment.warning"] = { link = "CommentError" }, - - DiffAdd = { fg = c.add, bg = c.add_quarter }, - GitSignsAdd = { fg = c.add, bg = c.background }, - GitSignsAddNr = { link = "DiffAdd" }, - DiffChange = { fg = c.change, bg = c.change_quarter }, - GitSignsChange = { fg = c.change, bg = c.background }, - GitSignsChangeNr = { link = "DiffChange" }, - DiffDelete = { fg = c.delete, bg = c.delete_quarter }, - GitSignsDelete = { fg = c.delete, bg = c.background }, - GitSignsDeleteNr = { link = "DiffDelete" }, - - -- Treesitter - ["@punctuation.special"] = { fg = c.punc }, - ["@special"] = { link = "NormalNC" }, - ["@variable"] = { link = "NormalNC" }, - ["@variable.member"] = { fg = c.member }, - ["@variable.parameter"] = { fg = c.accent2 }, - - -- UI Elements - CursorLine = { bg = c.highlight_subtle }, - - DiagnosticError = { fg = c.diagnostic_error, italic = true }, - DiagnosticHint = { fg = c.diagnostic_hint, italic = true }, - DiagnosticInfo = { fg = c.diagnostic_info, italic = true }, - DiagnosticWarn = { fg = c.diagnostic_warn, italic = true }, - DiagnosticFloatingError = { fg = c.diagnostic_error, bg = c.dialog_bg }, - DiagnosticFloatingHint = { fg = c.diagnostic_hint, bg = c.dialog_bg }, - DiagnosticFloatingInfo = { fg = c.diagnostic_info, bg = c.dialog_bg }, - DiagnosticFloatingWarn = { fg = c.diagnostic_warning, bg = c.dialog_bg }, - DiagnosticUnderlineError = { fg = c.foreground, undercurl = true, sp = c.diagnostic_error }, - DiagnosticUnderlineHint = { fg = c.foreground, undercurl = true, sp = c.diagnostic_hint }, - DiagnosticUnderlineInfo = { fg = c.foreground, undercurl = true, sp = c.diagnostic_info }, - DiagnosticUnderlineWarn = { fg = c.foreground, undercurl = true, sp = c.diagnostic_warn }, - - DiagnosticSignError = { fg = c.diagnostic_error }, - DiagnosticSignHint = { fg = c.diagnostic_hint }, - DiagnosticSignInfo = { fg = c.diagnostic_info }, - DiagnosticSignWarn = { fg = c.diagnostic_warning }, - LineNr = { fg = c.dimmed }, - CursorLineNr = { fg = c.dimmed_subtle, bg = c.highlight_subtle }, - - IndentLine = { fg = c.highlight }, - IndentLineCurrent = { fg = c.highlight }, - MiniIndentscopeSymbol = { link = "IndentLine" }, - MiniIndentscopeSymbolOff = { link = "IndentLine" }, - - TreesitterContext = { reverse = true }, - TreesitterContextLineNumber = { bg = c.dimmed, reverse = true, italic = true }, - InclineNormal = { bg = c.background }, - InclineNormalNC = { bg = c.background }, - - EndOfBuffer = { fg = c.dimmed }, - WinSeparator = { bg = c.dialog_bg, fg = c.dialog_fg }, - NormalFloat = { bg = c.dialog_bg, fg = c.foreground }, - FloatBorder = { bg = c.dialog_bg, fg = c.dialog_border }, - FloatTitle = { bg = c.dialog_bg, fg = c.dialog_border, bold = true }, - - Title = { fg = c.foreground, bold = true }, - - MiniPickNormal = { bg = c.dialog_bg, fg = c.dialog_fg }, - MiniPickBorder = { bg = c.dialog_bg, fg = c.dialog_border }, - MiniPickBorderText = { link = "MiniPickBorder" }, - MiniPickMatchCurrent = { bg = c.dialog_bg, fg = c.dialog_fg, reverse = true }, - - MiniClueBorder = { link = "MiniPickBorder" }, - MiniClueTitle = { bg = c.dialog_bg, fg = c.dialog_border, bold = true }, - MiniClueNextKey = { link = "MiniClueTitle" }, - MiniClueDescGroup = { bg = c.dialog_bg, fg = c.foreground, italic = true }, - MiniClueDescSingle = { bg = c.dialog_bg, fg = c.foreground }, - MiniClueSeparator = { link = "MiniClueBorder" }, - - MiniCursorWord = { underdotted = true, bold = true, sp = c.diagnostic_hint }, - - MiniStarterCurrent = { link = "MiniPickMatchCurrent" }, - - BlinkCmpMenu = { bg = c.cmp_bg, fg = c.cmp_fg }, - BlinkCmpMenuSelection = { bg = c.cmp_selected_bg, fg = c.cmp_selected_fg, reverse = false }, - BlinkCmpMenuBorder = { bg = c.cmp_bg, fg = c.cmp_fg }, - BlinkCmpLabel = { link = 'BlinkCmpMenu' }, - BlinkCmpLabelMatch = { link = 'BlinkCmpMenu', underline = true }, - - BlinkCmpDoc = { bg = c.doc_bg, fg = c.foreground }, - BlinkCmpDocBorder = { bg = c.doc_bg, fg = c.doc_fg }, - BlinkCmpDocDetail = { link = 'BlinkCmpDoc' }, - BlinkCmpSignatureHelp = { link = 'BlinkCmpDoc' }, - BlinkCmpSignatureHelpBorder = { link = 'BlinkCmpDocBorder' }, - - BlinkCmpGhostText = { fg = c.suggestion, italic = true, bold = true }, - NeoCodeiumSuggestion = { link = 'BlinkCmpGhostText' }, - - LspReferenceText = { fg = c.highlight_intense, undercurl = true }, - LspInlayHint = { fg = c.accent1, italic = true, bold = true }, - } -end - - -local setupGroupsNoColor = function(c) - local g = setupGroups(c) - local cl = { link = "NormalNC" } - g.Constant = cl - g.Delimiter = cl - g.Function = cl - g.Identifier = cl - g.Keyword = cl - g.Operator = cl - g["@punctuation.special"] = cl - g["@special"] = cl - g["@string"] = cl - g["@lsp.type.string"] = cl - g.Special = cl - g.String = cl - g.Type = cl - g.Variable = cl - g["@variable"] = cl - g["@variable.member"] = cl - g["@variable.parameter"] = cl - -- g.Comment = { fg = c.dimmed_subtle, italic = true, bold = true } - g.CommentError = { link = "Comment" } - return g -end - -local setup_common = function(groups) - vim.cmd("hi clear") - if vim.fn.exists("syntax_on") == 1 then - vim.cmd("syntax reset") - end - for group, hl in pairs(groups) do - vim.api.nvim_set_hl(0, group, hl) - end -end - -local T = {} - -T.setup = function() - local c = colors[vim.o.background] - local groups = setupGroups(c) - setup_common(groups) - vim.g.colors_name = "dieter" -end - -T.setup_nocolor = function() - local c = colors[vim.o.background] - local groups = setupGroupsNoColor(c) - setup_common(groups) - vim.g.colors_name = "dieter-nocolor" -end - -return T diff --git a/home/common/nvim/init.lua b/home/common/nvim/init.lua deleted file mode 100644 index cd34947..0000000 --- a/home/common/nvim/init.lua +++ /dev/null @@ -1,241 +0,0 @@ -vim.env.RIPGREP_CONFIG_PATH = vim.env.HOME .. "/.config/ripgrep/ripgreprc" - -vim.g.mapleader = ' ' -vim.g.maplocalleader = "," - --- UI - -vim.opt.cursorline = false -vim.opt.guicursor = -"n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175" -vim.opt.number = false -vim.opt.relativenumber = false -vim.opt.ruler = true -vim.opt.syntax = "on" -vim.opt.termguicolors = true - --- Ruler -function GetIndicators() - local bufnr = vim.api.nvim_get_current_buf() - local counts = vim.diagnostic.count(bufnr) - local errors = counts[vim.diagnostic.severity.ERROR] or 0 - local warnings = counts[vim.diagnostic.severity.WARN] or 0 - local warn_string = warnings > 0 and "%#DiagnosticWarn# " .. warnings .. " " or "" - local error_string = errors > 0 and "%#DiagnosticError# " .. errors .. " " or "" - return warn_string .. error_string -end - -function CondensedPath() - local path = vim.fn.expand("%:p") - local home = os.getenv("HOME") - if home then - path = vim.fn.substitute(path, '^' .. home, '~', '') - end - - local segments = vim.fn.split(path, '/') - if #segments <= 3 then - return path - end - - local early_path = table.concat(vim.list_slice(segments, 1, #segments - 2), '/') - local late_path = table.concat(vim.list_slice(segments, #segments - 1), '/') - - return vim.fn.pathshorten(early_path) .. '/' .. late_path -end - -vim.opt.statusline = "%{%v:lua.CondensedPath()%}%=%{%v:lua.GetIndicators()%}%7(%l:%c%)" - --- Search -vim.opt.ignorecase = true -vim.opt.smartcase = true - --- Tab completion --- vim.opt.wildmode="list:longest,full" -vim.opt.wildignore = '*.swp,*.o,*.so,*.exe,*.dll' - --- Whitespaces -vim.opt.breakindent = true -vim.opt.copyindent = true -vim.opt.expandtab = true -vim.opt.softtabstop = 2 -vim.opt.shiftround = true -vim.opt.shiftwidth = 2 -vim.opt.smartindent = true -vim.opt.tabstop = 2 -vim.opt.wrap = false -vim.opt.list = true -vim.opt.listchars = "tab:»·,trail:·" - --- Folds -vim.opt.foldenable = false -vim.opt.foldtext = "v:lua.vim.treesitter.foldtext()" -vim.opt.foldmethod = "expr" -vim.opt.foldexpr = "nvim_treesitter#foldexpr()" --- - -vim.o.autochdir = true -vim.o.cia = 'kind,abbr,menu' -vim.o.fillchars = "stl: ,stlnc: ,eob:🮘,vert:│" -vim.o.icm = "split" -vim.o.list = false -vim.o.scrolloff = 7 -vim.o.shada = vim.o.shada .. ',r~/.cargo/,r~/go/,r/nix/store/,r/run/,r/tmp/,rhealth:,rterm:' -vim.o.showcmd = false -vim.o.showmode = false -vim.o.smoothscroll = true -vim.o.splitkeep = "screen" -vim.o.timeout = false -vim.o.updatetime = 250 - --- Use rg -vim.o.grepprg = [[rg --glob "!.jj" --glob "!.git" --no-heading --vimgrep --follow $*]] -vim.opt.grepformat = vim.opt.grepformat ^ { "%f:%l:%c:%m" } - --- Diagnostics -vim.diagnostic.config { - float = { - border = "rounded", - header = "", - source = "if_many", - }, - severity_sort = true, - signs = { - linehl = { - [vim.diagnostic.severity.ERROR] = "DiagnosticSignErrorLine", - [vim.diagnostic.severity.WARN] = "DiagnosticSignWarnLine", - [vim.diagnostic.severity.INFO] = "DiagnosticSignInfoLine", - [vim.diagnostic.severity.HINT] = "DiagnostigSignHintLine", - }, - numhl = { - [vim.diagnostic.severity.ERROR] = "DiagnosticSignError", - [vim.diagnostic.severity.WARN] = "DiagnosticSignWarn", - [vim.diagnostic.severity.INFO] = "DiagnosticSignInfo", - [vim.diagnostic.severity.HINT] = "DiagnostigSignHint", - }, - text = { - [vim.diagnostic.severity.ERROR] = "", - [vim.diagnostic.severity.WARN] = "", - [vim.diagnostic.severity.INFO] = "", - [vim.diagnostic.severity.HINT] = "", - }, - }, - virtual_lines = false, -} -vim.keymap.set('n', '<Space>ud', function() - if vim.diagnostic.config().virtual_lines == true then - -- vim.diagnostic.config({ virtual_lines = { current_line = true } }) - vim.diagnostic.config({ virtual_lines = false }) - else - vim.diagnostic.config({ virtual_lines = true }) - end -end, { desc = 'Toggle diagnostic virtual_lines' }) - - --- Make <Tab> work for snippets -vim.keymap.set({ "i", "s" }, "<Tab>", function() - if vim.snippet.active({ direction = 1 }) then - return "<cmd>lua vim.snippet.jump(1)<cr>" - else - return "<Tab>" - end -end, { expr = true }) - - --- Autoformat - -vim.g.autoformat_enabled = true -- set to true by default - -vim.api.nvim_create_user_command('ToggleAutoFormat', function() - vim.g.autoformat_enabled = not vim.g.autoformat_enabled - print('Autoformatting ' .. (vim.g.autoformat_enabled and 'enabled' or 'disabled')) -end, {}) - -vim.api.nvim_create_augroup("AutoFormat", {}) - -vim.api.nvim_create_autocmd("BufWritePre", { - group = "AutoFormat", - callback = function() - if vim.g.autoformat_enabled then - vim.lsp.buf.format({ - async = false, - timeout_ms = 2000 -- Adjust timeout as needed - }) - end - end, -}) - --- Keymap -local opts = function(label) - return { noremap = true, silent = true, desc = label } -end - --- Comments -vim.keymap.set("n", "<c-/>", "gcc", { remap = true }) -vim.keymap.set("v", "<c-/>", "gc", { remap = true }) -vim.keymap.set("n", "<c-_>", "gcc", { remap = true }) -vim.keymap.set("v", "<c-_>", "gc", { remap = true }) - -vim.keymap.set({ "n", "v" }, "<Leader>a", vim.lsp.buf.code_action, { remap = true, desc = "Code action" }) -vim.keymap.set("n", "<Leader>af", function() - vim.lsp.buf.format({ async = true }) -end, opts("Format Buffer")) -vim.keymap.set('n', '<Leader><Leader>', "<cmd>Pick visit_paths cwd=''<cr>", opts("Visits")) -vim.keymap.set('n', '<Leader>b', "<cmd>Pick buffers<cr>", opts("Open buffer picker")) -vim.keymap.set('n', '<Leader>/', "<cmd>Pick grep_live_root<cr>", opts("Search workspace files")) -vim.keymap.set('n', '<Leader>d', vim.diagnostic.open_float, opts("Show diagnostics for line")) -vim.keymap.set('n', '<m-d>', vim.diagnostic.open_float, opts("Show diagnostics for line")) -vim.keymap.set('n', '<Leader>D', function() - local width = vim.o.columns - 8 - MiniExtra.pickers.diagnostic({ scope = "current" }, { window = { config = { width = width } } }) -end, opts("Open diagnostics picker")) - -vim.keymap.set("n", "<Leader>r", vim.lsp.buf.rename, opts("Rename Symbol")) -vim.keymap.set('n', '<Leader>F', "<cmd>Pick files<cr>", opts("Open file picker CWD")) -vim.keymap.set('n', '<Leader>f', "<cmd>Pick files_root<cr>", opts("Open file picker")) -vim.keymap.set('n', '<c-p>', "<Leader>f", { remap = true }) -vim.keymap.set('n', '<Leader>g', "<cmd>Pick oldfiles<cr>", opts("Open file picker history")) -vim.keymap.set("n", '<Leader>k', vim.lsp.buf.hover, opts("Show docs for item under cursor")) -vim.keymap.set('n', '<Leader>p', "<cmd>Pick projects<cr>", opts("Open projects picker")) -vim.keymap.set('n', '<Leader>q', require('mini.bufremove').delete, opts("Delete buffer")) -vim.keymap.set('n', '<Leader>s', "<cmd>Pick lsp scope='document_symbol'<cr>", opts("Open symbol picker")) -vim.keymap.set('n', '<Leader>S', "<cmd>Pick lsp scope='workspace_symbol'<cr>", opts("Open workspace symbol picker")) -vim.keymap.set("n", "<Leader>ws", "<C-w>s", opts("Horizontal split")) -vim.keymap.set("n", "<Leader>wv", "<C-w>v", opts("Vertical split")) -vim.keymap.set("n", "<m-f>", require('mini.files').open, opts("Open file manager")) -vim.keymap.set('n', '<tab>', "<cmd>Pick buffers include_current=false<cr>", opts("Buffers")) -vim.keymap.set("n", "zz", "zt", { remap = true }) -vim.keymap.set({ "n", "v" }, "<Leader>y", '"+y', opts("Yank to clipboard")) -vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts("Declaration")) -vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts("Definition")) -vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts("Implementation")) -vim.keymap.set("n", "gr", vim.lsp.buf.references, opts("Buffer References")) -vim.keymap.set("n", "gt", vim.lsp.buf.type_definition, opts("Type Definition")) -vim.keymap.set({ "n", "i" }, "<M-k>", vim.lsp.buf.signature_help, opts("Signature Help")) -vim.keymap.set({ "n", "v" }, "<Leader>aa", vim.lsp.buf.code_action, opts("Code Action")) -vim.keymap.set("n", "K", function() - vim.lsp.buf.hover { - border = 'rounded', - max_height = 24, - max_width = 80, - offset_x = 2, - } -end, {}) -vim.keymap.set("n", "<Leader>ub", function() - vim.o.background = (vim.o.background == "light" and "dark" or "light") -end, opts("Toggle dark/light background")) -vim.keymap.set("n", "<Leader>uc", function() - if vim.g.colors_name == "dieter-nocolor" then - vim.cmd [[colorscheme dieter]] - else - vim.cmd [[colorscheme dieter-nocolor]] - end -end, opts("Toggle Dieter colors")) -vim.keymap.set("n", "<Leader>uf", "<cmd>ToggleAutoFormat<cr>", opts("Toggle autoformat on save")) -vim.keymap.set("n", "<Leader>uh", "<cmd>InlayHintsToggle<cr>", opts("Toggle inlay hints")) -vim.keymap.set("n", "<Leader>ul", "<cmd>set invcursorline<cr>", opts("Toggle cursor line")) -vim.keymap.set("n", "<Leader>un", "<cmd>set invnumber<cr>", opts("Toggle line numbers")) -vim.keymap.set("n", "<Leader>uw", "<cmd>set invwrap<cr>", opts("Toggle line wrapping")) - -vim.keymap.set("n", "<Leader>ui", function() - vim.g.miniindentscope_disable = not vim.g.miniindentscope_disable -end, opts("Toggle indent scope")) diff --git a/home/common/nvim/lsp.lua b/home/common/nvim/lsp.lua deleted file mode 100644 index f36bd30..0000000 --- a/home/common/nvim/lsp.lua +++ /dev/null @@ -1,60 +0,0 @@ -local lspconfig = require("lspconfig") -local servers = { - cssls = {}, - html = {}, - jsonls = {}, - sqls = {}, - superhtml = {}, - ts_ls = {}, - - gopls = { - settings = { - gopls = { - hints = { - rangeVariableTypes = true, - parameterNames = true, - constantValues = true, - assignVariableTypes = true, - compositeLiteralFields = true, - compositeLiteralTypes = true, - functionTypeParameters = true, - }, - }, - }, - }, - - lua_ls = { - settings = { - Lua = { - runtime = { - version = "LuaJIT", - path = vim.split(package.path, ";"), - }, - diagnostics = { globals = { "vim", "hs" } }, - hint = { enable = true }, - workspace = { - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true, - }, - }, - }, - }, - }, - - nixd = { - cmd = { "nixd" }, - settings = { - nixd = { - nixpkgs = { expr = "import <nixpkgs> { }" }, - formatting = { command = { "nixfmt" } }, - options = {}, - }, - }, - }, -} - -for server, config in pairs(servers) do - config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities) - lspconfig[server].setup(config) -end diff --git a/home/common/nvim/mini.lua b/home/common/nvim/mini.lua deleted file mode 100644 index 3c7d129..0000000 --- a/home/common/nvim/mini.lua +++ /dev/null @@ -1,261 +0,0 @@ -require('mini.ai').setup() -require('mini.align').setup() -require('mini.bracketed').setup() -require('mini.bufremove').setup() -require('mini.comment').setup() -require('mini.diff').setup() -require('mini.extra').setup() -require('mini.files').setup() -require('mini.icons').setup() -require('mini.jump').setup() -require('mini.surround').setup() -require('mini.splitjoin').setup() -require('mini.trailspace').setup() -require('mini.visits').setup() - -require('mini.cursorword').setup({ - delay = 800 -}) - -local hipatterns = require('mini.hipatterns') -hipatterns.setup({ - highlighters = { - -- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE' - fixme = { pattern = '%f[%w]()FIXME()%f[%W]', group = 'MiniHipatternsFixme' }, - hack = { pattern = '%f[%w]()HACK()%f[%W]', group = 'MiniHipatternsHack' }, - todo = { pattern = '%f[%w]()TODO()%f[%W]', group = 'MiniHipatternsTodo' }, - note = { pattern = '%f[%w]()NOTE()%f[%W]', group = 'MiniHipatternsNote' }, - hex_color = hipatterns.gen_highlighter.hex_color(), - } -}) - -local indentscope = require('mini.indentscope') -indentscope.setup({ - draw = { - delay = 10, - animation = indentscope.gen_animation.none(), - }, - symbol = '│', -}) -vim.g.miniindentscope_disable = true - -require('mini.jump2d').setup({ - mappings = { start_jumping = 'gw' } -}) - -local picker_win_config = function() - local height = vim.o.lines - 8 - local width = 80 - return { - border = 'rounded', - anchor = 'NW', - height = height, - width = width, - row = 2, - col = 5, - } -end - -require('mini.pick').setup({ - mappings = { - move_down = '<tab>', - move_up = '<S-tab>', - toggle_info = '<C-k>', - toggle_preview = '<C-p>', - }, - options = { use_cache = true }, - window = { - config = picker_win_config, - }, -}) - -local MiniPick = require('mini.pick') -MiniPick.registry.projects = function(local_opts) - local root = vim.fn.expand("~/src") - - local command = { - "fd", - "--max-depth=8", - "--one-file-system", - "--unrestricted", - "--full-path", - "/.jj/repo/store/type$|/.git/HEAD$", - root, - } - - local postprocess = function(paths) - local result = {} - local seen = {} - for _, path in ipairs(paths) do - path = path:gsub("%/.jj/repo/store/type$", "") - path = path:gsub("%/.git/HEAD$", "") - if not seen[path] then - local item = { - path = path, - text = path:gsub("%" .. root .. "/", " "), - } - table.insert(result, item) - seen[path] = true - end - end - return result - end - - local choose = function(item) - local_opts.cwd = item.path - vim.fn.chdir(item.path) - vim.schedule(function() - MiniPick.builtin.files(local_opts, { source = { cwd = item.path, tool = "rg" } }) - end) - end - - return MiniPick.builtin.cli({ command = command, postprocess = postprocess }, { source = { choose = choose } }) -end - -MiniPick.registry.files_root = function(local_opts) - local root_patterns = { ".jj", ".git" } - local root_dir = vim.fs.dirname(vim.fs.find(root_patterns, { upward = true })[1]) - local_opts.cwd = root_dir - local_opts.tool = "rg" - return MiniPick.builtin.files(local_opts, { source = { cwd = root_dir, tool = "rg" } }) -end - -MiniPick.registry.grep_live_root = function(local_opts) - local root_patterns = { ".jj", ".git" } - local root_dir = vim.fs.dirname(vim.fs.find(root_patterns, { upward = true })[1]) - local_opts.cwd = root_dir - return MiniPick.builtin.grep_live(local_opts, { source = { cwd = root_dir } }) -end - -require("mini.pick").registry.buffers = function(local_opts, opts) - local_opts = vim.tbl_deep_extend( - "force", - { sort_lastused = false, sort_mru = true, include_current = true, include_unlisted = false }, - local_opts or {} - ) - local buffers_output = vim.api.nvim_exec("buffers" .. (local_opts.include_unlisted and "!" or ""), true) - local cur_buf_id, include_current = vim.api.nvim_get_current_buf(), local_opts.include_current - local items = {} - local default_selection_idx = 1 - for _, l in ipairs(vim.split(buffers_output, "\n")) do - local buf_str, name = l:match("^%s*%d+"), l:match('"(.*)"') - local buf_id = tonumber(buf_str) - local flag = buf_id == vim.fn.bufnr("") and "%" or (buf_id == vim.fn.bufnr("#") and "#" or " ") - local item = { text = name, bufnr = buf_id, flag = flag } - if buf_id ~= cur_buf_id or include_current then - if local_opts.sort_lastused and not local_opts.ignore_current_buffer and flag == "#" then - default_selection_idx = 2 - end - if local_opts.sort_lastused and (flag == "#" or flag == "%") then - local idx = ((items[1] ~= nil and items[1].flag == "%") and 2 or 1) - table.insert(items, idx, item) - else - table.insert(items, item) - end - end - end - if local_opts.sort_mru then - table.sort(items, function(a, b) - return vim.fn.getbufinfo(a.bufnr)[1].lastused > vim.fn.getbufinfo(b.bufnr)[1].lastused - end) - end - - local show = function(buf_id, items, query) - require("mini.pick").default_show(buf_id, items, query, { show_icons = true }) - end - local default_opts = { source = { name = "Buffers", show = show } } - opts = vim.tbl_deep_extend("force", default_opts, opts or {}, { source = { items = items } }) - if default_selection_idx > 1 then - vim.api.nvim_create_autocmd("User", { - pattern = "MiniPickStart", - once = true, - callback = function() - local mappings = require("mini.pick").get_picker_opts().mappings - local keys = vim.fn["repeat"](mappings.move_down, default_selection_idx - 1) - vim.api.nvim_input(vim.api.nvim_replace_termcodes(keys, true, true, true)) - end, - }) - end - return require("mini.pick").start(opts) -end - -local miniclue = require('mini.clue') -miniclue.setup({ -- cute prompts about bindings - triggers = { - { mode = 'n', keys = '<Leader>' }, - { mode = 'x', keys = '<Leader>' }, - { mode = 'n', keys = '<space>' }, - { mode = 'x', keys = '<space>' }, - - -- Built-in completion - { mode = 'i', keys = '<C-x>' }, - - -- `g` key - { mode = 'n', keys = 'g' }, - { mode = 'x', keys = 'g' }, - - -- Marks - { mode = 'n', keys = "'" }, - { mode = 'n', keys = '`' }, - { mode = 'x', keys = "'" }, - { mode = 'x', keys = '`' }, - - -- Registers - { mode = 'n', keys = '"' }, - { mode = 'x', keys = '"' }, - { mode = 'i', keys = '<C-r>' }, - { mode = 'c', keys = '<C-r>' }, - - -- Window commands - { mode = 'n', keys = '<C-w>' }, - - -- `z` key - { mode = 'n', keys = 'z' }, - { mode = 'x', keys = 'z' }, - - -- Bracketed - { mode = 'n', keys = '[' }, - { mode = 'n', keys = ']' }, - }, - clues = { - miniclue.gen_clues.builtin_completion(), - miniclue.gen_clues.g(), - miniclue.gen_clues.marks(), - miniclue.gen_clues.registers(), - miniclue.gen_clues.windows(), - miniclue.gen_clues.z(), - }, - window = { - delay = 0, - config = { - border = 'rounded', - width = 'auto', - }, - } -}) - -local notify_win_config = function() - local has_statusline = vim.o.laststatus > 0 - local pad = vim.o.cmdheight + (has_statusline and 1 or 0) - return { anchor = 'SE', border = 'rounded', col = vim.o.columns, row = vim.o.lines - pad } -end -require('mini.notify').setup({ - window = { - config = notify_win_config, - winblend = 0, - }, -}) - -require('mini.starter').setup({ - header = - [[ -████████▄ ▄▄ ▒▒ -██ ▀██ ██ -██ ▄██ ▄██████▄ ██████ ▄██████▄ ▄████▄██ ██ ▄██████▄ -████████▀ ▀▀ ██ ██ ▀▀ ██ ██▀ ▀██ ██ ▀▀ ██ -██ ▄███████ ██ ▄███████ ██ ██ ██ ▄███████ -██ ██ ██ ██ ██ ██ ██▄ ▄██ ██ ██ ██ -██ ▀████▀██ ▀███ ▀████▀██ ▀████▀██ ██ ▀████▀██ - ▄▄ ██ - ▀██████▀ ]] -}) diff --git a/home/common/nvim/rust.lua b/home/common/nvim/rust.lua deleted file mode 100644 index 982daa7..0000000 --- a/home/common/nvim/rust.lua +++ /dev/null @@ -1,40 +0,0 @@ -vim.g.rustaceanvim = { - server = { - settings = { - ["rust-analyzer"] = { - inlayHints = { - bindingModeHints = { - enable = false, - }, - chainingHints = { - enable = true, - }, - closingBraceHints = { - enable = true, - minLines = 25, - }, - closureReturnTypeHints = { - enable = "never", - }, - lifetimeElisionHints = { - enable = "never", - useParameterNames = false, - }, - maxLength = 25, - parameterHints = { - enable = true, - }, - reborrowHints = { - enable = "never", - }, - renderColons = true, - typeHints = { - enable = true, - hideClosureInitialization = false, - hideNamedConstructor = false, - }, - }, - }, - }, - }, -} diff --git a/home/common/nvim/treesitter.nix b/home/common/nvim/treesitter.nix deleted file mode 100644 index 25e15f8..0000000 --- a/home/common/nvim/treesitter.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ - inputs, - lib, - pkgs, - ... -}: -{ - programs.neovim = { - extraPackages = with pkgs; [ - tree-sitter - ]; - - plugins = with pkgs.vimPlugins; [ - nvim-ts-context-commentstring - playground - ts-comments-nvim - - { - plugin = nvim-treesitter-context; - type = "lua"; - config = '' - require'treesitter-context'.setup{ - enable = false, - } - vim.keymap.set('n', '<space>ut', "<cmd>TSContextToggle<cr>", {noremap = true, silent = true, desc = "TS Context"}) - ''; - } - - { - plugin = nvim-treesitter.withAllGrammars; - type = "lua"; - config = '' - require'nvim-treesitter.configs'.setup { - highlight = { enable = true, }, - indent = { enable = true }, - rainbow = { enable = true }, - textobjects = { - select = { - enable = true, - lookahead = true, - }, - }, - } - ''; - } - - { - plugin = nvim-treesitter-textobjects; - type = "lua"; - config = '' - require'nvim-treesitter.configs'.setup { - incremental_selection = { - enable = true, - keymaps = { - init_selection = "<M-o>", - scope_incremental = "<M-O>", - node_incremental = "<M-o>", - node_decremental = "<M-i>", - }, - }, - } - ''; - } - ]; - }; -} diff --git a/home/common/scripts.nix b/home/common/scripts.nix deleted file mode 100644 index 7f607ac..0000000 --- a/home/common/scripts.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - home.file = { - ".local/bin" = { - recursive = true; - source = ./../../files/scripts; - }; - - }; - - home.sessionPath = [ "$HOME/.local/bin" ]; -} diff --git a/home/common/ssh.nix b/home/common/ssh.nix deleted file mode 100644 index 1f59463..0000000 --- a/home/common/ssh.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ ... }: -{ - programs.ssh = { - enable = true; - addKeysToAgent = "yes"; - compression = false; - controlMaster = "auto"; - controlPath = "\${XDG_RUNTIME_DIR}/ssh_control:%h:%p:%r"; - controlPersist = "15m"; - extraConfig = '' - PreferredAuthentications publickey - ''; - }; -} diff --git a/home/common/tmux.nix b/home/common/tmux.nix deleted file mode 100644 index a587338..0000000 --- a/home/common/tmux.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ ... }: -{ - programs.tmux = { - enable = true; - baseIndex = 0; - clock24 = true; - escapeTime = 500; - mouse = true; - shortcut = "t"; - extraConfig = '' - set -g allow-passthrough on - set -g default-terminal "tmux-256color" - set -g display-panes-time 3000 - set -g escape-time 10 - set -g history-limit 50000 - set -g set-clipboard on - set -g set-titles on - set -g set-titles-string "#H - #T" - set -g status off - set -g status-interval 30 - set -g status-style "italics,reverse" - set -g status-left-length 0 - set -g status-right-length 0 - set -g status-left '#W #{pane_current_path}' - set -g status-right '%F | %R' - set -g status off - set -g update-environment "SSH_AUTH_SOCK" - setw -g alternate-screen on - setw -g automatic-rename off - setw -g window-status-format "" - setw -g window-status-current-format "" - setw -g window-status-separator "" - - set -s command-alias[1000] stty='run-shell "tmux send-keys \"stty cols #{pane_width} rows #{pane_height}\" Enter"' - - bind -n C-2 if-shell 'tmux select-window -t t1' refresh-client 'new-window -S -n t1' - bind -n C-3 if-shell 'tmux select-window -t t2' refresh-client 'new-window -S -n t2' - bind -n C-4 if-shell 'tmux select-window -t t3' refresh-client 'new-window -S -n t3' - bind -n C-5 if-shell 'tmux select-window -t t4' refresh-client 'new-window -S -n t4' - bind -n C-6 if-shell 'tmux select-window -t t5' refresh-client 'new-window -S -n t5' - bind -n C-7 if-shell 'tmux select-window -t t6' refresh-client 'new-window -S -n t6' - bind -n C-8 if-shell 'tmux select-window -t t7' refresh-client 'new-window -S -n t7' - bind -n C-9 if-shell 'tmux select-window -t t8' refresh-client 'new-window -S -n t8' - bind -n C-0 if-shell 'tmux select-window -t t9' refresh-client 'new-window -S -n t9' - bind -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 1 scroll-up - bind -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 1 scroll-down - bind C-s set-option -g status - bind-key ] paste-buffer -p - bind K confirm kill-server - ''; - }; -} diff --git a/home/common/utils.nix b/home/common/utils.nix deleted file mode 100644 index ff902b9..0000000 --- a/home/common/utils.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ - dust - jless - procs - viddy - ]; - - home.sessionVariables.DIRENV_LOG_FORMAT = ''$(printf "\033[2mdirenv: %%s\033[0m")''; - - programs = { - bat = { - enable = true; - config = { - italic-text = "always"; - paging = "auto"; - style = "plain"; - theme = "ansi"; - }; - }; - - bottom.enable = true; - - direnv = { - enable = true; - nix-direnv.enable = true; - silent = false; - config.global = { - hide_env_diff = true; - load_dotenv = true; - strict_env = true; - warn_timeout = "10s"; - }; - }; - - fd.enable = true; - - fzf = { - enable = true; - enableFishIntegration = true; - }; - - jq.enable = true; - less.enable = true; - lesspipe.enable = true; - tmux.enable = true; - - ripgrep = { - enable = true; - arguments = [ - "--glob=!**/.cache/*" - "--glob=!**/.direnv/*" - "--glob=!**/.git/*" - "--glob=!**/.jj/*" - "--glob=!**/{node_modules,.npm,dist}/*" - "--glob=!**/target/*" - "--glob=!**/result/*" - ]; - }; - - }; - - programs.eza = { - enable = true; - enableFishIntegration = true; - }; - home.sessionVariables.EZA_COLORS = "reset:oc=0:ur=0:uw=0:ux=0:ue=0:gr=0:gw=0:gx=0:tr=0:tw=0:tx=0:su=0:sf=0:xa=0:sn=0:nb=0:nk=0:nm=0:ng=0:nt=0:sb=0:ub=0:uk=0:um=0:ug=0:ut=0:df=0:ds=0:uu=0:uR=0:un=0:gu=0:gR=0:gn=0:lc=0:lm=0:ga=0:gm=0:gd=0:gv=0:gt=0:gi=0:gc=0:Gm=0:Go=0:Gc=0:Gd=0:xx=0:da=0:in=0:bl=0:hd=0:lp=4:cc=0:bO=0:sp=0:mp=0:im=0:vi=0:mu=0:lo=0:cr=0:do=0:co=0:tm=0:cm=0:bu=0:sc=0:ic=0:Sn=0:Su=0:Sr=0:St=0:Sl=0:ff=0:di=1:ex=0:fi=0:pi=0:so=0:bd=0:cd=0:ln=4:or=4"; - - programs.zoxide = { - enable = true; - enableFishIntegration = true; - options = [ "--cmd=cd" ]; - }; - home.sessionVariables._ZO_FZF_OPTS = "--reverse --height=10 --border=rounded --no-info --no-separator --no-scrollbar --no-color --no-sort"; - -} diff --git a/home/common/vcs.nix b/home/common/vcs.nix deleted file mode 100644 index bc74bb3..0000000 --- a/home/common/vcs.nix +++ /dev/null @@ -1,140 +0,0 @@ -{ - config, - inputs, - pkgs, - ... -}: -{ - - home.packages = with pkgs; [ - delta - diffedit3 - difftastic - git-get - git-graph - tea - ]; - - programs.gh = { - enable = true; - }; - - programs.git = { - enable = true; - - aliases = { - b = "branch -va"; - cl = "clone --filter=blob:none"; - co = "checkout"; - d = "diff --stat -p -C --color-words"; - ds = "diff --staged --stat -p -C --color-words"; - g = "graph -S -m simple -s round"; - guilt = "!f(){ git log --pretty='format:%an <%ae>' $@ | sort | uniq -c | sort -rn; }; f"; - lla = "log --graph --all --topo-order --pretty='format:\t%x1B[0;3;36m%as %x1B[0;95;3m%<(12)%al %x1B[3;32m• %h%x1B[0;1;92m%d%x1B[0m %s'"; - ll = "log --pretty='format:%x1B[0;3;36m%as %G? %x1B[0;95;3m%<(12,trunc)%al %x1B[3;32m• %h%x1B[0;1;92m%(decorate:prefix= [,suffix=]%n)%>|(35)%Creset %s'"; - patch = "!git --no-pager diff --no-color"; - pullr = "pull --rebase --autostash"; - sh = "show --stat -p -C --color-words --show-signature"; - st = "status -sb"; - }; - - delta = { - enable = true; - options = { - file-added-label = "[+]"; - file-decoration-style = "none"; - file-modified-label = "[*]"; - file-removed-label = "[-]"; - file-renamed-label = "[>]"; - file-style = "bold reverse"; - file-transformation = "s/$/ ░▒▓/"; - grep-file-style = "bold reverse"; - hunk-header-decoration-style = "none"; - hunk-header-file-style = "bold"; - hunk-header-line-number-style = "bold"; - hunk-header-style = "bold"; - hunk-label = "⯁"; - hunk-label-style = "bold"; - line-numbers = true; - max-line-distance = "0.9"; - navigate = true; - }; - }; - - extraConfig = { - apply.whitespace = "nowarn"; - blame.date = "relative"; - branch.main.rebase = true; - color = { - branch = "auto"; - diff = "auto"; - status = "auto"; - ui = "auto"; - }; - column.ui = "auto"; - core = { - compression = 3; - looseCompression = 3; - excludesfile = "~/.config/git/ignore"; - }; - fetch = { - prune = true; - prunetags = true; - showForcedUpdates = true; - }; - gitget = { - root = "${config.home.homeDirectory}/src/oss"; - }; - gpg = { - format = "ssh"; - ssh = { - allowedSignersFile = "${config.home.homeDirectory}/.ssh/authorized_keys"; - defaultKeyCommand = "${config.home.homeDirectory}/.local/bin/git-signing-key"; - }; - }; - init.defaultBranch = "main"; - merge.conflictstyle = "zdiff3"; - pack = { - compression = 3; - threads = 0; - }; - pull.rebase = true; - push.default = "tracking"; - rebase.autosquash = true; - rerere.enabled = true; - tag.sort = "-v:refname"; - user.useConfigOnly = true; - }; - - ignores = [ - "*~" - "*.a" - "*.class" - "*.iml" - "*.ipr" - "*.iwr" - "*.iws" - "*.la" - "*.o" - "*.pyc" - "*.so" - "*.swp" - ".direnv" - ".env" - ".idea" - ".nixos-test-history" - ".null-ls_*" - "/result*" - "/target" - ]; - - signing = { - key = null; - signByDefault = true; - }; - }; - - programs.jujutsu = { - enable = true; - }; -} diff --git a/home/common/web.nix b/home/common/web.nix deleted file mode 100644 index 880604a..0000000 --- a/home/common/web.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - config = lib.mkIf config.patagia.desktop.enable { - - home.packages = with pkgs; [ tor-browser ]; - - programs.firefox = { - enable = true; - }; - - programs.chromium = { - enable = true; - package = pkgs.ungoogled-chromium; - }; - - }; -} diff --git a/home/common/wezterm.nix b/home/common/wezterm.nix deleted file mode 100644 index 121b8ca..0000000 --- a/home/common/wezterm.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ - config, - lib, - ... -}: -{ - config = lib.mkIf config.patagia.desktop.enable { - programs.wezterm = { - enable = true; - colorSchemes = { - patagiaLight = { - ansi = [ - "#222222" - "#D14949" - "#48874F" - "#AFA75A" - "#599797" - "#8F6089" - "#5C9FA8" - "#8C8C8C" - ]; - brights = [ - "#444444" - "#FF6D6D" - "#89FF95" - "#FFF484" - "#97DDFF" - "#FDAAF2" - "#85F5DA" - "#E9E9E9" - ]; - background = "#fefeff"; - foreground = "#222222"; - cursor_bg = "#aa0000"; - cursor_border = "#aa0000"; - cursor_fg = "#1B1B1B"; - selection_bg = "#ffe6a4"; - selection_fg = "#483600"; - }; - }; - - extraConfig = '' - return { - font = wezterm.font("Berkeley Mono", { weight = "Regular", stretch = "Normal" }), - font_size = 16, - -- freetype_load_target = "HorizontalLcd", - freetype_load_target = "Light", - -- font_size = 11, - -- font_size = 11, - -- freetype_load_target = "Normal", - freetype_load_flags = "NO_AUTOHINT", - color_scheme = "patagiaLight", - check_for_updates = false, - custom_block_glyphs = false, - warn_about_missing_glyphs = false, - bold_brightens_ansi_colors = false, - unicode_version = 14, - allow_square_glyphs_to_overflow_width = "Always", - xcursor_theme = "Adwaita", - hide_mouse_cursor_when_typing = false, - tab_bar_at_bottom = true, - use_fancy_tab_bar = false, - show_tab_index_in_tab_bar = true, - underline_position = -4, - underline_thickness = 2, - --line_height = 0.95, - } - ''; - - }; - }; -} diff --git a/home/dln/desktop.nix b/home/dln/desktop.nix deleted file mode 100644 index e6f9326..0000000 --- a/home/dln/desktop.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ pkgs, ... }: -{ - patagia = { - desktop.enable = true; - }; - - home.packages = with pkgs; [ - cameractrls-gtk4 - dynamic-wallpaper - gimp - gimpPlugins.bimp - inkscape - libreoffice - moonlight-qt - obsidian - pavucontrol - plexamp - signal-desktop - spotify - ]; - - xdg.desktopEntries = { - firefox-work = { - categories = [ - "Network" - "WebBrowser" - ]; - comment = "Browse the Web"; - exec = "firefox %u -P work --new-instance --name firefox-work"; - genericName = "Web Browser"; - icon = "firefox"; - mimeType = [ - "text/html" - "text/xml" - "application/xhtml+xml" - "application/vnd.mozilla.xul+xml" - "text/mml" - "x-scheme-handler/http" - "x-scheme-handler/https" - ]; - name = "Firefox (Work)"; - settings = { - StartupWMClass = "firefox-work"; - Keywords = "web;browser;internet"; - }; - terminal = false; - type = "Application"; - }; - }; -} diff --git a/home/dln/dinky.nix b/home/dln/dinky.nix deleted file mode 100644 index 333d785..0000000 --- a/home/dln/dinky.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ - ./home.nix - ./desktop.nix - ]; - - patagia = { - laptop.enable = true; - oled.enable = true; - }; - - dconf.settings = { - "org/gnome/shell" = { - enabled-extensions = [ "Battery-Health-Charging@maniacx.github.com" ]; - }; - }; - - home.packages = with pkgs; [ ]; - - programs.gpg.enable = true; - services.gpg-agent = { - enable = true; - pinentryPackage = pkgs.pinentry-curses; - }; - - xdg.desktopEntries = { - ghostty-devel = { - categories = [ - "System" - "TerminalEmulator" - ]; - exec = '' - ghostty --class=com.mitchellh.ghostty-devel --command="ssh -t devel" --initial-command="ssh -t devel" - ''; - genericName = "Ghostty (devel)"; - icon = "com.mitchellh.ghostty"; - name = "Ghostty (devel)"; - settings = { - StartupWMClass = "com.mitchellh.ghostty-devel"; - TryExec = "ghostty"; - }; - terminal = false; - type = "Application"; - }; - - ghostty-devel-secondary = { - categories = [ - "System" - "TerminalEmulator" - ]; - exec = '' - ghostty --class=com.mitchellh.ghostty-devel-secondary --background-opacity=0.8 --font-style="ExtraCondensed" --font-style-bold="Bold ExtraCondensed" --font-style-italic="ExtraCondensed Oblique" --command="ssh -t devel" --initial-command="ssh -t devel" - ''; - genericName = "Secondary Ghostty (devel)"; - icon = "com.mitchellh.ghostty"; - name = "Secondary Ghostty (devel)"; - settings = { - StartupWMClass = "com.mitchellh.ghostty-devel-secondary"; - TryExec = "ghostty"; - }; - terminal = false; - type = "Application"; - }; - }; -} diff --git a/home/dln/home.nix b/home/dln/home.nix deleted file mode 100644 index ae8681e..0000000 --- a/home/dln/home.nix +++ /dev/null @@ -1,316 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -let - realName = "Daniel Lundin"; - email = "dln@arity.se"; -in -{ - home = { - username = "dln"; - homeDirectory = "/home/dln"; - packages = with pkgs; [ - asciinema - openconnect - ouch - ]; - }; - - programs.atuin.settings = { - show_tabs = false; - - cwd_filter = [ - "^~/media" - "^/home/dln/media" - "^/tmp" - ]; - - history_filter = [ - "^kubectl create secret.*--from-literal" - "^kubectl delete ns" - "^kubectl delete namespace" - "^talosctl reset" - ]; - }; - - programs.git = { - userName = realName; - userEmail = email; - }; - - programs.helix = { - enable = true; - }; - - programs.jujutsu = { - settings = { - user = { - email = email; - name = realName; - }; - - signing = { - behavior = "own"; - backend = "ssh"; - backends.ssh.allowed-signers = "/home/dln/.ssh/authorized_keys"; - key = "/home/dln/.ssh/git_signing_key.pub"; - }; - - git = { - push-bookmark-prefix = "dln/push-"; - subprocess = true; - }; - - ui = { - "default-command" = [ "s" ]; - pager = "delta"; - }; - - "merge-tools" = { - difft."diff-args" = [ - "--color=always" - "$left" - "$right" - ]; - difftu = { - program = "difft"; - "diff-args" = [ - "--color=always" - "--display=inline" - "$left" - "$right" - ]; - }; - }; - - aliases = { - l = [ - "log" - "--limit=25" - "-T" - "builtin_log_comfortable" - "-r" - "(main..@) | (main..@)-" - ]; - la = [ - "log" - "--limit=25" - "-T" - "builtin_log_oneline" - "-r" - "all()" - ]; - d = [ - "diff" - "--tool=difft" - ]; - dd = [ - "diff" - "--git" - ]; - du = [ - "diff" - "--tool=difftu" - ]; - s = [ - "util" - "exec" - "--" - "bash" - "-c" - '' - #!/usr/bin/env bash - set -eo pipefail - printf '\e[38;5;240m\u2504%.0s\e[0m' $(seq 1 $(tput cols)) '\n' - jj show --stat - printf '\e[38;5;240m\u2504%.0s\e[0m' $(seq 1 $(tput cols)) '\n' - if [ -n "$1" ]; then - jj diff --tool=difft -r "$@" - else - jj log --limit=15 -T builtin_log_comfortable - fi - '' - "" - ]; - }; - - "revset-aliases" = { - # Prevent rewriting commits on main@origin and commits authored by other users; - "user(x)" = "author(x) | committer(x)"; - "trunk()" = "latest((present(main) | present(master)) & remote_bookmarks())"; - "open" = "(mine() ~ ::trunk()) ~ heads(empty())"; - "wip" = ''description("wip: ")''; - "ready" = "open() ~ (wip::)"; - }; - - colors = - let - bold = { - bold = true; - }; - dim = { - fg = "bright black"; - }; - underline = { - fg = "default"; - underline = true; - }; - in - { - "error" = bold; - "warning" = bold; - "error heading" = bold; - "error_source heading" = bold; - "warning heading" = bold; - "hint heading" = bold; - "prefix" = bold; - "rest" = "bright black"; - "divergent prefix" = underline; - "bookmark" = "bright magenta"; - "bookmarks" = "bright magenta"; - "change_id" = "bright magenta"; - "local_bookmarks" = "bright magenta"; - - "diff file_header" = bold; - "diff hunk_header" = "cyan"; - "diff removed" = "red"; - "diff removed token" = "red"; - "diff added" = "green"; - "diff added token" = "green"; - "diff modified" = "cyan"; - "diff untracked" = "blue"; - "diff renamed" = "cyan"; - "diff copied" = "green"; - "diff access-denied" = { - bg = "red"; - }; - - "empty" = "green"; - "elided" = "blue"; - "node elided" = dim; - "node working_copy" = { - fg = "green"; - bold = true; - }; - "node current_operation" = bold; - "node immutable" = bold; - "node conflict" = { - fg = "red"; - bold = true; - }; - "operation id" = "blue"; - "operation current_operation" = bold; - "remote_bookmarks" = "bright magenta"; - "working_copy" = { - fg = "green"; - bold = true; - }; - "working_copy empty" = { - fg = "green"; - bold = true; - }; - "working_copy change_id" = "bright magenta"; - "working_copy description placeholder" = "green"; - "working_copy empty description placeholder" = "green"; - "working_copy bookmark" = "bright magenta"; - "working_copy bookmarks" = "bright magenta"; - "working_copy local_bookmarks" = "bright magenta"; - "working_copy remote_bookmarks" = "bright magenta"; - } - // lib.genAttrs [ - "author" - "branch" - "branches" - "commit_id" - "committer" - "config_list name" - "config_list overridden" - "config_list overridden name" - "config_list overridden value" - "config_list value" - "conflict" - "conflict_description" - "conflict_description difficult" - "description placeholder" - "diff token" - "divergent" - "divergent change_id" - "divergent rest" - "empty description placeholder" - "error_source" - "git_head" - "git_refs" - "hidden prefix" - "hint" - "local_branches" - "operation current_operation id" - "operation current_operation time" - "operation current_operation user" - "operation time" - "operation user" - "placeholder" - "remote_branches" - "root" - "separator" - "tag" - "tags" - "timestamp" - "working_copies" - "working_copy author" - "working_copy branch" - "working_copy branches" - "working_copy commit_id" - "working_copy committer" - "working_copy conflict" - "working_copy divergent" - "working_copy divergent change_id" - "working_copy git_refs" - "working_copy local_branches" - "working_copy placeholder" - "working_copy remote_branches" - "working_copy tag" - "working_copy tags" - "working_copy timestamp" - "working_copy working_copies" - ] (_: "default"); - - }; - }; - - programs.ssh.extraConfig = '' - Include ${config.home.homeDirectory}/.ssh/config_local - ''; - - programs.ssh.matchBlocks = { - dev-old = { - hostname = "10.1.100.16"; - forwardAgent = true; - }; - - devel = { - hostname = "10.1.100.20"; - forwardAgent = true; - localForwards = [ - { - bind.address = "localhost"; - bind.port = 8000; - host.address = "localhost"; - host.port = 8000; - } - { - bind.address = "localhost"; - bind.port = 8080; - host.address = "localhost"; - host.port = 8080; - } - ]; - }; - }; - - services.syncthing.enable = true; - - home.stateVersion = "24.05"; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion -} diff --git a/home/dln/nemo.nix b/home/dln/nemo.nix deleted file mode 100644 index cffb9ca..0000000 --- a/home/dln/nemo.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ lib, pkgs, ... }: -{ - imports = [ - ./home.nix - ./desktop.nix - ]; - - programs.ghostty.settings = { - font-size = lib.mkForce 15; - }; - - programs.obs-studio = { - enable = true; - plugins = with pkgs; [ - obs-studio-plugins.wlrobs - obs-studio-plugins.obs-vaapi - obs-studio-plugins.obs-pipewire-audio-capture - ]; - }; - - dconf.settings = { - "org/gnome/shell" = { - enabled-extensions = [ "azclock@azclock.gitlab.com" ]; - }; - }; - - home.packages = with pkgs; [ - endeavour - picard - stable.calibre - ]; - - programs.gpg.enable = true; - - services.gpg-agent = { - enable = true; - enableScDaemon = false; - pinentry.package = pkgs.pinentry-curses; - }; -} diff --git a/home/dln/pearl.nix b/home/dln/pearl.nix deleted file mode 100644 index 18a1715..0000000 --- a/home/dln/pearl.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ - ./home.nix - ]; - - home.packages = with pkgs; [ - ]; -} diff --git a/hosts/dinky/default.nix b/hosts/dinky/default.nix deleted file mode 100644 index 5a5806a..0000000 --- a/hosts/dinky/default.nix +++ /dev/null @@ -1,145 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - modulesPath, - ... -}: - -{ - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - boot = { - initrd = { - availableKernelModules = [ - "xhci_pci" - "thunderbolt" - "nvme" - "usb_storage" - "sd_mod" - ]; - kernelModules = [ ]; - luks.devices."enc".device = "/dev/disk/by-uuid/e7c7a230-b321-4e6d-869c-6c2d858455d2"; - systemd.enable = true; - }; - kernelModules = [ "kvm-intel" ]; - kernelParams = [ "mitigations=off" ]; - extraModulePackages = [ ]; - }; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/81e5205d-fe1e-458f-82e1-d60ab03c0a1d"; - fsType = "btrfs"; - options = [ - "noatime" - "nodiratime" - ]; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/D6C0-1A05"; - fsType = "vfat"; - options = [ - "fmask=0022" - "dmask=0022" - ]; - }; - - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - hardware.graphics = { - enable = true; - extraPackages = with pkgs; [ - vpl-gpu-rt - intel-media-driver - vaapiVdpau - libvdpau-va-gl - ]; - }; - - hardware.enableAllFirmware = true; - hardware.nitrokey.enable = true; - - swapDevices = [ { device = "/dev/disk/by-uuid/c9cc5270-87b0-4ed4-9891-7df924b0f55a"; } ]; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - - environment.systemPackages = with pkgs; [ - mullvad-vpn - ]; - - services.printing.enable = lib.mkForce false; - services.printing.drivers = [ pkgs.brlaser ]; - - services.udev.packages = [ pkgs.nitrokey-udev-rules ]; - - programs.adb.enable = true; - - networking = { - hostName = "dinky"; - domain = "aarn.patagia.net"; - search = [ - "patagia.net" - "aarn.patagia.net" - ]; - useDHCP = lib.mkDefault true; - }; - - networking.networkmanager.wifi.backend = "iwd"; - - services.mullvad-vpn.enable = true; - - users.users.dln = { - isNormalUser = true; - description = "Daniel Lundin"; - extraGroups = [ - "adbusers" - "lp" - "nitrokey" - "wheel" - ]; - openssh.authorizedKeys.keys = [ - "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAILwakA+EeuR23vRhjvjMkzK+FtWIhpnbs7z1pfnBehCUAAAABHNzaDo= dln@dinky" - "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIJNOBFoU7Cdsgi4KpYRcv7EhR/8kD4DYjEZnwk6urRx7AAAABHNzaDo= dln@nemo" - ]; - }; - - patagia = { - desktop.enable = true; - laptop.enable = true; - plymouth.enable = true; - podman.enable = true; - }; - - services.displayManager.autoLogin.enable = true; - services.displayManager.autoLogin.user = "dln"; - systemd.services."getty@tty1".enable = false; - systemd.services."autovt@tty1".enable = false; - - nix.settings.trusted-users = [ "dln" ]; - nix.buildMachines = [ - { - hostName = "nemo.aarn.patagia.net"; - sshUser = "nixremote"; - sshKey = "/root/.ssh/id_ed25519"; - system = "x86_64-linux"; - protocol = "ssh-ng"; - maxJobs = 32; - speedFactor = 2; - supportedFeatures = [ - "nixos-test" - "big-parallel" - "kvm" - ]; - mandatoryFeatures = [ ]; - } - ]; - nix.distributedBuilds = true; - nix.settings.builders-use-substitutes = true; - nix.settings.trusted-substituters = [ - "ssh-ng://nemo.aarn.patagia.net" - ]; - - system.stateVersion = "24.05"; # Did you read the comment? -} diff --git a/hosts/nemo/default.nix b/hosts/nemo/default.nix deleted file mode 100644 index 7f7c70c..0000000 --- a/hosts/nemo/default.nix +++ /dev/null @@ -1,242 +0,0 @@ -{ - lib, - config, - pkgs, - modulesPath, - ... -}: - -{ - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ./woodpecker.nix - ]; - - boot = { - extraModulePackages = with config.boot.kernelPackages; [ - nct6687d - v4l2loopback - ]; - initrd.availableKernelModules = [ - "xhci_pci" - "ahci" - "nct6687" - "nvme" - "firewire_ohci" - "usbhid" - "usb_storage" - "sd_mod" - ]; - initrd.kernelModules = [ "nct6687" ]; - kernelModules = [ - "nct6687" - "kvm-intel" - ]; - extraModprobeConfig = '' - options nct6687 force=1 - options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 - ''; - kernelParams = [ "mitigations=off" ]; - }; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/b9514f88-1c83-4596-999f-7e3640db6a86"; - fsType = "btrfs"; - options = [ - "subvol=@" - "noatime" - "nodiratime" - ]; - }; - - fileSystems."/home" = { - device = "/dev/disk/by-uuid/b9514f88-1c83-4596-999f-7e3640db6a86"; - fsType = "btrfs"; - options = [ - "subvol=@home" - "noatime" - "nodiratime" - ]; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/2670-0FCA"; - fsType = "vfat"; - options = [ - "fmask=0022" - "dmask=0022" - ]; - }; - - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - hardware.graphics = { - enable = true; - extraPackages = with pkgs; [ - vpl-gpu-rt - intel-media-driver - vaapiVdpau - libvdpau-va-gl - ]; - }; - - hardware.enableAllFirmware = true; - - swapDevices = [ ]; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - - networking = { - hostName = "nemo"; # Define your hostname. - domain = "aarn.patagia.net"; - nameservers = [ - "10.1.100.11" - "10.1.100.12" - "10.1.100.13" - ]; - firewall.enable = false; - - networkmanager.enable = false; - useDHCP = false; - - wireless.iwd = { - enable = true; - settings = { - DriverQuirks.PowerSaveDisable = "*"; - Network = { - EnableIPv6 = false; - NameResolvingService = "systemd"; - }; - Settings = { - AutoConnect = true; - }; - }; - }; - }; - - services.nscd.enableNsncd = false; - - systemd.network.enable = true; - systemd.network.networks."10-wifi" = { - matchConfig.Name = "wlan0"; - address = [ "10.1.100.20/22" ]; - gateway = [ "10.1.100.1" ]; - linkConfig.RequiredForOnline = "routable"; - }; - - # FIXME: pam_rssh is broken from rust 1.80 upgrade - security = { - pam.services.doas = - { config, ... }: - { - rules.auth.rssh = { - order = config.rules.auth.ssh_agent_auth.order - 1; - control = "sufficient"; - modulePath = "${pkgs.pam_rssh}/lib/libpam_rssh.so"; - settings.authorized_keys_command = pkgs.writeShellScript "get-authorized-keys" '' - cat "/etc/ssh/authorized_keys.d/$1" - ''; - }; - }; - }; - - services.resolved = { - enable = true; - domains = [ - "patagia.net" - "aarn.patagia.net" - ]; - llmnr = "false"; - fallbackDns = [ "9.9.9.9" ]; - }; - - services.openssh = { - enable = true; - settings = { - PasswordAuthentication = false; - PermitRootLogin = "no"; - StreamLocalBindUnlink = true; - }; - }; - - patagia = { - desktop.enable = true; - plymouth.enable = true; - podman.enable = true; - }; - - environment.systemPackages = with pkgs; [ - ffado - libcamera - lm_sensors - pam_rssh - openconnect - tpm2-tools - v4l-utils - ]; - - environment.variables = { - OTEL_EXPORTER_OTLP_ENDPOINT = "https://otel.aarn.patagia.net"; - }; - - security.tpm2 = { - enable = true; - pkcs11.enable = true; - tctiEnvironment.enable = true; - }; - - users.users.dln = { - isNormalUser = true; - description = "Daniel Lundin"; - extraGroups = [ - "tss" - "wheel" - ]; - openssh.authorizedKeys.keys = [ - "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIIHMAEZx02kbHrEygyPQYStiXlrIe6EIqBCv7anIkL0pAAAABHNzaDo= dln@dinky" - "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIJNOBFoU7Cdsgi4KpYRcv7EhR/8kD4DYjEZnwk6urRx7AAAABHNzaDo= dln@nemo" - ]; - }; - - users.users.lsjostro = { - isNormalUser = true; - description = "Lars Sjöström"; - extraGroups = [ - "tss" - "wheel" - ]; - openssh.authorizedKeys.keys = [ - "sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBJ10mLOpInoqDaySyrxbzvcOrJfLw48Y6eWHa9501lw+hEEBXya3ib7nlvpCqEQJ8aPU5fVRqpkOW5zSimCiRbwAAAAEc3NoOg==" - "sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBLpoKvsZDIQQLfgzJhe1jAQubBNxjydkj8UfdUPaSXqgfB02OypMOC1m5ZuJYcQIxox0I+4Z8xstFhYP6s8zKZwAAAAEc3NoOg==" - ]; - }; - - users.users.nixremote = { - name = "nixremote"; - isSystemUser = true; - shell = pkgs.bashInteractive; - group = "nixremote"; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEJjhHem/l3p/79Rqo3Wtk9ksxmt7Q/pkRdnXiNzP4Cf" - ]; - }; - users.groups.nixremote = { }; - - nix.sshServe.enable = true; - nix.sshServe.keys = [ - "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIIHMAEZx02kbHrEygyPQYStiXlrIe6EIqBCv7anIkL0pAAAABHNzaDo= dln@dinky" - "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIJNOBFoU7Cdsgi4KpYRcv7EhR/8kD4DYjEZnwk6urRx7AAAABHNzaDo= dln@nemo" - "sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBJ10mLOpInoqDaySyrxbzvcOrJfLw48Y6eWHa9501lw+hEEBXya3ib7nlvpCqEQJ8aPU5fVRqpkOW5zSimCiRbwAAAAEc3NoOg==" - "sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBLpoKvsZDIQQLfgzJhe1jAQubBNxjydkj8UfdUPaSXqgfB02OypMOC1m5ZuJYcQIxox0I+4Z8xstFhYP6s8zKZwAAAAEc3NoOg==" - ]; - - nix.settings.trusted-users = [ - "dln" - "lsjostro" - "nixremote" - ]; - - services.printing.enable = lib.mkForce true; - services.printing.drivers = [ pkgs.brlaser ]; - - system.stateVersion = "24.11"; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion -} diff --git a/hosts/nemo/woodpecker.nix b/hosts/nemo/woodpecker.nix deleted file mode 100644 index f3cd5ec..0000000 --- a/hosts/nemo/woodpecker.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ - config, - pkgs, - ... -}: -{ - - users.users.woodpecker = { - isSystemUser = true; - group = "woodpecker"; - extraGroups = [ - "docker" - "podman" - ]; - createHome = true; - home = "/etc/woodpecker"; - homeMode = "764"; - }; - users.groups.woodpecker = { }; - - services.woodpecker-agents.agents.docker = { - enable = true; - package = pkgs.woodpecker-agent; - environment = { - DOCKER_HOST = "unix:///run/podman/podman.sock"; - WOODPECKER_BACKEND = "docker"; - WOODPECKER_SERVER = "10.1.100.10:8300"; # forgejo-1 - WOODPECKER_MAX_WORKFLOWS = "5"; - WOODPECKER_BACKEND_DOCKER_VOLUMES = "/nix:/mnt/nix:ro"; - }; - environmentFile = [ - "/etc/woodpecker/woodpecker-agent.env" - ]; - extraGroups = [ "podman" ]; - }; - - systemd.services.woodpecker-agent-docker = { - after = [ - "podman.socket" - "woodpecker-server.service" - ]; - # restartIfChanged = false; - serviceConfig = { - User = "woodpecker"; - Group = "woodpecker"; - WorkingDirectory = "/etc/woodpecker"; - BindPaths = [ "/run/podman/podman.sock" ]; - }; - }; - -} diff --git a/hosts/pearl/apps.nix b/hosts/pearl/apps.nix deleted file mode 100644 index b856fea..0000000 --- a/hosts/pearl/apps.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ - lib, - pkgs, - ... -}: -{ - programs.firefox.enable = true; - - environment.systemPackages = with pkgs; [ - calibre - gimp - gnomeExtensions.emoji-copy - gnomeExtensions.just-perfection - gnomeExtensions.vitals - gnome-pomodoro - gnome-tweaks - hitori - inkscape - krita - moonlight-qt - obsidian - pavucontrol - plexamp - signal-desktop - ]; - - environment.gnome.excludePackages = - [ - ]; - - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - }; -} diff --git a/hosts/pearl/default.nix b/hosts/pearl/default.nix deleted file mode 100644 index 4696113..0000000 --- a/hosts/pearl/default.nix +++ /dev/null @@ -1,122 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - modulesPath, - ... -}: -{ - imports = [ - ./hardware-configuration.nix - ./apps.nix - ]; - - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - hardware.graphics = { - enable = true; - extraPackages = with pkgs; [ - vpl-gpu-rt - intel-media-driver - vaapiVdpau - libvdpau-va-gl - ]; - }; - - hardware.enableAllFirmware = true; - - services.printing.enable = true; - services.printing.drivers = [ pkgs.brlaser ]; - - networking = { - hostName = "pearl"; - domain = "aarn.patagia.net"; - search = [ - "patagia.dev" - "aarn.patagia.net" - ]; - useDHCP = lib.mkDefault true; - }; - - networking.networkmanager.enable = true; - networking.networkmanager.wifi.backend = "iwd"; - - time.timeZone = "Europe/Stockholm"; - - users.users = { - annso = { - isNormalUser = true; - description = "Ann-Sofie Stenberg"; - extraGroups = [ - "lp" - "video" - "audio" - "wheel" - ]; - }; - - dln = { - isNormalUser = true; - description = "Daniel Lundin"; - extraGroups = [ - "lp" - "wheel" - ]; - openssh.authorizedKeys.keys = [ - "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAILwakA+EeuR23vRhjvjMkzK+FtWIhpnbs7z1pfnBehCUAAAABHNzaDo= dln@dinky" - "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIJNOBFoU7Cdsgi4KpYRcv7EhR/8kD4DYjEZnwk6urRx7AAAABHNzaDo= dln@nemo" - ]; - }; - }; - - patagia = { - desktop.enable = true; - laptop.enable = true; - plymouth.enable = true; - podman.enable = false; - }; - - systemd.services."getty@tty1".enable = false; - systemd.services."autovt@tty1".enable = false; - - # Enable the X11 windowing system. - services.xserver.enable = true; - - # Enable the GNOME Desktop Environment. - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "se"; - # variant = "us"; - }; - - # Configure console keymap - console.keyMap = "sv-latin1"; - - # Enable sound with pipewire. - services.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; - }; - - nixpkgs.config.allowUnfree = true; - - services.openssh.enable = true; - - system.stateVersion = "24.05"; # Did you read the comment? -} diff --git a/hosts/pearl/hardware-configuration.nix b/hosts/pearl/hardware-configuration.nix deleted file mode 100644 index f1105d5..0000000 --- a/hosts/pearl/hardware-configuration.nix +++ /dev/null @@ -1,38 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/5ab8f3b9-4f74-4bc3-ac8e-3392a6120240"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/4C5D-8244"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - swapDevices = [ ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/justfile b/justfile deleted file mode 100644 index ccf14df..0000000 --- a/justfile +++ /dev/null @@ -1,26 +0,0 @@ -set shell := ["/usr/bin/env", "bash", "-euo", "pipefail", "-c"] - -[private] -default: - @just --list - -build: - nh os build . - -switch: - nh os switch . - -update: - nh os switch --update --ask . - -clean: - nh clean all - -home-build: - nh home build . - -home-switch: - nh home switch . - -home-update: - nh home switch --update --ask . diff --git a/overlays/default.nix b/overlays/default.nix deleted file mode 100644 index 9dd6924..0000000 --- a/overlays/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ inputs, ... }: -{ - - additions = final: _prev: import ../pkgs final.pkgs; - - modifications = final: prev: { - - # https://discourse.nixos.org/t/disable-ssh-agent-from-gnome-keyring-on-gnome/28176/5 - gnome-keyring = prev.gnome-keyring.overrideAttrs (oldAttrs: { - configureFlags = oldAttrs.configureFlags or [ ] ++ [ "--disable-ssh-agent" ]; - }); - }; - - unstable-packages = final: _prev: { - stable = import inputs.nixpkgs-stable { - system = final.system; - config.allowUnfree = true; - }; - nixpkgs-unstable = import inputs.nixpkgs-unstable { - system = final.system; - config.allowUnfree = true; - }; - }; -} diff --git a/pkgs/default.nix b/pkgs/default.nix deleted file mode 100644 index 3d0d4d6..0000000 --- a/pkgs/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -pkgs: { - gnome-ssh-askpass4 = pkgs.callPackage ./gnome-ssh-askpass4 { }; -} diff --git a/pkgs/gnome-ssh-askpass4/default.nix b/pkgs/gnome-ssh-askpass4/default.nix deleted file mode 100644 index 7247a0f..0000000 --- a/pkgs/gnome-ssh-askpass4/default.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - gcr_4, - glib, - gtk4, - pkg-config, -}: - -stdenv.mkDerivation (finalAttrs: { - pname = "gnome-ssh-askpass4"; - version = "0.0.0"; - - src = fetchFromGitHub { - name = "openssh"; - owner = "openssh"; - repo = "openssh-portable"; - rev = "5b0d9e3ed8fd407936d973990ae169cc296150f7"; - hash = "sha256-QJilKQ6weWZuf3L8yUplXwjqlzH5Ki7YeDnCh4HSuIQ="; - }; - - sourceRoot = "openssh/contrib"; - - nativeBuildInputs = [ - pkg-config - ]; - - buildInputs = [ - gcr_4 - glib - gtk4 - ]; - - strictDeps = true; - - buildPhase = ''make gnome-ssh-askpass4''; - - installPhase = ''install -Dm 755 gnome-ssh-askpass4 $out/bin/gnome-ssh-askpass4''; - - meta = with lib; { - description = "A simple SSH passphrase grabber for GNOME"; - homepage = "https://github.com/openssh/openssh-portable"; - license = licenses.bsd2; - maintainers = with maintainers; [ ]; - mainProgram = "gnome-ssh-askpass4"; - }; -})