1

Move some home config to initial basic modules

This commit is contained in:
2023-05-24 20:49:53 +02:00
parent e904da39b6
commit 7e184384f5
14 changed files with 349 additions and 1942 deletions

View File

@ -0,0 +1,33 @@
# TODO: Expose some settings
{
config,
nixosConfig,
lib,
mylib,
pkgs,
...
}:
with lib;
with mylib.modules; let
cfg = config.modules.chromium;
in {
options.modules.chromium = import ./options.nix {inherit lib mylib;};
config = mkIf cfg.enable {
programs.chromium = {
enable = true;
# TODO: Extensions for ungoogled, see https://discourse.nixos.org/t/home-manager-ungoogled-chromium-with-extensions/15214
# package = pkgs.ungoogled-chromium;
extensions = [
{id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";} # UBlock Origin
{id = "oboonakemofpalcgghocfoadofidjkkk";} # KeepassXC Browser
{id = "pkehgijcmpdhfbdbbnkijodmdjhbjlgp";} # Privacy Badger
{id = "lckanjgmijmafbedllaakclkaicjfmnk";} # ClearURLs
{id = "njdfdhgcmkocbgbhcioffdbicglldapd";} # LocalCDN
{id = "jaoafjdoijdconemdmodhbfpianehlon";} # Skip Redirect
];
};
};
}

View File

@ -0,0 +1,9 @@
{
lib,
mylib,
...
}:
with lib;
with mylib.modules; {
enable = mkEnableOpt "Chromium";
}

View File

@ -9,20 +9,21 @@
}: {
imports = [
./audio
./chromium
./emacs
./email
./firefox
./fish
./flatpak
./gaming
./gnome
./helix
./hyprland
./kitty
./misc
./neovim
./nextcloud
./nzbget
./plasma
./nnn
./ranger
./vscode
];
}

View File

@ -0,0 +1,58 @@
# TODO: Expose some settings
# TODO: Fix language config
{
config,
nixosConfig,
lib,
mylib,
pkgs,
...
}:
with lib;
with mylib.modules; let
cfg = config.modules.helix;
in {
options.modules.helix = import ./options.nix {inherit lib mylib;};
config = mkIf cfg.enable {
programs.helix = {
enable = true;
# NOTE: Syntax changed
# languages = [
# {
# name = "verilog";
# roots = [
# ".svls.toml"
# ".svlint.toml"
# ];
# language-server = {
# command = "svls";
# args = [];
# };
# }
# ];
# https://docs.helix-editor.com/configuration.html
settings = {
# theme = "base16_terminal";
editor = {
scrolloff = 10;
mouse = false; # Default true
middle-click-paste = false; # Default true
line-number = "relative";
cursorline = true;
auto-completion = true; # Default
bufferline = "multiple";
cursor-shape = {
normal = "block";
insert = "bar";
select = "underline";
};
lsp.display-messages = true;
indent-guides.render = false;
};
};
};
};
}

View File

@ -0,0 +1,9 @@
{
lib,
mylib,
...
}:
with lib;
with mylib.modules; {
enable = mkEnableOpt "Helix Editor";
}

View File

