From 92c82ca8c64103c26c3b26d653ecd8de05c081f7 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Fri, 15 Dec 2023 00:26:06 +0100 Subject: [PATCH] update to NixOS 23.11 --- configuration.nix | 2 +- jobs.nix | 2 ++ neovim.nix | 52 +++++++++++++++++++++++++++++------------------ packages.nix | 2 +- 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/configuration.nix b/configuration.nix index ee7de8e..3626694 100644 --- a/configuration.nix +++ b/configuration.nix @@ -76,7 +76,7 @@ users.users ={ # Only needed for local (read emergency) shell access - root.passwordFile = config.secrets.passwords.root; + root.hashedPasswordFile = config.secrets.passwords.root; # Admin rnhmjoj = { diff --git a/jobs.nix b/jobs.nix index 665aa55..5cd143f 100644 --- a/jobs.nix +++ b/jobs.nix @@ -55,6 +55,8 @@ with lib; ''; }; + system.fsPackages = [ pkgs.nfs-utils ]; + systemd.mounts = lib.singleton { description = "backup NFS volume"; diff --git a/neovim.nix b/neovim.nix index 25af9c4..360dfb2 100644 --- a/neovim.nix +++ b/neovim.nix @@ -16,9 +16,10 @@ let # Syntax vim-pandoc-syntax - nix-queries + nix-queries fortran-queries (nvim-treesitter.withPlugins (p: with p; [ bash fish + fortran haskell html css markdown nix python ])) @@ -44,6 +45,8 @@ let nix-queries = pkgs.writeTextDir "/queries/nix/injections.scm" '' + ;; extends + ; /*language*/ highlight (too slow) ; ((comment) @language ; [ @@ -66,6 +69,14 @@ let @combined ''; + fortran-queries = pkgs.writeTextDir "/queries/fortran/highlights.scm" + '' + ;; extends + + (end_block_construct_statement) @keyword + (implicit_statement) @keyword + ''; + conf = pkgs.writeText "init.lua" '' local opt = vim.opt local cmd = vim.api.nvim_command @@ -87,10 +98,11 @@ let opt.shadafile = cache..'/shada' opt.undodir = cache..'/undo' - opt.hidden = true -- Hide buffers - opt.mouse = 'a' -- Enable mouse support - opt.ignorecase = true -- Case insensitive search... - opt.smartcase = true -- ...for lowercase terms + opt.hidden = true -- Hide buffers + opt.mouse = 'a' -- Enable mouse support + opt.ignorecase = true -- Case insensitive search... + opt.smartcase = true -- ...for lowercase terms + opt.splitkeep = 'screen' -- keep text still when splitting opt.fsync = true -- Sync writes opt.swapfile = false -- Disable swap files @@ -160,9 +172,10 @@ let -- -- Hide some UI elements - autocmd('TermOpen', {pattern='*', command='setlocal nonumber'}) - autocmd('TermEnter', {pattern='*', command='set noshowcmd'}) - autocmd('TermLeave', {pattern='*', command='set showcmd'}) + autocmd('TermOpen', {pattern='*', command='setlocal nonumber'}) + autocmd('TermEnter', {pattern='*', command='set noshowcmd'}) + autocmd('TermLeave', {pattern='*', command='set showcmd'}) + autocmd('VimResized', {pattern='*', command='wincmd ='}) -- Exit without confirmation autocmd('TermClose', {pattern='*', command='call feedkeys("\\")'}) @@ -315,25 +328,24 @@ let vim.g.neomake_error_sign = {text='E→', texthl='ErrorMsg'} vim.g.neomake_highlight_lines = 1 vim.g.neomake_virtualtext_current_error = 0 + vim.g.neomake_fortran_gfortran_args = + {'-fsyntax-only', '-Wall', '-Wextra', '-Jbuild/obj'} -- Pandoc Markdown autocmd({'BufNewFile', 'BufFilePre', 'BufRead'}, {pattern='*.md', command='set filetype=markdown.pandoc'}) -- Git signs - require'gitsigns'.setup{ - signs={ - add = {hl='GitAdd' , text='+'}, - change = {hl='GitChange', text='δ'}, - delete = {hl='GitDelete', text='-'}, - topdelete = {hl='GitDelete', text='‾'}, - changedelete = {hl='GitChange', text='~'}, - }, - keymaps={ - ['n gb'] = ':lua require"gitsigns".blame_line(true)', - ['n gp'] = ':lua require"gitsigns".preview_hunk()', - } + gitsigns = require'gitsigns' + gitsigns.setup{signs={ + add = {hl='GitAdd' , text='+'}, + change = {hl='GitChange', text='δ'}, + delete = {hl='GitDelete', text='-'}, + topdelete = {hl='GitDelete', text='‾'}, + changedelete = {hl='GitChange', text='~'}} } + keymap('n', 'gb', function() gitsigns.blame_line{full=true} end, {silent=true}) + keymap('n', 'gp', function() gitsigns.preview_hunk() end, {silent=true}) -- Tree-sitter require'nvim-treesitter.configs'.setup{ diff --git a/packages.nix b/packages.nix index 187b3eb..b1e9910 100644 --- a/packages.nix +++ b/packages.nix @@ -26,7 +26,7 @@ smartmontools # namecoin - namecoin haskellPackages.rosa + namecoind haskellPackages.rosa ]; }