refactor: restructure config files

This commit is contained in:
2026-04-27 15:59:20 +02:00
parent bac6e4997b
commit 0b2ecd31b0
58 changed files with 6 additions and 2 deletions
+92
View File
@@ -0,0 +1,92 @@
{ inputs, config, ... }:
let
account = config.repo.account;
sharedContext = ''
# Global Agent Context
Be a concise technical thought partner. Check the premise before executing, optimize for the user's actual outcome, and make important assumptions or tradeoffs visible.
## Machine Environment
- This machine is Nix/NixOS-based. Standard Linux assumptions may be wrong: software is usually provided by flakes, dev shells, `devenv`, `direnv`, or the user's NixOS/Home Manager config rather than `apt`, `dnf`, or global installs.
- If a repo has `flake.nix`, `devenv.nix`, `shell.nix`, or `.envrc`, prefer entering or invoking its dev environment (`nix develop`, `devenv shell`, or `direnv exec . <cmd>`). `direnv` may not be loaded automatically inside agent shells.
- For NixOS/Home Manager/nixpkgs/packages/options, use the NixOS MCP when available instead of relying on memory.
## User Preferences
- The user values precision, minimalism, and conceptual clarity. Challenge weak premises, but explain why.
- For larger or ambiguous work, interview or plan before broad implementation. For small concrete requests, proceed with the obvious scoped change.
'';
in
{
flake.modules.nixos.ai = {
nixpkgs.overlays = [ inputs.llm-agents.overlays.default ];
nix.settings = {
extra-substituters = [ "https://cache.numtide.com" ];
extra-trusted-public-keys = [
"niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g="
];
};
};
flake.modules.homeManager.ai =
{
config,
lib,
pkgs,
...
}:
{
home.sessionVariables.GEMINI_CONFIG_DIR = "${config.xdg.configHome}/gemini";
programs.mcp = {
enable = true;
servers.nixos = {
command = "${pkgs.uv}/bin/uvx";
args = [ "mcp-nixos" ];
};
};
programs.gemini-cli = {
enable = false;
package = pkgs.llm-agents.gemini-cli;
enableMcpIntegration = true;
context.AGENTS = sharedContext;
settings = {
context = {
fileName = [
"AGENTS.md"
"GEMINI.md"
];
loadMemoryFromIncludeDirectories = true;
};
model.name = "gemini-3.1-pro-preview";
};
};
programs.codex = {
enable = true;
package = pkgs.llm-agents.codex;
enableMcpIntegration = true;
context = sharedContext;
settings = {
model = "gpt-5.5";
model_reasoning_effort = "high";
plan_mode_reasoning_effort = "high";
tui.status_line = [
"model-with-reasoning"
"current-dir"
"git-branch"
"context-remaining"
"five-hour-limit"
];
projects.${account.nixosConfigurationPath}.trust_level = "trusted";
sandbox_mode = "workspace-write";
personality = "pragmatic";
features.undo = true;
};
};
};
}
+12
View File
@@ -0,0 +1,12 @@
{
flake.modules.nixos.audio = {
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
};
};
}
+26
View File
@@ -0,0 +1,26 @@
{
config,
...
}:
let
repo = config.repo;
account = repo.account;
in
{
flake.modules.homeManager.bitwarden =
{
config,
pkgs,
...
}:
{
programs.rbw = {
enable = true;
settings = {
base_url = repo.services.vaultwarden.url;
email = account.primaryEmail.address;
pinentry = pkgs.pinentry-gnome3;
};
};
};
}
+6
View File
@@ -0,0 +1,6 @@
{
flake.modules.nixos.bluetooth = {
hardware.bluetooth.enable = true;
services.blueman.enable = true;
};
}
+10
View File
@@ -0,0 +1,10 @@
{
flake.modules.homeManager.clipboard =
{ pkgs, ... }:
{
home.packages = [ pkgs.wl-clipboard ];
services.cliphist.enable = true;
services.wl-clip-persist.enable = true;
};
}
+40
View File
@@ -0,0 +1,40 @@
{
flake.modules.homeManager.dev-tools =
{ config, pkgs, ... }:
{
home.sessionVariables.CARGO_HOME = "${config.xdg.dataHome}/cargo";
home.packages = with pkgs; [
devenv
httpie
bruno
usql
posting
resterm
];
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
programs.lazygit = {
enable = true;
enableZshIntegration = true;
};
programs.jujutsu.enable = true;
programs.jq.enable = true;
programs.bun.enable = true;
programs.ripgrep.enable = true;
programs.uv.enable = true;
programs.git.ignores = [
"devenv.*"
".devenv*"
".direnv"
"pre-commit-config.yaml"
".envrc"
];
};
}
+88
View File
@@ -0,0 +1,88 @@
{ config, ... }:
let
account = config.repo.account;
in
{
flake.modules.homeManager.email =
{
config,
lib,
...
}:
let
mkOffice365Account =
{
address,
primary,
...
}:
{
enable = true;
inherit address primary;
realName = account.realName;
userName = address;
thunderbird = {
enable = true;
settings = id: {
"mail.smtpserver.smtp_${id}.authMethod" = 10;
"mail.server.server_${id}.authMethod" = 10;
};
};
flavor = "outlook.office365.com";
};
mkMxrouteAccount =
{
address,
primary,
...
}:
{
enable = true;
inherit address primary;
realName = account.realName;
userName = address;
thunderbird.enable = true;
imap = {
authentication = "plain";
host = "taylor.mxrouting.net";
port = 993;
tls.enable = true;
};
smtp = {
authentication = "plain";
host = "taylor.mxrouting.net";
port = 465;
tls.enable = true;
};
};
mkEmailAccount =
email:
if email.type == "office365" then
mkOffice365Account email
else if email.type == "mxrouting" then
mkMxrouteAccount email
else
throw "Unsupported email type `${email.type}` for ${config.home.username}";
in
{
programs.thunderbird = {
enable = true;
profiles.${config.home.username} = {
isDefault = true;
withExternalGnupg = true;
settings = {
"mail.ui.display.message_pane_vertical" = true;
"mail.ui.display.thread_pane_view_type" = "cards";
"mail.uidensity" = 1;
"privacy.donottrackheader.enabled" = true;
"mail.server.server2.hidden" = true;
"mailnews.start_page.enabled" = false;
"mail.provider.enabled" = false;
"layout.css.devPixelsPerPx" = 0.85;
};
};
};
accounts.email.accounts = lib.mapAttrs (_: mkEmailAccount) account.emails;
};
}
+5
View File
@@ -0,0 +1,5 @@
{
flake.modules.nixos.flatpak = {
services.flatpak.enable = true;
};
}
+26
View File
@@ -0,0 +1,26 @@
{
flake.modules.nixos.fonts =
{ pkgs, ... }:
{
fonts = {
enableDefaultPackages = false;
packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-color-emoji
iosevka
jetbrains-mono
fira-code
roboto
fira
merriweather
ibm-plex
lexend
literata
montserrat
source-sans-pro
source-serif-pro
];
};
};
}
+82
View File
@@ -0,0 +1,82 @@
{ config, lib, ... }:
let
account = config.repo.account;
in
{
flake.modules.homeManager.git =
{
config,
osConfig,
...
}:
let
machine = osConfig.meta.machine;
allowedSignersFile = "${config.xdg.configHome}/git/allowed_signers";
mkScope =
scope:
let
email = account.emails.${scope}.address;
key = lib.attrByPath [ scope ] null machine.sshKeys;
hasSigningKey = key != null;
in
{
allowedSigners = lib.optional hasSigningKey "${email} ${key.publicKey}";
git = {
user = {
name = account.realName;
inherit email;
}
// lib.optionalAttrs hasSigningKey {
signingKey = "${key.privateKeyPath}.pub";
};
}
// lib.optionalAttrs hasSigningKey {
gpg.ssh.allowedSignersFile = allowedSignersFile;
};
};
personal = mkScope "personal";
work = mkScope "work";
in
{
xdg.configFile."git/allowed_signers".text = lib.concatStringsSep "\n" (
personal.allowedSigners ++ work.allowedSigners ++ [ "" ]
);
programs.git = {
enable = true;
signing.format = "ssh";
ignores = [
".claude/"
".codex"
];
settings = {
init.defaultBranch = "main";
user = {
name = account.realName;
email = account.emails.personal.address;
};
};
includes = [
{
condition = "gitdir:${account.nixosConfigurationPath}/";
contents = personal.git;
}
{
condition = "gitdir:${config.xdg.userDirs.projects}/";
contents = personal.git;
}
{
condition = "gitdir:${config.home.homeDirectory}/work/";
contents = work.git;
}
];
};
programs.gh = {
enable = true;
settings.git_protocol = "ssh";
};
};
}
+6
View File
@@ -0,0 +1,6 @@
{
flake.modules.nixos.laptop-power = {
services.upower.enable = true;
services.power-profiles-daemon.enable = true;
};
}
+34
View File
@@ -0,0 +1,34 @@
{ config, ... }:
let
repo = config.repo;
repoHelpers = repo.helpers;
in
{
flake.modules.homeManager.local-apps =
{ pkgs, ... }:
let
browserPackage = repoHelpers.resolvePackagePath {
inherit pkgs;
path = repo.desktop.browser.packagePath;
};
in
{
home.sessionVariables.BROWSER = repo.desktop.browser.command;
home.packages =
with pkgs;
[
postman
spotify
calcure
planify
unzip
gimp
dbeaver-bin
]
++ [ browserPackage ];
programs.imv.enable = true;
programs.sioyek.enable = true;
};
}
+47
View File
@@ -0,0 +1,47 @@
{
flake.modules.homeManager.mpv =
{ pkgs, ... }:
{
programs.mpv = {
enable = true;
bindings = {
D = "cycle deband";
};
config = {
profile = "high-quality";
osc = "no";
border = "no";
vo = "gpu-next";
gpu-api = "vulkan";
hwdec = "vulkan";
demuxer-mkv-subtitle-preroll = "yes";
sub-auto = "fuzzy";
sub-gauss = 1.0;
sub-gray = "yes";
tone-mapping = "bt.2446a";
keep-open = "yes";
save-position-on-quit = "yes";
volume-max = 150;
deband = "yes";
deband-iterations = 2;
deband-threshold = 64;
deband-range = 17;
deband-grain = 12;
};
scripts = with pkgs.mpvScripts; [
modernz
thumbfast
mpris
autosub
];
};
};
}
@@ -0,0 +1,64 @@
{ themeName }:
''
require("kanagawa").setup({
dimInactive = true,
colors = {
theme = {
all = {
ui = {
bg_gutter = "none"
}
}
}
},
overrides = function(colors)
local theme = colors.theme
local makeDiagnosticColor = function(color)
local c = require("kanagawa.lib.color")
return { fg = color, bg = c(color):blend(theme.ui.bg, 0.95):to_hex() }
end
return {
TelescopeTitle = { fg = theme.ui.special, bold = true },
TelescopePromptNormal = { bg = theme.ui.bg_p1 },
TelescopePromptBorder = { fg = theme.ui.bg_p1, bg = theme.ui.bg_p1 },
TelescopeResultsNormal = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m1 },
TelescopeResultsBorder = { fg = theme.ui.bg_m1, bg = theme.ui.bg_m1 },
TelescopePreviewNormal = { bg = theme.ui.bg_dim },
TelescopePreviewBorder = { bg = theme.ui.bg_dim, fg = theme.ui.bg_dim },
Pmenu = { fg = theme.ui.shade0, bg = theme.ui.bg_p1 }, -- add `blend = vim.o.pumblend` to enable transparency
PmenuSel = { fg = "NONE", bg = theme.ui.bg_p2 },
PmenuSbar = { bg = theme.ui.bg_m1 },
PmenuThumb = { bg = theme.ui.bg_p2 },
DiagnosticVirtualTextHint = makeDiagnosticColor(theme.diag.hint),
DiagnosticVirtualTextInfo = makeDiagnosticColor(theme.diag.info),
DiagnosticVirtualTextWarn = makeDiagnosticColor(theme.diag.warning),
DiagnosticVirtualTextError = makeDiagnosticColor(theme.diag.error),
DiagnosticVirtualLinesHint = makeDiagnosticColor(theme.diag.hint),
DiagnosticVirtualLinesInfo = makeDiagnosticColor(theme.diag.info),
DiagnosticVirtualLinesWarn = makeDiagnosticColor(theme.diag.warning),
DiagnosticVirtualLinesError = makeDiagnosticColor(theme.diag.error),
FloatBorder = { fg = theme.ui.float.fg_border, bg = theme.ui.float.bg },
NormalFloat = { fg = theme.ui.float.fg, bg = theme.ui.float.bg },
WinBar = { fg = theme.ui.fg_dim, bg = "NONE" },
WinBarNC = { fg = theme.ui.nontext, bg = theme.ui.bg_dim },
BufferLineFill = { bg = theme.ui.bg_m3 },
BufferLineBackground = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m3 },
BufferLineBufferSelected = { fg = theme.ui.fg, bg = theme.ui.bg, bold = true },
BufferLineModified = { fg = theme.vcs.changed, bg = theme.ui.bg_m3 },
BufferLineModifiedSelected = { fg = theme.vcs.changed, bg = theme.ui.bg },
BufferLineDiagnostic = { fg = theme.ui.nontext, bg = theme.ui.bg_m3 },
BufferLineDiagnosticSelected = { fg = theme.ui.fg_dim, bg = theme.ui.bg },
}
end,
})
vim.cmd.colorscheme("${themeName}")
''
+181
View File
@@ -0,0 +1,181 @@
{ config, ... }:
let
account = config.repo.account;
repoTheme = config.repo.theme.kanagawa;
in
{
flake.modules.homeManager.neovim =
{
pkgs,
config,
inputs,
osConfig,
...
}:
{
home.sessionVariables = {
EDITOR = "nvim";
VISUAL = "nvim";
};
imports = [
(inputs.nix-wrapper-modules.lib.mkInstallModule {
name = "neovim";
value = inputs.nix-wrapper-modules.lib.wrapperModules.neovim;
loc = [
"home"
"packages"
];
})
];
wrappers.neovim = {
enable = true;
# 1. Point to your existing Lua config directory
settings.config_directory = ./lua-config;
# 2. Runtime Dependencies (from lspsAndRuntimeDeps)
# These are added to the PATH of the wrapper
extraPackages = with pkgs; [
# Tools
universal-ctags
ripgrep
fd
tree-sitter
wl-clipboard
# LSPs & Formatters
stylua
lua-language-server
nixd
nix-doc
nixfmt
dafny
typescript
typescript-language-server
rustc
rust-analyzer
rustfmt
astro-language-server
tinymist
typstyle
websocat
# ty
# basedpyright
ty
ruff
];
# 3. Plugins
# Nix provisions plugins; lz.n controls when lazy specs are packadd'd.
specs = {
lz-n = {
data = pkgs.vimPlugins.lz-n;
};
support = {
data = with pkgs.vimPlugins; [
plenary-nvim
kanagawa-nvim
nvim-treesitter.withAllGrammars
nvim-treesitter-textobjects
rainbow-delimiters-nvim
];
};
completion = {
lazy = true;
data = with pkgs.vimPlugins; [
blink-cmp
luasnip
friendly-snippets
colorful-menu-nvim
];
};
lsp = {
lazy = true;
data = with pkgs.vimPlugins; [
nvim-lspconfig
lazydev-nvim
trouble-nvim
typst-preview-nvim
];
};
formatting = {
lazy = true;
data = with pkgs.vimPlugins; [
conform-nvim
];
};
core = {
lazy = true;
data = with pkgs.vimPlugins; [
mini-nvim
guess-indent-nvim
direnv-vim
];
};
ui = {
lazy = true;
data = with pkgs.vimPlugins; [
lualine-nvim
bufferline-nvim
gitsigns-nvim
zen-mode-nvim
which-key-nvim
kulala-nvim
];
};
project = {
lazy = true;
data = with pkgs.vimPlugins; [
project-nvim
];
};
telescope = {
lazy = true;
data = with pkgs.vimPlugins; [
telescope-nvim
telescope-fzf-native-nvim
telescope-ui-select-nvim
];
};
};
# 4. Values exposed to Lua through require("nix-info").settings.
settings = {
# Hostname/ConfigDir needed for nixd
nixdExtras = {
nixpkgs = "import ${pkgs.path} {}";
nixos_options = ''(builtins.getFlake "path://${account.nixosConfigurationPath}").nixosConfigurations.${osConfig.meta.machine.name}.options'';
home_manager_options = ''(builtins.getFlake "path://${account.nixosConfigurationPath}").nixosConfigurations.${osConfig.meta.machine.name}.options.home-manager.users.type.getSubOptions []'';
};
themeSetup = import ./_kanagawa-theme.nix {
themeName = repoTheme.name;
};
typstPreviewDependencies = {
tinymist = "${pkgs.tinymist}/bin/tinymist";
websocat = "${pkgs.websocat}/bin/websocat";
};
};
# 5. Wrapper Configuration
# Enable Python/Node providers
hosts.python3.nvim-host.enable = true;
hosts.node.nvim-host.enable = true;
# Ensure the bin name matches what you expect
binName = "nvim";
};
};
}
@@ -0,0 +1,8 @@
require("options")
require("plugins.lsp")
require("plugins.completion")
require("plugins.formatting")
require("plugins.treesitter")
require("plugins.telescope")
require("plugins.ui")
require("plugins.core")
@@ -0,0 +1,74 @@
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.o.expandtab = true
vim.o.shiftwidth = 2
vim.o.tabstop = 2
vim.o.softtabstop = 2
vim.o.number = true
-- vim.o.relativenumber = true
vim.o.mouse = "a"
vim.o.showmode = false
vim.opt.shortmess:append("Wc")
vim.schedule(function()
vim.o.clipboard = "unnamedplus"
end)
vim.o.breakindent = true
vim.o.undofile = true
vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.signcolumn = "yes"
vim.o.updatetime = 250
vim.o.timeoutlen = 300
vim.o.splitright = true
vim.o.splitbelow = true
vim.o.list = true
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "" }
vim.o.inccommand = "split"
vim.o.cursorline = true
vim.o.scrolloff = 10
vim.o.confirm = true
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
vim.keymap.set("n", "<C-h>", "<C-w><C-h>", { desc = "Move focus to the left window" })
vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Move focus to the right window" })
vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower window" })
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })
vim.keymap.set("n", "j", "gj", { silent = true })
vim.keymap.set("n", "k", "gk", { silent = true })
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
vim.api.nvim_create_autocmd("TextYankPost", {
desc = "Highlight when yanking (copying) text",
group = vim.api.nvim_create_augroup("lux-highlight-yank", { clear = true }),
callback = function()
vim.hl.on_yank()
end,
})
@@ -0,0 +1,112 @@
require("lz.n").load({
{
"friendly-snippets",
},
{
"luasnip",
event = { "InsertEnter", "CmdlineEnter" },
before = function()
require("lz.n").trigger_load("friendly-snippets")
end,
after = function()
require("luasnip.loaders.from_vscode").lazy_load()
-- Load custom lua snippets
require("luasnip.loaders.from_lua").load({ paths = { vim.fn.stdpath("config") .. "/snippets" } })
end,
},
{
"colorful-menu.nvim",
event = { "InsertEnter", "CmdlineEnter" },
after = function()
require("colorful-menu").setup({})
end,
},
{
"blink.cmp",
event = { "InsertEnter", "CmdlineEnter" },
before = function()
-- Trigger lazydev so it's ready for blink source
require("lz.n").trigger_load({ "lazydev.nvim", "luasnip", "colorful-menu.nvim" })
end,
after = function()
require("blink.cmp").setup({
keymap = {
preset = "default",
-- [Up/Down]
["<C-j>"] = { "select_next", "fallback" },
["<C-k>"] = { "select_prev", "fallback" }, -- Overrides Signature Help
-- [Insert Suggestion]
["<tab>"] = { "select_and_accept", "fallback" },
-- [Remap Signature Help]
-- Since we took <C-k>, let's move signature help to <C-g> (optional)
["<C-g>"] = { "show_signature", "hide_signature", "fallback" },
},
appearance = {
nerd_font_variant = "mono",
},
completion = {
documentation = {
auto_show = true,
auto_show_delay_ms = 500,
window = {
border = "none",
},
},
menu = {
border = "none",
draw = {
columns = { { "kind_icon" }, { "label", gap = 1 } },
components = {
label = {
text = function(ctx)
return require("colorful-menu").blink_components_text(ctx)
end,
highlight = function(ctx)
return require("colorful-menu").blink_components_highlight(ctx)
end,
},
},
},
},
},
cmdline = {
completion = {
menu = {
auto_show = true,
},
},
keymap = { preset = "inherit" },
},
sources = {
default = {
"lsp",
"path",
"snippets",
"lazydev",
},
providers = {
lazydev = { module = "lazydev.integrations.blink", score_offset = 100 },
},
},
snippets = { preset = "luasnip" },
fuzzy = { implementation = "prefer_rust_with_warning" },
signature = {
enabled = true,
window = {
border = "none",
},
},
})
end,
},
})
@@ -0,0 +1,57 @@
require("lz.n").load({
{
"mini.nvim",
event = { "BufReadPre", "BufNewFile" },
after = function()
require("mini.ai").setup({ n_lines = 500 })
require("mini.surround").setup()
require("mini.pairs").setup()
local files = require("mini.files")
files.setup()
vim.keymap.set("n", "<leader>e", function()
if not files.close() then
files.open(vim.api.nvim_buf_get_name(0))
end
end, { desc = "File [E]xplorer" })
local icons = require("mini.icons")
icons.setup()
icons.mock_nvim_web_devicons()
local hipatterns = require("mini.hipatterns")
hipatterns.setup({
highlighters = {
hex_color = hipatterns.gen_highlighter.hex_color(),
fixme = { pattern = "%f[%w]()FIXME()%f[%W]", group = "MiniHipatternsFixme" },
hack = { pattern = "%f[%w]()HACK()%f[%W]", group = "MiniHipatternsHack" },
todo = { pattern = "%f[%w]()TODO()%f[%W]", group = "MiniHipatternsTodo" },
note = { pattern = "%f[%w]()NOTE()%f[%W]", group = "MiniHipatternsNote" },
},
})
local indentscope = require("mini.indentscope")
indentscope.setup({
symbol = "",
})
vim.api.nvim_create_autocmd("FileType", {
pattern = { "help", "Trouble" },
callback = function()
vim.b.miniindentscope_disable = true
end,
})
end,
},
{
"guess-indent.nvim",
event = { "BufReadPre", "BufNewFile" },
after = function()
require("guess-indent").setup({})
end,
},
{
"direnv.vim",
event = "BufEnter",
},
})
@@ -0,0 +1,42 @@
require("lz.n").load({
{
"conform.nvim",
event = "BufWritePre",
cmd = "ConformInfo",
keys = {
{
"<leader>f",
function()
require("conform").format({ async = true, lsp_format = "fallback" })
end,
mode = "",
desc = "[F]ormat buffer",
},
},
after = function()
require("conform").setup({
notify_on_error = true,
format_on_save = function(bufnr)
local disable_filetypes = { c = true, cpp = true }
if disable_filetypes[vim.bo[bufnr].filetype] then
return nil
else
return {
timeout_ms = 500,
lsp_format = "fallback",
}
end
end,
formatters_by_ft = {
lua = { "stylua" },
python = { "ruff_fix", "ruff_format", "ruff_organize_imports" },
},
formatters = {
stylua = {
prepend_args = { "--indent-type", "Spaces", "--indent-width", "2" },
},
},
})
end,
},
})
@@ -0,0 +1,251 @@
require("lz.n").load({
{
"typst-preview.nvim",
ft = "typst",
after = function()
-- Setup typst-preview
require("typst-preview").setup({
-- Optionally configure things here
dependencies_bin = require("nix-info").settings.typstPreviewDependencies,
})
vim.keymap.set("n", "<leader>tp", "<cmd>TypstPreviewToggle<cr>", { desc = "[T]ypst [P]review Toggle" })
end,
},
{
"lazydev.nvim",
cmd = "LazyDev",
ft = "lua",
after = function()
require("lazydev").setup({
library = {
{ words = { "nix%-info", "settings" }, path = "nix-info" },
},
})
end,
},
{
"nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
before = function()
require("lz.n").trigger_load("lazydev.nvim")
end,
after = function()
local telescope_plugins = {
"project.nvim",
"telescope.nvim",
"telescope-fzf-native.nvim",
"telescope-ui-select.nvim",
}
local telescope_picker = function(picker)
return function()
require("lz.n").trigger_load(telescope_plugins)
require("telescope.builtin")[picker]()
end
end
local lsp_float = { border = "single" }
local navic_excluded_filetypes = {
[""] = true,
help = true,
minifiles = true,
TelescopePrompt = true,
Trouble = true,
}
local function navic_enabled(bufnr)
return vim.bo[bufnr].buftype == "" and not navic_excluded_filetypes[vim.bo[bufnr].filetype]
end
_G.lux_navic_location = function()
local ok, navic = pcall(require, "nvim-navic")
if not ok or not navic.is_available() then
return ""
end
return navic.get_location()
end
local function update_winbar(winid, bufnr)
if not vim.api.nvim_win_is_valid(winid) then
return
end
local is_float = vim.api.nvim_win_get_config(winid).relative ~= ""
local winbar = ""
if not is_float and vim.b[bufnr].lux_navic_attached and navic_enabled(bufnr) then
winbar = "%{%v:lua.lux_navic_location()%}"
end
vim.api.nvim_set_option_value("winbar", winbar, { win = winid })
end
local function update_winbars_for_buffer(bufnr)
for _, winid in ipairs(vim.fn.win_findbuf(bufnr)) do
update_winbar(winid, bufnr)
end
end
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter", "WinEnter" }, {
group = vim.api.nvim_create_augroup("lux-navic-winbar", { clear = true }),
callback = function(args)
update_winbar(vim.api.nvim_get_current_win(), args.buf)
end,
})
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("lux-lsp-attach", { clear = true }),
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
local bufnr = args.buf
local map = function(keys, func, desc, mode)
mode = mode or "n"
vim.keymap.set(mode, keys, func, { buffer = bufnr, desc = "LSP: " .. desc })
end
map("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
map("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction", { "n", "x" })
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
map("K", function()
vim.lsp.buf.hover(lsp_float)
end, "Hover Documentation")
map("<C-s>", function()
vim.lsp.buf.signature_help(lsp_float)
end, "Signature Help", { "i", "s" })
map("gd", telescope_picker("lsp_definitions"), "[G]oto [D]efinition")
map("gr", telescope_picker("lsp_references"), "[G]oto [R]eferences")
map("gI", telescope_picker("lsp_implementations"), "[G]oto [I]mplementation")
map("<leader>D", telescope_picker("lsp_type_definitions"), "Type [D]efinition")
map("<leader>ds", telescope_picker("lsp_document_symbols"), "[D]ocument [S]ymbols")
map("<leader>ws", telescope_picker("lsp_dynamic_workspace_symbols"), "[W]orkspace [S]ymbols")
if client and client:supports_method("textDocument/documentSymbol", bufnr) and navic_enabled(bufnr) then
require("lz.n").trigger_load("nvim-navic")
local ok, navic = pcall(require, "nvim-navic")
if ok then
navic.attach(client, bufnr)
vim.b[bufnr].lux_navic_attached = true
update_winbars_for_buffer(bufnr)
end
end
if client and client:supports_method("textDocument/documentHighlight", bufnr) then
local highlight_augroup = vim.api.nvim_create_augroup("lux-lsp-highlight", { clear = false })
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
buffer = bufnr,
group = highlight_augroup,
callback = vim.lsp.buf.document_highlight,
})
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
buffer = bufnr,
group = highlight_augroup,
callback = vim.lsp.buf.clear_references,
})
vim.api.nvim_create_autocmd("LspDetach", {
group = vim.api.nvim_create_augroup("lux-lsp-detach", { clear = true }),
callback = function(event)
vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds({ group = "lux-lsp-highlight", buffer = event.buf })
end,
})
end
if client and client:supports_method("textDocument/inlayHint", bufnr) then
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
map("<leader>th", function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }))
end, "[T]oggle Inlay [H]ints")
end
end,
})
vim.diagnostic.config({
severity_sort = true,
underline = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.HINT] = "󰠠 ",
},
},
virtual_text = false,
virtual_lines = {
current_line = true,
},
float = {
border = "single",
source = "if_many",
},
})
vim.lsp.config("lua_ls", {
settings = {
Lua = {
runtime = { version = "LuaJIT" },
signatureHelp = { enabled = true },
diagnostics = { globals = { "vim" } },
telemetry = { enabled = false },
completion = { callSnippet = "Replace" },
},
},
})
vim.lsp.enable("lua_ls")
local settings = require("nix-info").settings
vim.lsp.config("nixd", {
settings = {
nixd = {
nixpkgs = { expr = settings.nixdExtras.nixpkgs },
options = {
nixos = { expr = settings.nixdExtras.nixos_options },
["home-manager"] = { expr = settings.nixdExtras.home_manager_options },
},
formatting = { command = { "nixfmt" } },
},
},
})
vim.lsp.enable("nixd")
vim.lsp.enable("dafny")
vim.lsp.enable("ts_ls")
vim.lsp.enable("rust_analyzer")
vim.lsp.enable("ty")
vim.lsp.enable("ruff")
vim.lsp.enable("astro")
vim.lsp.config("tinymist", {
settings = {
tinymist = {
formatterMode = "typstyle",
},
},
})
vim.lsp.enable("tinymist")
end,
},
{
"trouble.nvim",
cmd = "Trouble",
keys = {
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics (Trouble)" },
{ "<leader>xX", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer Diagnostics (Trouble)" },
},
after = function()
require("trouble").setup({
focus = true,
preview = {
border = "single",
},
})
end,
},
})
@@ -0,0 +1,111 @@
local telescope_plugins = {
"project.nvim",
"telescope.nvim",
"telescope-fzf-native.nvim",
"telescope-ui-select.nvim",
}
local function load_telescope()
require("lz.n").trigger_load(telescope_plugins)
return require("telescope.builtin")
end
local function map_picker(lhs, picker, desc, opts)
vim.keymap.set("n", lhs, function()
load_telescope()[picker](opts or {})
end, { desc = desc })
end
map_picker("<leader>sh", "help_tags", "[S]earch [H]elp")
map_picker("<leader>sk", "keymaps", "[S]earch [K]eymaps")
map_picker("<leader>sf", "find_files", "[S]earch [F]iles")
map_picker("<leader>ss", "builtin", "[S]earch [S]elect Telescope")
map_picker("<leader>sw", "grep_string", "[S]earch current [W]ord")
map_picker("<leader>sg", "live_grep", "[S]earch by [G]rep")
map_picker("<leader>sd", "diagnostics", "[S]earch [D]iagnostics")
map_picker("<leader>sr", "resume", "[S]earch [R]esume")
map_picker("<leader>s.", "oldfiles", '[S]earch Recent Files ("." for repeat)')
map_picker("<leader><leader>", "buffers", "[ ] Find existing buffers")
map_picker("<leader>sn", "find_files", "[S]earch [N]eovim files", { cwd = vim.fn.stdpath("config") })
vim.keymap.set("n", "<leader>sp", function()
load_telescope()
require("telescope").extensions.projects.projects({})
end, { desc = "[S]earch [P]rojects" })
vim.keymap.set("n", "<leader>/", function()
local builtin = load_telescope()
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
winblend = 10,
previewer = false,
}))
end, { desc = "[/] Fuzzily search in current buffer" })
vim.keymap.set("n", "<leader>s/", function()
load_telescope().live_grep({
grep_open_files = true,
prompt_title = "Live Grep in Open Files",
})
end, { desc = "[S]earch [/] in Open Files" })
require("lz.n").load({
{
"project.nvim",
event = "VimEnter",
after = function()
require("project").setup({
manual_mode = false,
lsp = { enabled = true },
patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json", "flake.nix" },
show_hidden = true,
scope_chdir = "global",
})
end,
},
{
"telescope-fzf-native.nvim",
},
{
"telescope-ui-select.nvim",
},
{
"telescope.nvim",
cmd = "Telescope",
before = function()
require("lz.n").trigger_load("project.nvim")
end,
after = function()
local actions = require("telescope.actions")
require("telescope").setup({
defaults = {
path_display = { "truncate" },
border = true,
borderchars = { "", "", "", "", "", "", "", "" },
layout_strategy = "horizontal",
layout_config = {
prompt_position = "top",
},
sorting_strategy = "ascending",
mappings = {
i = {
["<C-k>"] = actions.move_selection_previous,
["<C-j>"] = actions.move_selection_next,
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
},
},
},
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown(),
},
},
})
require("lz.n").trigger_load({ "telescope-fzf-native.nvim", "telescope-ui-select.nvim" })
pcall(require("telescope").load_extension, "projects")
pcall(require("telescope").load_extension, "fzf")
pcall(require("telescope").load_extension, "ui-select")
end,
},
})
@@ -0,0 +1,28 @@
local ok, treesitter = pcall(require, "nvim-treesitter")
if not ok then
return
end
treesitter.setup({})
local group = vim.api.nvim_create_augroup("lux-treesitter", { clear = true })
local enableTreesitter = function(bufnr)
vim.schedule(function()
if not vim.api.nvim_buf_is_valid(bufnr) then
return
end
if pcall(vim.treesitter.start, bufnr) then
vim.bo[bufnr].indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end
end)
end
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter", "FileType" }, {
group = group,
pattern = "*",
callback = function(args)
enableTreesitter(args.buf)
end,
})
@@ -0,0 +1,201 @@
require("lz.n").load({
{
"theme-loader",
event = "VimEnter",
load = function()
local settings = require("nix-info").settings
local theme_code = settings.themeSetup
local func, err = loadstring(theme_code)
if func then
func()
else
print("Error loading theme code: " .. err)
end
end,
},
{
"kulala.nvim",
after = function()
require("kulala").setup({
global_keymaps = true,
global_keymaps_prefix = "<leader>R",
})
end,
},
{
"lualine.nvim",
event = "VimEnter",
after = function()
local filename = {
"filename",
path = 1,
symbols = {
modified = "",
readonly = "",
unnamed = "[No Name]",
},
}
require("lualine").setup({
options = {
icons_enabled = true,
globalstatus = false,
component_separators = "",
section_separators = "",
theme = "kanagawa",
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { filename },
lualine_x = { "lsp_status" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { filename },
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
})
end,
},
{
"bufferline.nvim",
event = "VimEnter",
before = function()
require("lz.n").trigger_load("mini.nvim")
end,
after = function()
require("bufferline").setup({
options = {
mode = "buffers",
numbers = "none",
diagnostics = "nvim_lsp",
diagnostics_indicator = function(count, level)
local icon = level:match("error") and "" or level:match("warning") and "" or ""
return " " .. icon .. count
end,
always_show_bufferline = true,
show_buffer_close_icons = false,
show_close_icon = false,
separator_style = "thin",
sort_by = "insert_after_current",
offsets = {
{
filetype = "minifiles",
text = "Files",
separator = true,
},
},
},
})
vim.keymap.set("n", "<C-0>", "<cmd>BufferLineCycleNext<cr>", { desc = "[B]uffer [N]ext" })
vim.keymap.set("n", "<C-9>", "<cmd>BufferLineCyclePrev<cr>", { desc = "[B]uffer [P]revious" })
vim.keymap.set("n", "<leader>bb", "<cmd>BufferLinePick<cr>", { desc = "[B]uffer [B]rowse" })
vim.keymap.set("n", "<leader>bd", "<cmd>bdelete<cr>", { desc = "[B]uffer [D]elete" })
end,
},
{
"gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
after = function()
require("gitsigns").setup({
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
untracked = { text = "" },
},
signs_staged_enable = true,
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local map = function(mode, lhs, rhs, desc, opts)
opts = opts or {}
opts.buffer = bufnr
opts.desc = desc
vim.keymap.set(mode, lhs, rhs, opts)
end
map("n", "]h", function()
if vim.wo.diff then
return "]h"
end
vim.schedule(function()
gs.nav_hunk("next")
end)
return "<Ignore>"
end, "Next git hunk", { expr = true })
map("n", "[h", function()
if vim.wo.diff then
return "[h"
end
vim.schedule(function()
gs.nav_hunk("prev")
end)
return "<Ignore>"
end, "Previous git hunk", { expr = true })
map("n", "<leader>hp", gs.preview_hunk, "Git [H]unk [P]review")
map("n", "<leader>hs", gs.stage_hunk, "Git [H]unk [S]tage")
map("n", "<leader>hr", gs.reset_hunk, "Git [H]unk [R]eset")
map("n", "<leader>hu", gs.undo_stage_hunk, "Git [H]unk [U]ndo stage")
map("n", "<leader>hS", gs.stage_buffer, "Git [H]unk [S]tage buffer")
map("n", "<leader>hR", gs.reset_buffer, "Git [H]unk [R]eset buffer")
map("v", "<leader>hs", function()
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
end, "Git [H]unk [S]tage")
map("v", "<leader>hr", function()
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
end, "Git [H]unk [R]eset")
end,
})
end,
},
{
"zen-mode.nvim",
cmd = "ZenMode",
after = function()
require("zen-mode").setup({
window = {
options = {
linebreak = true,
},
},
})
end,
},
{
"which-key.nvim",
event = "VimEnter",
before = function()
require("lz.n").trigger_load("mini.nvim")
end,
after = function()
require("which-key").setup({
preset = "modern",
delay = 200,
icons = {
mappings = true,
keys = {},
},
spec = {
{ "<leader>b", group = "[B]uffer" },
{ "<leader>s", group = "[S]earch" },
{ "<leader>t", group = "[T]oggle" },
{ "<leader>h", group = "Git [H]unk", mode = { "n", "v" } },
},
})
end,
},
})
@@ -0,0 +1,91 @@
local ls = require("luasnip")
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
return {
-- Full lux module (both nixos and homeManager)
s("luxmod", {
t({
"{ inputs, ... }:",
"{",
" lux."
}),
i(1, "moduleName"),
t({
" = {",
" nixos = { config, lib, pkgs, ... }: {",
" "
}),
i(2),
t({
"",
" };",
"",
" homeManager = { config, lib, pkgs, ... }: {",
" "
}),
i(3),
t({
"",
" };",
" };",
"}",
}),
}),
-- lux nixos only module
s("luxnixos", {
t({
"{ inputs, ... }:",
"{",
" lux."
}),
i(1, "moduleName"),
t({
".nixos = { config, lib, pkgs, ... }: {",
" "
}),
i(0),
t({
"",
" };",
"}",
}),
}),
-- lux homeManager only module
s("luxhm", {
t({
"{ inputs, ... }:",
"{",
" lux."
}),
i(1, "moduleName"),
t({
".homeManager = { config, lib, pkgs, ... }: {",
" "
}),
i(0),
t({
"",
" };",
"}",
}),
}),
-- den inline aspect
s("denaspect", {
t({
"(",
" { host, user, ... }: {",
" "
}),
i(0),
t({
"",
" }",
")"
}),
}),
}
+15
View File
@@ -0,0 +1,15 @@
{
flake.modules.nixos.server-firewall = {
networking = {
firewall.enable = true;
firewall.allowPing = false;
};
};
flake.modules.nixos.networking = {
networking = {
nftables.enable = true;
networkmanager.enable = true;
};
};
}
+14
View File
@@ -0,0 +1,14 @@
{ config, ... }:
let
account = config.repo.account;
in
{
flake.modules.homeManager.nh =
{ ... }:
{
programs.nh = {
enable = true;
flake = account.nixosConfigurationPath;
};
};
}
+211
View File
@@ -0,0 +1,211 @@
{
browserCommand,
terminalCommand,
}:
{
"Mod+Return" = {
action.spawn = terminalCommand;
hotkey-overlay.title = "Terminal";
};
"Mod+B" = {
action.spawn = browserCommand;
hotkey-overlay.title = "Browser";
};
"Mod+Space" = {
repeat = false;
action.spawn = [
"vicinae"
"toggle"
];
hotkey-overlay.title = "App Launcher";
};
"XF86AudioPlay" = {
action.spawn-sh = "playerctl play-pause";
allow-when-locked = true;
};
"XF86AudioStop" = {
action.spawn-sh = "playerctl stop";
allow-when-locked = true;
};
"XF86AudioPrev" = {
action.spawn-sh = "playerctl previous";
allow-when-locked = true;
};
"XF86AudioNext" = {
action.spawn-sh = "playerctl next";
allow-when-locked = true;
};
"XF86AudioRaiseVolume" = {
action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
allow-when-locked = true;
};
"XF86AudioLowerVolume" = {
action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
allow-when-locked = true;
};
"XF86AudioMute" = {
action.spawn-sh = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
allow-when-locked = true;
};
"XF86AudioMicMute" = {
action.spawn-sh = "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
allow-when-locked = true;
};
"XF86MonBrightnessUp" = {
action.spawn-sh = "brightnessctl s 5%+";
allow-when-locked = true;
};
"XF86MonBrightnessDown" = {
action.spawn-sh = "brightnessctl s 5%-";
allow-when-locked = true;
};
"Mod+S".action.screenshot = [ ];
"Mod+Ctrl+S".action.screenshot-screen = [ ];
"Mod+Alt+S".action.screenshot-window = [ ];
"Mod+Shift+Slash".action.show-hotkey-overlay = [ ];
"Mod+Escape" = {
action.toggle-keyboard-shortcuts-inhibit = [ ];
allow-inhibiting = false;
};
"Mod+Alt+L" = {
action.spawn-sh = "loginctl lock-session";
hotkey-overlay.title = "Lock Screen";
};
"Mod+Shift+E".action.quit = [ ];
"Ctrl+Alt+Delete".action.quit = [ ];
"Mod+Shift+P".action.power-off-monitors = [ ];
"Mod+O" = {
action.toggle-overview = [ ];
repeat = false;
};
"Mod+Q" = {
action.close-window = [ ];
repeat = false;
};
"Mod+H".action.focus-column-or-monitor-left = [ ];
"Mod+J".action.focus-window-down = [ ];
"Mod+K".action.focus-window-up = [ ];
"Mod+L".action.focus-column-or-monitor-right = [ ];
"Mod+Ctrl+Left".action.move-column-left = [ ];
"Mod+Ctrl+Down".action.move-window-down = [ ];
"Mod+Ctrl+Up".action.move-window-up = [ ];
"Mod+Ctrl+Right".action.move-column-right = [ ];
"Mod+Ctrl+H".action.move-column-left = [ ];
"Mod+Ctrl+J".action.move-window-down = [ ];
"Mod+Ctrl+K".action.move-window-up = [ ];
"Mod+Ctrl+L".action.move-column-right = [ ];
"Mod+Home".action.focus-column-first = [ ];
"Mod+End".action.focus-column-last = [ ];
"Mod+Ctrl+Home".action.move-column-to-first = [ ];
"Mod+Ctrl+End".action.move-column-to-last = [ ];
"Mod+Shift+Left".action.focus-monitor-left = [ ];
"Mod+Shift+Down".action.focus-monitor-down = [ ];
"Mod+Shift+Up".action.focus-monitor-up = [ ];
"Mod+Shift+Right".action.focus-monitor-right = [ ];
"Mod+Shift+H".action.focus-monitor-left = [ ];
"Mod+Shift+J".action.focus-monitor-down = [ ];
"Mod+Shift+K".action.focus-monitor-up = [ ];
"Mod+Shift+L".action.focus-monitor-right = [ ];
"Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = [ ];
"Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = [ ];
"Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = [ ];
"Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = [ ];
"Mod+Shift+Ctrl+H".action.move-column-to-monitor-left = [ ];
"Mod+Shift+Ctrl+J".action.move-column-to-monitor-down = [ ];
"Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = [ ];
"Mod+Shift+Ctrl+L".action.move-column-to-monitor-right = [ ];
"Mod+Page_Down".action.focus-workspace-down = [ ];
"Mod+Page_Up".action.focus-workspace-up = [ ];
"Mod+U".action.focus-workspace-down = [ ];
"Mod+I".action.focus-workspace-up = [ ];
"Mod+Ctrl+Page_Down".action.move-column-to-workspace-down = [ ];
"Mod+Ctrl+Page_Up".action.move-column-to-workspace-up = [ ];
"Mod+Ctrl+U".action.move-column-to-workspace-down = [ ];
"Mod+Ctrl+I".action.move-column-to-workspace-up = [ ];
"Mod+Shift+Page_Down".action.move-workspace-down = [ ];
"Mod+Shift+Page_Up".action.move-workspace-up = [ ];
"Mod+Shift+U".action.move-workspace-down = [ ];
"Mod+Shift+I".action.move-workspace-up = [ ];
"Mod+WheelScrollDown" = {
action.focus-workspace-down = [ ];
cooldown-ms = 150;
};
"Mod+WheelScrollUp" = {
action.focus-workspace-up = [ ];
cooldown-ms = 150;
};
"Mod+Ctrl+WheelScrollDown" = {
action.move-column-to-workspace-down = [ ];
cooldown-ms = 150;
};
"Mod+Ctrl+WheelScrollUp" = {
action.move-column-to-workspace-up = [ ];
cooldown-ms = 150;
};
"Mod+WheelScrollRight".action.focus-column-right = [ ];
"Mod+WheelScrollLeft".action.focus-column-left = [ ];
"Mod+Ctrl+WheelScrollRight".action.move-column-right = [ ];
"Mod+Ctrl+WheelScrollLeft".action.move-column-left = [ ];
"Mod+Shift+WheelScrollDown".action.focus-column-right = [ ];
"Mod+Shift+WheelScrollUp".action.focus-column-left = [ ];
"Mod+Ctrl+Shift+WheelScrollDown".action.move-column-right = [ ];
"Mod+Ctrl+Shift+WheelScrollUp".action.move-column-left = [ ];
"Mod+1".action.focus-workspace = 1;
"Mod+2".action.focus-workspace = 2;
"Mod+3".action.focus-workspace = 3;
"Mod+4".action.focus-workspace = 4;
"Mod+5".action.focus-workspace = 5;
"Mod+6".action.focus-workspace = 6;
"Mod+7".action.focus-workspace = 7;
"Mod+8".action.focus-workspace = 8;
"Mod+9".action.focus-workspace = 9;
"Mod+Ctrl+1".action.move-column-to-workspace = 1;
"Mod+Ctrl+2".action.move-column-to-workspace = 2;
"Mod+Ctrl+3".action.move-column-to-workspace = 3;
"Mod+Ctrl+4".action.move-column-to-workspace = 4;
"Mod+Ctrl+5".action.move-column-to-workspace = 5;
"Mod+Ctrl+6".action.move-column-to-workspace = 6;
"Mod+Ctrl+7".action.move-column-to-workspace = 7;
"Mod+Ctrl+8".action.move-column-to-workspace = 8;
"Mod+Ctrl+9".action.move-column-to-workspace = 9;
"Mod+BracketLeft".action.consume-or-expel-window-left = [ ];
"Mod+BracketRight".action.consume-or-expel-window-right = [ ];
"Mod+Comma".action.consume-window-into-column = [ ];
"Mod+Period".action.expel-window-from-column = [ ];
"Mod+R".action.switch-preset-column-width = [ ];
"Mod+Shift+R".action.switch-preset-window-height = [ ];
"Mod+Ctrl+R".action.reset-window-height = [ ];
"Mod+F".action.maximize-column = [ ];
"Mod+Shift+F".action.fullscreen-window = [ ];
"Mod+M".action.maximize-window-to-edges = [ ];
"Mod+Ctrl+F".action.expand-column-to-available-width = [ ];
"Mod+C".action.center-column = [ ];
"Mod+Ctrl+C".action.center-visible-columns = [ ];
"Mod+Minus".action.set-column-width = "-10%";
"Mod+Equal".action.set-column-width = "+10%";
"Mod+Shift+Minus".action.set-window-height = "-10%";
"Mod+Shift+Equal".action.set-window-height = "+10%";
"Mod+V".action.toggle-window-floating = [ ];
"Mod+Shift+V".action.switch-focus-between-floating-and-tiling = [ ];
"Mod+W".action.toggle-column-tabbed-display = [ ];
}
+168
View File
@@ -0,0 +1,168 @@
{
inputs,
config,
...
}:
let
repo = config.repo;
repoHelpers = repo.helpers;
in
{
flake.modules.nixos.niri =
{ pkgs, ... }:
{
imports = [ inputs.niri.nixosModules.niri ];
nixpkgs.overlays = [ inputs.niri.overlays.niri ];
programs.niri.enable = true;
programs.niri.package = pkgs.niri-unstable;
programs.dconf.enable = true;
services.gvfs.enable = true;
services.udisks2.enable = true;
xdg.portal.enable = true;
};
flake.modules.homeManager.niri =
{
config,
lib,
osConfig,
pkgs,
...
}:
let
repoTheme = repo.theme.kanagawa;
browserCommand = repo.desktop.browser.command;
fileManagerPackage = repoHelpers.resolvePackagePath {
inherit pkgs;
path = repo.desktop.fileManager.packagePath;
};
terminalCommand = config.repo.terminal.primary.command;
outputs = lib.mapAttrs (
_: display:
{
position = {
x = display.x;
y = display.y;
};
}
// lib.optionalAttrs (display.primary or false) {
"focus-at-startup" = true;
}
// lib.optionalAttrs (display.scale != null) {
inherit (display) scale;
}
// lib.optionalAttrs (display.width != null && display.height != null && display.refresh != null) {
mode = {
inherit (display)
width
height
refresh
;
};
}
) osConfig.meta.machine.displays;
in
{
assertions = [
{
assertion = fileManagerPackage != null;
message = "Unknown file manager package `${lib.showAttrPath repo.desktop.fileManager.packagePath}`.";
}
];
home.sessionVariables.NIXOS_OZONE_WL = "1";
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
};
home.packages =
with pkgs;
[
playerctl
brightnessctl
xwayland-satellite
]
++ [ fileManagerPackage ];
programs.niri.settings = {
inherit outputs;
environment.DISPLAY = ":0";
spawn-at-startup = [
{ command = [ "xwayland-satellite" ]; }
{ command = [ "noctalia-shell" ]; }
];
prefer-no-csd = true;
hotkey-overlay.skip-at-startup = true;
screenshot-path = "${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%dT%H:%M:%S.png";
animations.slowdown = 0.6;
cursor = with config.home.pointerCursor; {
size = size;
theme = name;
hide-after-inactive-ms = 3000;
hide-when-typing = true;
};
layout = {
always-center-single-column = true;
gaps = 14;
focus-ring.enable = false;
default-column-width.proportion = 1. / 2.;
border = {
enable = true;
width = 3;
active.color = repoTheme.palette.niri.border.active;
inactive.color = repoTheme.palette.niri.border.inactive;
urgent.color = repoTheme.palette.niri.border.urgent;
};
};
window-rules = [
{
geometry-corner-radius =
let
radius = 10.0;
in
{
bottom-left = radius;
bottom-right = radius;
top-left = radius;
top-right = radius;
};
clip-to-geometry = true;
}
];
debug.honor-xdg-activation-with-invalid-serial = true;
input = {
focus-follows-mouse.enable = true;
mouse."accel-speed" = 0.4;
keyboard = {
repeat-delay = 300;
repeat-rate = 50;
xkb.options = "caps:escape";
};
touchpad = {
dwt = true;
};
};
binds = import ./_bindings.nix {
inherit
browserCommand
terminalCommand
;
};
};
};
}
+57
View File
@@ -0,0 +1,57 @@
{ inputs, ... }:
{
flake.modules.nixos.nix =
{ ... }:
{
nixpkgs.config.allowUnfree = true;
nix = {
gc.automatic = true;
optimise.automatic = true;
registry.nixpkgs.flake = inputs.nixpkgs;
channel.enable = false;
settings = {
trusted-users = [ "@wheel" ];
use-xdg-base-directories = true;
auto-optimise-store = true;
experimental-features = [
"nix-command"
"flakes"
];
};
};
};
flake.modules.homeManager.nix =
{ pkgs, ... }:
{
imports = [
inputs.nix-index-database.homeModules.default
];
home.packages = [
(pkgs.writeShellApplication {
name = "ns";
runtimeInputs = [
pkgs.fzf
pkgs.nix-search-tv
];
text = builtins.readFile "${pkgs.nix-search-tv.src}/nixpkgs.sh";
})
];
programs.nix-index-database.comma.enable = true;
programs.television = {
enable = true;
enableZshIntegration = false;
};
programs.nix-search-tv = {
enable = true;
enableTelevisionIntegration = true;
};
};
}
@@ -0,0 +1,569 @@
{
homeDirectory,
lib,
terminal,
}:
{
settingsVersion = 53;
bar = {
barType = "simple";
position = "top";
monitors = [ ];
density = "default";
showOutline = false;
showCapsule = false;
capsuleOpacity = 1;
capsuleColorKey = "none";
widgetSpacing = 6;
contentPadding = 2;
fontScale = 1;
backgroundOpacity = 0;
useSeparateOpacity = false;
floating = false;
marginVertical = 6;
marginHorizontal = 8;
frameThickness = 0;
frameRadius = 0;
outerCorners = false;
hideOnOverview = true;
displayMode = "always_visible";
autoHideDelay = 500;
autoShowDelay = 150;
showOnWorkspaceSwitch = true;
widgets = {
left = [
{
colorizeSystemIcon = "none";
customIconPath = "";
enableColorization = false;
icon = "rocket";
iconColor = "none";
id = "Launcher";
useDistroLogo = false;
}
{
characterCount = 2;
colorizeIcons = true;
emptyColor = "secondary";
enableScrollWheel = true;
focusedColor = "primary";
followFocusedScreen = false;
groupedBorderOpacity = 1;
hideUnoccupied = true;
iconScale = 0.75;
id = "Workspace";
labelMode = "none";
occupiedColor = "secondary";
pillSize = 0.6;
showApplications = true;
showBadge = false;
showLabelsOnlyWhenOccupied = true;
unfocusedIconsOpacity = 1;
}
];
center = [
{
clockColor = "none";
customFont = "";
formatHorizontal = "HH:mm ddd, MMM dd";
formatVertical = "HH mm - dd MM";
id = "Clock";
tooltipFormat = "HH:mm ddd, MMM dd";
useCustomFont = false;
}
];
right = [
{
blacklist = [ ];
chevronColor = "none";
colorizeIcons = false;
drawerEnabled = true;
hidePassive = false;
id = "Tray";
pinned = [ ];
}
{
displayMode = "onhover";
iconColor = "none";
id = "Volume";
middleClickCommand = "pwvucontrol || pavucontrol";
textColor = "none";
}
{
colorizeDistroLogo = false;
colorizeSystemIcon = "none";
customIconPath = "";
enableColorization = false;
icon = "noctalia";
id = "ControlCenter";
useDistroLogo = false;
}
];
};
screenOverrides = [ ];
};
general = {
avatarImage = "${homeDirectory}/.face";
dimmerOpacity = 0;
showScreenCorners = false;
forceBlackScreenCorners = false;
scaleRatio = 1;
radiusRatio = 0.5;
iRadiusRatio = 0.5;
boxRadiusRatio = 0;
screenRadiusRatio = 0;
animationSpeed = 2;
animationDisabled = false;
compactLockScreen = false;
lockScreenAnimations = false;
lockOnSuspend = true;
showSessionButtonsOnLockScreen = true;
showHibernateOnLockScreen = false;
enableLockScreenMediaControls = false;
enableShadows = true;
shadowDirection = "bottom_right";
shadowOffsetX = 2;
shadowOffsetY = 3;
language = "";
allowPanelsOnScreenWithoutBar = true;
showChangelogOnStartup = true;
telemetryEnabled = false;
enableLockScreenCountdown = true;
lockScreenCountdownDuration = 10000;
autoStartAuth = false;
allowPasswordWithFprintd = false;
clockStyle = "custom";
clockFormat = "hh\\nmm";
passwordChars = false;
lockScreenMonitors = [ ];
lockScreenBlur = 0;
lockScreenTint = 0;
keybinds = {
keyUp = [
"Up"
"Ctrl+K"
];
keyDown = [
"Down"
"Ctrl+J"
];
keyLeft = [
"Left"
"Ctrl+H"
];
keyRight = [
"Right"
"Ctrl+L"
];
keyEnter = [
"Return"
];
keyEscape = [
"Esc"
];
keyRemove = [
"Del"
];
};
reverseScroll = false;
};
ui = {
fontDefault = "Comfortaa Medium";
fontFixed = "FiraCode Nerd Font";
fontDefaultScale = 1;
fontFixedScale = 1;
tooltipsEnabled = true;
boxBorderEnabled = false;
panelBackgroundOpacity = 1;
panelsAttachedToBar = true;
settingsPanelMode = "attached";
settingsPanelSideBarCardStyle = false;
};
location = {
name = "Meterik, Limburg";
weatherEnabled = true;
weatherShowEffects = true;
useFahrenheit = false;
use12hourFormat = false;
showWeekNumberInCalendar = true;
showCalendarEvents = true;
showCalendarWeather = true;
analogClockInCalendar = false;
firstDayOfWeek = "unknown character to parse: -";
",
" = "unknown character to parse: h";
deWeatherTimezone = false;
hideWeatherCityName = false;
};
calendar = {
cards = [
{
enabled = true;
id = "calendar-header-card";
}
{
enabled = true;
id = "calendar-month-card";
}
{
enabled = true;
id = "weather-card";
}
];
};
wallpaper = {
enabled = true;
overviewEnabled = false;
directory = "${homeDirectory}/media/images/wallpapers";
monitorDirectories = [ ];
enableMultiMonitorDirectories = false;
showHiddenFiles = false;
viewMode = "recursive";
setWallpaperOnAllMonitors = true;
fillMode = "crop";
fillColor = "#000000";
useSolidColor = false;
solidColor = "#1a1a2e";
automationEnabled = false;
wallpaperChangeMode = "random";
randomIntervalSec = 300;
transitionDuration = 1500;
transitionType = "random";
skipStartupTransition = false;
transitionEdgeSmoothness = 5.0e-2;
panelPosition = "follow_bar";
hideWallpaperFilenames = false;
overviewBlur = 0.4;
overviewTint = 0.6;
useWallhaven = false;
wallhavenQuery = "";
wallhavenSorting = "relevance";
wallhavenOrder = "desc";
wallhavenCategories = "111";
wallhavenPurity = "100";
wallhavenRatios = "";
wallhavenApiKey = "";
wallhavenResolutionMode = "atleast";
wallhavenResolutionWidth = "";
wallhavenResolutionHeight = "";
sortOrder = "name";
favorites = [ ];
};
appLauncher = {
enableClipboardHistory = true;
autoPasteClipboard = false;
enableClipPreview = true;
clipboardWrapText = true;
clipboardWatchTextCommand = "wl-paste --type text --watch cliphist store";
clipboardWatchImageCommand = "wl-paste --type image --watch cliphist store";
position = "top_center";
pinnedApps = [ ];
useApp2Unit = false;
sortByMostUsed = true;
terminalCommand = lib.concatStringsSep " " ([ terminal.command ] ++ terminal.execArgs);
customLaunchPrefixEnabled = false;
customLaunchPrefix = "";
viewMode = "grid";
showCategories = true;
iconMode = "tabler";
showIconBackground = false;
enableSettingsSearch = true;
enableWindowsSearch = true;
enableSessionSearch = true;
ignoreMouseInput = false;
screenshotAnnotationTool = "";
overviewLayer = false;
density = "default";
};
controlCenter = {
position = "close_to_bar_button";
diskPath = "/";
shortcuts = {
left = [
{
id = "Network";
}
{
id = "Bluetooth";
}
{
id = "WallpaperSelector";
}
{
id = "NoctaliaPerformance";
}
];
right = [
{
id = "Notifications";
}
{
id = "PowerProfile";
}
{
id = "KeepAwake";
}
{
id = "NightLight";
}
];
};
cards = [
{
enabled = true;
id = "profile-card";
}
{
enabled = true;
id = "shortcuts-card";
}
{
enabled = true;
id = "audio-card";
}
{
enabled = false;
id = "brightness-card";
}
{
enabled = true;
id = "weather-card";
}
{
enabled = true;
id = "media-sysmon-card";
}
];
};
systemMonitor = {
cpuWarningThreshold = 80;
cpuCriticalThreshold = 90;
tempWarningThreshold = 80;
tempCriticalThreshold = 90;
gpuWarningThreshold = 80;
gpuCriticalThreshold = 90;
memWarningThreshold = 80;
memCriticalThreshold = 90;
swapWarningThreshold = 80;
swapCriticalThreshold = 90;
diskWarningThreshold = 80;
diskCriticalThreshold = 90;
diskAvailWarningThreshold = 20;
diskAvailCriticalThreshold = 10;
batteryWarningThreshold = 20;
batteryCriticalThreshold = 5;
enableDgpuMonitoring = false;
useCustomColors = false;
warningColor = "";
criticalColor = "";
externalMonitor = "resources || missioncenter || jdsystemmonitor || corestats || system-monitoring-center || gnome-system-monitor || plasma-systemmonitor || mate-system-monitor || ukui-system-monitor || deepin-system-monitor || pantheon-system-monitor";
};
dock = {
enabled = false;
position = "bottom";
displayMode = "exclusive";
dockType = "floating";
backgroundOpacity = 1;
floatingRatio = 1;
size = 1;
onlySameOutput = true;
monitors = [ ];
pinnedApps = [ ];
colorizeIcons = false;
showLauncherIcon = false;
launcherPosition = "end";
launcherIconColor = "none";
pinnedStatic = false;
inactiveIndicators = false;
groupApps = false;
groupContextMenuMode = "extended";
groupClickAction = "cycle";
groupIndicatorStyle = "dots";
deadOpacity = 0.6;
animationSpeed = 1;
sitOnFrame = false;
showFrameIndicator = true;
};
network = {
wifiEnabled = true;
airplaneModeEnabled = false;
bluetoothRssiPollingEnabled = false;
bluetoothRssiPollIntervalMs = 60000;
networkPanelView = "wifi";
wifiDetailsViewMode = "grid";
bluetoothDetailsViewMode = "grid";
bluetoothHideUnnamedDevices = false;
disableDiscoverability = false;
};
sessionMenu = {
enableCountdown = true;
countdownDuration = 10000;
position = "center";
showHeader = true;
showKeybinds = true;
largeButtonsStyle = true;
largeButtonsLayout = "single-row";
powerOptions = [
{
action = "lock";
command = "";
countdownEnabled = true;
enabled = true;
keybind = "1";
}
{
action = "suspend";
command = "";
countdownEnabled = true;
enabled = true;
keybind = "2";
}
{
action = "hibernate";
command = "";
countdownEnabled = true;
enabled = true;
keybind = "3";
}
{
action = "reboot";
command = "";
countdownEnabled = true;
enabled = true;
keybind = "4";
}
{
action = "logout";
command = "";
countdownEnabled = true;
enabled = true;
keybind = "5";
}
{
action = "shutdown";
command = "";
countdownEnabled = true;
enabled = true;
keybind = "6";
}
{
action = "rebootToUefi";
command = "";
countdownEnabled = true;
enabled = true;
keybind = "";
}
];
};
notifications = {
enabled = true;
enableMarkdown = false;
density = "default";
monitors = [ ];
location = "top_right";
overlayLayer = true;
backgroundOpacity = 1;
respectExpireTimeout = false;
lowUrgencyDuration = 3;
normalUrgencyDuration = 8;
criticalUrgencyDuration = 15;
clearDismissed = true;
saveToHistory = {
low = true;
normal = true;
critical = true;
};
sounds = {
enabled = false;
volume = 0.5;
separateSounds = false;
criticalSoundFile = "";
normalSoundFile = "";
lowSoundFile = "";
excludedApps = "discord,firefox,chrome,chromium,edge";
};
enableMediaToast = false;
enableKeyboardLayoutToast = true;
enableBatteryToast = true;
};
osd = {
enabled = true;
location = "top_right";
autoHideMs = 2000;
overlayLayer = true;
backgroundOpacity = 1;
enabledTypes = [
0
1
2
];
monitors = [ ];
};
audio = {
volumeStep = 5;
volumeOverdrive = false;
cavaFrameRate = 30;
visualizerType = "linear";
mprisBlacklist = [ ];
preferredPlayer = "";
volumeFeedback = false;
volumeFeedbackSoundFile = "";
};
brightness = {
brightnessStep = 5;
enforceMinimum = true;
enableDdcSupport = false;
backlightDeviceMappings = [ ];
};
colorSchemes = {
useWallpaperColors = false;
predefinedScheme = "Kanagawa";
darkMode = true;
schedulingMode = "off";
manualSunrise = "06:30";
manualSunset = "18:30";
generationMethod = "tonal-spot";
monitorForColors = "";
};
templates = {
activeTemplates = [ ];
enableUserTheming = false;
};
nightLight = {
enabled = false;
forced = false;
autoSchedule = true;
nightTemp = "4000";
dayTemp = "6500";
manualSunrise = "06:30";
manualSunset = "18:30";
};
hooks = {
enabled = false;
wallpaperChange = "";
darkModeChange = "";
screenLock = "";
screenUnlock = "";
performanceModeEnabled = "";
performanceModeDisabled = "";
startup = "";
session = "";
};
plugins = {
autoUpdate = false;
};
idle = {
enabled = false;
screenOffTimeout = 600;
lockTimeout = 660;
suspendTimeout = 1800;
fadeDuration = 5;
customCommands = "[]";
};
desktopWidgets = {
enabled = false;
overviewEnabled = true;
gridSnap = false;
monitorWidgets = [ ];
};
}
+92
View File
@@ -0,0 +1,92 @@
{
config,
lib,
...
}:
let
mkNoctaliaSettings =
{
homeDirectory,
lib,
terminal,
}:
import ./_noctalia-config.nix {
inherit
homeDirectory
lib
terminal
;
};
mkBaseSettings =
{
homeDirectory,
lib,
terminal,
}:
mkNoctaliaSettings {
inherit
homeDirectory
lib
terminal
;
};
mkPortableSettings =
baseSettings:
lib.recursiveUpdate baseSettings {
bar.widgets.right = lib.concatMap (
widget:
if widget.id == "ControlCenter" then
[
{
id = "Network";
}
{
id = "Battery";
showPowerProfiles = true;
displayMode = "graphic";
}
widget
]
else
[ widget ]
) baseSettings.bar.widgets.right;
};
in
{
flake.modules.homeManager.noctalia =
{
config,
inputs,
lib,
osConfig,
pkgs,
...
}:
let
baseSettings = mkBaseSettings {
inherit lib;
homeDirectory = config.home.homeDirectory;
terminal = config.repo.terminal.primary;
};
settings =
if baseSettings == { } || !osConfig.meta.machine.portable then
baseSettings
else
mkPortableSettings baseSettings;
in
{
imports = [ inputs.noctalia.homeModules.default ];
programs.noctalia-shell = {
enable = true;
package = lib.mkForce (
inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default.override {
calendarSupport = true;
}
);
inherit settings;
};
};
}
+82
View File
@@ -0,0 +1,82 @@
{
config,
...
}:
let
repo = config.repo;
in
{
flake.modules.homeManager.pim =
{
config,
...
}:
let
calendarsPath = "${config.xdg.dataHome}/calendars";
in
{
programs.pimsync.enable = true;
services.pimsync.enable = true;
programs.khal = {
enable = false;
locale = {
timeformat = "%H:%M";
dateformat = "$m-$d";
};
};
programs.todoman = {
enable = true;
glob = "*/*";
extraConfig = ''
date_format = "%Y-%m-%d"
time_format = "%H:%M"
default_list = "personal"
default_due = 0
default_command = "list --sort priority,due"
humanize = True
'';
};
accounts.calendar = {
basePath = calendarsPath;
accounts.radicale = {
primary = true;
primaryCollection = "personal";
local = {
type = "filesystem";
fileExt = ".ics";
};
remote = {
url = repo.services.radicale.url;
type = "caldav";
userName = config.home.username;
passwordCommand = [
"rbw"
"get"
"Radicale"
];
};
pimsync = {
enable = true;
extraPairDirectives = [
{
name = "collections";
params = [ "from b" ];
}
];
};
khal = {
enable = true;
type = "discover";
color = "light blue";
};
};
};
};
}
+24
View File
@@ -0,0 +1,24 @@
{ ... }:
{
flake.modules.nixos.plymouth =
{ pkgs, ... }:
{
boot = {
consoleLogLevel = 3;
initrd.verbose = false;
kernelParams = [
"quiet"
"udev.log_priority=3"
"rd.systemd.show_status=false"
"vt.global_cursor_default=0"
];
plymouth = {
enable = true;
theme = "spinner_alt";
themePackages = [ pkgs.adi1090x-plymouth-themes ];
};
};
};
}
+8
View File
@@ -0,0 +1,8 @@
{ ... }:
{
flake.modules.homeManager.podman = {
services.podman = {
enable = true;
};
};
}
+14
View File
@@ -0,0 +1,14 @@
{
flake.modules.nixos.printing =
{ pkgs, ... }:
{
services.printing = {
enable = true;
drivers = with pkgs; [
cups-filters
cups-browsed
cnijfilter2
];
};
};
}
@@ -0,0 +1,22 @@
{
flake.modules.nixos.qbittorrent-client = {
networking.firewall = {
allowedTCPPorts = [ 43864 ];
allowedUDPPorts = [ 43864 ];
};
};
flake.modules.homeManager.qbittorrent-client =
{
lib,
pkgs,
...
}:
{
home.packages = [ pkgs.qbittorrent ];
programs.niri.settings.spawn-at-startup = lib.mkAfter [
{ command = [ "qbittorrent" ]; }
];
};
}
+22
View File
@@ -0,0 +1,22 @@
{ ... }:
{
flake.modules.nixos.region-nl = {
time.timeZone = "Europe/Amsterdam";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_MEASUREMENT = "nl_NL.UTF-8";
LC_PAPER = "nl_NL.UTF-8";
LC_ADDRESS = "nl_NL.UTF-8";
LC_TELEPHONE = "nl_NL.UTF-8";
LC_NAME = "nl_NL.UTF-8";
# Use '.' as decimal point and ',' as thouands separator
LC_NUMERIC = "en_IE.UTF-8";
LC_MONETARY = "en_IE.UTF-8";
# English day and month names, YYYY-MM-DD format
LC_TIME = "en_IE.UTF-8";
};
};
}
+21
View File
@@ -0,0 +1,21 @@
{
flake.modules.nixos.sddm =
{
pkgs,
...
}:
{
services.displayManager.sddm = {
enable = true;
enableHidpi = true;
wayland.enable = true;
wayland.compositor = "kwin";
theme = "${
pkgs.sddm-astronaut.override { embeddedTheme = "purple_leaves"; }
}/share/sddm/themes/sddm-astronaut-theme";
extraPackages = with pkgs; [
kdePackages.qtmultimedia
];
};
};
}
+29
View File
@@ -0,0 +1,29 @@
{ config, ... }:
let
repo = config.repo;
repoHelpers = repo.helpers;
service = repo.services.actual;
in
{
flake.modules.nixos.actual =
{ lib, ... }:
lib.mkMerge [
{
services.actual = {
enable = true;
openFirewall = false;
settings = {
inherit (service) port;
hostname = service.host;
};
};
}
(repoHelpers.mkCaddyReverseProxy {
inherit (service)
domain
port
;
})
];
}
+13
View File
@@ -0,0 +1,13 @@
{ config, ... }:
let
repo = config.repo;
in
{
flake.modules.nixos.caddy = {
services.caddy = {
enable = true;
email = repo.account.primaryEmail.address;
openFirewall = true;
};
};
}
+42
View File
@@ -0,0 +1,42 @@
{ config, ... }:
let
repo = config.repo;
repoHelpers = repo.helpers;
service = repo.services.gitea;
in
{
flake.modules.nixos.gitea =
{ lib, ... }:
lib.mkMerge [
{
services.gitea = {
enable = true;
settings = {
server = {
DOMAIN = service.domain;
ROOT_URL = service.url;
HTTP_PORT = service.port;
HTTP_ADDR = service.host;
START_SSH_SERVER = false;
SSH_PORT = 22;
};
service.DISABLE_REGISTRATION = true;
};
};
}
{
services.openssh.settings.AllowUsers = [ "gitea" ];
}
(repoHelpers.mkCaddyReverseProxy {
inherit (service)
domain
port
;
})
];
}
+34
View File
@@ -0,0 +1,34 @@
{ config, lib, ... }:
let
account = config.repo.account;
personalPublicKeys =
machines:
map (machine: machine.sshKeys.personal.publicKey) (
lib.filter (machine: machine.sshKeys ? personal) (builtins.attrValues machines)
);
in
{
flake.modules.nixos.ssh-agent-auth = {
security.pam = {
rssh.enable = true;
services.sudo.rssh = true;
};
};
flake.modules.nixos.openssh =
{ ... }:
{
services.openssh.openFirewall = true;
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
AllowUsers = [ account.name ];
};
};
users.users.${account.name}.openssh.authorizedKeys.keys = personalPublicKeys config.repo.machines;
};
}
@@ -0,0 +1,49 @@
{ config, ... }:
let
repo = config.repo;
repoHelpers = repo.helpers;
service = repo.services.radicale;
in
{
flake.modules.nixos.radicale =
{ lib, ... }:
lib.mkMerge [
{
services.radicale = {
enable = true;
settings = {
server.hosts = [ "${service.host}:${toString service.port}" ];
auth = {
type = "htpasswd";
htpasswd_filename = "/var/lib/radicale/users";
htpasswd_encryption = "bcrypt";
};
storage.filesystem_folder = "/var/lib/radicale/collections";
};
};
}
(repoHelpers.mkCaddyReverseProxy {
inherit (service)
domain
port
;
extraHeaders = [
{
name = "X-Script-Name";
value = "/";
}
{
name = "X-Forwarded-For";
value = "{remote}";
}
{
name = "X-Remote-User";
value = "{http.auth.user.id}";
}
];
})
];
}
@@ -0,0 +1,31 @@
{ config, ... }:
let
repo = config.repo;
repoHelpers = repo.helpers;
service = repo.services.vaultwarden;
in
{
flake.modules.nixos.vaultwarden =
{ lib, ... }:
lib.mkMerge [
{
services.vaultwarden = {
enable = true;
backupDir = "/var/backup/vaultwarden";
config = {
DOMAIN = service.url;
SIGNUPS_ALLOWED = false;
ROCKET_PORT = service.port;
ROCKET_LOG = "critical";
};
};
}
(repoHelpers.mkCaddyReverseProxy {
inherit (service)
domain
port
;
})
];
}
+183
View File
@@ -0,0 +1,183 @@
{
flake.modules.homeManager.shell =
{
lib,
config,
pkgs,
...
}:
{
home.sessionVariables = {
STARSHIP_CACHE = "${config.xdg.cacheHome}/starship";
};
home.activation = {
clearZshCompDump = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
rm -f "${config.programs.zsh.dotDir}"/.zcompdump*
'';
};
programs.zsh = {
enable = true;
dotDir = "${config.xdg.configHome}/zsh";
enableCompletion = true;
completionInit = ''
autoload -U compinit
compinit -C
ZCOMPDUMP="${config.programs.zsh.dotDir}/.zcompdump"
{
if [[ -s "$ZCOMPDUMP" && (! -s "''${ZCOMPDUMP}.zwc" || "$ZCOMPDUMP" -nt "''${ZCOMPDUMP}.zwc") ]]; then
zcompile "$ZCOMPDUMP"
fi
} &!
'';
autosuggestion.enable = true;
syntaxHighlighting = {
enable = true;
highlighters = [
"main"
"brackets"
"pattern"
"regexp"
"root"
"line"
];
};
historySubstringSearch.enable = true;
history = {
ignoreDups = true;
save = 10000;
size = 10000;
path = "${config.xdg.dataHome}/zsh_history";
};
profileExtra = lib.optionalString (config.home.sessionPath != [ ]) ''
export PATH="$PATH''${PATH:+:}${lib.concatStringsSep ":" config.home.sessionPath}"
'';
initContent = ''
bindkey -v
export KEYTIMEOUT=1
autoload -U history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^[OA" history-beginning-search-backward-end
bindkey "^[OB" history-beginning-search-forward-end
zstyle ':completion:*' completer _extensions _complete _approximate
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/.zcompcache"
zstyle ':completion:*' complete true
zstyle ':completion:*' complete-options true
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' keep-prefix true
zstyle ':completion:*' menu select
zstyle ':completion:*' list-grouped false
zstyle ':completion:*' list-separator '''
zstyle ':completion:*' group-name '''
zstyle ':completion:*' verbose yes
zstyle ':completion:*:matches' group 'yes'
zstyle ':completion:*:warnings' format '%F{red}%B-- No match for: %d --%b%f'
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b'
zstyle ':completion:*:descriptions' format '[%d]'
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
zstyle ':completion:*:*:cd:*' tag-order local-directories directory-stack path-directories
zstyle ':completion:*:*:cd:*:directory-stack' menu yes select
zstyle ':completion:*:-tilde-:*' group-order 'named-directories' 'path-directories' 'users' 'expand'
zstyle ':completion:*:*:-command-:*:*' group-order aliases builtins functions commands
zstyle ':completion:*' special-dirs true
zstyle ':completion:*' squeeze-slashes true
zstyle ':completion:*' sort false
zstyle ":completion:*:git-checkout:*" sort false
zstyle ':completion:*' file-sort modification
zstyle ':completion:*:eza' sort false
zstyle ':completion:complete:*:options' sort false
zstyle ':completion:files' sort false
'';
};
programs.starship = {
enable = true;
enableZshIntegration = true;
settings = {
add_newline = true;
format = lib.concatStrings [
"$nix_shell"
"$hostname"
"$directory"
"$git_branch"
"$git_state"
"$line_break"
"$character"
];
directory = {
truncation_length = 99;
truncate_to_repo = false;
};
nix_shell = {
format = "[$symbol]($style) ";
symbol = "🐚";
style = "";
};
git_state = {
format = "([$state( $progress_current/$progress_total)]($style)) ";
style = "bright-black";
};
line_break.disabled = false;
};
};
programs.eza = {
enable = true;
extraOptions = [ "--group-directories-first" ];
};
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.bottom.enable = true;
programs.yazi = {
enable = true;
shellWrapperName = "y";
};
home.packages = [
pkgs.fd
pkgs.bat
pkgs.tlrc
pkgs.sd
pkgs.procs
pkgs.dua
pkgs.duf
pkgs.systemctl-tui
pkgs.xh
];
services.tldr-update = {
enable = true;
package = pkgs.tlrc;
};
};
}
+20
View File
@@ -0,0 +1,20 @@
{
flake.modules.homeManager.ssh-client =
{ config, ... }:
{
programs.ssh = {
enable = true;
enableDefaultConfig = false;
includes = [
config.sops.templates."ssh-config-orion".path
];
};
sops.secrets."orion-ip" = { };
sops.templates."ssh-config-orion".content = ''
Host orion
HostName ${config.sops.placeholder."orion-ip"}
ForwardAgent yes
'';
};
}
+35
View File
@@ -0,0 +1,35 @@
{ ... }:
{
flake.modules.nixos.standard-boot =
{ config, pkgs, ... }:
{
boot = {
loader = {
efi.canTouchEfiVariables = true;
systemd-boot = {
enable = true;
consoleMode = "auto";
configurationLimit = 5;
extraInstallCommands = ''
ENTRIES="${config.boot.loader.efi.efiSysMountPoint}/loader/entries"
PROFILES="/nix/var/nix/profiles"
for file in "$ENTRIES"/nixos-generation-*.conf; do
generation=$(${pkgs.coreutils}/bin/basename "$file" | ${pkgs.gnugrep}/bin/grep -o -E '[0-9]+')
timestamp=$(${pkgs.coreutils}/bin/stat -c %y "$PROFILES/system-$generation-link" 2>/dev/null | ${pkgs.coreutils}/bin/cut -d. -f1)
if [ -z "$timestamp" ]; then
timestamp="Unknown Date"
fi
${pkgs.gnused}/bin/sed -i "s/^version .*/version Generation $generation - $timestamp/" "$file"
done
'';
};
};
tmp.cleanOnBoot = true;
kernelPackages = pkgs.linuxPackages_latest;
};
};
}
+9
View File
@@ -0,0 +1,9 @@
{ ... }:
{
flake.modules.nixos.steam = {
programs.steam = {
enable = true;
protontricks.enable = true;
};
};
}
+52
View File
@@ -0,0 +1,52 @@
{
config,
lib,
...
}:
let
syncthingMesh = lib.listToAttrs (
lib.concatMap (
machine:
lib.optional (machine.syncthingId != null) (
let
name = "${config.repo.account.name}@${machine.name}";
in
{
inherit name;
value = {
inherit name;
id = machine.syncthingId;
};
}
)
) (builtins.attrValues config.repo.machines)
);
in
{
flake.modules.homeManager.syncthing =
{ ... }:
{
services.syncthing = {
enable = true;
overrideDevices = true;
overrideFolders = true;
settings = {
folders = {
sync = {
path = "~/sync";
label = "sync";
devices = builtins.attrNames syncthingMesh;
};
calibre = {
path = "~/calibre";
label = "calibre";
devices = builtins.attrNames syncthingMesh;
};
};
devices = syncthingMesh;
};
};
};
}
+196
View File
@@ -0,0 +1,196 @@
{ config, ... }:
let
repo = config.repo;
mkPrimaryTerminalOption =
lib:
lib.mkOption {
type = lib.types.submodule {
options = {
package = lib.mkOption {
type = lib.types.package;
};
command = lib.mkOption {
type = lib.types.str;
};
desktopId = lib.mkOption {
type = lib.types.str;
};
execArgs = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
};
};
};
};
mkPrimaryTerminal =
{
desktopId,
packageFor,
terminalModule,
}:
{ lib, pkgs, ... }:
let
package = packageFor pkgs;
in
{
imports = [ terminalModule ];
options.repo.terminal.primary = mkPrimaryTerminalOption lib;
config = {
repo.terminal.primary = {
inherit
desktopId
package
;
command = lib.getExe package;
execArgs = [ "-e" ];
};
xdg.terminal-exec = {
enable = true;
settings.default = [ desktopId ];
};
};
};
in
{
flake.modules.homeManager.terminal-foot =
{
lib,
pkgs,
...
}:
let
repoTheme = repo.theme.kanagawa;
palette = repoTheme.palette;
hex = lib.removePrefix "#";
in
{
programs.foot = {
enable = true;
package = pkgs.foot;
settings = {
main = {
font = "JetBrains Mono:size=11:fontfeatures=-liga:fontfeatures=-calt";
pad = "3x3";
};
bell.system = "no";
scrollback.lines = 10000;
colors-dark = {
background = hex palette.background;
foreground = hex palette.foreground;
selection-background = hex palette.selectionBackground;
selection-foreground = hex palette.selectionForeground;
urls = hex palette.url;
cursor = "${hex palette.background} ${hex palette.cursor}";
regular0 = hex palette.terminal.color0;
regular1 = hex palette.terminal.color1;
regular2 = hex palette.terminal.color2;
regular3 = hex palette.terminal.color3;
regular4 = hex palette.terminal.color4;
regular5 = hex palette.terminal.color5;
regular6 = hex palette.terminal.color6;
regular7 = hex palette.terminal.color7;
bright0 = hex palette.terminal.color8;
bright1 = hex palette.terminal.color9;
bright2 = hex palette.terminal.color10;
bright3 = hex palette.terminal.color11;
bright4 = hex palette.terminal.color12;
bright5 = hex palette.terminal.color13;
bright6 = hex palette.terminal.color14;
bright7 = hex palette.terminal.color15;
"16" = hex palette.terminal.color16;
"17" = hex palette.terminal.color17;
};
};
};
};
flake.modules.homeManager.terminal-kitty =
{ pkgs, ... }:
let
repoTheme = repo.theme.kanagawa;
palette = repoTheme.palette;
in
{
programs.kitty = {
enable = true;
package = pkgs.kitty;
font = {
name = "JetBrains Mono";
size = 11;
};
settings = {
disable_ligatures = "always";
scrollback_lines = 10000;
enable_audio_bell = false;
confirm_os_window_close = 0;
window_padding_width = 3;
update_check_interval = 0;
};
extraConfig = ''
## name: ${repoTheme.displayName}
## license: MIT
## author: Tommaso Laurenzi
## upstream: https://github.com/rebelot/kanagawa.nvim/
background ${palette.background}
foreground ${palette.foreground}
selection_background ${palette.selectionBackground}
selection_foreground ${palette.selectionForeground}
url_color ${palette.url}
cursor ${palette.cursor}
active_tab_background ${palette.background}
active_tab_foreground ${palette.selectionForeground}
inactive_tab_background ${palette.background}
inactive_tab_foreground ${palette.muted}
color0 ${palette.terminal.color0}
color1 ${palette.terminal.color1}
color2 ${palette.terminal.color2}
color3 ${palette.terminal.color3}
color4 ${palette.terminal.color4}
color5 ${palette.terminal.color5}
color6 ${palette.terminal.color6}
color7 ${palette.terminal.color7}
color8 ${palette.terminal.color8}
color9 ${palette.terminal.color9}
color10 ${palette.terminal.color10}
color11 ${palette.terminal.color11}
color12 ${palette.terminal.color12}
color13 ${palette.terminal.color13}
color14 ${palette.terminal.color14}
color15 ${palette.terminal.color15}
color16 ${palette.terminal.color16}
color17 ${palette.terminal.color17}
'';
};
};
flake.modules.homeManager.primary-terminal-foot = mkPrimaryTerminal {
desktopId = "foot.desktop";
packageFor = pkgs: pkgs.foot;
terminalModule = config.flake.modules.homeManager.terminal-foot;
};
flake.modules.homeManager.primary-terminal-kitty = mkPrimaryTerminal {
desktopId = "kitty.desktop";
packageFor = pkgs: pkgs.kitty;
terminalModule = config.flake.modules.homeManager.terminal-kitty;
};
}
+94
View File
@@ -0,0 +1,94 @@
{
config,
...
}:
let
repo = config.repo;
repoHelpers = repo.helpers;
in
{
flake.modules.nixos.theme =
{
pkgs,
...
}:
let
repoTheme = repo.theme;
cursorTheme = repoTheme.cursor // {
package = repoHelpers.resolvePackagePath {
inherit pkgs;
path = repoTheme.cursor.packagePath;
};
};
in
{
environment.systemPackages = [ cursorTheme.package ];
services.displayManager.sddm.settings = {
Theme = {
CursorTheme = cursorTheme.name;
CursorSize = cursorTheme.size;
};
};
};
flake.modules.homeManager.theme =
{ config, pkgs, ... }:
let
repoTheme = repo.theme;
cursorTheme = repoTheme.cursor // {
package = repoHelpers.resolvePackagePath {
inherit pkgs;
path = repoTheme.cursor.packagePath;
};
};
kanagawaThemeSrc = pkgs.fetchFromGitHub {
inherit (repoTheme.kanagawa)
hash
owner
repo
rev
;
};
kanagawaOverride = {
version = repoTheme.kanagawa.version;
src = kanagawaThemeSrc;
};
in
{
home.pointerCursor = {
inherit (cursorTheme)
name
package
size
;
dotIcons.enable = false;
gtk.enable = true;
};
gtk = {
enable = true;
gtk3.bookmarks = [
"sftp://orion Orion VPS"
];
theme = {
name = repoTheme.kanagawa.gtkThemeName;
package = pkgs.kanagawa-gtk-theme.overrideAttrs (_: kanagawaOverride);
};
gtk4.theme = {
inherit (config.gtk.theme) name package;
};
iconTheme = {
name = repoTheme.kanagawa.iconThemeName;
package = pkgs.kanagawa-icon-theme.overrideAttrs (_: kanagawaOverride);
};
};
qt = {
enable = true;
platformTheme.name = "gtk3";
};
};
}
+74
View File
@@ -0,0 +1,74 @@
{ config, ... }:
let
repo = config.repo;
in
{
flake.modules.homeManager.vicinae =
{
pkgs,
inputs,
...
}:
let
repoTheme = repo.theme.kanagawa;
palette = repoTheme.palette;
in
{
programs.vicinae = {
enable = true;
systemd.enable = true;
themes.${repoTheme.name} = {
meta = {
version = 1;
name = repoTheme.displayName;
description = "A dark theme inspired by the colors of the famous painting by Katsushika Hokusai.";
variant = "dark";
inherits = "vicinae-dark";
};
colors = {
core = {
background = palette.background;
foreground = palette.foreground;
secondary_background = palette.secondaryBackground;
border = palette.border;
accent = palette.accents.blue;
};
accents = {
inherit (palette.accents)
blue
cyan
green
magenta
orange
purple
red
yellow
;
};
input.border_focus = "colors.core.accent";
};
};
settings.theme = {
light.name = repoTheme.name;
dark.name = repoTheme.name;
};
extensions = with inputs.vicinae-extensions.packages.${pkgs.stdenv.hostPlatform.system}; [
agenda
brotab
fuzzy-files
github
it-tools
niri
nix
podman
process-manager
pulseaudio
simple-bookmarks
ssh
];
};
};
}
+65
View File
@@ -0,0 +1,65 @@
{ config, ... }:
let
repo = config.repo;
repoHelpers = repo.helpers;
in
{
flake.modules.homeManager.xdg =
{ config, pkgs, ... }:
let
browserPackage = repoHelpers.resolvePackagePath {
inherit pkgs;
path = repo.desktop.browser.packagePath;
};
fileManagerPackage = repoHelpers.resolvePackagePath {
inherit pkgs;
path = repo.desktop.fileManager.packagePath;
};
homeDir = config.home.homeDirectory;
localDir = "${homeDir}/.local";
mediaDir = "${homeDir}/media";
in
{
home.preferXdgDirectories = true;
xdg = {
enable = true;
cacheHome = "${localDir}/cache";
configHome = "${homeDir}/.config";
dataHome = "${localDir}/share";
stateHome = "${localDir}/state";
userDirs = {
enable = true;
createDirectories = true;
setSessionVariables = true;
download = "${homeDir}/downloads";
documents = "${homeDir}/documents";
projects = "${homeDir}/dev";
music = "${mediaDir}/music";
pictures = "${mediaDir}/images";
videos = "${mediaDir}/videos";
desktop = "${localDir}/desktop";
publicShare = "${localDir}/public";
templates = "${localDir}/templates";
};
mimeApps = {
enable = true;
defaultApplicationPackages =
with pkgs;
[
sioyek
imv
neovim
]
++ [
browserPackage
fileManagerPackage
];
};
};
};
}