aight, making progress

This commit is contained in:
Chris Kruining 2025-07-28 16:52:48 +02:00
parent c2d6c719a2
commit 9aa634bd71
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
37 changed files with 451 additions and 620 deletions

View file

@ -0,0 +1,24 @@
{ config, options, lib, pkgs, namespace, ... }:
let
inherit (lib) attrValues mkIf mkMerge mkOption;
inherit (lib.types) nullOr enum;
cfg = config.${namespace}.editors;
in {
options.${namespace}.editors = {
default = mkOption {
type = nullOr (enum [ "nano" "nvim" "zed" "kate" "vscodium" ]);
default = "nano";
description = "Default editor for text manipulation";
example = "nvim";
};
};
config = mkMerge [
(mkIf (cfg.default != null) {
home.sessionVariables = {
EDITOR = cfg.default;
};
})
];
}

View file

@ -0,0 +1,30 @@
{ config, options, lib, pkgs, namespace, ... }:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.editors.nano;
in
{
options.${namespace}.editors.nano = {
enable = mkEnableOption "nano";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [ nano ];
programs.nano = {
enable = true;
syntaxHighlight = true;
nanorc = ''
set autoindent
set jumpyscrolling
set linenumbers
set mouse
set saveonexit
set smarthome
set tabstospaces
set tabsize 2
'';
};
};
}

View file

@ -0,0 +1,43 @@
{ inputs, config, lib, pkgs, namespace, ... }:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.${namespace}.editor.nvim;
in
{
options.${namespace}.editor.nvim = {
enable = mkEnableOption "enable nvim via nvf on user level";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
imagemagick
editorconfig-core-c
sqlite
deno
pandoc
nuspell
hunspellDicts.nl_NL
hunspellDicts.en_GB-ise
];
programs.nvf = {
enable = true;
settings.vim = {
statusline.lualine.enable = true;
telescope.enable = true;
autocomplete.nvim-cmp.enable = true;
lsp.enable = true;
languages = {
enableTreesitter = true;
nix.enable = true;
ts.enable = true;
rust.enable = true;
};
};
};
};
}

View file

@ -0,0 +1,73 @@
{ config, lib, pkgs, namespace, ... }: let
inherit (lib) mkIf mkEnableOption;
cfg = config.${namespace}.editors.zed;
in {
options.${namespace}.editors.zed = {
enable = mkEnableOption "zed";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
zed-editor nixd nil alejandra
];
programs.zed-editor = {
enable = true;
extensions = [ "nix" "toml" "html" ];
userSettings = {
assistant.enabled = false;
vim_mode = false;
load_direnv = "shell_hook";
base_keymap = "JetBrains";
format_on_save = "on";
bindings = {
"ctrl+s" = "workspace::SaveAll";
};
tabs = {
file_icons = true;
git_status = true;
};
project_panel.auto_reveal_entries = false;
"experimental.theme_overrides" = {
border = "#ffffff07";
};
hour_format = "hour24";
auto_update = false;
lsp = {
nixd = {};
nil = {
initialization_options = {
nix = {
flake = {
autoArchive = true;
};
};
formatting = {
command = ["alejandra" "--quiet" "--"];
};
};
binary = {
path_lookup = true;
};
};
};
languages = {
"Nix" = {
language_servers = ["nixd" "nil"];
format_on_save = "on";
};
};
};
};
};
}