started migration to snowfall

This commit is contained in:
Chris Kruining 2025-07-23 10:03:10 +02:00
parent 091438d802
commit 5ba5d55108
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
100 changed files with 49 additions and 32 deletions

View file

@ -0,0 +1,39 @@
{
config,
options,
lib,
pkgs,
user,
...
}: let
inherit (lib.attrsets) attrValues;
inherit (lib.modules) mkIf mkMerge;
cfg = config.modules.${user}.desktop.editors;
in {
options.modules.${user}.desktop.editors = let
inherit (lib.options) mkOption;
inherit (lib.types) nullOr enum;
in {
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-manager.users.${user}.home.sessionVariables = {
EDITOR = cfg.default;
};
})
(mkIf (cfg.default == "nvim") {
home-manager.users.${user}.home.packages = attrValues {
inherit (pkgs) imagemagick editorconfig-core-c sqlite deno pandoc nuspell;
inherit (pkgs.hunspellDicts) nl_NL en_GB-ise;
};
})
];
}

View file

@ -0,0 +1,18 @@
{ config, options, lib, pkgs, user, ... }:
let
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf;
cfg = config.modules.${user}.desktop.editors.kate;
in
{
options.modules.${user}.desktop.editors.kate = let
inherit (lib.options) mkEnableOption;
in {
enable = mkEnableOption "kate";
};
config = mkIf cfg.enable {
home-manager.users.${user}.programs.kate.enable = true;
};
}

View file

@ -0,0 +1,33 @@
{ config, options, lib, pkgs, user, ... }:
let
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf;
cfg = config.modules.${user}.desktop.editors.nano;
in
{
options.modules.${user}.desktop.editors.nano = let
inherit (lib.options) mkEnableOption;
in { enable = mkEnableOption "nano"; };
config = mkIf cfg.enable {
home-manager.users.${user}.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,38 @@
{ config, lib, user, ... }:
let
inherit (lib.modules) mkIf;
cfg = config.modules.${user}.desktop.editors.nvim;
in
{
options.modules.${user}.desktop.editors.nvim = let
inherit (lib.options) mkEnableOption;
in {
enable = mkEnableOption "neo-vim (nixvim)";
};
config = mkIf cfg.enable {
modules.desktop.editors.nvim.enable = true;
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,18 @@
{ config, lib, pkgs, user, ... }:
let
inherit (lib.modules) mkIf;
inherit (lib.attrsets) attrValues;
cfg = config.modules.${user}.desktop.editors.vscodium;
in
{
options.modules.${user}.desktop.editors.vscodium = let
inherit (lib.options) mkEnableOption;
in { enable = mkEnableOption "vscodium"; };
config = mkIf cfg.enable {
home-manager.users.${user}.home.packages = attrValues {
inherit (pkgs) vscodium;
};
};
}

View file

@ -0,0 +1,75 @@
{ config, lib, pkgs, user, ... }: let
inherit (lib.modules) mkIf;
cfg = config.modules.${user}.desktop.editors.zed;
in {
options.modules.${user}.desktop.editors.zed = let
inherit (lib.options) mkEnableOption;
in {enable = mkEnableOption "zed";};
config = mkIf cfg.enable {
home-manager.users.${user} = {
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";
};
};
};
};
};
};
}