nixbook: add postman, gofmt, difftastic

This commit is contained in:
tristan 2024-10-24 10:45:15 +01:00
parent 825381f98b
commit a8c80aa3d5
9 changed files with 57 additions and 3 deletions

View file

@ -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

View file

@ -26,7 +26,7 @@
git fetch origin
''}/bin/bare-clone";
};
delta = {
difftastic = {
enable = true;
};
};

View file

@ -19,6 +19,7 @@ in {
home.packages = [
pkgs.thunderbird
pkgs.remmina
pkgs.postman
(import ../../lib/mkapp.nix "slack" {
inherit pkgs browser;
desktopName = "Slack";

View file

@ -27,6 +27,7 @@
wl-clipboard
playerctl
quickemu
devenv
];
services.udiskie = {

View file

@ -24,6 +24,7 @@ in
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "bak";
users.${user}.imports =
home-modules
++ [

View file

@ -66,6 +66,14 @@
key = "<C-S-Tab>";
action = "<CMD>tabprev<CR>";
}
{
key = "<leader>bn";
action = "<CMD>bnext<CR>";
}
{
key = "<leader>bp";
action = "<CMD>bprevious<CR>";
}
{
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 = {

View file

@ -96,6 +96,7 @@ in {
unzip
fzf
sops
lsof
];
boot.kernel.sysctl = {

View file

@ -11,6 +11,7 @@ in {
# nonfree vscode required for dev containers
"vscode"
"steam-run"
"postman"
];
nixpkgs.config.permittedInsecurePackages = [

View file

@ -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;
}