diff --git a/flake.nix b/flake.nix index 8fae4e1..e6b7f52 100644 --- a/flake.nix +++ b/flake.nix @@ -50,11 +50,10 @@ FCS-Tristan-Nixbook = mkConf { nixos-modules = [ ./hardware/fcs-tristan-nixbook.nix - # (auto-login "Hyprland") - # ./nixos/programs/hyprland.nix ./nixos/workstation.nix ./nixos/modules/work.nix ./nixos/programs/cosmic.nix + ./nixos/programs/libvertd.nix ]; home-modules = [ ./home/programs/work.nix diff --git a/home/programs/git.nix b/home/programs/git.nix index cc5b7b7..0829c05 100644 --- a/home/programs/git.nix +++ b/home/programs/git.nix @@ -26,7 +26,7 @@ git fetch origin ''}/bin/bare-clone"; }; - delta = { + difftastic = { enable = true; }; }; diff --git a/home/programs/work.nix b/home/programs/work.nix index 803b582..09aeeb8 100644 --- a/home/programs/work.nix +++ b/home/programs/work.nix @@ -19,6 +19,7 @@ in { home.packages = [ pkgs.thunderbird pkgs.remmina + pkgs.postman (import ../../lib/mkapp.nix "slack" { inherit pkgs browser; desktopName = "Slack"; diff --git a/home/workstation.nix b/home/workstation.nix index 88ebdcf..7241379 100644 --- a/home/workstation.nix +++ b/home/workstation.nix @@ -27,6 +27,7 @@ wl-clipboard playerctl quickemu + devenv ]; services.udiskie = { diff --git a/lib/mkconf.nix b/lib/mkconf.nix index f779cdb..e8b9d34 100644 --- a/lib/mkconf.nix +++ b/lib/mkconf.nix @@ -24,6 +24,7 @@ in home-manager = { useGlobalPkgs = true; useUserPackages = true; + backupFileExtension = "bak"; users.${user}.imports = home-modules ++ [ diff --git a/lib/nixvim.nix b/lib/nixvim.nix index 221fc0c..e763d61 100644 --- a/lib/nixvim.nix +++ b/lib/nixvim.nix @@ -66,6 +66,14 @@ key = ""; action = "tabprev"; } + { + key = "bn"; + action = "bnext"; + } + { + key = "bp"; + action = "bprevious"; + } { key = "gl"; action = "g$"; @@ -155,6 +163,33 @@ } ]; + autoCmd = [{ + event = "BufWritePre"; + pattern = "*.go"; + # https://github.com/golang/tools/blob/master/gopls/doc/vim.md#imports-and-formatting + callback.__raw = '' + function() + local params = vim.lsp.util.make_range_params() + params.context = {only = {"source.organizeImports"}} + -- buf_request_sync defaults to a 1000ms timeout. Depending on your + -- machine and codebase, you may want longer. Add an additional + -- argument after params if you find that you have to write the file + -- twice for changes to be saved. + -- E.g., vim.lsp.buf_request_sync(0, "textDocument/codeAction", params, 3000) + local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params) + for cid, res in pairs(result or {}) do + for _, r in pairs(res.result or {}) do + if r.edit then + local enc = (vim.lsp.get_client_by_id(cid) or {}).offset_encoding or "utf-16" + vim.lsp.util.apply_workspace_edit(r.edit, enc) + end + end + end + vim.lsp.buf.format({async = false}) + end + ''; + }]; + plugins = { bufferline.enable = true; web-devicons.enable = true; @@ -188,6 +223,7 @@ servers = { ts-ls.enable = true; nil-ls.enable = true; + yamlls.enable = true; gopls.enable = true; }; keymaps = { diff --git a/nixos/default.nix b/nixos/default.nix index 68a84c1..793d0d7 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -96,6 +96,7 @@ in { unzip fzf sops + lsof ]; boot.kernel.sysctl = { diff --git a/nixos/modules/work.nix b/nixos/modules/work.nix index 675ac39..24d9b2d 100644 --- a/nixos/modules/work.nix +++ b/nixos/modules/work.nix @@ -11,6 +11,7 @@ in { # nonfree vscode required for dev containers "vscode" "steam-run" + "postman" ]; nixpkgs.config.permittedInsecurePackages = [ diff --git a/nixos/programs/libvertd.nix b/nixos/programs/libvertd.nix new file mode 100644 index 0000000..b7500d9 --- /dev/null +++ b/nixos/programs/libvertd.nix @@ -0,0 +1,14 @@ +{config, ...}: let + user = config.user; +in +{ + users.users.${user}.extraGroups = ["libvirtd" "kvm"]; + virtualisation.libvirtd = { + enable = true; + nss = { + enable = true; + enableGuest = true; + }; + }; + programs.virt-manager.enable = true; +}