diff --git a/flake.lock b/flake.lock index 582ddc8d..9bc76b5e 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1648827187, - "narHash": "sha256-lNQqw80uMiUb1GgD4QTCc4bsAXPk7/jwH70J9/0e+QA=", + "lastModified": 1650836336, + "narHash": "sha256-W9NfDZVSBrmiURX3LUQOp6McJMEqpw6njC1/vtRLp+M=", "owner": "rycee", "repo": "home-manager", - "rev": "e1fab012e872c129099535b5b535fc2347cfa6f4", + "rev": "09f3e67950823d5abe192e474f1af51914f4cb9a", "type": "github" }, "original": { @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1648632716, - "narHash": "sha256-kCmnDeiaMsdhfnNKjxdOzwRh2H6eQb8yWAL+nNabC/Y=", + "lastModified": 1650831523, + "narHash": "sha256-6pDZ08SAXsUx5rOP391x+TG39ENP/XA8VMa1tQvgEjc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "710fed5a2483f945b14f4a58af2cd3676b42d8c8", + "rev": "87d34a6b8982e901b8e50096b8e79ebc0e66cda0", "type": "github" }, "original": { diff --git a/hardware/pulseaudio.nix b/hardware/pulseaudio.nix index ed61ca7c..eb87982d 100644 --- a/hardware/pulseaudio.nix +++ b/hardware/pulseaudio.nix @@ -25,7 +25,6 @@ in pulseaudio = { enable = true; package = pkgs.pulseaudioFull; # JACK support, Bluetooth - extraModules = [ pkgs.pulseaudio-modules-bt ]; # auto-switch to bluetooth headset extraConfig = lib.mkDefault "load-module module-switch-on-connect"; }; diff --git a/packages/3d-print.nix b/packages/3d-print.nix index 87155934..4ce7b2b7 100644 --- a/packages/3d-print.nix +++ b/packages/3d-print.nix @@ -9,6 +9,6 @@ # programmatic cads openscad - libfive + # libfive ]; } diff --git a/readme.md b/readme.md index 9eb3bd54..6349d1ab 100644 --- a/readme.md +++ b/readme.md @@ -31,7 +31,7 @@ This repo is just a bunch of NixOS modules, so you can pick or override anything ## Hardware Engineering -* programmatic cads: libfive, openscad +* programmatic cads: openscad * slicers for 3d printer: prusa-slicer, cura * circuit diagrams: librepcb, fritzing * [platformio-cli](https://jeelabs.org/2018/getting-started-bp/) diff --git a/services/vpn/surfshark/de-ber.prod.surfshark.com_udp.ovpn b/services/vpn/surfshark/de-ber.prod.surfshark.com_udp.ovpn index 90e44268..18ecf8ee 100644 --- a/services/vpn/surfshark/de-ber.prod.surfshark.com_udp.ovpn +++ b/services/vpn/surfshark/de-ber.prod.surfshark.com_udp.ovpn @@ -17,7 +17,7 @@ reneg-sec 0 remote-cert-tls server -auth-user-pass /etc/nixos/services/vpn/surfshark/auth.txt /etc/nixos/services/vpn/surfshark/auth.txt +auth-user-pass /etc/nixos/services/vpn/surfshark/auth.txt #comp-lzo verb 3 diff --git a/services/vpn/surfshark/fr-par.prod.surfshark.com_udp.ovpn b/services/vpn/surfshark/fr-par.prod.surfshark.com_udp.ovpn index 5f2fc515..bac9ac04 100644 --- a/services/vpn/surfshark/fr-par.prod.surfshark.com_udp.ovpn +++ b/services/vpn/surfshark/fr-par.prod.surfshark.com_udp.ovpn @@ -17,7 +17,7 @@ reneg-sec 0 remote-cert-tls server -auth-user-pass /etc/nixos/services/vpn/surfshark/auth.txt /etc/nixos/services/vpn/surfshark/auth.txt +auth-user-pass /etc/nixos/services/vpn/surfshark/auth.txt #comp-lzo verb 3 diff --git a/services/vpn/surfshark/uk-lon.prod.surfshark.com_udp.ovpn b/services/vpn/surfshark/uk-lon.prod.surfshark.com_udp.ovpn index c513c120..34f10b39 100644 --- a/services/vpn/surfshark/uk-lon.prod.surfshark.com_udp.ovpn +++ b/services/vpn/surfshark/uk-lon.prod.surfshark.com_udp.ovpn @@ -17,7 +17,7 @@ reneg-sec 0 remote-cert-tls server -auth-user-pass /etc/nixos/services/vpn/surfshark/auth.txt /etc/nixos/services/vpn/surfshark/auth.txt +auth-user-pass /etc/nixos/services/vpn/surfshark/auth.txt #comp-lzo verb 3 diff --git a/sys/aliases.nix b/sys/aliases.nix index a1a96623..80d15ac2 100644 --- a/sys/aliases.nix +++ b/sys/aliases.nix @@ -36,7 +36,8 @@ # nix e = "nvim /etc/nixos/configuration.nix"; - b = "sudo nixos-rebuild switch --keep-going"; + # hack for https://github.com/NixOS/nixpkgs/issues/169193 + b = "nixos-rebuild switch --use-remote-sudo"; search = "nix search nixpkgs"; wipe-user-packages = "nix-env -e '*'"; nix-gc = "sudo nix-collect-garbage --delete-older-than 30d"; diff --git a/users/shared/.config/nvim/lua/config.lua b/users/shared/.config/nvim/lua/config.lua index 3a4e76d3..172a1edc 100644 --- a/users/shared/.config/nvim/lua/config.lua +++ b/users/shared/.config/nvim/lua/config.lua @@ -2,91 +2,91 @@ local lspconfig = require('lspconfig') local g = vim.g local prettier = { - formatCommand = 'prettier --stdin-filepath ${INPUT}', - formatStdin = true + formatCommand = 'prettier --stdin-filepath ${INPUT}', + formatStdin = true +} +local luaformatter = { + formatCommand = 'lua-format -i --indent-width=2', + formatStdin = true } -local luaformatter = {formatCommand = 'lua-format -i', formatStdin = true} require'navigator'.setup({ - treesitter_analysis = true, - icons = { - code_action_icon = '🔨', - diagnostic_err = '●', - diagnostic_warn = '●', - diagnostic_info = [[●]], - diagnostic_hint = [[●]], - diagnostic_virtual_text = '' + treesitter_analysis = true, + icons = { + code_action_icon = '🔨', + diagnostic_err = '●', + diagnostic_warn = '●', + diagnostic_info = [[●]], + diagnostic_hint = [[●]], + diagnostic_virtual_text = '' + }, + lsp = { + diagnostic_scrollbar_sign = false, + disable_format_cap = {"tsserver", "sumneko_lua"}, + disable_lsp = {"flow", "vuels", "denols"}, + tsserver = { + on_attach = function(client) + client.resolved_capabilities.document_formatting = false + client.resolved_capabilities.range_formatting = false + end, + + handlers = {['textDocument/publishDiagnostics'] = function(...) end} }, - lsp = { - diagnostic_scrollbar_sign = false, - disable_format_cap = {"tsserver", "sumneko_lua"}, - disable_lsp = {"flow", "vuels", "denols"}, - tsserver = { - on_attach = function(client) - client.resolved_capabilities.document_formatting = false - client.resolved_capabilities.range_formatting = false - end, - - handlers = {['textDocument/publishDiagnostics'] = function(...) end} - }, - efm = { - on_attach = function(client) - client.resolved_capabilities.document_formatting = true - end, - init_options = {codeAction = true, document_formatting = true}, - root_dir = lspconfig.util.root_pattern({'.git/', 'package.json'}), - - filetypes = {"css", "html", "json", "lua", "markdown"}, - settings = { - log_level = 1, - log_file = '~/efm.log', - languages = { - css = {prettier}, - html = {prettier}, - json = {prettier}, - lua = {luaformatter}, - markdown = {prettier} - } - } + efm = { + on_attach = function(client) + client.resolved_capabilities.document_formatting = true + end, + init_options = {codeAction = true, document_formatting = true}, + root_dir = lspconfig.util.root_pattern({'.git/', 'package.json'}), + + filetypes = {"css", "html", "json", "lua", "markdown"}, + settings = { + log_level = 1, + log_file = '~/efm.log', + languages = { + css = {prettier}, + html = {prettier}, + json = {prettier}, + lua = {luaformatter}, + markdown = {prettier} } + } } + } }) local cmp = require 'cmp' cmp.setup({ - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. - end - }, - mapping = { - [''] = cmp.mapping(cmp.mapping.scroll_docs(-4), {'i', 'c'}), - [''] = cmp.mapping(cmp.mapping.scroll_docs(4), {'i', 'c'}), - [''] = cmp.mapping(cmp.mapping.complete(), {'i', 'c'}), - [''] = cmp.mapping({ - i = cmp.mapping.abort(), - c = cmp.mapping.close() - }), - [''] = cmp.mapping.confirm({select = true}) -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }, - sources = cmp.config.sources({ - {name = 'nvim_lsp'}, {name = 'vsnip'} -- For vsnip users. - }, {{name = 'buffer'}}) + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + end + }, + mapping = { + [''] = cmp.mapping(cmp.mapping.scroll_docs(-4), {'i', 'c'}), + [''] = cmp.mapping(cmp.mapping.scroll_docs(4), {'i', 'c'}), + [''] = cmp.mapping(cmp.mapping.complete(), {'i', 'c'}), + [''] = cmp.mapping({i = cmp.mapping.abort(), c = cmp.mapping.close()}), + [''] = cmp.mapping.confirm({select = true}) -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }, + sources = cmp.config.sources({ + {name = 'nvim_lsp'}, {name = 'vsnip'} -- For vsnip users. + }, {{name = 'buffer'}}) }) -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline(':', { - sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}}) + sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}}) }) local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp .protocol .make_client_capabilities()) require'lspconfig'.elixirls.setup { - cmd = {"/run/current-system/sw/bin/elixir-ls"}, - capabilities = capabilities + cmd = {"/run/current-system/sw/bin/elixir-ls"}, + capabilities = capabilities } vim.api.nvim_command( @@ -97,110 +97,103 @@ vim.api.nvim_command("au BufWritePre *.js,*.vue EslintFixAll") require'lspconfig'.rnix.setup {capabilities = capabilities} require'lspconfig'.eslint.setup { - on_attach = function(client) - client.resolved_capabilities.completion = false - client.resolved_capabilities.document_formatting = true - client.resolved_capabilities.range_formatting = true - end + on_attach = function(client) + client.resolved_capabilities.completion = false + client.resolved_capabilities.document_formatting = true + client.resolved_capabilities.range_formatting = true + end } require'lualine'.setup { - options = { - icons_enabled = true, - component_separators = {left = '', right = ''}, - section_separators = {left = '', right = ''}, - always_divide_middle = false + options = { + icons_enabled = true, + component_separators = {left = '', right = ''}, + section_separators = {left = '', right = ''}, + always_divide_middle = false + }, + sections = { + lualine_a = { + { + 'filename', + symbols = {modified = ' + ', readonly = '  ', unnamed = 'No Name'} + } }, - sections = { - lualine_a = { - { - 'filename', - symbols = { - modified = ' + ', - readonly = '  ', - unnamed = 'No Name' - } - } - }, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = { - { - 'diagnostics', - symbols = { - error = '● ', - warn = '● ', - info = '● ', - hint = '● ' - } - } - }, - lualine_z = {'branch'} + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = { + { + 'diagnostics', + symbols = {error = '● ', warn = '● ', info = '● ', hint = '● '} + } }, - inactive_sections = { - lualine_a = { - { - 'filename', - symbols = { - modified = ' + ', - readonly = '  ', - unnamed = 'No Name' - } - } - }, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {} + lualine_z = {'branch'} + }, + inactive_sections = { + lualine_a = { + { + 'filename', + symbols = {modified = ' + ', readonly = '  ', unnamed = 'No Name'} + } }, - tabline = {}, - extensions = {} + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + extensions = {} } -g.nvim_tree_show_icons = {git = 1, folders = 0, files = 0, folder_arrows = 1} +g.nvim_tree_show_icons = {git = 1, folders = 1, files = 0, folder_arrows = 0} local tree_cb = require'nvim-tree.config'.nvim_tree_callback local list = { - {key = {"", "o", "<2-LeftMouse>"}, cb = tree_cb("edit")}, - {key = {"g"}, cb = tree_cb("cd")}, {key = "", cb = tree_cb("vsplit")}, - {key = "", cb = tree_cb("split")}, - {key = "", cb = tree_cb("tabnew")}, - {key = "<", cb = tree_cb("prev_sibling")}, - {key = ">", cb = tree_cb("next_sibling")}, - {key = "P", cb = tree_cb("parent_node")}, - {key = "", cb = tree_cb("close_node")}, - {key = "", cb = tree_cb("preview")}, - {key = "K", cb = tree_cb("first_sibling")}, - {key = "J", cb = tree_cb("last_sibling")}, - {key = "I", cb = tree_cb("toggle_ignored")}, - {key = "H", cb = tree_cb("toggle_dotfiles")}, - {key = "R", cb = tree_cb("refresh")}, {key = "a", cb = tree_cb("create")}, - {key = "d", cb = tree_cb("remove")}, {key = "D", cb = tree_cb("trash")}, - {key = "r", cb = tree_cb("rename")}, - {key = "", cb = tree_cb("full_rename")}, - {key = "x", cb = tree_cb("cut")}, {key = "c", cb = tree_cb("copy")}, - {key = "p", cb = tree_cb("paste")}, {key = "y", cb = tree_cb("copy_name")}, - {key = "Y", cb = tree_cb("copy_path")}, - {key = "y", cb = tree_cb("copy_absolute_path")}, - {key = "[c", cb = tree_cb("prev_git_item")}, - {key = "]c", cb = tree_cb("next_git_item")}, - {key = "u", cb = tree_cb("dir_up")}, - {key = "s", cb = tree_cb("system_open")}, - {key = "q", cb = tree_cb("close")}, {key = "?", cb = tree_cb("toggle_help")} + {key = {"", "o", "<2-LeftMouse>"}, cb = tree_cb("edit")}, + {key = {"g"}, cb = tree_cb("cd")}, {key = "", cb = tree_cb("vsplit")}, + {key = "", cb = tree_cb("split")}, + {key = "", cb = tree_cb("tabnew")}, + {key = "<", cb = tree_cb("prev_sibling")}, + {key = ">", cb = tree_cb("next_sibling")}, + {key = "P", cb = tree_cb("parent_node")}, + {key = "", cb = tree_cb("close_node")}, + {key = "", cb = tree_cb("preview")}, + {key = "K", cb = tree_cb("first_sibling")}, + {key = "J", cb = tree_cb("last_sibling")}, + {key = "I", cb = tree_cb("toggle_ignored")}, + {key = "H", cb = tree_cb("toggle_dotfiles")}, + {key = "R", cb = tree_cb("refresh")}, {key = "a", cb = tree_cb("create")}, + {key = "d", cb = tree_cb("remove")}, {key = "D", cb = tree_cb("trash")}, + {key = "r", cb = tree_cb("rename")}, + {key = "", cb = tree_cb("full_rename")}, + {key = "x", cb = tree_cb("cut")}, {key = "c", cb = tree_cb("copy")}, + {key = "p", cb = tree_cb("paste")}, {key = "y", cb = tree_cb("copy_name")}, + {key = "Y", cb = tree_cb("copy_path")}, + {key = "y", cb = tree_cb("copy_absolute_path")}, + {key = "[c", cb = tree_cb("prev_git_item")}, + {key = "]c", cb = tree_cb("next_git_item")}, + {key = "u", cb = tree_cb("dir_up")}, {key = "s", cb = tree_cb("system_open")}, + {key = "q", cb = tree_cb("close")}, {key = "?", cb = tree_cb("toggle_help")} } require'nvim-tree'.setup { - view = { - hide_root_folder = false, - side = 'left', - auto_resize = false, - number = false, - relativenumber = false, - signcolumn = "yes", - mappings = {custom_only = false, list = list} + view = { + hide_root_folder = false, + side = 'left', + auto_resize = false, + number = false, + relativenumber = false, + signcolumn = "yes", + mappings = {custom_only = false, list = list} + }, + actions = { + open_file = { + quit_on_open = false, + resize_window = false, + window_picker = {enable = false} } + } } require'telescope'.setup {pickers = {find_files = {hidden = true}}}