🚚 [shared] Added shared config that shared desktop config inherits from

This commit is contained in:
2025-05-20 21:52:00 +02:00
parent adb02fbcc2
commit 9a8cc63674
92 changed files with 41 additions and 25 deletions

View File

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

View File

@ -0,0 +1,35 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
git-crypt
gitmoji-cli
];
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";
p = "push";
};
signing.signByDefault = true;
extraConfig = {
pull.rebase = true;
push.autoSetupRemote = true;
safe.directory = "/etc/nixos";
credential.helper = "${package}/bin/git-credential-libsecret";
};
};
}

View File

@ -0,0 +1,103 @@
{
pkgs,
lib,
theme,
...
}:
{
catppuccin.helix = {
enable = true;
flavor = theme.flavor;
};
programs = {
fish.shellAliases.edit = "hx";
helix =
let
prettier = format: {
command = "prettier";
args = [
"--stdin-filepath"
"file.${format}"
];
};
in
{
enable = true;
defaultEditor = true;
extraPackages = with pkgs; [
# Markdown
marksman
markdown-oxide
# Html, css, Json, Eslint
vscode-langservers-extracted
# Yaml
ansible-language-server
yaml-language-server
];
settings = {
editor = {
auto-save = {
after-delay.enable = true;
focus-lost = true;
};
cursor-shape = {
normal = "block";
insert = "bar";
select = "underline";
};
lsp = {
display-inlay-hints = true;
display-messages = true;
};
};
keys.normal = {
C-f = ":format";
};
};
languages.language = [
{
name = "css";
formatter = prettier "css";
auto-format = true;
}
{
name = "json";
language-servers = [
"vscode-json-language-server"
];
formatter = prettier "json";
auto-format = true;
}
{
name = "jsonc";
language-servers = [
];
formatter = prettier "jsonc";
file-types = [
"jsonc"
];
auto-format = true;
}
{
name = "markdown";
formatter = prettier "md";
auto-format = true;
}
{
name = "nix";
formatter.command = lib.getExe pkgs.nixfmt-rfc-style;
auto-format = true;
}
{
name = "yaml";
formatter = prettier "yaml";
auto-format = true;
}
];
};
};
}

View File

@ -0,0 +1,56 @@
{ pkgs, theme, ... }:
{
programs.zed-editor = {
enable = true;
package = pkgs.unstable.zed-editor;
extensions = [
"html"
"catppuccin"
"catppuccin-icons"
"toml"
"nix"
"git-firefly"
"just"
];
userSettings =
let
font = "${theme.nerdFont} Nerd Font";
fontSize = 14;
in
{
assistant = {
default_model = {
provider = "ollama";
model = "deepseek-r1:8b";
};
version = "2";
};
autosave = "on_focus_change";
auto_update = false;
base_keymap = "JetBrains";
buffer_font_family = font;
features = {
edit_completion_provider = "zed";
};
icon_theme = {
mode = theme.mode;
light = "Catppuccin Latte";
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" ];
};
};
}