@ -1,3 +1,4 @@
# TODO: Expose some settings
{
config,
nixosConfig,

View File

@ -0,0 +1,65 @@
# TODO: Expose some settings
{
config,
nixosConfig,
lib,
mylib,
pkgs,
...
}:
with lib;
with mylib.modules; let
cfg = config.modules.nnn;
in {
options.modules.nnn = import ./options.nix {inherit lib mylib;};
config = mkIf cfg.enable {
programs.nnn = {
package = pkgs.nnn.override {
# These two are mutually exclusive
withIcons = false;
withNerdIcons = true;
};
enable = true;
extraPackages = with pkgs; [
xdragon # Drag and drop (why man)
];
bookmarks = {
c = "~/.config";
d = "~/Documents";
D = "~/Downloads";
n = "~/Notes";
t = "~/Notes/TU";
h = "~/Notes/HHU";
N = "~/NixFlake";
p = "~/Pictures";
v = "~/Videos";
};
plugins = {
mappings = {
c = "fzcd";
d = "dragdrop";
f = "finder";
j = "autojump";
k = "kdeconnect";
p = "preview-tui";
# s = "suedit";
# s = "x2sel";
v = "imgview";
};
src =
(pkgs.fetchFromGitHub {
owner = "jarun";
repo = "nnn";
rev = "aaf60b93d741ffff211902a10a159434629bbdb9";
sha256 = "sha256-MwI3PqPfSyblURUAds4aVsw8WFBAgbDo5hqXMmRbAW4=";
})
+ "/plugins";
};
};
};
}

View File

@ -0,0 +1,9 @@
{
lib,
mylib,
...
}:
with lib;
with mylib.modules; {
enable = mkEnableOpt "NNN File Manager";
}

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +0,0 @@
{
lib,
mylib,
...
}:
with lib;
with mylib.modules; {
enable = mkEnableOpt "Enable NzbGet";
mainDir = mkOption {
type = types.str;
default = "~/Videos/NzbGet";
description = "The folder, where nzbget stores downloaded data.";
};
}

View File

@ -0,0 +1,138 @@
# TODO: Expose some settings
{
config,
nixosConfig,
lib,
mylib,
pkgs,
...
}:
with lib;
with mylib.modules; let
cfg = config.modules.vscode;
in {
options.modules.vscode = import ./options.nix {inherit lib mylib;};
config = mkIf cfg.enable {
programs.vscode = {
enable = true;
enableExtensionUpdateCheck = false;
enableUpdateCheck = false;
extensions = with pkgs.vscode-extensions; [
alefragnani.bookmarks
# alefragnani.project-manager # Not much sense with flake dev environments
# bradlc.vscode-tailwindcss
christian-kohler.path-intellisense
codezombiech.gitignore
coolbear.systemd-unit-file
eamodio.gitlens
# formulahendry.auto-rename-tag
# formulahendry.auto-close-tag
# gitlab.gitlab-workflow
# irongeek.vscode-env
jnoortheen.nix-ide
kamadorueda.alejandra
# kamikillerto.vscode-colorize
llvm-vs-code-extensions.vscode-clangd
matklad.rust-analyzer
mechatroner.rainbow-csv
# mikestead.dotenv
# mkhl.direnv
ms-azuretools.vscode-docker
ms-kubernetes-tools.vscode-kubernetes-tools
ms-python.python # TODO: Reenable, was disabled bc build failure
ms-toolsai.jupyter
ms-vscode.cmake-tools
ms-vscode.cpptools
ms-vscode.hexeditor
ms-vscode.makefile-tools
# naumovs.color-highlight
njpwerner.autodocstring
james-yu.latex-workshop
redhat.java
redhat.vscode-xml
redhat.vscode-yaml
rubymaniac.vscode-paste-and-indent
ryu1kn.partial-diff
serayuzgur.crates
shd101wyy.markdown-preview-enhanced
skyapps.fish-vscode
tamasfe.even-better-toml
timonwong.shellcheck
# tomoki1207.pdf # Incompatible with latex workshop
valentjn.vscode-ltex
vscodevim.vim
vscode-icons-team.vscode-icons
yzhang.markdown-all-in-one
];
# haskell = {};
# keybindings = {};
userSettings = {
# VSCode Internals
"editor.fontFamily" = "JetBrainsMono Nerd Font Mono";
"editor.fontSize" = 14;
"editor.renderWhitespace" = "selection";
"editor.cursorStyle" = "line"; # Use line for vim plugin
"editor.lineNumbers" = "relative";
"editor.linkedEditing" = true;
"editor.smoothScrolling" = true;
"editor.stickyScroll.enabled" = true;
"editor.tabCompletion" = "on";
"editor.cursorSmoothCaretAnimation" = "on";
"editor.cursorSurroundingLines" = 10;
"editor.minimap.renderCharacters" = false;
"editor.bracketPairColorization.enabled" = true;
"editor.guides.bracketPairs" = "active";
"editor.guides.bracketPairsHorizontal" = "active";
"editor.guides.highlightActiveIndentation" = false;
"files.autoSave" = "onFocusChange";
"files.trimFinalNewlines" = true;
"files.trimTrailingWhitespace" = true; # NOTE: If this is enabled with frequent autosave, the current lines whitespace will always be removed, which is obnoxious
"workbench.enableExperiments" = false;
"workbench.list.smoothScrolling" = true;
"workbench.colorTheme" = "Default Light Modern";
"workbench.iconTheme" = "vscode-icons";
"security.workspace.trust.enabled" = false;
# Language Tool
"ltex.checkFrequency" = "manual";
# LaTeX
"latex-workshop.latex.tools" = [
{
"name" = "latexmk";
"command" = "latexmk";
"args" = [
"-synctex=1"
"-shell-escape"
"-interaction=nonstopmode"
"-file-line-error"
"-pdf"
"-outdir=%OUTDIR%"
"%DOC%"
];
"env" = {};
}
];
"latex-workshop.latexindent.args" = [
"-c"
"%DIR%/"
"%TMPFILE%"
"-m"
"-y=defaultIndent: '%INDENT%'"
];
# Nix
"[nix]"."editor.tabSize" = 2;
"nix.enableLanguageServer" = true;
"nix.serverPath" = "nil";
"nix.formatterPath" = "alejandra";
};
# TODO: Snippets
};
};
}

View File

@ -0,0 +1,9 @@
{
lib,
mylib,
...
}:
with lib;
with mylib.modules; {
enable = mkEnableOpt "Visual Studio Code";
}