Compare commits

..

14 Commits

182 changed files with 2079 additions and 17967 deletions

1
.envrc
View File

@@ -1 +0,0 @@
use flake

3
.gitignore vendored
View File

@@ -9,5 +9,4 @@ result-*
nixos-efi-vars.fd nixos-efi-vars.fd
.direnv/ /.pre-commit-config.yaml
.pre-commit-config.yaml

View File

@@ -1,8 +1,5 @@
# ❄️ NixOS flake # ❄️ NixOS flake
![nix](https://img.shields.io/badge/nix-blue?logo=nixos&logoColor=%234d6fb7&labelColor=%23fff&color=%234d6fb7&link=https%3A%2F%2Fnixos.org%2F)
![neovim](https://img.shields.io/badge/neovim-flat?logo=neovim&logoColor=%23408040&labelColor=%23fff&color=%2380C040)
## hosts ## hosts
### NixOS ### NixOS

View File

@@ -6,31 +6,30 @@
let let
inherit (inputs.nixpkgs) lib; inherit (inputs.nixpkgs) lib;
utils = import ../utils { inherit lib; }; utils = import ../utils { inherit lib; };
hostnames = utils.dirNames ../hosts; hostDirNames = utils.dirNames ../hosts;
mkNode = mkNode = hostname: tags: {
hostname:
let
meta = utils.hostMeta ../hosts/${hostname};
isLocal = builtins.elem "local" meta.tags;
in
{
imports = [ ../hosts/${hostname} ]; imports = [ ../hosts/${hostname} ];
host.name = hostname;
deployment = { deployment = {
inherit (meta) tags; targetHost = self.nixosConfigurations.${hostname}.config.ssh.publicHostname;
targetUser = meta.host.username; targetUser = self.nixosConfigurations.${hostname}.config.ssh.username;
targetHost = if isLocal then "" else hostname; buildOnTarget = builtins.any (t: t != "local" && t != "arm") tags;
buildOnTarget = builtins.any (t: t != "local" && t != "arm") meta.tags; inherit tags;
}; };
}; };
nodes = lib.genAttrs hostnames mkNode; nodes = lib.genAttrs hostDirNames (
hostname: mkNode hostname (utils.hostMeta ../hosts/${hostname}).deployment.tags
);
in in
inputs.colmena.lib.makeHive ( inputs.colmena.lib.makeHive (
{ {
meta = { meta = {
nixpkgs = import inputs.nixpkgs { localSystem = "x86_64-linux"; }; nixpkgs = import inputs.nixpkgs {
localSystem = "x86_64-linux";
};
nodeNixpkgs = builtins.mapAttrs (_: v: v.pkgs) self.nixosConfigurations;
specialArgs = { specialArgs = {
inherit inputs; inherit inputs;
outputs = self; outputs = self;

View File

@@ -27,6 +27,8 @@ alias ipa="ip -brief address"
alias ipl="ip -brief link" alias ipl="ip -brief link"
alias ipr="ip route" alias ipr="ip route"
alias clip="xclip -sel clip"
alias df="df -kTh" alias df="df -kTh"
alias fzfpac="pacman -Slq | fzf -m --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S" alias fzfpac="pacman -Slq | fzf -m --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S"
alias path='echo -e ${PATH//:/\\n}' # Pretty print path variables alias path='echo -e ${PATH//:/\\n}' # Pretty print path variables

View File

@@ -60,7 +60,7 @@ export XDG_DATA_HOME=$HOME/.local/share
if [ -f "/usr/bin/fzf" ]; then if [ -f "/usr/bin/fzf" ]; then
# Fuzzy finder setup # Fuzzy finder setup
export FZF_COMPLETION_TRIGGER='**' export FZF_COMPLETION_TRIGGER='**'
export FZF_DEFAULT_COMMAND='rg --files ""' export FZF_DEFAULT_COMMAND='ag -g ""'
export FZF_DEFAULT_OPTS=" export FZF_DEFAULT_OPTS="
--pointer='❭' --pointer='❭'
--height 10% --height 10%

4
dots/.bin/save-zk Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env bash
cd "$ZK_PATH" || echo "No zettelkasten directory found"
git a . && git commit -m "Update" && git push

20
dots/.bin/setup-zk Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
if [ ! -d ~/.zk ]; then
echo "[zk] Setting up zettelkasten"
gh repo clone zk ~/.zk
else
echo "[zk] Zettelkasten already set up."
fi
read -p "Would you like open your zettelkasten? [y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
if [ -x "$(command -v zk)" ]; then
zk
else
echo "Error: 'zk' command not found or not executable"
exit 1
fi
fi

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python3 #!/usr/bin/python
import argparse import argparse
import json import json

14
home/modules/zk/scripts/zk.sh → dots/.bin/zk Normal file → Executable file
View File

@@ -1,6 +1,8 @@
current_zettel_path="$(cat "$ZK_PATH/current-zettel.txt")" #!/usr/bin/env bash
if [ -n "${TMUX:-}" ]; then current_zettel_path="$ZK_PATH/$(cat "$ZK_PATH/current-zettel.txt")"
if [ "$TERM_PROGRAM" = tmux ]; then
cd "$ZK_PATH" && $EDITOR "$current_zettel_path" cd "$ZK_PATH" && $EDITOR "$current_zettel_path"
else else
echo 'Not in tmux' echo 'Not in tmux'
@@ -10,9 +12,13 @@ else
read -r -p 'Enter your choice: ' choice read -r -p 'Enter your choice: ' choice
case $choice in case $choice in
1) 1)
if tmux has-session -t zk 2>/dev/null; then # Check if a tmux session is running with a window named zk
tmux attach -t zk if tmux list-windows -F '#{window_name}' | grep -q zk; then
# Attach to the session containing the 'zk' window
session="$(tmux list-windows -F '#{window_name} #{session_name}' | grep zk | head -n 1 | awk '{ print $2 }')"
tmux attach -t "$session"
else else
# Create session with a window named 'zk' and start nvim
tmux new-session -s zk -n zk -d tmux new-session -s zk -n zk -d
tmux send-keys -t zk:zk "cd $ZK_PATH && $EDITOR $current_zettel_path" Enter tmux send-keys -t zk:zk "cd $ZK_PATH && $EDITOR $current_zettel_path" Enter
tmux attach -t zk tmux attach -t zk

View File

@@ -1,35 +0,0 @@
local hydra_repl = "hydra-repl"
if not vim.fn.executable(hydra_repl) then
return
end
local function send(lines)
vim.system({ hydra_repl, table.concat(lines, "\n") })
end
local function get_paragraph(buf)
local start_ = vim.fn.search("^$", "bnW")
local end_ = vim.fn.search("^$", "nW") - 1
if end_ < vim.api.nvim_win_get_cursor(0)[1] then
end_ = vim.api.nvim_buf_line_count(buf)
end
return vim.api.nvim_buf_get_lines(buf, start_, end_, false)
end
local function get_selection(buf)
return vim.api.nvim_buf_get_lines(buf, vim.fn.line("'<") - 1, vim.fn.line("'>"), false)
end
vim.api.nvim_create_autocmd("FileType", {
pattern = "javascript",
callback = function(e)
if vim.fn.fnamemodify(vim.api.nvim_buf_get_name(e.buf), ":e") ~= "hydra" then
return
end
local buf = e.buf
vim.keymap.set("n", "<CR>", function() send(get_paragraph(buf)) end, { buffer = buf, desc = "hydra: send block" })
vim.keymap.set("v", "<CR>", function() send(get_selection(buf)) end, { buffer = buf, desc = "hydra: send selection" })
end,
})

View File

@@ -1,5 +1,3 @@
if not vim.env.KITTY_WINDOW_ID then return end
require("image").setup({ require("image").setup({
backend = "kitty", backend = "kitty",
kitty_method = "normal", kitty_method = "normal",

View File

@@ -64,7 +64,7 @@ cmp.setup({
sources = { sources = {
{ name = "copilot", group_index = 2 }, { name = "copilot", group_index = 2 },
{ name = "zk" }, { name = "zk" },
{ name = "nvim_lsp" }, { name = "nvim_lsp", keyword_length = 8 },
{ name = "luasnip", max_item_count = 16 }, { name = "luasnip", max_item_count = 16 },
{ name = "path" }, { name = "path" },
{ name = "buffer", max_item_count = 8 }, { name = "buffer", max_item_count = 8 },

View File

@@ -1,8 +0,0 @@
require("ts_context_commentstring").setup({ enable_autocmd = false })
-- https://github.com/JoosepAlviste/nvim-ts-context-commentstring/issues/109
local get_option = vim.filetype.get_option
vim.filetype.get_option = function(filetype, option)
return option == "commentstring" and require("ts_context_commentstring.internal").calculate_commentstring()
or get_option(filetype, option)
end

View File

@@ -123,7 +123,7 @@ treesitter.setup({
}) })
opt.foldmethod = "expr" opt.foldmethod = "expr"
opt.foldexpr = "v:lua.vim.treesitter.foldexpr()" opt.foldexpr = "nvim_treesitter#foldexpr()"
opt.foldenable = false opt.foldenable = false
-- TreeSJ -- TreeSJ

View File

@@ -1,8 +1,6 @@
require("zk.utils")
vim.cmd([[ vim.cmd([[
" Change local buffer to directory of current file after the plugin has loaded " Change local buffer to directory of current file after the plugin has loaded
execute 'autocmd BufEnter' g:zk_path . '/*.md' 'silent lcd %:p:h' autocmd VimEnter * lcd %:p:h
" " Override wiki index mapping to also cd into the wiki " " Override wiki index mapping to also cd into the wiki
nm <leader>ww <plug>(wiki-index) nm <leader>ww <plug>(wiki-index)
@@ -13,16 +11,11 @@ nm <leader>ww <plug>(wiki-index)
" nm <leader>s <plug>(wiki-link-follow-split) " nm <leader>s <plug>(wiki-link-follow-split)
" nm <leader>v <plug>(wiki-link-follow-vsplit) " nm <leader>v <plug>(wiki-link-follow-vsplit)
function! ZKContextualEcho() autocmd BufEnter *.md if expand('%:t') =~ '_' | echo 'hierarchical relation' | endif
let l:name = expand('%:t') autocmd BufEnter *.md if expand('%:t') =~ '--' | echo 'relation' | endif
if l:name =~ '_' | echo 'hierarchical relation' autocmd BufEnter *.md if expand('%:t') =~ '<>' | echo 'dichotomy' | endif
elseif l:name =~ '--' | echo 'relation' autocmd BufEnter *.md if expand('%:t') =~ 'my-' | echo 'personal file' | endif
elseif l:name =~ '<>' | echo 'dichotomy' autocmd BufEnter *.md if expand('%:t') =~ 'project_' | echo 'project file' | endif
elseif l:name =~ 'my-' | echo 'personal file'
elseif l:name =~ 'project_' | echo 'project file'
endif
endfunction
execute 'autocmd BufEnter' g:zk_path . '/*.md' 'call ZKContextualEcho()'
" Only load wiki.vim for zk directory " Only load wiki.vim for zk directory
let g:wiki_index_name='index' let g:wiki_index_name='index'
@@ -83,7 +76,7 @@ let g:wiki_templates = [
" "
let g:wiki_filetypes=['md'] let g:wiki_filetypes=['md']
let g:wiki_root=g:zk_path let g:wiki_root='~/.zk'
let g:wiki_global_load=0 let g:wiki_global_load=0
let g:wiki_link_creation = { let g:wiki_link_creation = {
\ 'md': { \ 'md': {

View File

@@ -42,11 +42,11 @@
}, },
"nixCats": { "nixCats": {
"locked": { "locked": {
"lastModified": 1777273601, "lastModified": 1774835836,
"narHash": "sha256-xBUa8Tl9V7IXI+VmLEuDc81La/EhoSn1C3EVSnJ3cfU=", "narHash": "sha256-6ok7iv/9R82vl6MYe3Lwyyb6S5bmW2PxEZtmjzlqyPs=",
"owner": "BirdeeHub", "owner": "BirdeeHub",
"repo": "nixCats-nvim", "repo": "nixCats-nvim",
"rev": "f69ea013e328841a7def7037ed59788a76be8816", "rev": "ebb9f279a55ca60ff4e37e4accf6518dc627aa8d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -73,11 +73,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1777270315, "lastModified": 1775608838,
"narHash": "sha256-yKB4G6cKsQsWN7M6rZGk6gkJPDNPIzT05y4qzRyCDlI=", "narHash": "sha256-2ySoGH+SAi34U0PeuQgABC0WiH9LQ3tkyHTiE93KUeg=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6368eda62c9775c38ef7f714b2555a741c20c72d", "rev": "9a01fad67a57e44e1b3e1d905c6881bcfb209e8a",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -45,38 +45,13 @@
inherit (nixCats) utils; inherit (nixCats) utils;
luaPath = ./.; luaPath = ./.;
forEachSystem = utils.eachSystem nixpkgs.lib.platforms.all; forEachSystem = utils.eachSystem nixpkgs.lib.platforms.all;
extra_pkg_config = { extra_pkg_config = { };
allowUnfreePredicate =
pkg:
builtins.elem (nixpkgs.lib.getName pkg) [
"vim-sandwich"
"jupytext.nvim"
"eyeliner.nvim"
"context_filetype.vim"
"editorconfig-vim"
"unicode.vim"
"quarto-nvim"
"vim-openscad"
"lsp_lines.nvim"
"nvim-highlight-colors"
"nvim-lint"
];
};
mkDependencyOverlays = system: [ mkDependencyOverlays = system: [
(utils.standardPluginOverlay inputs) (utils.standardPluginOverlay inputs)
(_final: _prev: { (_final: _prev: {
mcp-hub = inputs.mcp-hub.packages.${system}.default; mcp-hub = inputs.mcp-hub.packages.${system}.default;
}) })
(_: prev: {
luajitPackages = prev.luajitPackages.overrideScope (
_: lprev: {
neotest = lprev.neotest.overrideAttrs (_: {
doCheck = false;
});
}
);
})
]; ];
categoryDefinitions = categoryDefinitions =
@@ -87,11 +62,9 @@
{ {
lspsAndRuntimeDeps = with pkgs; { lspsAndRuntimeDeps = with pkgs; {
general = [ general = [
nodejs_24
black black
clang clang
clang-tools clang-tools
curl # → plenary-nvim, mcp-hub
delta delta
emmet-language-server emmet-language-server
eslint_d eslint_d
@@ -105,8 +78,6 @@
mcp-hub mcp-hub
nixd nixd
nixfmt nixfmt
prettier
typescript-language-server
ormolu ormolu
prettierd prettierd
rust-analyzer rust-analyzer
@@ -115,7 +86,6 @@
stylelint stylelint
stylua stylua
tree-sitter tree-sitter
tailwindcss-language-server
typescript-language-server typescript-language-server
vscode-langservers-extracted vscode-langservers-extracted
vtsls vtsls
@@ -174,7 +144,6 @@
nvim-treesitter-textobjects nvim-treesitter-textobjects
# nvim-treesitter-context # nvim-treesitter-context
nvim-ts-context-commentstring nvim-ts-context-commentstring
# theHamsta/crazy-node-movement
treesj treesj
sniprun sniprun
gitsigns-nvim gitsigns-nvim

View File

@@ -8,9 +8,11 @@ require("cursor")
require("fold") require("fold")
require("netrw") require("netrw")
require("ftdetect") require("ftdetect")
require("plug")
require("pandoc") require("pandoc")
require("keymaps") require("keymaps")
require("highlight") require("highlight")
require("paq-setup")
require("statusline") require("statusline")
require("diagnostic") require("diagnostic")
require("utils") require("utils")
@@ -18,3 +20,4 @@ require("zk")
require("reload") require("reload")
vim.opt.background = "dark" vim.opt.background = "dark"
vim.opt.laststatus = 3

View File

@@ -9,6 +9,5 @@ vim.filetype.add({
["%.env.*"] = "dotenv", ["%.env.*"] = "dotenv",
["%.pl$"] = "prolog", ["%.pl$"] = "prolog",
[".*.containerfile.*"] = "dockerfile", [".*.containerfile.*"] = "dockerfile",
["%.hydra$"] = "javascript",
}, },
}) })

View File

@@ -0,0 +1,53 @@
-- Source: https://github.com/BirdeeHub/nixCats-nvim/blob/main/templates/example/lua/nixCatsUtils/catPacker.lua
--[[
This directory is the luaUtils template.
You can choose what things from it that you would like to use.
And then delete the rest.
Everything in this directory is optional.
--]]
local M = {}
-- NOTE: This function is for defining a paq.nvim fallback method of downloading plugins
-- when nixCats was not used to install your config.
-- If you only ever load your config using nixCats, you don't need this file.
-- it literally just only runs it when not on nixCats
-- all neovim package managers that use the regular plugin loading scheme
-- can be used this way, just do whatever the plugin manager needs to put it in the
-- opt directory for lazy loading, and add the build steps so that when theres no nix the steps are ran
function M.setup(v)
if not vim.g[ [[nixCats-special-rtp-entry-nixCats]] ] then
local function clone_paq()
local path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/paq-nvim"
local is_installed = vim.fn.empty(vim.fn.glob(path)) == 0
if not is_installed then
vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/savq/paq-nvim.git", path })
return true
end
end
local function bootstrap_paq(packages)
local first_install = clone_paq()
vim.cmd.packadd("paq-nvim")
local paq = require("paq")
if first_install then
vim.notify("Installing plugins... If prompted, hit Enter to continue.")
end
paq(packages)
paq.install()
end
vim.api.nvim_create_autocmd("VimEnter", {
once = true,
callback = function()
local pkgs_count = #require("paq").query("to_install")
if pkgs_count < 1 then
return
end
vim.notify(string.format("There are %d to install", pkgs_count))
end,
})
bootstrap_paq(vim.list_extend({ "savq/paq-nvim" }, v))
end
end
return M

View File

@@ -0,0 +1,47 @@
require("nixCatsUtils.catPacker").setup({
{ "savq/paq-nvim" },
{ "jinh0/eyeliner.nvim" },
{ "ibhagwan/fzf-lua" },
{ "barreiroleo/ltex_extra.nvim" },
{ "neovim/nvim-lspconfig" },
{ "https://git.sr.ht/~whynothugo/lsp_lines.nvim" },
{ "linrongbin16/lsp-progress.nvim" },
{ "folke/neodev.nvim" }, -- Nvim
{ "b0o/schemastore.nvim" }, -- JSON Schemas
{ "mfussenegger/nvim-lint" },
{ "stevearc/conform.nvim" },
{ "L3MON4D3/LuaSnip" },
{ "saadparwaiz1/cmp_luasnip" },
{ "hrsh7th/nvim-cmp" },
{ "hrsh7th/cmp-nvim-lsp" },
{ "hrsh7th/cmp-buffer" },
{ "hrsh7th/cmp-path" },
{ "nvim-lua/plenary.nvim" },
{ "MunifTanjim/nui.nvim" },
{ "folke/trouble.nvim" },
{ "rktjmp/shipwright.nvim" }, -- For building themes based on lush (e.g. terminal)
{ "rktjmp/lush.nvim" },
{ "mcchrish/zenbones.nvim" }, -- Zenbones themes (contains zenwritten)
{ "theHamsta/crazy-node-movement" },
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
{ "nvim-treesitter/nvim-treesitter-textobjects" },
-- { "nvim-treesitter/nvim-treesitter-context" },
{ "JoosepAlviste/nvim-ts-context-commentstring" }, -- commentstring based on cursor position (e.g. for Svelte)
{ "Wansmer/treesj" },
{ "michaelb/sniprun", build = "sh install.sh" },
{ "lewis6991/gitsigns.nvim" },
{ "brenoprata10/nvim-highlight-colors" },
{ "razak17/tailwind-fold.nvim" },
{ "rmagatti/auto-session" },
{ "kndndrj/nvim-dbee" },
{ "3rd/image.nvim", build = false },
{ "polarmutex/beancount.nvim" },
{ "jamesblckwell/nvimkit.nvim" },
{ 'olimorris/codecompanion.nvim' },
{ "ravitemer/mcphub.nvim", build = "pnpm install -g mcp-hub@latest" },
{ "zbirenbaum/copilot.lua" },
{ "zbirenbaum/copilot-cmp" },
{ "qvalentin/helm-ls.nvim", ft = "helm" },
{ "mikesmithgh/kitty-scrollback.nvim" },
{ "greggh/claude-code.nvim" },
})

View File

@@ -0,0 +1,35 @@
if not vim.g[ [[nixCats-special-rtp-entry-nixCats]] ] then
local vim = vim
local Plug = vim.fn["plug#"]
vim.call("plug#begin")
Plug("machakann/vim-sandwich")
Plug("Shougo/context_filetype.vim")
Plug("editorconfig/editorconfig-vim")
Plug("honza/vim-snippets")
Plug("chrisbra/unicode.vim")
Plug("ap/vim-css-color")
-- Jupyter
Plug("quarto-dev/quarto-vim")
-- LaTeX
Plug("lervag/vimtex")
-- Wiki
Plug("lervag/wiki.vim")
-- Markdown
Plug("vim-pandoc/vim-pandoc")
Plug("vim-pandoc/vim-pandoc-syntax")
Plug("ferrine/md-img-paste.vim")
-- TidalCycles
Plug("supercollider/scvim")
Plug("tidalcycles/vim-tidal")
-- GLSL
Plug("tikhomirov/vim-glsl")
Plug("timtro/glslView-nvim")
-- Jupyter notebooks
Plug("goerz/jupytext.vim")
-- OpenSCAD
Plug("sirtaj/vim-openscad")
vim.call("plug#end")
end

View File

@@ -1,6 +1,5 @@
vim.opt.laststatus = 3
vim.cmd([[ vim.cmd([[
se ls=2
se stl=\ %0*%n se stl=\ %0*%n
se stl+=\ %m se stl+=\ %m
se stl+=\ %y%0* se stl+=\ %y%0*

View File

@@ -13,19 +13,13 @@ local function get_markdown_files(base)
return items return items
end end
function source:get_keyword_pattern()
return "[%w%./%-]*"
end
function source:complete(params, callback) function source:complete(params, callback)
local cursor_before_line = params.context.cursor_before_line local cursor_before_line = params.context.cursor_before_line
local cursor_after_line = params.context.cursor_after_line or "" local cursor_after_line = params.context.cursor_after_line or ""
if not cursor_before_line:match("%[[^%]]*%]%(") then local trigger = cursor_before_line:match("%[[^%]]*%]%(([^)]*)$")
callback({})
return
end
if trigger ~= nil then
local items = get_markdown_files(".") local items = get_markdown_files(".")
local next_char = cursor_after_line:sub(1, 1) local next_char = cursor_after_line:sub(1, 1)
@@ -38,6 +32,9 @@ function source:complete(params, callback)
end end
callback(items) callback(items)
else
callback({})
end
end end
function source:get_trigger_characters() function source:get_trigger_characters()

View File

@@ -1,10 +1,9 @@
require("zk.cmp") require("zk.cmp")
require("zk.utils")
vim.cmd([[ vim.cmd([[
let s:zk_preview_enabled = 0 let s:zk_preview_enabled = 0
let s:live_server_job = -1 let s:live_server_job = -1
execute 'au BufEnter' g:zk_path . '/*.md' 'silent exe "!echo %" ">" g:zk_path . "/current-zettel.txt"' au BufEnter /home/h/.zk/*.md silent exe '!echo "%" > /home/h/.zk/current-zettel.txt'
function! ToggleZKPreview() function! ToggleZKPreview()
if s:zk_preview_enabled == 1 if s:zk_preview_enabled == 1
let s:zk_preview_enabled = 0 let s:zk_preview_enabled = 0
@@ -12,10 +11,10 @@ function! ToggleZKPreview()
au! ZKPreview au! ZKPreview
else else
let s:zk_preview_enabled = 1 let s:zk_preview_enabled = 1
let s:live_server_job = jobstart('live-server --watch=' . g:zk_path . '/current-zettel-content.html --open=current-zettel-content.html --port=8080') let s:live_server_job = jobstart('live-server --watch=/home/h/.zk/current-zettel-content.html --open=current-zettel-content.html --port=8080')
augroup ZKPreview augroup ZKPreview
execute 'au BufEnter' g:zk_path . '/*.md' 'silent exe "!cat %:r.html" ">" g:zk_path . "/current-zettel-content.html"' au BufEnter /home/h/.zk/*.md silent exe '!cat "%:r.html" > /home/h/.zk/current-zettel-content.html'
execute 'au BufWritePost' g:zk_path . '/*.md' 'silent exe "!make && cat %:r.html" ">" g:zk_path . "/current-zettel-content.html"' au BufWritePost /home/h/.zk/*.md silent exe '!make && cat "%:r.html" > /home/h/.zk/current-zettel-content.html'
augroup END augroup END
endif endif
endfunction endfunction

View File

@@ -1,2 +0,0 @@
vim.g.zk_path = os.getenv("ZK_PATH") or (os.getenv("HOME") .. "/.zk")
return vim.g.zk_path

View File

@@ -1,3 +1,4 @@
include ./taskrc.d/$HOSTNAME
include ./taskrc.d/aliases include ./taskrc.d/aliases
include ./taskrc.d/urgency include ./taskrc.d/urgency
include ./taskrc.d/reports include ./taskrc.d/reports
@@ -9,5 +10,6 @@ search.case.sensitive=no
rc.json.array=on rc.json.array=on
rc.verbose=nothing rc.verbose=nothing
news.version=3.4.2 news.version=3.1.0
recurrence=off

View File

@@ -0,0 +1 @@
set -g status-style bg=colour12,fg=colour0

View File

@@ -70,11 +70,11 @@ set -g status-right '#(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") %a %l:%M:%S
set -g default-terminal "tmux-256color" set -g default-terminal "tmux-256color"
set-hook -g after-new-session 'if -F "#{==:#{session_name},ssh}" "source ${XDG_CONFIG_HOME}/tmux/hooks/tmux.ssh.conf" "source ${XDG_CONFIG_HOME}/tmux/hooks/tmux.regular.conf"'
# Vi copypaste mode # Vi copypaste mode
if-shell "test '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 4 \)'" 'bind-key -Tcopy-mode-vi v send -X begin-selection; bind-key -Tcopy-mode-vi y send -X copy-selection-and-cancel' if-shell "test '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 4 \)'" 'bind-key -Tcopy-mode-vi v send -X begin-selection; bind-key -Tcopy-mode-vi y send -X copy-selection-and-cancel'
if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 4\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'bind-key -t vi-copy v begin-selection; bind-key -t vi-copy y copy-selection' if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 4\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'bind-key -t vi-copy v begin-selection; bind-key -t vi-copy y copy-selection'
if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 2\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'set-option -g status-utf8 on' if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 2\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'set-option -g status-utf8 on'
set -g allow-passthrough on set -g allow-passthrough on
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env python3
import sys
import json
SLOTS_FILE = "/home/h/.local/share/task/add_slots"
def get_slots():
try:
with open(SLOTS_FILE, "r") as f:
return int(f.read().strip())
except:
return 0
slots = get_slots()
if slots <= 0:
print(f"Cannot add task: No slots available (0/{slots}).")
print("Delete or complete a task first to earn an add slot.")
sys.exit(1)
with open(SLOTS_FILE, "w") as f:
f.write(str(slots - 1))
print(f"Task added. Slots remaining: {slots - 1}")
for line in sys.stdin:
task = json.loads(line)
print(json.dumps(task))
sys.exit(0)

View File

@@ -0,0 +1,34 @@
#!/usr/bin/env python3
import sys
import json
SLOTS_FILE = "/home/h/.local/share/task/add_slots"
def get_slots():
try:
with open(SLOTS_FILE, "r") as f:
return int(f.read().strip())
except:
return 0
data = sys.stdin.read().strip().split("\n")
if len(data) < 2:
for line in data:
if line:
print(line)
sys.exit(0)
old_task = json.loads(data[0])
new_task = json.loads(data[1])
was_pending = old_task.get("status") == "pending"
is_not_pending = new_task.get("status") in ("completed", "deleted")
if was_pending and is_not_pending:
slots = get_slots() + 1
with open(SLOTS_FILE, "w") as f:
f.write(str(slots))
print(f"Slot earned! Total slots: {slots}")
print(json.dumps(new_task))
sys.exit(0)

View File

@@ -1,11 +1,11 @@
{ {
"config": { "config": {
"options": {},
"preferences": { "preferences": {
"ascii": "", "ascii": "",
"asciiBibLaTeX": false, "asciiBibLaTeX": false,
"asciiBibTeX": true, "asciiBibTeX": true,
"autoAbbrev": false, "autoAbbrev": false,
"autoAbbrevStyle": "",
"autoExport": "immediate", "autoExport": "immediate",
"autoExportDelay": 5, "autoExportDelay": 5,
"autoExportIdleWait": 10, "autoExportIdleWait": 10,
@@ -13,22 +13,18 @@
"autoExportPathReplaceDirSep": "-", "autoExportPathReplaceDirSep": "-",
"autoExportPathReplaceSpace": " ", "autoExportPathReplaceSpace": " ",
"automaticTags": true, "automaticTags": true,
"autoPinDelay": 0,
"auxImport": false, "auxImport": false,
"baseAttachmentPath": "/home/h/doc/books", "baseAttachmentPath": "/home/h/doc/books",
"biblatexExtendedDateFormat": true, "biblatexExtendedDateFormat": true,
"biblatexExtendedNameFormat": true, "biblatexExtendedNameFormat": true,
"biblatexExtractEprint": true, "biblatexExtractEprint": true,
"biblatexUsePrefix": true,
"bibtexEditionOrdinal": false,
"bibtexParticleNoOp": false, "bibtexParticleNoOp": false,
"bibtexURL": "off", "bibtexURL": "off",
"cache": true, "cache": true,
"cacheDelete": false, "cacheFlushInterval": 5,
"charmap": "", "charmap": "",
"chinese": false,
"chineseSplitName": true,
"citeCommand": "cite", "citeCommand": "cite",
"citekeyCaseInsensitive": true,
"citekeyFold": true, "citekeyFold": true,
"citekeyFormat": "zotero.clean", "citekeyFormat": "zotero.clean",
"citekeyFormatEditing": "zotero.clean", "citekeyFormatEditing": "zotero.clean",
@@ -38,35 +34,32 @@
"DOIandURL": "both", "DOIandURL": "both",
"exportBibTeXStrings": "off", "exportBibTeXStrings": "off",
"exportBraceProtection": true, "exportBraceProtection": true,
"exportSort": "citekey",
"exportTitleCase": true, "exportTitleCase": true,
"extraMergeCitekeys": false, "extraMergeCitekeys": false,
"extraMergeCSL": false, "extraMergeCSL": false,
"extraMergeTeX": false, "extraMergeTeX": false,
"fillKeyAfter": 1,
"git": "config", "git": "config",
"import": true, "import": true,
"importBibTeXStrings": true, "importBibTeXStrings": true,
"importCaseProtection": "as-needed", "importCaseProtection": "as-needed",
"importCitationKey": true, "importCitationKey": true,
"importDetectURLs": true,
"importExtra": true, "importExtra": true,
"importJabRefAbbreviations": true, "importJabRefAbbreviations": true,
"importJabRefStrings": true, "importJabRefStrings": true,
"importNoteToExtra": "", "importNoteToExtra": "",
"importPlaceEvent": "inproceedings,conference,presentation,talk",
"importSentenceCase": "on+guess", "importSentenceCase": "on+guess",
"importSentenceCaseQuoted": true,
"importUnknownTexCommand": "ignore", "importUnknownTexCommand": "ignore",
"itemObserverDelay": 5, "itemObserverDelay": 5,
"jabrefFormat": 0, "jabrefFormat": 0,
"japanese": false, "jieba": false,
"keyConflictPolicy": "keep",
"keyScope": "global", "keyScope": "global",
"kuroshiro": false,
"language": "langid", "language": "langid",
"logEvents": false, "logEvents": false,
"mapMath": "", "mapMath": "",
"mapText": "", "mapText": "",
"packages": "", "mapUnicode": "conservative",
"parseParticles": true, "parseParticles": true,
"patchDates": "dateadded=dateAdded, date-added=dateAdded, datemodified=dateModified, date-modified=dateModified", "patchDates": "dateadded=dateAdded, date-added=dateAdded, datemodified=dateModified, date-modified=dateModified",
"platform": "lin", "platform": "lin",
@@ -82,8 +75,7 @@
"rawImports": false, "rawImports": false,
"rawLaTag": "#LaTeX", "rawLaTag": "#LaTeX",
"relativeFilePaths": false, "relativeFilePaths": false,
"remigrate": false, "retainCache": false,
"resetKeyOnChange": false,
"scrubDatabase": false, "scrubDatabase": false,
"separatorList": "and", "separatorList": "and",
"separatorNames": "and", "separatorNames": "and",
@@ -99,3 +91,4 @@
} }
} }
} }

193
flake.lock generated
View File

@@ -38,11 +38,11 @@
"base16-helix": { "base16-helix": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1776754714, "lastModified": 1760703920,
"narHash": "sha256-E3OAK27smtATTmX45uoTSRsVD+Y+ZiVVfgM/tjpbtYg=", "narHash": "sha256-m82fGUYns4uHd+ZTdoLX2vlHikzwzdu2s2rYM2bNwzw=",
"owner": "tinted-theming", "owner": "tinted-theming",
"repo": "base16-helix", "repo": "base16-helix",
"rev": "4d508123037e7851ad36ebf7d9c48b0e9e1eb581", "rev": "d646af9b7d14bff08824538164af99d0c521b185",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -92,28 +92,6 @@
"type": "github" "type": "github"
} }
}, },
"comin": {
"inputs": {
"flake-compat": "flake-compat_2",
"nixpkgs": [
"nixpkgs"
],
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1780200954,
"narHash": "sha256-3476T026t+XSpOvgBGzKSG6J4swuRLnPO9dR+OATtq8=",
"owner": "nlewo",
"repo": "comin",
"rev": "4f14d338d755239c27131cbf6b466be4bbb20f91",
"type": "github"
},
"original": {
"owner": "nlewo",
"repo": "comin",
"type": "github"
}
},
"disko": { "disko": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -143,11 +121,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1780200155, "lastModified": 1775966594,
"narHash": "sha256-cKpqEvRqxnCbp/2ZVczMHws31Qh4D/HTEuanWuJmySk=", "narHash": "sha256-pnRtaqTr7ut8dz8b04OWAanUM4tGhDUJz8SWmeTRp7U=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "d29c0c2692ced897777eca19c9bab1b34be0e0d6", "rev": "000d1d2322d28fa0a51b8db9f85a227aa5413b52",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@@ -160,11 +138,11 @@
"firefox-gnome-theme": { "firefox-gnome-theme": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1779670703, "lastModified": 1775176642,
"narHash": "sha256-UdfMivNMwCCqQsYDg5pSz8X2IOaOrIZLIIy+Bg3CO2o=", "narHash": "sha256-2veEED0Fg7Fsh81tvVDNYR6SzjqQxa7hbi18Jv4LWpM=",
"owner": "rafaelmardojai", "owner": "rafaelmardojai",
"repo": "firefox-gnome-theme", "repo": "firefox-gnome-theme",
"rev": "942159e73e40bf785816f7f1f5feed9ef3d7c8f9", "rev": "179704030c5286c729b5b0522037d1d51341022c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -190,22 +168,6 @@
} }
}, },
"flake-compat_2": { "flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1765121682,
"narHash": "sha256-4VBOP18BFeiPkyhy9o4ssBNQEvfvv1kXkasAYd0+rrA=",
"owner": "NixOS",
"repo": "flake-compat",
"rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_3": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1767039857, "lastModified": 1767039857,
@@ -251,11 +213,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1778716662, "lastModified": 1775087534,
"narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=", "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb", "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -315,18 +277,18 @@
}, },
"git-hooks": { "git-hooks": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_2",
"gitignore": "gitignore", "gitignore": "gitignore",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1778507602, "lastModified": 1775585728,
"narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=", "narHash": "sha256-8Psjt+TWvE4thRKktJsXfR6PA/fWWsZ04DVaY6PUhr4=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a", "rev": "580633fa3fe5fc0379905986543fd7495481913d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -380,11 +342,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1780099287, "lastModified": 1775983377,
"narHash": "sha256-efIPwVGtIWIjWcznhaop6XN6HxnOL8800hF6CBNvlqQ=", "narHash": "sha256-ZeRjipGQnVtQ/6batI+yVOrL853FZsL0m9A63OaSfgM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "7d8127d308c3fb9664f7e643eec944be74ebb37d", "rev": "e0ca734ffc85d25297715e98010b93303fa165c4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -396,7 +358,7 @@
"mcp-hub": { "mcp-hub": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1755841689, "lastModified": 1755841689,
@@ -436,10 +398,10 @@
"nix-secrets": { "nix-secrets": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1778944969, "lastModified": 1776003473,
"narHash": "sha256-wT4WiBUqfeajcaOWvSKmHGKXEGmnDVQsRg0v7NoZW5o=", "narHash": "sha256-v87721Nfc5qnevsgGkaAO+MpeJdfgPtBpazs6N5dUiI=",
"ref": "main", "ref": "main",
"rev": "aae027d8de9ae66ea29c9e6a5ff6ea0f4b735261", "rev": "d95fb37764e5033ad2cdf543f7d8acccb36146c8",
"shallow": true, "shallow": true,
"type": "git", "type": "git",
"url": "ssh://git@github.com/hektor/nix-secrets" "url": "ssh://git@github.com/hektor/nix-secrets"
@@ -453,11 +415,11 @@
}, },
"nixCats": { "nixCats": {
"locked": { "locked": {
"lastModified": 1777273601, "lastModified": 1774835836,
"narHash": "sha256-xBUa8Tl9V7IXI+VmLEuDc81La/EhoSn1C3EVSnJ3cfU=", "narHash": "sha256-6ok7iv/9R82vl6MYe3Lwyyb6S5bmW2PxEZtmjzlqyPs=",
"owner": "BirdeeHub", "owner": "BirdeeHub",
"repo": "nixCats-nvim", "repo": "nixCats-nvim",
"rev": "f69ea013e328841a7def7037ed59788a76be8816", "rev": "ebb9f279a55ca60ff4e37e4accf6518dc627aa8d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -488,15 +450,12 @@
} }
}, },
"nixos-hardware": { "nixos-hardware": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": { "locked": {
"lastModified": 1780065812, "lastModified": 1775490113,
"narHash": "sha256-SCSLUKBmwlSLGQ8Xbr8PjRFtiHNk0l9ktqkcmqdBkfE=", "narHash": "sha256-2ZBhDNZZwYkRmefK5XLOusCJHnoeKkoN95hoSGgMxWM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "b76b5639c0593e0aeb0b5879ad62d4b30596c144", "rev": "c775c2772ba56e906cbeb4e0b2db19079ef11ff7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -508,40 +467,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1770107345, "lastModified": 1775710090,
"narHash": "sha256-tbS0Ebx2PiA1FRW8mt8oejR0qMXmziJmPaU1d4kYY9g=", "narHash": "sha256-ar3rofg+awPB8QXDaFJhJ2jJhu+KqN/PRCXeyuXR76E=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4533d9293756b63904b7238acb84ac8fe4c8c2c4", "rev": "4c1018dae018162ec878d42fec712642d214fdfa",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1767892417,
"narHash": "sha256-8bW3q88CEg2u4hSP66Vf4lpbLonHz7hqDNBMcCY7E9U=",
"rev": "3497aa5c9457a9d88d71fa93a4a8368816fbeeba",
"type": "tarball",
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.05pre924538.3497aa5c9457/nixexprs.tar.xz"
},
"original": {
"type": "tarball",
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1779560665,
"narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -551,7 +481,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1743689281, "lastModified": 1743689281,
"narHash": "sha256-y7Hg5lwWhEOgflEHRfzSH96BOt26LaYfrYWzZ+VoVdg=", "narHash": "sha256-y7Hg5lwWhEOgflEHRfzSH96BOt26LaYfrYWzZ+VoVdg=",
@@ -579,11 +509,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1779766384, "lastModified": 1775228139,
"narHash": "sha256-P7Ohnlq8b8b2fU+Sgkrej7LBTM60LBTkHleLuYzmLmU=", "narHash": "sha256-ebbeHmg+V7w8050bwQOuhmQHoLOEOfqKzM1KgCTexK4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "57800b7ab648725ccd33551d01484ee14952ad3f", "rev": "601971b9c89e0304561977f2c28fa25e73aa7132",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -715,7 +645,6 @@
"root": { "root": {
"inputs": { "inputs": {
"colmena": "colmena", "colmena": "colmena",
"comin": "comin",
"disko": "disko", "disko": "disko",
"firefox-addons": "firefox-addons", "firefox-addons": "firefox-addons",
"git-hooks": "git-hooks", "git-hooks": "git-hooks",
@@ -723,7 +652,7 @@
"nix-secrets": "nix-secrets", "nix-secrets": "nix-secrets",
"nixgl": "nixgl", "nixgl": "nixgl",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs",
"nvim": "nvim", "nvim": "nvim",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"stylix": "stylix" "stylix": "stylix"
@@ -736,11 +665,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1777944972, "lastModified": 1775971308,
"narHash": "sha256-VfGRo1qTBKOe3s2gOv8LSoA6Fk19PvBlwQ1ECN0Evn8=", "narHash": "sha256-VKp9bhVSm0bT6JWctFy06ocqxGGnWHi1NfoE90IgIcY=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "c591bf665727040c6cc5cb409079acb22dcce33c", "rev": "31ac5fe5d015f76b54058c69fcaebb66a55871a4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -785,11 +714,11 @@
"tinted-zed": "tinted-zed" "tinted-zed": "tinted-zed"
}, },
"locked": { "locked": {
"lastModified": 1780079634, "lastModified": 1775936757,
"narHash": "sha256-VVyCrzwLitvxZGx48FgzvlbLYGQU99GsaQnZmwqZoUo=", "narHash": "sha256-KJO/7qoxJ+hlsb3WlFSl6IGrExBIf1GvKdrhOlnGdKY=",
"owner": "danth", "owner": "danth",
"repo": "stylix", "repo": "stylix",
"rev": "ca07e0644716a7c13e91c6d92d169fc81889c589", "rev": "d3e447786b74d62c75f665e17cb3e681c66e90c7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -847,11 +776,11 @@
"tinted-schemes": { "tinted-schemes": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1777806186, "lastModified": 1772661346,
"narHash": "sha256-PDF0/wObw4nIsSBeXVYLsloXOiphXCgIdsrNcVXguKs=", "narHash": "sha256-4eu3LqB9tPqe0Vaqxd4wkZiBbthLbpb7llcoE/p5HT0=",
"owner": "tinted-theming", "owner": "tinted-theming",
"repo": "schemes", "repo": "schemes",
"rev": "0c94645546f4f3ddac77a1a5fce54eb95bf50795", "rev": "13b5b0c299982bb361039601e2d72587d6846294",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -863,11 +792,11 @@
"tinted-tmux": { "tinted-tmux": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1778379944, "lastModified": 1772934010,
"narHash": "sha256-wPDFzMGSlARlw0Sfsn48Q2+jPSfk6N0Ng6BC/d+7Q24=", "narHash": "sha256-x+6+4UvaG+RBRQ6UaX+o6DjEg28u4eqhVRM9kpgJGjQ=",
"owner": "tinted-theming", "owner": "tinted-theming",
"repo": "tinted-tmux", "repo": "tinted-tmux",
"rev": "fe0203a198690e71a5ff11e08812a4673de3678d", "rev": "c3529673a5ab6e1b6830f618c45d9ce1bcdd829d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -879,11 +808,11 @@
"tinted-zed": { "tinted-zed": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1778378178, "lastModified": 1772909925,
"narHash": "sha256-OXPXRIQgGwV77HjYRryOHguh4ALX96jkg+tseLkGgHA=", "narHash": "sha256-jx/5+pgYR0noHa3hk2esin18VMbnPSvWPL5bBjfTIAU=",
"owner": "tinted-theming", "owner": "tinted-theming",
"repo": "base16-zed", "repo": "base16-zed",
"rev": "9cd816033ff969415b190722cddf134e78a5665f", "rev": "b4d3a1b3bcbd090937ef609a0a3b37237af974df",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -891,24 +820,6 @@
"repo": "base16-zed", "repo": "base16-zed",
"type": "github" "type": "github"
} }
},
"treefmt-nix": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1770228511,
"narHash": "sha256-wQ6NJSuFqAEmIg2VMnLdCnUc0b7vslUohqqGGD+Fyxk=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "337a4fe074be1042a35086f15481d763b8ddc0e7",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@@ -3,6 +3,10 @@
nixpkgs = { nixpkgs = {
url = "github:nixos/nixpkgs/nixos-unstable"; url = "github:nixos/nixpkgs/nixos-unstable";
}; };
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware = { nixos-hardware = {
url = "github:NixOS/nixos-hardware/master"; url = "github:NixOS/nixos-hardware/master";
}; };
@@ -18,22 +22,6 @@
url = "git+ssh://git@github.com/hektor/nix-secrets?shallow=1&ref=main"; url = "git+ssh://git@github.com/hektor/nix-secrets?shallow=1&ref=main";
flake = false; flake = false;
}; };
colmena = {
url = "github:zhaofengli/colmena";
inputs.nixpkgs.follows = "nixpkgs";
};
comin = {
url = "github:nlewo/comin";
inputs.nixpkgs.follows = "nixpkgs";
};
git-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@@ -50,15 +38,23 @@
url = "path:./dots/.config/nvim"; url = "path:./dots/.config/nvim";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
colmena = {
url = "github:zhaofengli/colmena";
inputs.nixpkgs.follows = "nixpkgs";
};
git-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = outputs =
{ {
self, self,
nixpkgs, nixpkgs,
git-hooks,
home-manager, home-manager,
nixgl, nixgl,
git-hooks,
... ...
}@inputs: }@inputs:
let let
@@ -80,10 +76,7 @@
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
modules = [ modules = [
./hosts/${host} ./hosts/${host}
{ { nixpkgs.hostPlatform = import ./hosts/${host}/system.nix; }
nixpkgs.hostPlatform = (myUtils.hostMeta ./hosts/${host}).system;
host.name = host;
}
]; ];
specialArgs = { specialArgs = {
inherit inherit
@@ -142,7 +135,6 @@
}; };
modules = [ ./home/hosts/work ]; modules = [ ./home/hosts/work ];
extraSpecialArgs = { extraSpecialArgs = {
osConfig = null;
inherit inherit
inputs inputs
outputs outputs
@@ -153,9 +145,7 @@
}; };
}; };
apps.${system}.colmena = inputs.colmena.apps.${system}.default // { apps.${system}.colmena = inputs.colmena.apps.${system}.default;
meta.description = "colmena";
};
colmenaHive = import ./deploy/colmena.nix { colmenaHive = import ./deploy/colmena.nix {
inherit inherit

View File

@@ -8,6 +8,28 @@
{ {
imports = [ imports = [
../../modules ../../modules
../../modules/3d
../../modules/ai-tools
../../modules/anki
../../modules/audio
../../modules/browser
../../modules/cloud
../../modules/comms
../../modules/desktop/niri
../../modules/devenv
../../modules/direnv
../../modules/git
../../modules/k8s/k9s.nix
../../modules/keepassxc
../../modules/music
../../modules/nvim
../../modules/pandoc
../../modules/photography
../../modules/shell
../../modules/ssh
../../modules/taskwarrior
../../modules/terminal
../../modules/torrenting
]; ];
home = { home = {
@@ -23,39 +45,14 @@
printing.enable = true; printing.enable = true;
modeling.enable = true; modeling.enable = true;
}; };
ai-tools = { ai-tools.opencode.enable = true;
claude-code.enable = true;
opencode.enable = true;
};
desktop.niri.enable = true;
browser.enable = true;
browser.primary = "librewolf"; browser.primary = "librewolf";
cloud.hetzner.enable = true; cloud.hetzner.enable = true;
comms.signal.enable = true; comms.signal.enable = true;
git.enable = true;
git.github.enable = true; git.github.enable = true;
shell = { shell.bash.aliases.lang-js = true;
enable = true; shell.bash.addBinToPath = true;
bash.aliases.lang-js = true;
bash.addBinToPath = true;
};
anki.enable = true;
k8s.k9s.enable = true;
secrets.enable = true;
taskwarrior.enable = true;
audio.enable = true;
ssh.enable = true;
music.enable = true;
terminal.enable = true;
devenv.enable = true;
keepassxc.enable = true;
direnv.enable = true;
nvim.enable = true;
pandoc.enable = true;
photography.enable = true;
torrenting.enable = true; torrenting.enable = true;
my.yubikey.enable = true;
zk.enable = true;
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;

View File

@@ -7,6 +7,27 @@
{ {
imports = [ imports = [
../../modules ../../modules
../../modules/3d
../../modules/ai-tools
../../modules/anki
../../modules/audio
../../modules/browser
../../modules/cloud
../../modules/comms
../../modules/desktop/niri
../../modules/direnv
../../modules/git
../../modules/k8s/k9s.nix
../../modules/keepassxc
../../modules/music
../../modules/nfc
../../modules/nvim
../../modules/pandoc
../../modules/secrets
../../modules/shell
../../modules/ssh
../../modules/taskwarrior
../../modules/terminal
]; ];
home = { home = {
@@ -15,44 +36,17 @@
homeDirectory = "/home/${config.host.username}"; homeDirectory = "/home/${config.host.username}";
}; };
xdg.userDirs = { xdg.userDirs.createDirectories = false;
enable = false; xdg.userDirs.download = "${config.home.homeDirectory}/dl";
createDirectories = false;
};
modules."3d".printing.enable = true; modules."3d".printing.enable = true;
ai-tools = { ai-tools.opencode.enable = true;
claude-code.enable = true;
opencode.enable = true;
};
anki.enable = true;
audio.enable = true;
browser.enable = true;
browser.primary = "librewolf"; browser.primary = "librewolf";
cloud.hetzner.enable = true; cloud.hetzner.enable = true;
comms.signal.enable = true; comms.signal.enable = true;
desktop.niri.enable = true;
devenv.enable = true;
direnv.enable = true;
git.enable = true;
git.github.enable = true; git.github.enable = true;
k8s.k9s.enable = true; shell.bash.aliases.lang-js = true;
keepassxc.enable = true; shell.bash.addBinToPath = true;
music.enable = true;
my.yubikey.enable = true;
nfc.enable = true;
nvim.enable = true;
pandoc.enable = true;
secrets.enable = true;
shell = {
enable = true;
bash.aliases.lang-js = true;
bash.addBinToPath = true;
};
ssh.enable = true;
taskwarrior.enable = true;
terminal.enable = true;
reference-manager.enable = true;
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;

View File

@@ -3,9 +3,7 @@
with pkgs; with pkgs;
[ [
bat bat
curl
entr entr
fd
feh feh
fzf fzf
htop htop
@@ -15,6 +13,7 @@ with pkgs;
parallel parallel
pass pass
ripgrep ripgrep
silver-searcher
sops sops
tldr tldr
tree tree

View File

@@ -5,29 +5,53 @@
... ...
}: }:
let
username = "hektor";
in
{ {
imports = [ imports = [
inputs.sops-nix.homeManagerModules.sops inputs.sops-nix.homeManagerModules.sops
inputs.stylix.homeModules.stylix
../../modules ../../modules
../../modules/ai-tools
../../modules/anki
../../modules/browser
../../modules/bruno
../../modules/cloud
../../modules/comms
../../modules/database
../../modules/dconf
../../modules/desktop/niri
../../modules/direnv
../../modules/docker
../../modules/git
../../modules/go
../../modules/infra
../../modules/k8s
../../modules/k8s/k9s.nix
../../modules/keepassxc
../../modules/music
../../modules/nodejs
../../modules/nvim
../../modules/pandoc
../../modules/secrets
../../modules/shell
../../modules/stylix
../../modules/taskwarrior
../../modules/ticketing
../../modules/terminal
../../modules/vscode
]; ];
sops.age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt"; sops.age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
xdg = { xdg.systemDirs.config = [ "/etc/xdg" ];
systemDirs.config = [ "/etc/xdg" ];
userDirs = {
createDirectories = false;
download = "${config.home.homeDirectory}/dl";
};
};
home = { home = {
stateVersion = "25.05"; stateVersion = "25.05";
username = "hektor"; inherit username;
homeDirectory = "/home/${config.home.username}"; homeDirectory = "/home/${username}";
}; };
targets.genericLinux.nixGL = { targets.genericLinux.nixGL = {
@@ -35,57 +59,21 @@
defaultWrapper = "mesa"; defaultWrapper = "mesa";
}; };
browser.primary = "firefox";
browser.secondary = "chromium";
cloud.azure.enable = true;
comms.signal.enable = true;
comms.teams.enable = true;
ai-tools = { ai-tools = {
claude-code.enable = true; claude-code.enable = true;
tirith.enable = true; tirith.enable = true;
opencode.enable = true; opencode.enable = true;
}; };
anki.enable = true; database.mssql.enable = true;
browser = { database.postgresql.enable = true;
enable = true; git.github.enable = true;
primary = "firefox"; git.gitlab.enable = true;
secondary = "chromium";
};
bruno.enable = true;
cloud.azure.enable = true;
comms.signal.enable = true;
comms.teams.enable = true;
database = {
mssql.enable = true;
postgresql.enable = true;
redis.enable = true;
};
desktop.niri.enable = true;
devenv.enable = true;
direnv.enable = true;
docker.enable = true;
git = {
enable = true;
github.enable = true;
gitlab.enable = true;
};
go.enable = true;
k8s.enable = true;
keepassxc.enable = true;
music.enable = true;
my.dconf.enable = true;
my.stylix.enable = true;
nvim.enable = true;
pandoc.enable = true;
shell.enable = true;
taskwarrior.enable = true;
terminal.enable = true;
infra.enable = true;
nodejs.enable = true;
secrets.enable = true;
secrets.vault.enable = true; secrets.vault.enable = true;
ticketing.enable = true;
vscode.enable = true;
services.home-manager.autoUpgrade = {
enable = true;
frequency = "weekly";
};
programs = { programs = {
gh.enable = true; gh.enable = true;

View File

@@ -1,60 +0,0 @@
{
lib,
config,
pkgs,
...
}:
let
cfg = config.ai-tools.claude-code;
rtk-version = "0.18.1";
in
{
options.ai-tools.claude-code.enable = lib.mkEnableOption "claude code with rtk and ccline";
config = lib.mkIf cfg.enable {
programs.claude-code.enable = true;
home.packages = with pkgs; [
(stdenv.mkDerivation {
name = "ccline";
src = fetchurl {
url = "https://github.com/Haleclipse/CCometixLine/releases/download/v1.0.8/ccline-linux-x64.tar.gz";
hash = "sha256-Joe3Dd6uSMGi66QT6xr2oY/Tz8rA5RuKa6ckBVJIzI0=";
};
unpackPhase = "tar xzf $src";
installPhase = ''
mkdir -p $out/bin
cp ccline $out/bin/
chmod +x $out/bin/ccline
'';
meta = {
description = "CCometixLine Linux x64 CLI (Claude Code statusline)";
homepage = "https://github.com/Haleclipse/CCometixLine";
license = lib.licenses.mit;
platforms = [ "x86_64-linux" ];
};
})
(stdenv.mkDerivation {
name = "rtk-${rtk-version}";
version = rtk-version;
src = fetchurl {
url = "https://github.com/rtk-ai/rtk/releases/download/v${rtk-version}/rtk-x86_64-unknown-linux-gnu.tar.gz";
hash = "sha256-XoTia5K8b00OzcKYCufwx8ApkAS31DxUCpGSU0jFs2Q=";
};
unpackPhase = "tar xzf $src";
installPhase = ''
mkdir -p $out/bin
cp rtk $out/bin/
chmod +x $out/bin/rtk
'';
meta = {
description = "RTK - AI coding tool enhancer";
homepage = "https://www.rtk-ai.app";
license = lib.licenses.mit;
platforms = [ "x86_64-linux" ];
};
})
mcp-nixos
];
};
}

View File

@@ -1,8 +1,116 @@
{ {
imports = [ lib,
./claude-code.nix config,
./opencode.nix pkgs,
./skills.nix ...
./tirith.nix }:
let
cfg = config.ai-tools;
rtk-version = "0.18.1";
in
{
options.ai-tools = {
claude-code.enable = lib.mkEnableOption "claude code with rtk and ccline";
tirith.enable = lib.mkEnableOption "tirith shell security guard";
opencode.enable = lib.mkEnableOption "opencode";
};
config = lib.mkMerge [
(lib.mkIf cfg.claude-code.enable {
home.packages = with pkgs; [
claude-code
(pkgs.stdenv.mkDerivation {
name = "ccline";
src = pkgs.fetchurl {
url = "https://github.com/Haleclipse/CCometixLine/releases/download/v1.0.8/ccline-linux-x64.tar.gz";
hash = "sha256-Joe3Dd6uSMGi66QT6xr2oY/Tz8rA5RuKa6ckBVJIzI0=";
};
unpackPhase = ''
tar xzf $src
'';
installPhase = ''
mkdir -p $out/bin
cp ccline $out/bin/
chmod +x $out/bin/ccline
'';
meta = with pkgs.lib; {
description = "CCometixLine Linux x64 CLI (Claude Code statusline)";
homepage = "https://github.com/Haleclipse/CCometixLine";
license = licenses.mit;
platforms = [ "x86_64-linux" ];
};
})
(pkgs.stdenv.mkDerivation {
name = "rtk-${rtk-version}";
version = rtk-version;
src = pkgs.fetchurl {
url = "https://github.com/rtk-ai/rtk/releases/download/v${rtk-version}/rtk-x86_64-unknown-linux-gnu.tar.gz";
hash = "sha256-XoTia5K8b00OzcKYCufwx8ApkAS31DxUCpGSU0jFs2Q=";
};
unpackPhase = ''
tar xzf $src
'';
installPhase = ''
mkdir -p $out/bin
cp rtk $out/bin/
chmod +x $out/bin/rtk
'';
meta = with pkgs.lib; {
description = "RTK - AI coding tool enhancer";
homepage = "https://www.rtk-ai.app";
license = licenses.mit;
platforms = [ "x86_64-linux" ];
};
})
mcp-nixos
];
})
(lib.mkIf cfg.tirith.enable {
home.packages = with pkgs; [
tirith
];
})
(lib.mkIf (cfg.tirith.enable && cfg.claude-code.enable) {
home.file.".claude/hooks/tirith-check.py" = {
source = ./tirith-check.py;
executable = true;
};
home.activation.tirith-claude-code = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
${pkgs.tirith}/bin/tirith setup claude-code --with-mcp --scope user --force 2>/dev/null || true
'';
})
(lib.mkIf cfg.opencode.enable {
home.packages = with pkgs; [
opencode
];
home.file.".config/opencode/opencode.json".text = builtins.toJSON {
"$schema" = "https://opencode.ai/config.json";
permission = {
external_directory = {
"/run/secrets/" = "deny";
"~/.config/sops/age/keys.txt" = "deny";
"~/.ssh/id_rsa" = "deny";
"~/.ssh/id_ed25519" = "deny";
"~/.ssh/id_ecdsa" = "deny";
"~/.ssh/id_dsa" = "deny";
"/etc/ssh/ssh_host_rsa_key" = "deny";
"/etc/ssh/ssh_host_ed25519_key" = "deny";
"/etc/ssh/ssh_host_ecdsa_key" = "deny";
"/etc/ssh/ssh_host_dsa_key" = "deny";
};
command = {
sops = "deny";
};
};
plugin = [ "@mohak34/opencode-notifier@latest" ];
};
})
]; ];
} }

View File

@@ -1,40 +0,0 @@
{
lib,
config,
pkgs,
...
}:
let
cfg = config.ai-tools.opencode;
in
{
options.ai-tools.opencode = {
enable = lib.mkEnableOption "opencode";
};
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.opencode ];
home.file.".config/opencode/opencode.json".text = builtins.toJSON {
"$schema" = "https://opencode.ai/config.json";
permission = {
external_directory = {
"/run/secrets/" = "deny";
"~/.config/sops/age/keys.txt" = "deny";
"~/.ssh/id_rsa" = "deny";
"~/.ssh/id_ed25519" = "deny";
"~/.ssh/id_ecdsa" = "deny";
"~/.ssh/id_dsa" = "deny";
"/etc/ssh/ssh_host_rsa_key" = "deny";
"/etc/ssh/ssh_host_ed25519_key" = "deny";
"/etc/ssh/ssh_host_ecdsa_key" = "deny";
"/etc/ssh/ssh_host_dsa_key" = "deny";
};
command = {
sops = "deny";
};
};
plugin = [ "@mohak34/opencode-notifier@latest" ];
};
};
}

View File

@@ -1,49 +0,0 @@
{
lib,
config,
pkgs,
...
}:
let
cfg = config.ai-tools.claude-code;
skillType = lib.types.submodule {
options = {
owner = lib.mkOption { type = lib.types.str; };
repo = lib.mkOption { type = lib.types.str; };
rev = lib.mkOption { type = lib.types.str; };
hash = lib.mkOption { type = lib.types.str; };
skill = lib.mkOption { type = lib.types.str; };
};
};
fetchSkill =
skill:
let
src = pkgs.fetchFromGitHub {
inherit (skill)
owner
repo
rev
hash
;
};
in
{
name = ".claude/skills/${skill.skill}";
value = {
source = "${src}/${skill.skill}";
recursive = true;
};
};
in
{
options.ai-tools.claude-code.skills = lib.mkOption {
type = lib.types.listOf skillType;
default = [ ];
};
config = lib.mkIf cfg.enable {
home.file = builtins.listToAttrs (map fetchSkill cfg.skills);
};
}

View File

@@ -1,30 +0,0 @@
{
lib,
config,
pkgs,
...
}:
let
cfg = config.ai-tools.tirith;
in
{
options.ai-tools.tirith = {
enable = lib.mkEnableOption "tirith";
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
home.packages = [ pkgs.tirith ];
})
(lib.mkIf (cfg.enable && config.ai-tools.claude-code.enable) {
home.file.".claude/hooks/tirith-check.py" = {
source = ./tirith-check.py;
executable = true;
};
home.activation.tirith-claude-code = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
${pkgs.tirith}/bin/tirith setup claude-code --with-mcp --scope user --force 2>/dev/null || true
'';
})
];
}

View File

@@ -9,42 +9,25 @@
}: }:
let let
cfg = config.anki;
sops = myUtils.sopsAvailability config osConfig; sops = myUtils.sopsAvailability config osConfig;
standalone = osConfig == null; standalone = osConfig == null;
in in
{
options.anki.enable = lib.mkEnableOption "Anki";
config = lib.mkIf cfg.enable (
lib.optionalAttrs standalone { lib.optionalAttrs standalone {
sops.secrets = myUtils.mkSopsSecrets "${toString inputs.nix-secrets}/secrets" { sops.secrets = myUtils.mkSopsSecrets "${toString inputs.nix-secrets}/secrets" "anki" [
anki = [
"sync-user" "sync-user"
"sync-key" "sync-key"
]; ] { };
};
} }
// { // {
warnings = lib.optional ( warnings = lib.optional (
!sops.available !sops.available && config.programs.anki.enable
) "anki is enabled but sops secrets are not available. anki sync will not be configured."; ) "anki is enabled but sops secrets are not available. anki sync will not be configured.";
programs.anki = { programs.anki = {
enable = true; enable = true;
package = config.nixgl.wrap pkgs.anki; package = config.nixgl.wrap pkgs.anki;
addons = with pkgs.ankiAddons; [ addons = with pkgs.ankiAddons; [
(anki-connect.withConfig { anki-connect
# https://git.sr.ht/~foosoft/anki-connect/tree/master/item/plugin/config.json
config = {
apiKey = null;
apiLogPath = null;
webBindAddress = "127.0.0.1";
webBindPort = 8765;
webCorsOriginList = [ "http://localhost" ];
ignoreOriginList = [ ];
};
})
puppy-reinforcement puppy-reinforcement
review-heatmap review-heatmap
]; ];
@@ -54,5 +37,3 @@ in
}; };
}; };
} }
);
}

View File

@@ -1,19 +1,7 @@
{ { osConfig, pkgs, ... }:
config,
lib,
pkgs,
osConfig,
...
}:
let
cfg = config.audio;
in
{ {
options.audio.enable = lib.mkEnableOption "audio";
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ pulsemixer ]; home.packages = with pkgs; [ pulsemixer ];
services.mpris-proxy.enable = osConfig.hardware.bluetooth.enable or false; services.mpris-proxy.enable = osConfig.hardware.bluetooth.enable or false;
};
} }

View File

@@ -1,19 +1,7 @@
{ { lib, ... }:
config,
lib,
...
}:
{ {
imports = [
./firefox.nix
./librewolf.nix
./chromium.nix
];
options.browser = { options.browser = {
enable = lib.mkEnableOption "browser";
primary = lib.mkOption { primary = lib.mkOption {
type = lib.types.enum [ type = lib.types.enum [
"firefox" "firefox"
@@ -35,7 +23,9 @@
}; };
}; };
config = lib.mkIf config.browser.enable { imports = [
home.sessionVariables.BROWSER = config.browser.primary; ./firefox.nix
}; ./librewolf.nix
./chromium.nix
];
} }

View File

@@ -10,7 +10,6 @@
config = lib.mkIf (config.browser.primary == "firefox" || config.browser.secondary == "firefox") { config = lib.mkIf (config.browser.primary == "firefox" || config.browser.secondary == "firefox") {
programs.firefox = { programs.firefox = {
enable = true; enable = true;
configPath = "${config.xdg.configHome}/mozilla/firefox";
} }
// (import ./firefox-base.nix { // (import ./firefox-base.nix {
inherit inherit

View File

@@ -1,19 +1,7 @@
{ { config, pkgs, ... }:
config,
lib,
pkgs,
...
}:
let
cfg = config.bruno;
in
{ {
options.bruno = { config = {
enable = lib.mkEnableOption "Bruno";
};
config = lib.mkIf cfg.enable {
home.packages = [ (config.nixgl.wrap (config.wrapApp pkgs.bruno "--no-sandbox")) ]; home.packages = [ (config.nixgl.wrap (config.wrapApp pkgs.bruno "--no-sandbox")) ];
}; };
} }

View File

@@ -1,21 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.clipboard;
in
{
options.clipboard = {
enable = lib.mkEnableOption "clipboard";
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
wl-clipboard
];
};
}

View File

@@ -3,10 +3,10 @@
{ {
options.cloud = { options.cloud = {
azure = { azure = {
enable = lib.mkEnableOption "Azure CLI"; enable = lib.mkEnableOption "azure CLI";
}; };
hetzner = { hetzner = {
enable = lib.mkEnableOption "Hetzner CLI"; enable = lib.mkEnableOption "hetzner CLI";
}; };
}; };

View File

@@ -9,18 +9,14 @@
options.database = { options.database = {
mssql.enable = lib.mkEnableOption "MSSQL"; mssql.enable = lib.mkEnableOption "MSSQL";
postgresql.enable = lib.mkEnableOption "PostgreSQL"; postgresql.enable = lib.mkEnableOption "PostgreSQL";
redis.enable = lib.mkEnableOption "Redis";
}; };
config = lib.mkMerge [ config = lib.mkMerge [
(lib.mkIf config.database.mssql.enable { (lib.mkIf config.database.mssql.enable {
home.packages = with pkgs; [ (config.nixgl.wrap dbeaver-bin) ]; home.packages = [ (config.nixgl.wrap pkgs.dbeaver-bin) ];
}) })
(lib.mkIf config.database.postgresql.enable { (lib.mkIf config.database.postgresql.enable {
home.packages = with pkgs; [ (config.nixgl.wrap pgadmin4-desktopmode) ]; home.packages = [ (config.nixgl.wrap pkgs.pgadmin4-desktopmode) ];
})
(lib.mkIf config.database.postgresql.enable {
home.packages = with pkgs; [ redis ];
}) })
]; ];
} }

View File

@@ -1,22 +1,10 @@
{ { config, pkgs, ... }:
config,
lib,
pkgs,
...
}:
let let
cfg = config.my.dconf;
terminal = "kitty"; terminal = "kitty";
browser = config.browser.primary; browser = config.browser.primary;
font = "${config.stylix.fonts.monospace.name} ${toString config.stylix.fonts.sizes.applications}";
in in
{ {
options.my.dconf = {
enable = lib.mkEnableOption "dconf";
};
config = lib.mkIf cfg.enable {
dconf.settings = { dconf.settings = {
"org/gnome/desktop/background" = { "org/gnome/desktop/background" = {
color-shading-type = "solid"; color-shading-type = "solid";
@@ -52,9 +40,9 @@ in
clock-show-weekday = true; clock-show-weekday = true;
color-scheme = "prefer-dark"; color-scheme = "prefer-dark";
enable-hot-corners = false; enable-hot-corners = false;
# font-name = font; font-name = "Iosevka Term SS08 12";
locate-pointer = true; locate-pointer = true;
monospace-font-name = font; monospace-font-name = "Iosevka Term SS08 12";
}; };
"org/gnome/desktop/wm/keybindings" = { "org/gnome/desktop/wm/keybindings" = {
@@ -133,5 +121,4 @@ in
}; };
home.packages = with pkgs; [ dconf2nix ]; home.packages = with pkgs; [ dconf2nix ];
};
} }

View File

@@ -6,26 +6,13 @@
}: }:
{ {
imports = options.nixgl.wrap = lib.mkOption {
let
dirs = lib.attrNames (lib.filterAttrs (_: v: v == "directory") (builtins.readDir ./.));
hasDef = name: builtins.pathExists ./${name}/default.nix;
in
map (name: ./${name}) (builtins.filter hasDef dirs);
options = {
host.username = lib.mkOption {
type = lib.types.str;
default = config.home.username;
};
nixgl.wrap = lib.mkOption {
type = lib.types.functionTo lib.types.package; type = lib.types.functionTo lib.types.package;
default = if config.lib ? nixGL then config.lib.nixGL.wrap else lib.id; default = if config.lib ? nixGL then config.lib.nixGL.wrap else lib.id;
readOnly = true; readOnly = true;
}; };
wrapApp = lib.mkOption { options.wrapApp = lib.mkOption {
type = lib.types.raw; type = lib.types.raw;
default = default =
pkg: flags: pkg: flags:
@@ -40,5 +27,4 @@
pkg; pkg;
readOnly = true; readOnly = true;
}; };
};
} }

View File

@@ -1,5 +0,0 @@
{ ... }:
{
imports = [ ./niri ];
}

View File

@@ -179,5 +179,4 @@ binds {
Alt+Print { screenshot-window; } Alt+Print { screenshot-window; }
Mod+Shift+Delete { quit; } Mod+Shift+Delete { quit; }
} }

View File

@@ -1,32 +1,18 @@
{ { pkgs, ... }:
lib,
pkgs,
config,
...
}:
{ {
imports = [ imports = [
../../clipboard
../../fuzzel ../../fuzzel
../../mako ../../mako
../../shikane ../../shikane
../../waybar ../../waybar
]; ];
options.desktop.niri.enable = lib.mkEnableOption "niri desktop";
config = lib.mkIf config.desktop.niri.enable {
clipboard.enable = lib.mkDefault true;
fuzzel.enable = lib.mkDefault true;
mako.enable = lib.mkDefault true;
shikane.enable = lib.mkDefault true;
waybar.enable = lib.mkDefault true;
home = { home = {
file.".config/niri/config.kdl".source = ./config.kdl; file.".config/niri/config.kdl".source = ./config.kdl;
packages = with pkgs; [ packages = with pkgs; [
brightnessctl brightnessctl
wl-clipboard
wlsunset wlsunset
]; ];
}; };
@@ -37,35 +23,4 @@
latitude = 51.05; latitude = 51.05;
longitude = 3.71667; longitude = 3.71667;
}; };
xdg.configFile."electron-flags.conf".text = ''
--enable-features=UseOzonePlatform
--ozone-platform=wayland
'';
xdg.portal = {
enable = true;
config = {
niri = {
default = [
"gnome"
"gtk"
];
"org.freedesktop.impl.portal.Access" = "gtk";
"org.freedesktop.impl.portal.Notification" = "gtk";
"org.freedesktop.impl.portal.Secret" = "gnome-keyring";
"org.freedesktop.impl.portal.FileChooser" = "gtk";
"org.freedesktop.impl.portal.ScreenCast" = [ "gnome" ];
"org.freedesktop.impl.portal.Settings" = [
"gnome"
"gtk"
];
};
};
extraPortals = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-gnome
];
};
};
} }

View File

@@ -1,19 +1,4 @@
{ pkgs, ... }:
{ {
config,
lib,
pkgs,
...
}:
let
cfg = config.devenv;
in
{
options.devenv = {
enable = lib.mkEnableOption "devenv";
};
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.devenv ]; home.packages = [ pkgs.devenv ];
};
} }

View File

@@ -1,20 +1,7 @@
{ {
config,
lib,
...
}:
let
cfg = config.direnv;
in
{
options.direnv.enable = lib.mkEnableOption "direnv";
config = lib.mkIf cfg.enable {
programs.direnv = { programs.direnv = {
enable = true; enable = true;
enableBashIntegration = true; enableBashIntegration = true;
nix-direnv.enable = true; nix-direnv.enable = true;
}; };
};
} }

View File

@@ -1,21 +1,7 @@
{ { pkgs, ... }:
config,
lib,
pkgs,
...
}:
let
cfg = config.docker;
in
{ {
options.docker = {
enable = lib.mkEnableOption "Docker";
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
dive dive
]; ];
};
} }

View File

@@ -1,16 +1,4 @@
{ {
config,
lib,
...
}:
let
cfg = config.fuzzel;
in
{
options.fuzzel.enable = lib.mkEnableOption "fuzzel";
config = lib.mkIf cfg.enable {
programs.fuzzel = { programs.fuzzel = {
enable = true; enable = true;
settings = { settings = {
@@ -24,5 +12,4 @@ in
}; };
}; };
}; };
};
} }

View File

@@ -8,12 +8,11 @@
{ {
options.git = { options.git = {
enable = lib.mkEnableOption "git";
github.enable = lib.mkEnableOption "Github CLI"; github.enable = lib.mkEnableOption "Github CLI";
gitlab.enable = lib.mkEnableOption "Gitlab CLI"; gitlab.enable = lib.mkEnableOption "Gitlab CLI";
}; };
config = lib.mkIf config.git.enable { config = {
programs.git.enable = true; programs.git.enable = true;
home.file = { home.file = {
".gitconfig".source = dotsPath + "/.gitconfig"; ".gitconfig".source = dotsPath + "/.gitconfig";

View File

@@ -1,22 +1,7 @@
{ pkgs, ... }:
{ {
config,
lib,
pkgs,
...
}:
let
cfg = config.go;
in
{
options.go = {
enable = lib.mkEnableOption "Go";
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
go go
gopls gopls
]; ];
};
} }

View File

@@ -1,19 +1,7 @@
{ { pkgs, ... }:
config,
lib,
pkgs,
...
}:
let
cfg = config.infra;
in
{ {
options.infra = { config = {
enable = lib.mkEnableOption "infrastructure tools";
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
opentofu opentofu
upbound upbound

View File

@@ -1,25 +1,6 @@
{ pkgs, ... }:
{ {
config,
lib,
pkgs,
...
}:
let
cfg = config.k8s;
in
{
imports = [
./helm.nix
./k9s.nix
];
options.k8s.enable = lib.mkEnableOption "k8s";
config = lib.mkIf cfg.enable {
k8s.helm.enable = lib.mkDefault true;
k8s.k9s.enable = lib.mkDefault true;
home.packages = with pkgs; [ home.packages = with pkgs; [
argocd argocd
fluxcd fluxcd
@@ -37,8 +18,8 @@ in
enableAlias = true; enableAlias = true;
}; };
home.shellAliases = { imports = [
k = "kubectl"; ./helm.nix
}; ./k9s.nix
}; ];
} }

View File

@@ -1,17 +1,6 @@
{ { pkgs, ... }:
config,
lib,
pkgs,
...
}:
let
cfg = config.k8s.helm;
in
{ {
options.k8s.helm.enable = lib.mkEnableOption "helm";
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
(wrapHelm kubernetes-helm { (wrapHelm kubernetes-helm {
plugins = with kubernetes-helmPlugins; [ plugins = with kubernetes-helmPlugins; [
@@ -23,5 +12,4 @@ in
]; ];
}) })
]; ];
};
} }

View File

@@ -1,16 +1,4 @@
{ {
config,
lib,
...
}:
let
cfg = config.k8s.k9s;
in
{
options.k8s.k9s.enable = lib.mkEnableOption "";
config = lib.mkIf cfg.enable {
programs.k9s = { programs.k9s = {
enable = true; enable = true;
settings.k9s = { settings.k9s = {
@@ -20,5 +8,4 @@ in
}; };
}; };
}; };
};
} }

View File

@@ -1,21 +1,8 @@
{ {
config,
lib,
...
}:
let
cfg = config.keepassxc;
in
{
options.keepassxc.enable = lib.mkEnableOption "KeePassXC";
config = lib.mkIf cfg.enable {
programs.keepassxc = { programs.keepassxc = {
enable = true; enable = true;
settings = { settings = {
Browser.Enabled = true; Browser.Enabled = true;
}; };
}; };
};
} }

View File

@@ -1,16 +1,5 @@
{ {
config, services.mako = {
lib, enable = true;
...
}:
let
cfg = config.mako;
in
{
options.mako.enable = lib.mkEnableOption "mako";
config = lib.mkIf cfg.enable {
services.mako.enable = true;
}; };
} }

View File

@@ -1,13 +1,10 @@
{ {
config,
lib,
pkgs,
dotsPath, dotsPath,
pkgs,
... ...
}: }:
let let
cfg = config.music;
spotifyWithWayland = pkgs.symlinkJoin { spotifyWithWayland = pkgs.symlinkJoin {
name = "spotify"; name = "spotify";
paths = [ pkgs.spotify ]; paths = [ pkgs.spotify ];
@@ -19,14 +16,12 @@ let
}; };
in in
{ {
options.music.enable = lib.mkEnableOption "music"; home.packages = with pkgs; [
spotifyWithWayland
config = lib.mkIf cfg.enable { ];
home.packages = [ spotifyWithWayland ];
programs.ncspot = { programs.ncspot = {
enable = true; enable = true;
settings = fromTOML (builtins.readFile (dotsPath + "/.config/ncspot/config.toml")); settings = builtins.fromTOML (builtins.readFile (dotsPath + "/.config/ncspot/config.toml"));
};
}; };
} }

View File

@@ -1,21 +1,5 @@
{ {
config, imports = [
lib, ./proxmark3.nix
pkgs,
...
}:
let
cfg = config.nfc;
in
{
options.nfc = {
enable = lib.mkEnableOption "NFC tools";
};
config = lib.mkIf cfg.enable {
home.packages = [
(pkgs.proxmark3.override { withGeneric = true; })
]; ];
};
} }

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = [
(pkgs.proxmark3.override { withGeneric = true; })
];
}

View File

@@ -5,21 +5,15 @@
... ...
}: }:
let
cfg = config.nodejs;
in
{ {
options.nodejs = { options.nodejs.package = lib.mkOption {
enable = lib.mkEnableOption "Node.js";
package = lib.mkOption {
type = lib.types.package; type = lib.types.package;
default = pkgs.nodejs_24; default = pkgs.nodejs_24;
}; };
};
config = lib.mkIf cfg.enable { config = {
home.packages = with pkgs; [ home.packages = with pkgs; [
cfg.package config.nodejs.package
pnpm pnpm
yarn yarn
biome biome

View File

@@ -1,20 +1,7 @@
{ { pkgs, inputs, ... }:
config,
lib,
pkgs,
inputs,
...
}:
let
cfg = config.nvim;
in
{ {
options.nvim.enable = lib.mkEnableOption "nvim";
config = lib.mkIf cfg.enable {
home.packages = [ home.packages = [
inputs.nvim.packages.${pkgs.stdenv.hostPlatform.system}.nvim inputs.nvim.packages.${pkgs.stdenv.hostPlatform.system}.nvim
]; ];
};
} }

View File

@@ -1,23 +1,8 @@
{ pkgs, ... }:
{ {
config,
lib,
pkgs,
...
}:
let
cfg = config.pandoc;
in
{
options.pandoc = {
enable = lib.mkEnableOption "pandoc";
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
haskellPackages.pandoc-crossref haskellPackages.pandoc-crossref
pandoc pandoc
texliveSmall texliveSmall
]; ];
};
} }

View File

@@ -1,21 +1,7 @@
{ { pkgs, ... }:
config,
lib,
pkgs,
...
}:
let
cfg = config.photography;
in
{ {
options.photography = {
enable = lib.mkEnableOption "photography";
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
darktable darktable
]; ];
};
} }

View File

@@ -1,37 +0,0 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
cfg = config.reference-manager;
hasBrowser =
name:
lib.elem name [
config.browser.primary
config.browser.secondary
];
zoteroConnector =
inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system}.zotero-connector;
zoteroAddonId = "zotero@chnm.gmu.edu";
connectorExtension = {
profiles.default.extensions.packages = [ zoteroConnector ];
policies.ExtensionSettings.${zoteroAddonId}.default_area = "navbar";
};
in
{
options.reference-manager.enable = lib.mkEnableOption "reference manager (Zotero)";
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.zotero ];
programs.firefox = lib.mkIf (hasBrowser "firefox") connectorExtension;
programs.librewolf = lib.mkIf (hasBrowser "librewolf") connectorExtension;
};
}

View File

@@ -1,19 +1,13 @@
{ {
config,
lib,
pkgs, pkgs,
... ...
}: }:
{ {
imports = [ ./vault.nix ]; imports = [ ./vault.nix ];
options.secrets.enable = lib.mkEnableOption "secrets";
config = lib.mkIf config.secrets.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
age age
age-plugin-yubikey age-plugin-yubikey # TODO: only needed when using Yubikey
sops sops
]; ];
};
} }

View File

@@ -4,12 +4,13 @@
dotsPath, dotsPath,
... ...
}: }:
let let
cfg = config.shell.bash; cfg = config.shell.bash;
inherit (config.home) username; inherit (config.home) username;
in in
{ {
imports = [ ./utils.nix ];
options.shell.bash = { options.shell.bash = {
aliases = { aliases = {
all = lib.mkOption { all = lib.mkOption {
@@ -33,7 +34,7 @@ in
}; };
}; };
config = lib.mkIf config.shell.enable { config = {
programs.bash = { programs.bash = {
enable = true; enable = true;
enableCompletion = true; enableCompletion = true;

View File

@@ -1,9 +1,3 @@
{
config,
lib,
...
}:
{ {
imports = [ imports = [
./bash.nix ./bash.nix
@@ -11,10 +5,4 @@
./prompt.nix ./prompt.nix
../tmux ../tmux
]; ];
options.shell.enable = lib.mkEnableOption "shell";
config = lib.mkIf config.shell.enable {
tmux.enable = lib.mkDefault true;
};
} }

View File

@@ -1,18 +1,3 @@
{ {
config, programs.starship.enable = true;
lib,
...
}:
{
config = lib.mkIf config.shell.enable {
programs.starship = {
enable = true;
settings = {
git_status = {
ahead = "$\{count\}";
};
};
};
};
} }

View File

@@ -1,12 +1,9 @@
{ {
config,
lib, lib,
pkgs, pkgs,
... ...
}: }:
{ {
config = lib.mkIf config.shell.enable {
programs.fzf = { programs.fzf = {
enable = true; enable = true;
enableBashIntegration = lib.mkDefault true; enableBashIntegration = lib.mkDefault true;
@@ -19,5 +16,4 @@
entr entr
parallel parallel
]; ];
};
} }

View File

@@ -1,70 +1,6 @@
{ { pkgs, ... }:
config,
lib,
pkgs,
...
}:
{ {
options.shikane.enable = lib.mkEnableOption "shikane"; home.packages = with pkgs; [ wdisplays ];
config = lib.mkIf config.shikane.enable {
home.packages = with pkgs; [ (config.nixgl.wrap wdisplays) ];
services.shikane.enable = true; services.shikane.enable = true;
home.file.".config/shikane/config.toml" = {
force = true;
text = ''
[[profile]]
name = "work"
[[profile.output]]
enable = true
search = ["m=Unknown", "s=", "v=Unknown"]
mode = "2880x1800@120Hz"
position = "288,3240"
scale = 1.5
transform = "normal"
adaptive_sync = false
[[profile.output]]
enable = true
search = ["m=Q27P1B", "s=GNXM2HA196769", "v=PNP(AOC)"]
mode = "2560x1440@59.951Hz"
position = "116,1800"
scale = 1.0
transform = "normal"
adaptive_sync = false
[[profile.output]]
enable = true
search = ["m=PHL 243S7", "s=UHB1923012753", "v=Philips Consumer Electronics Company"]
mode = "1920x1080@60Hz"
position = "2676,1800"
scale = 1.0
transform = "270"
adaptive_sync = false
[[profile]]
name = "home"
[[profile.output]]
enable = true
search = ["m=Unknown", "s=Unknown", "v=Unknown"]
mode = "2880x1800@60.001Hz"
position = "185,1440"
scale = 1.75
transform = "normal"
adaptive_sync = false
[[profile.output]]
enable = true
search = ["m=PHL 276E8V", "s=0x0000046D", "v=Philips Consumer Electronics Company"]
mode = "3840x2160@59.996Hz"
position = "1500,0"
scale = 1.5
transform = "normal"
adaptive_sync = false
'';
};
};
} }

View File

@@ -1,52 +0,0 @@
# SSH keys
* primary keys (host-specific, non-resident)
* backup key (shared, resident)
## generate keys
### YubiKey 01 - `host_01`
```sh
ssh-keygen -t ed25519-sk \
-O verify-required \
-f ~/.ssh/id_ed25519_sk \
-C "h@host_01"
```
### YubiKey 01 — `host_02`
```sh
ssh-keygen -t ed25519-sk \
-O verify-required \
-f ~/.ssh/id_ed25519_sk \
-C "h@host_02"
```
### YubiKey 02 - `host_*`
```sh
ssh-keygen -t ed25519-sk \
-O resident \
-O verify-required \
-f ~/.ssh/id_ed25519_sk_bak \
-C "backup"
```
## register keys
when you the primary key (`id_ed25519_sk.pub`), make sure to also register the
backup key (`id_ed25519_sk_bak.pub`) if needed.
## recovery scenarios
| scenario | recovery |
|---|---|
| primary key file lost | generate new primary key on that device, re-register (use backup key) |
| primary YubiKey lost | generate new primary keys on all devices using new YubiKey (use backup key) |
| backup key file lost | regenerate from backup YubiKey resident key (use `ssh-keygen -K`) |
| backup YubiKey lost | generate resident backup key, distribute across hosts, re-register (use primary key) |
## references
* <https://developers.yubico.com/SSH/Securing_SSH_with_FIDO2.html>

View File

@@ -1,52 +1,44 @@
{ {
config, outputs,
lib, lib,
pkgs, pkgs,
myUtils,
... ...
}: }:
let let
cfg = config.ssh; nixosConfigs = builtins.attrNames outputs.nixosConfigurations;
hostDir = ../../hosts; homeConfigs = map (n: lib.last (lib.splitString "@" n)) (
hostNames = myUtils.dirNames hostDir; builtins.attrNames outputs.homeConfigurations
);
allHosts = lib.unique (homeConfigs ++ nixosConfigs);
hostsWithKeys = lib.filter ( hostsWithKeys = lib.filter (
hostname: builtins.pathExists (hostDir + "/${hostname}/ssh_host.pub") hostname: builtins.pathExists ../../hosts/${hostname}/ssh_host.pub
) hostNames; ) allHosts;
in in
{ {
options.ssh.enable = lib.mkEnableOption "ssh";
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ sshfs ]; home.packages = with pkgs; [ sshfs ];
programs.ssh = { programs.ssh = {
enable = true; enable = true;
enableDefaultConfig = false; enableDefaultConfig = false;
settings = matchBlocks =
lib.genAttrs hostsWithKeys ( lib.genAttrs hostsWithKeys (
hostname: hostname:
let let
meta = myUtils.hostMeta (hostDir + "/${hostname}"); hostConfig = outputs.nixosConfigurations.${hostname}.config;
isLocal = builtins.elem "local" meta.tags; inherit (hostConfig.ssh) publicHostname username;
in in
{ {
User = meta.host.username; host = hostname;
user = username;
} }
// lib.optionalAttrs (!isLocal) { // lib.optionalAttrs (publicHostname != "") {
HostName = hostname; hostname = publicHostname;
} }
) )
// { // {
"*" = { "*" = {
AddKeysToAgent = "yes"; addKeysToAgent = "yes";
ForwardAgent = false;
identityFile = [
"~/.ssh/id_ed25519_sk"
"~/.ssh/id_ed25519_sk_bak"
];
};
}; };
}; };
}; };

View File

@@ -1,18 +1,16 @@
{ {
config, config,
lib, inputs,
pkgs, pkgs,
... ...
}: }:
let let
cfg = config.my.stylix;
theme = import ../../../modules/stylix/theme.nix { inherit pkgs; }; theme = import ../../../modules/stylix/theme.nix { inherit pkgs; };
in in
{ {
options.my.stylix.enable = lib.mkEnableOption "stylix"; imports = [ inputs.stylix.homeModules.stylix ];
config = lib.mkIf cfg.enable {
stylix = { stylix = {
enable = true; enable = true;
inherit (theme) inherit (theme)
@@ -27,7 +25,21 @@ in
sansSerif = config.stylix.fonts.monospace; sansSerif = config.stylix.fonts.monospace;
emoji = config.stylix.fonts.monospace; emoji = config.stylix.fonts.monospace;
}; };
targets = import ../../../modules/stylix/targets.nix; targets = {
firefox = {
profileNames = [ "default" ];
colorTheme.enable = true;
};
librewolf = {
profileNames = [ "default" ];
colorTheme.enable = true;
};
gnome.enable = false;
gtk.enable = false;
kitty = {
variant256Colors = true;
};
nixvim.enable = false;
}; };
}; };
} }

View File

@@ -10,23 +10,16 @@
}: }:
let let
cfg = config.taskwarrior;
sops = myUtils.sopsAvailability config osConfig; sops = myUtils.sopsAvailability config osConfig;
standalone = osConfig == null; standalone = osConfig == null;
in in
{
options.taskwarrior.enable = lib.mkEnableOption "taskwarrior";
config = lib.mkIf cfg.enable (
lib.optionalAttrs standalone { lib.optionalAttrs standalone {
sops = { sops = {
secrets = myUtils.mkSopsSecrets "${toString inputs.nix-secrets}/secrets" { secrets = myUtils.mkSopsSecrets "${toString inputs.nix-secrets}/secrets" "taskwarrior" [
taskwarrior = [
"sync-server-url" "sync-server-url"
"sync-server-client-id" "sync-server-client-id"
"sync-encryption-secret" "sync-encryption-secret"
]; ] { };
};
templates."taskrc.d/sync" = { templates."taskrc.d/sync" = {
content = '' content = ''
@@ -38,8 +31,9 @@ in
}; };
} }
// { // {
warnings = warnings =
lib.optional (!sops.available) lib.optional (!sops.available && config.programs.taskwarrior.enable)
"taskwarrior is enabled, but sops templates are not available. taskwarrior sync will not be configured."; "taskwarrior is enabled, but sops templates are not available. taskwarrior sync will not be configured.";
home.packages = with pkgs; [ home.packages = with pkgs; [
@@ -62,6 +56,14 @@ in
".local/share/task/hooks/on-exit.sync.py" = { ".local/share/task/hooks/on-exit.sync.py" = {
source = dotsPath + "/.local/share/task/hooks/on-exit.sync.py"; source = dotsPath + "/.local/share/task/hooks/on-exit.sync.py";
}; };
".local/share/task/hooks/on-add.limit.py" = {
source = dotsPath + "/.local/share/task/hooks/on-add.limit.py";
executable = true;
};
".local/share/task/hooks/on-modify.limit.py" = {
source = dotsPath + "/.local/share/task/hooks/on-modify.limit.py";
executable = true;
};
".local/share/task/scripts/sync-and-notify.sh" = { ".local/share/task/scripts/sync-and-notify.sh" = {
source = dotsPath + "/.local/share/task/scripts/sync-and-notify.sh"; source = dotsPath + "/.local/share/task/scripts/sync-and-notify.sh";
executable = true; executable = true;
@@ -74,12 +76,9 @@ in
colorTheme = "dark-256"; colorTheme = "dark-256";
config = { config = {
recurrence = "off"; recurrence = "off";
reserved.lines = 3;
}; };
extraConfig = lib.optionalString sops.available '' extraConfig = lib.optionalString sops.available ''
include ${sops.templates."taskrc.d/sync".path} include ${sops.templates."taskrc.d/sync".path}
''; '';
}; };
} }
);
}

View File

@@ -1,18 +1,12 @@
{ {
config,
lib,
pkgs, pkgs,
config,
dotsPath, dotsPath,
... ...
}: }:
let
cfg = config.terminal;
in
{ {
options.terminal.enable = lib.mkEnableOption "terminal"; config = {
config = lib.mkIf cfg.enable {
programs.bash.shellAliases = { programs.bash.shellAliases = {
icat = "kitty +kitten icat"; icat = "kitty +kitten icat";
}; };

View File

@@ -1,21 +1,7 @@
{ { pkgs, ... }:
config,
lib,
pkgs,
...
}:
let
cfg = config.ticketing;
in
{ {
options.ticketing = {
enable = lib.mkEnableOption "ticketing";
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
jira-cli-go jira-cli-go
]; ];
};
} }

View File

@@ -1,18 +1,7 @@
{ { pkgs, dotsPath, ... }:
config,
lib,
pkgs,
dotsPath,
...
}:
let
cfg = config.tmux;
in
{ {
options.tmux.enable = lib.mkEnableOption "tmux"; config = {
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
tmuxp tmuxp
reptyr reptyr
@@ -22,5 +11,9 @@ in
enable = true; enable = true;
extraConfig = builtins.readFile (dotsPath + "/.config/tmux/tmux.conf"); extraConfig = builtins.readFile (dotsPath + "/.config/tmux/tmux.conf");
}; };
home.file = {
".config/tmux/hooks/tmux.ssh.conf".source = dotsPath + "/.config/tmux/hooks/tmux.ssh.conf";
};
}; };
} }

View File

@@ -10,7 +10,7 @@ let
in in
{ {
options.torrenting = { options.torrenting = {
enable = lib.mkEnableOption "torrenting"; enable = lib.mkEnableOption "transmission torrent client";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@@ -1,19 +1,7 @@
{ { config, pkgs, ... }:
config,
lib,
pkgs,
...
}:
let
cfg = config.vscode;
in
{ {
options.vscode = { config = {
enable = lib.mkEnableOption "Visual Studio Code";
};
config = lib.mkIf cfg.enable {
home.packages = [ (config.nixgl.wrap (config.wrapApp pkgs.vscode "--no-sandbox")) ]; home.packages = [ (config.nixgl.wrap (config.wrapApp pkgs.vscode "--no-sandbox")) ];
}; };
} }

View File

@@ -1,24 +1,11 @@
{
config,
lib,
...
}:
let
cfg = config.waybar;
in
{ {
imports = [ imports = [
./settings.nix ./settings.nix
./style.nix ./style.nix
]; ];
options.waybar.enable = lib.mkEnableOption "waybar";
config = lib.mkIf cfg.enable {
programs.waybar = { programs.waybar = {
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;
}; };
};
} }

View File

@@ -1,19 +0,0 @@
{
lib,
config,
pkgs,
...
}:
{
options.my.yubikey = {
enable = lib.mkEnableOption "yubikey";
};
config = lib.mkIf config.my.yubikey.enable {
home.packages = with pkgs; [
yubikey-manager
yubikey-personalization
];
};
}

View File

@@ -1,45 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.zk;
in
{
options.zk = {
enable = lib.mkEnableOption "zettelkasten";
path = lib.mkOption {
type = lib.types.str;
default = config.home.homeDirectory + "/.zk";
description = "Path to the zettelkasten directory";
};
};
config = lib.mkIf cfg.enable {
home = {
sessionVariables.ZK_PATH = cfg.path;
packages = [
(pkgs.writeShellApplication {
name = "zk";
runtimeInputs = with pkgs; [ tmux ];
text = builtins.readFile ./scripts/zk.sh;
})
(pkgs.writeShellApplication {
name = "save-zk";
runtimeInputs = with pkgs; [ git ];
text = builtins.readFile ./scripts/save-zk.sh;
})
(pkgs.writeShellApplication {
name = "setup-zk";
runtimeInputs = with pkgs; [ gh ];
text = builtins.readFile ./scripts/setup-zk.sh;
})
];
};
};
}

View File

@@ -1,2 +0,0 @@
cd "$ZK_PATH" || { echo "No zettelkasten directory found"; exit 1; }
git add . && git commit -m "Update" && git push

View File

@@ -1,13 +0,0 @@
if [ ! -d "$ZK_PATH" ]; then
echo "[zk] Setting up zettelkasten"
gh repo clone zk "$ZK_PATH"
else
echo "[zk] Zettelkasten already set up."
fi
read -p "Would you like open your zettelkasten? [y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
$EDITOR "$ZK_PATH"
fi

View File

@@ -7,72 +7,74 @@
}: }:
let let
meta = import ./meta.nix;
wolInterfaces = import ./wol-interfaces.nix; wolInterfaces = import ./wol-interfaces.nix;
in in
{ {
imports = [ imports = [
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
./hard.nix
./host.nix
inputs.nixos-hardware.nixosModules.common-cpu-intel inputs.nixos-hardware.nixosModules.common-cpu-intel
inputs.nixos-hardware.nixosModules.common-pc inputs.nixos-hardware.nixosModules.common-pc
inputs.nixos-hardware.nixosModules.common-pc-ssd inputs.nixos-hardware.nixosModules.common-pc-ssd
../../modules ../../modules/common
../../modules/boot/bootloader.nix
(import ../../modules/disko/zfs-encrypted-root.nix { (import ../../modules/disko/zfs-encrypted-root.nix {
inherit lib config; inherit lib config;
device = "/dev/nvme1n1"; device = "/dev/nvme1n1";
}) })
../../modules/ai-tools
../../modules/anki
../../modules/audio
../../modules/backups
../../modules/bluetooth
../../modules/desktops/niri
../../modules/docker
../../modules/firewall
../../modules/fonts
../../modules/gaming
../../modules/git
../../modules/hcloud
../../modules/keyboard
../../modules/localization
../../modules/networking
../../modules/nvidia
../../modules/secrets
../../modules/ssh
../../modules/storage
../../modules/stylix
../../modules/syncthing
../../modules/tailscale
../../modules/taskwarrior
../../modules/users
../../modules/wol
../../modules/yubikey
]; ];
inherit (meta) host; home-manager.users.${config.host.username} = import ../../home/hosts/andromache {
inherit
inputs
config
pkgs
lib
;
};
hardware.facter.reportPath = ./facter.json; ssh.username = config.host.username;
home-manager.users.${config.host.username} = import ../../home/hosts/${config.host.name}; ssh.authorizedHosts = [ "astyanax" ];
"ai-tools".enable = true;
anki.enable = true;
audio.enable = true;
bluetooth.enable = true;
bootloader.enable = true;
desktop.niri.enable = true;
firewall = {
enable = true;
allowedTCPPorts = [ 22 ];
};
gaming.enable = true;
git.enable = true;
keyboard.enable = true;
localization.enable = true;
my = {
fonts.enable = true;
stylix.enable = true;
users.enable = true;
yubikey = {
enable = true;
pam.enable = false;
};
};
desktop.ly.enable = true;
docker.enable = true;
hcloud.enable = true;
networking = {
enable = true;
hostId = "80eef97e";
useDHCP = lib.mkDefault true;
};
nvidia.enable = true;
restic-backup.enable = true;
secrets = { secrets = {
enable = true; inherit (config.host) username;
nixSigningKey.enable = true; nixSigningKey.enable = true;
}; };
ssh.enable = true;
storage.enable = true;
syncthing.enable = true;
tailscale.enable = true; tailscale.enable = true;
taskwarrior.enable = true;
wol = { docker.user = config.host.username;
hcloud = {
enable = true; enable = true;
interfaces.eno1 = { inherit (wolInterfaces.eno1) macAddress; }; inherit (config.host) username;
}; };
disko.devices = { disko.devices = {
@@ -103,8 +105,39 @@ in
inputs.colmena.packages.${pkgs.stdenv.hostPlatform.system}.colmena inputs.colmena.packages.${pkgs.stdenv.hostPlatform.system}.colmena
]; ];
my.yubikey = {
enable = false;
inherit (config.host) username;
keys = [
{
handle = "<KeyHandle1>";
userKey = "<UserKey1>";
coseType = "<CoseType1>";
options = "<Options1>";
}
{
handle = "<KeyHandle2>";
userKey = "<UserKey2>";
coseType = "<CoseType2>";
options = "<Options2>";
}
];
};
services.locate = { services.locate = {
enable = true; enable = true;
package = pkgs.plocate; package = pkgs.plocate;
}; };
networking.hostId = "80eef97e";
wol = {
enable = true;
interfaces.eno1 = { inherit (wolInterfaces.eno1) macAddress; };
};
firewall = {
enable = true;
allowedTCPPorts = [ 22 ];
};
} }

File diff suppressed because it is too large Load Diff

42
hosts/andromache/hard.nix Normal file
View File

@@ -0,0 +1,42 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot = {
initrd.availableKernelModules = [
"vmd"
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"uas"
"sd_mod"
];
initrd.kernelModules = [ ];
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

Some files were not shown because too many files have changed in this diff Show More