Added Thinkpad and pi4 configs

This commit is contained in:
2025-04-12 19:45:01 +02:00
parent 00cf2c38f9
commit 6ca92c8537
74 changed files with 7730 additions and 973 deletions

View File

@ -0,0 +1,9 @@
{
imports = [
./git.nix
./nixvim
./zed.nix
];
# TODO set Wayland vmOptions in Jetbrains products, Requires current installed version in path
# -Dawt.toolkit.name=WLToolKit
}

View File

@ -0,0 +1,33 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [ git-crypt ];
programs.git =
let
package = pkgs.git.override { withLibsecret = true; };
in
{
enable = true;
package = package;
userName = "Martin Berg Alstad";
userEmail = "git@martials.no";
aliases = {
amend = "commit --amend";
cm = "commit";
s = "status";
};
signing = {
signByDefault = true;
key = "848D71DE0590C199";
};
extraConfig = {
push.autoSetupRemote = true;
safe.directory = "/etc/nixos";
credential.helper = "${package}/bin/git-credential-libsecret";
};
};
}

View File

@ -0,0 +1,77 @@
# Neovim configuration for Nix
{ inputs, ... }:
{
imports = [
inputs.nixvim.homeManagerModules.nixvim
];
catppuccin.nvim.enable = true;
home.sessionVariables.EDITOR = "nvim";
programs.nixvim = {
enable = true;
clipboard.providers.wl-copy.enable = true;
colorschemes.catppuccin.enable = true;
defaultEditor = true;
vimdiffAlias = true; # Alias vimdiff to nvim -d
opts = {
number = true; # Show line numbers
relativenumber = true; # Show relative line numbers
shiftwidth = 2; # Tab width should be 2
};
plugins = {
bufferline.enable = false;
# Formatters
conform-nvim = {
enable = true;
# TODO use nix fmt on save
settings = { };
};
lsp = {
enable = true;
servers = {
nixd.enable = true;
};
};
lualine.enable = true;
luasnip.enable = true;
# Completions
cmp = {
enable = true;
autoEnableSources = true;
# TODO complete on <tab>
settings = {
sources = [
{ name = "nvim-lsp"; }
{ name = "path"; }
{ name = "buffer"; }
];
};
};
treesitter.enable = true;
web-devicons.enable = true;
};
extraConfigLua = ''
-- Translucent background
vim.cmd [[
highlight Normal guibg=none
highlight NonText guibg=none
highlight Normal ctermbg=none
highlight NonText ctermbg=none
]]
'';
};
}

View File

@ -0,0 +1,57 @@
{ pkgs, ... }:
{
programs.zed-editor = {
enable = true;
package = pkgs.unstable.zed-editor;
extensions = [
"html"
"catppuccin"
"catppuccin-icons"
"toml"
"nix"
"git-firefly"
"just"
];
userSettings =
let
theme = import ../../theme.nix;
font = "${theme.nerdFont} Nerd Font";
fontSize = 14;
in
{
assistant = {
default_model = {
provider = "ollama";
model = "deepseek-r1:8b";
};
version = "2";
};
autosave = "on_focus_change";
base_keymap = "JetBrains";
buffer_font_family = font;
features = {
edit_completion_provider = "zed";
};
icon_theme = "Catppuccin Mocha";
# icon_theme = { TODO replace icon theme above with below
# mode = theme.mode;
# light = "Catppuccin Mocha";
# dark = "Catppuccin Mocha";
# };
ui_font_family = font;
ui_font_size = fontSize;
buffer_font_size = fontSize;
tabs = {
file_icons = true;
git_status = true;
};
theme = {
mode = theme.mode;
light = "Catppuccin Latte";
dark = "Catppuccin Mocha";
};
lsp.nil.initialization_options.formatting.command = [ "nixfmt" ];
};
};
}