nixbook: git config, nixd, format

This commit is contained in:
tristan 2024-10-23 22:53:02 +01:00
parent 7322eaeb6f
commit 3bae7dc77c
6 changed files with 91 additions and 66 deletions

View file

@ -5,6 +5,7 @@
graph = "log --oneline --all --graph";
amend = "commit --amend --no-edit";
sdiff = "diff --staged";
fpush = "push --force-with-lease";
t = "tag --annotate";
bclone = "!sh ${pkgs.writeShellScriptBin "bare-clone" ''
url=$1

View file

@ -3,12 +3,12 @@
pkgs,
lib,
...
}: {
} @ input: {
programs.nixvim =
{
enable = true;
}
// (import ../../../lib/nixvim.nix {inherit pkgs;});
// (import ../../../lib/nixvim.nix input);
programs.vscode = {
extensions = [pkgs.vscode-extensions.asvetliakov.vscode-neovim];

View file

@ -15,6 +15,11 @@ in {
email = "tristan.beedell@cryoserver.com";
terminal = false;
};
programs.git.extraConfig = {
"includeIf \"gitdir:~/Documents/personal/\"" = {
path = "~/Documents/personal/.gitconfig";
};
};
home.packages = [
pkgs.thunderbird
@ -31,7 +36,8 @@ in {
desktopName = "Microsoft Teams";
})
pkgs.devcontainer
(pkgs.writeShellScriptBin "devcontainer-open" (let
(pkgs.writeShellScriptBin "devcontainer-open" (
let
jq = "${pkgs.jq}/bin/jq";
devcontainer = "${pkgs.devcontainer}/bin/devcontainer";
in ''
@ -41,7 +47,8 @@ in {
containerId=$(echo $res | ${jq} -r '.containerId')
remoteWorkspaceFolder=$(echo $res | ${jq} -r '.remoteWorkspaceFolder')
docker exec -it --workdir=$remoteWorkspaceFolder $containerId bash
''))
''
))
];
home.sessionVariables = {

View file

@ -28,6 +28,7 @@
playerctl
quickemu
devenv
logseq
];
services.udiskie = {

View file

@ -1,6 +1,11 @@
{pkgs, ...}: let
{
pkgs,
lib,
...
}: let
lua = cmd: {__raw = cmd;};
luaFunc = cmd: lua ''
luaFunc = cmd:
lua ''
function ()
${cmd}
end'';
@ -28,6 +33,8 @@ in {
"extends:>"
"precedes:<"
];
foldlevel = 2;
};
extraPlugins = [(pkgs.vimPlugins.actions-preview-nvim)];
extraConfigLua = ''
@ -204,9 +211,10 @@ in {
}
];
autoCmd = [{
autoCmd = [
{
event = "BufWritePre";
pattern = "*.go";
pattern = "*";
# https://github.com/golang/tools/blob/master/gopls/doc/vim.md#imports-and-formatting
callback = luaFunc ''
local params = vim.lsp.util.make_range_params()
@ -227,7 +235,8 @@ in {
end
vim.lsp.buf.format({async = false})
'';
}];
}
];
plugins = {
bufferline.enable = true;
@ -261,7 +270,15 @@ in {
enable = true;
servers = {
ts-ls.enable = true;
nil-ls.enable = true;
nixd = {
enable = true;
settings = {
nixpkgs.expr = ''import <nixpkgs> {}'';
options.zenix.expr = ''(builtins.getFlake "git+https://git.tristans.cloud/tristan/nix").nixosConfigurations.zenix.options'';
options.alpine.expr = ''(builtins.getFlake "git+https://git.tristans.cloud/tristan/nix").nixosConfigurations.alpine.options'';
formatting.command = [(lib.getExe pkgs.alejandra)];
};
};
yamlls.enable = true;
gopls.enable = true;
};

View file

@ -1,7 +1,6 @@
{config, ...}: let
user = config.user;
in
{
in {
users.users.${user}.extraGroups = ["libvirtd" "kvm"];
virtualisation.libvirtd = {
enable = true;