all repos — dotfiles @ 1193fa3e65b00a35e0d50f136fe0ae09b0bd3bde

my *nix dotfiles

nix: /boot is clapped
Anirudh Oppiliappan x@icyphox.sh
Wed, 30 Mar 2022 10:48:16 +0530
commit

1193fa3e65b00a35e0d50f136fe0ae09b0bd3bde

parent

a96131ac76676586934e00e8e21af42538f85f8c

M config/nvim/ftplugin/go.vimconfig/nvim/ftplugin/go.vim

@@ -5,48 +5,5 @@ setlocal smarttab

setlocal formatoptions=croql setlocal tabstop=4 -" stolen from https://go.googlesource.com/go/+/c4f5421/misc/vim/ftplugin/go/fmt.vim - -if exists("b:did_ftplugin_go_fmt") - finish -endif -if !exists("g:go_fmt_commands") - let g:go_fmt_commands = 1 -endif -if !exists("g:gofmt_command") - if executable("goimports") - let g:gofmt_command = "goimports" - else - let g:gofmt_command = "gofmt" - endif -endif -if g:go_fmt_commands - command! -buffer Fmt call s:GoFormat() -endif -function! s:GoFormat() - let view = winsaveview() - silent execute "%!" . g:gofmt_command - if v:shell_error - let errors = [] - for line in getline(1, line('$')) - let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)') - if !empty(tokens) - call add(errors, {"filename": @%, - \"lnum": tokens[2], - \"col": tokens[3], - \"text": tokens[4]}) - endif - endfor - if empty(errors) - % | " Couldn't detect gofmt error format, output errors - endif - undo - if !empty(errors) - call setloclist(0, errors, 'r') - endif - echohl Error | echomsg "Gofmt returned error" | echohl None - endif - call winrestview(view) -endfunction -let b:did_ftplugin_go_fmt = 1 -" vim:ts=4:sw=4:et +autocmd BufWritePre *.go lua vim.lsp.buf.formatting() +autocmd BufWritePre *.go lua goimports(1000)
M config/nvim/lua/lsp/config.luaconfig/nvim/lua/lsp/config.lua

@@ -9,3 +9,7 @@

-- hover for diagnostic vim.opt.updatetime = 250 vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(bor, {focus=false, border='rounded'})]] + +vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { + border = "rounded", +})
M config/nvim/lua/lsp/go.luaconfig/nvim/lua/lsp/go.lua

@@ -1,3 +1,43 @@

require('lspconfig').gopls.setup { - on_attach = require('maps').on_attach + filetypes = { 'go', 'gomod' }, + gopls = { + experimentalPostfixCompletions = true, + analyses = { + unusedparams = true, + shadow = true, + }, + staticcheck = true, + }, + on_attach = require('maps').on_attach, } + + +function goimports(timeout) + local context = { source = { organizeImports = true } } + vim.validate { context = { context, "t", true } } + + local params = vim.lsp.util.make_range_params() + params.context = context + + -- See the implementation of the textDocument/codeAction callback + -- (lua/vim/lsp/handler.lua) for how to do this properly. + local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params, timeout_ms) + if not result or next(result) == nil then return end + local actions = result[1].result + if not actions then return end + local action = actions[1] + + -- textDocument/codeAction can return either Command[] or CodeAction[]. If it + -- is a CodeAction, it can have either an edit, a command or both. Edits + -- should be executed first. + if action.edit or type(action.command) == "table" then + if action.edit then + vim.lsp.util.apply_workspace_edit(action.edit) + end + if type(action.command) == "table" then + vim.lsp.buf.execute_command(action.command) + end + else + vim.lsp.buf.execute_command(action) + end +end
M config/nvim/lua/maps.luaconfig/nvim/lua/maps.lua

@@ -74,6 +74,18 @@ local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end

buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', options) buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', options) + buf_set_keymap('n', 'ga', '<Cmd>lua vim.lsp.buf.code_action()<CR>', options) + buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', options) + buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', options) + buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', options) + buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', options) + buf_set_keymap('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', options) + + if client.resolved_capabilities.document_formatting then + buf_set_keymap('n', 'ff', '<cmd>lua vim.lsp.buf.formatting()<CR>', options) + elseif client.resolved_capabilities.document_range_formatting then + buf_set_keymap('n', 'ff', '<cmd>lua vim.lsp.buf.range_formatting()<CR>', options) + end end vim.api.nvim_exec([[
D config/nvim/plugin/go.vim

@@ -1,1 +0,0 @@

-autocmd BufWritePre *.go Fmt
M home/.xmodmaphome/.xmodmap

@@ -1,6 +1,3 @@

-! the iceman layout -! workman, with the f and b swapped - keycode 49 = grave asciitilde dead_tilde asciitilde keycode 10 = 1 exclam exclamdown onesuperior keycode 11 = 2 at masculine twosuperior

@@ -54,7 +51,7 @@ keycode 61 = slash question questiondown asciitilde

keycode 66 = Multi_key keycode 66 = Mode_switch -keycode 64 = Alt_L +keycode 64 = Alt_L keycode 94 = minus underscore endash emdash keycode 65 = space space space nobreakspace
M nix/flake.locknix/flake.lock

@@ -25,11 +25,11 @@ },

"flake-compat": { "flake": false, "locked": { - "lastModified": 1641205782, - "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", + "lastModified": 1648199409, + "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", "owner": "edolstra", "repo": "flake-compat", - "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", "type": "github" }, "original": {

@@ -102,11 +102,11 @@ "neovim-flake": "neovim-flake",

"nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1647159229, - "narHash": "sha256-aGawpstqvThlV5OWqCAFIFBc8apYvMT/Qwig111coSo=", + "lastModified": 1648542057, + "narHash": "sha256-jAoVaba+0Pxcds6eDCrLdBudEHy1HH3lirO/SWblSA4=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "4cf0e4a5738fb247f191a35c7c3900c4f06caca3", + "rev": "1426368bbc2137e735fbfcbb30b1ae3fe291f670", "type": "github" }, "original": {

@@ -125,11 +125,11 @@ ]

}, "locked": { "dir": "contrib", - "lastModified": 1647152497, - "narHash": "sha256-KNqAdyM0DQPSqb/low6Py9eUBQjfga0KAHAF6naMd7Y=", + "lastModified": 1648532309, + "narHash": "sha256-3SMmIGuGfpnVxjbuTXZBFgrJoIgetb9eY8bWExYEK9I=", "owner": "neovim", "repo": "neovim", - "rev": "c9b94188d5f96349566372e8a0ce94e14fd6b549", + "rev": "d89a80fafc6cdf12f72dac2bcbd5055038a241dc", "type": "github" }, "original": {

@@ -156,11 +156,11 @@ }

}, "nixpkgs": { "locked": { - "lastModified": 1646939531, - "narHash": "sha256-bxOjVqcsccCNm+jSmEh/bm0tqfE3SdjwS+p+FZja3ho=", + "lastModified": 1648390671, + "narHash": "sha256-u69opCeHUx3CsdIerD0wVSR+DjfDQjnztObqfk9Trqc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "fcd48a5a0693f016a5c370460d0c2a8243b882dc", + "rev": "ce8cbe3c01fd8ee2de526ccd84bbf9b82397a510", "type": "github" }, "original": {
M nix/home.nixnix/home.nix

@@ -11,6 +11,7 @@ imports = [

./programs ./services ./x + ./mail.nix ]; home.stateVersion = "21.05";

@@ -37,6 +38,7 @@ noto-fonts-emoji

jq yq sxiv + feh st fzy xorg.xmodmap

@@ -45,6 +47,8 @@ slack

nixpkgs-fmt libnotify signal-desktop + aerc + calibre ] ++ (import ./bin { inherit pkgs theme; });
M nix/hosts/lapis/configuration.nixnix/hosts/lapis/configuration.nix

@@ -12,12 +12,20 @@ boot.kernel.sysctl."net.ipv4.ip_forward" = 1;

networking = { nameservers = [ "1.1.1.1" "1.0.0.1" ]; - networkmanager = { + wireless = { enable = true; - insertNameservers = [ "1.1.1.1" "1.0.0.1" ]; - wifi.backend = "iwd"; + interfaces = [ "wlan0" ]; + environmentFile = "/home/icy/secrets/wireless.env"; + networks = { + Sanic.psk = "@PSK_SANI@"; + Gopalan.psk = "@PSK_GOPA@"; + }; + extraConfig = '' + ctrl_interface=/run/wpa_supplicant + ctrl_interface_group=wheel + ''; }; - dhcpcd.enable = false; + # dhcpcd.enable = true; hostName = "lapis"; useDHCP = false; interfaces.wlan0.useDHCP = true;
A nix/mail.nix

@@ -0,0 +1,37 @@

+{ config +, lib +, pkgs +, ... +}: + +{ + accounts.email.maildirBasePath = "mail"; + accounts.email.accounts."x@icyphox.sh" = { + address = "x@icyphox.sh"; + imap = { + host = "imap.migadu.com"; + port = 993; + }; + maildir = { + path = "personal"; + }; + mbsync = { + enable = true; + create = "maildir"; + expunge = "maildir"; + }; + primary = true; + passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty -d /home/icy/.pw/default.gpg"; + realName = "Anirudh Oppiliappan"; + userName = "x@icyphox.sh"; + signature = { + text = '' + + -- + Anirudh Oppiliappan + https://icyphox.sh + ''; + }; + }; +} +
M nix/programs/default.nixnix/programs/default.nix

@@ -19,9 +19,8 @@ ./firefox.nix

]; programs = { - # msmtp.enable = true; home-manager.enable = true; - mbsync.enable = false; + mbsync.enable = true; direnv = { enable = true; enableBashIntegration = true;
M nix/programs/neovim.nixnix/programs/neovim.nix

@@ -27,7 +27,6 @@ vim-surround

targets-vim vim-gitgutter vim-rsi - vim-go vim-jsonnet ]; };
M nix/services/mbsync.nixnix/services/mbsync.nix

@@ -6,6 +6,6 @@

{ services.mbsync = { enable = true; - frequency = "*:0/15"; + frequency = "*:0/2"; }; }
M weechat/irc.confweechat/irc.conf

@@ -19,10 +19,12 @@ color_nicks_in_nicklist = off

color_nicks_in_server_messages = on color_pv_nick_like_channel = on ctcp_time_format = "%a, %d %b %Y %T %z" +display_account_message = on display_away = local display_ctcp_blocked = on display_ctcp_reply = on display_ctcp_unknown = on +display_extended_join = on display_host_join = on display_host_join_local = on display_host_quit = on

@@ -68,6 +70,8 @@ smart_filter_nick = on

smart_filter_quit = on temporary_servers = off topic_strip_colors = off +typing_status_nicks = off +typing_status_self = off [color] input_nick = lightcyan
M weechat/sec.confweechat/sec.conf

@@ -17,4 +17,4 @@ salt = on

[data] __passphrase__ = on -znc = "B1E89E2569FC8D731C495E04652A3119F2F1D8FDB26C83F0F2710266897B283D2F7D79DE1A5B778FE53A94572D63C73A8CC821" +znc = "FF98D677A3058F3C1EF738A67E0DF87F2B4435EE1DB9CC666645C67950B0D14092D45D8FC473ED92804DD460A97F37940262E2"
M weechat/weechat.confweechat/weechat.conf

@@ -400,28 +400,13 @@ title.type = window

[layout] default.buffer = "core;weechat;1" -default.buffer = "python;slack.ory-hq;2" -default.buffer = "python;slack.ory-hq.#all-hands;3" -default.buffer = "python;slack.ory-hq.#allgemein;4" -default.buffer = "python;slack.ory-hq.#demo-friday;5" -default.buffer = "python;slack.ory-hq.#dev;6" -default.buffer = "python;slack.ory-hq.#release-automation;7" -default.buffer = "python;slack.ory-hq.#sre;8" -default.buffer = "python;slack.ory-hq.#sre-production-notifications;9" -default.buffer = "python;slack.ory-hq.#standup-product;10" -default.buffer = "python;slack.ory-hq.AdamWałach;11" -default.buffer = "python;slack.ory-hq.aeneas;12" -default.buffer = "python;slack.ory-hq.AlanoTerblanche;13" -default.buffer = "python;slack.ory-hq.AndreasBucksteeg;14" -default.buffer = "python;slack.ory-hq.anirudh;15" -default.buffer = "python;slack.ory-hq.demonsthere;16" -default.buffer = "python;slack.ory-hq.GrantZvolský;17" -default.buffer = "python;slack.ory-hq.LeonieHabermann;18" -default.buffer = "python;slack.ory-hq.Patrik;19" -default.buffer = "python;slack.ory-hq.PM;20" -default.buffer = "python;slack.ory-hq.Slackbot;21" -default.buffer = "python;slack.ory-hq.tacurran;22" -default.buffer = "python;slack.ory-hq.Vincent;23" +default.buffer = "irc;server.rizon;2" +default.buffer = "irc;rizon.#buddy;3" +default.buffer = "irc;rizon.#rice;4" +default.buffer = "irc;rizon.#taigobot-test;5" +default.buffer = "irc;rizon.#homescreen;6" +default.buffer = "irc;rizon.#bullshit;7" +default.buffer = "irc;rizon.*clientbuffer;8" default.window = "1;0;0;0;irc;rizon.Carp" default.current = on