12 Commits

Author SHA1 Message Date
4f7cdc02c5 refactor(home/work): improve configuration structure
- Add nixpkgs.config.allowUnfree setting
- Fix nixGL configuration path to targets.genericLinux.nixGL
- Remove redundant anki program import (now in modules)
- Enable gh and kubecolor programs
- Pass inputs to packages.nix for flake package access

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 15:32:55 +01:00
d85ee5316d feat(home): add GNOME desktop configuration
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 15:32:21 +01:00
b847bcae1c chore(home): add commented experimental anki sync config
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 15:32:10 +01:00
ea679f12a2 refactor(work): set up 'packages.local.nix' approach 2025-12-03 15:26:39 +01:00
48b72f0530 feat(home): add git config with example configuration for non-NixOS 2025-12-03 15:17:20 +01:00
3f47d9079e refactor: move common hosts config into 'modules/common.nix' 2025-12-03 15:17:20 +01:00
c03d572675 chore(nvim): update flake dependencies 2025-12-03 15:17:20 +01:00
39294a34b7 chore: formatting and cleanup
- Format shell.nix skeleton to single line
- Complete ts-node removal from astyanax packages
- Format andromache hardware config
2025-12-03 15:17:20 +01:00
847db443e6 chore: update flake to 'nixos-unstable'
- Switch from 'nixos-25.05' to 'nixos-unstable'
- Update home-manager to follow main branch
2025-12-03 14:25:50 +01:00
c4448013e5 fix(astyanax): correct hostname typo from astynanax to astyanax 2025-12-03 14:07:04 +01:00
4029eae7aa doc: add CLAUDE.md 2025-12-03 13:57:18 +01:00
022e5b17a0 Add neovim 'typescriptreact' snippets 2025-11-27 12:06:38 +01:00
71 changed files with 555 additions and 1246 deletions

159
CLAUDE.md Normal file
View File

@@ -0,0 +1,159 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with
code in this repository.
## Overview
This is a NixOS flake-based configuration repository managing both system
configurations (NixOS) and user environments (home-manager). The repository
follows a modular architecture with separate host configurations for physical
machines, VMs, and standalone home-manager setups.
## Essential Commands
### Building and Testing
```bash
# Build a NixOS system configuration
nix build -L '.#nixosConfigurations.<hostname>.config.system.build.toplevel'
# Build and run a VM with disko
nix build -L '.#nixosConfigurations.vm.config.system.build.vmWithDisko'
./result/bin/disko-vm
# Build home-manager configuration
nix build -L '.#homeConfigurations.work.activationPackage'
# Build the custom neovim package
nix build -L '.#nvim.packages.x86_64-linux.nvim'
```
### Development
```bash
# Update flake inputs
nix flake update
# Check flake for errors
nix flake check
# Show flake outputs
nix flake show
# Enter development shell for neovim
cd dots/.config/nvim && nix develop
```
## Architecture
### Repository Structure
The repository is organized into distinct layers:
- **`flake.nix`**: Root flake defining inputs and outputs. Uses `utils.dirNames` to automatically discover host directories.
- **`hosts/`**: NixOS system configurations (andromache, astyanax, vm). Each host has its own directory with `default.nix` and hardware configuration.
- **`home/`**: home-manager configurations, split into `hosts/` (per-host configs) and `modules/` (reusable user-level modules).
- **`modules/`**: Reusable NixOS modules for system-level configuration (audio, networking, fonts, etc.).
- **`dots/`**: Dotfiles and configurations, including a complete neovim flake at `dots/.config/nvim/`.
- **`utils/`**: Helper functions like `dirNames` for discovering directories.
### Key Architectural Patterns
**Host Discovery**: The flake uses `lib.genAttrs hostDirNames` to automatically
generate `nixosConfigurations` from directories in `hosts/`. Adding a new host
only requires creating a directory with a `default.nix`.
**Secrets Management**: Uses sops-nix with age encryption. Secrets are stored
in a separate private repository (`nix-secrets`) referenced as a flake input.
The `modules/secrets/default.nix` module provides options and templates for
injecting secrets into configurations.
**Disk Management**: Uses disko for declarative disk partitioning. The
`modules/disko.zfs-encrypted-root.nix` module provides a reusable ZFS-on-root
setup with encryption, taking a `device` parameter.
**Neovim as Flake**: The neovim configuration at `dots/.config/nvim/` is a
standalone flake using nixCats. It's referenced as a flake input in the root
and included in system packages. This allows independent development and
version control.
**Home Manager Integration**: Each NixOS host can include home-manager
configuration through `home-manager.users.<username>`, which imports from
`home/hosts/<hostname>`. Standalone home-manager configurations (like `work`)
are also available for non-NixOS systems.
**Module Parameterization**: Modules like `networking.nix` and
`secrets/default.nix` accept parameters and expose options, making them
reusable across hosts with different settings.
### Input Dependencies
- **nixpkgs**: Main package source (nixos-unstable)
- **nixos-hardware**: Hardware-specific configurations
- **disko**: Declarative disk partitioning
- **sops-nix**: Secrets management with age/sops
- **nix-secrets**: Private repository with encrypted secrets (git+ssh)
- **home-manager**: User environment management
- **nixgl**: OpenGL wrapper for non-NixOS systems
- **firefox-addons**: Firefox extension packages
- **nvim**: Local flake at `dots/.config/nvim/`
## Working with Hosts
### Adding a New NixOS Host
1. Create a new directory in `hosts/<hostname>/`
2. Add `default.nix` with imports and host-specific configuration
3. Add `hard.nix` for hardware configuration (generated by nixos-generate-config)
4. The host will automatically be discovered by the flake
### Adding a New Home Manager Host
1. Create directory in `home/hosts/<hostname>/`
2. Add `default.nix` importing desired modules from `home/modules/`
3. For standalone (non-NixOS) configs, add entry to `homeConfigurations` in root `flake.nix`
## Secrets Workflow
Secrets are managed with sops-nix and stored in the private `nix-secrets` repository:
1. Secrets are encrypted with age using keys at `~/.config/sops/age/keys.txt`
2. The `modules/secrets/default.nix` module reads from `${nix-secrets}/secrets.yaml`
3. Secrets are exposed as files in `/run/secrets/` with proper ownership
4. Templates can combine multiple secrets (see taskwarrior sync configuration)
## Common Patterns
### Import Patterns
Modules use different import patterns based on their needs:
```nix
# Simple module (no parameters)
imports = [ ../../modules/audio.nix ];
# Parameterized module (function call)
imports = [ (import ../../modules/networking.nix { hostName = "andromache"; }) ];
# Module with all parameters
imports = [
(import ../../modules/secrets {
inherit lib inputs config;
})
];
```
### Special Args
- `inputs`: Flake inputs, passed as `specialArgs` to NixOS and `extraSpecialArgs` to home-manager
- `lib`, `config`, `pkgs`: Standard NixOS/home-manager module arguments
### Username Handling
Each host defines a `username` variable (either "h" or "hektor") used for:
- User creation in NixOS
- Home directory paths
- Secrets ownership
- Home-manager configuration

View File

@@ -8,24 +8,19 @@ Pomodoro timer
- Notification on break finish
"""
import atexit
import os
import atexit
from argparse import ArgumentParser
from time import sleep
from plyer import notification
POMO_PATH = os.path.join(
os.getenv("XDG_DATA_HOME", os.path.expanduser("~/.local/share")), "pomo"
)
POMO_PATH = os.path.join(os.getenv("XDG_DATA_HOME", os.path.expanduser("~/.local/share")), "pomo")
@atexit.register
def clear():
if os.path.exists(POMO_PATH):
os.remove(POMO_PATH)
def format_mins_secs(mins, secs):
return f"{mins:02d}:{secs:02d}"
@@ -39,7 +34,6 @@ def make_countdown():
os.system(f'echo -n "{time_str}" > {POMO_PATH}')
sleep(1)
duration -= 1
return countdown
@@ -64,23 +58,21 @@ def main(args):
def handle_signal(signal, frame):
# Wait for clear to finish
clear()
print("Exiting")
print('Exiting')
exit(0)
if __name__ == "__main__":
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument(
"-w", "--work-duration", type=int, help="Session duration", default=25
)
parser.add_argument(
"-b", "--break-duration", type=int, help="Break duration", default=5
)
parser.add_argument(
"-r", "--repeats", type=int, help="Numer of sessions", default=1
)
parser.add_argument("-c", "--clear", action="store_true", help="Clear timer")
parser.add_argument('-w', '--work-duration', type=int,
help='Session duration', default=25)
parser.add_argument('-b', '--break-duration', type=int,
help='Break duration', default=5)
parser.add_argument('-r', '--repeats', type=int,
help='Numer of sessions', default=1)
parser.add_argument('-c', '--clear', action='store_true',
help='Clear timer')
args = parser.parse_args()

View File

@@ -2,8 +2,8 @@
session="r5rs"
tmux attach-session -t "$session" || tmux new-session -s "$session" \; \
tmux attach-session -t $session || tmux new-session -s $session \; \
split-window -h -t $session \; \
send-keys -t 1 "nvim -c \"set ft=scheme\"" C-m \; \
send-keys -t 2 "plt-r5rs --no-prim" C-m \; \
select-pane -t 1
send-keys -t 0 "vim" C-m \; \
send-keys -t 1 "plt-r5rs --no-prim" C-m \; \
select-pane -t 0

View File

@@ -22,5 +22,4 @@ restic -r "$RESTIC_REPOSITORY:$HOSTNAME" backup \
--one-file-system \
--files-from="$HOME/.resticinclude" \
--exclude-file="$HOME/.resticexclude" \
--exclude-if-present=".nobackup" \
--verbose=3

View File

@@ -1,12 +1,12 @@
#!/usr/bin/env python
import subprocess
import sys
import subprocess
DEFAULT_TEMPERATURE = 3500
try:
with open("/tmp/temperature", "r") as temp_file:
with open('/tmp/temperature', 'r') as temp_file:
current_temperature = int(temp_file.read())
except FileNotFoundError:
current_temperature = DEFAULT_TEMPERATURE
@@ -16,8 +16,7 @@ if len(sys.argv) == 1:
print(current_temperature)
sys.exit(0)
elif len(sys.argv) != 2:
print(
"""
print("""
Usage:
screen-temperature
@@ -28,8 +27,7 @@ Usage:
screen-temperature <+|-><temperature>
increase or decrease screen temperature by <temperature>
"""
)
""")
sys.exit(1)
temperature_change = sys.argv[1]
@@ -43,10 +41,11 @@ else:
try:
subprocess.run(["redshift", "-O", str(new_temperature), "-P"], check=True)
with open("/tmp/temperature", "w") as temp_file:
temp_file.write(str(new_temperature) + "\n")
with open('/tmp/temperature', 'w') as temp_file:
temp_file.write(str(new_temperature) + '\n')
# Send notification
subprocess.run(["notify-send", str(new_temperature) + "K"])
subprocess.run(
["notify-send", str(new_temperature) + "K"])
except subprocess.CalledProcessError:
print("Error: could not set screen temperature.")
sys.exit(1)

144
dots/.bin/taskdeps Executable file
View File

@@ -0,0 +1,144 @@
#!/usr/bin/python
import argparse
import json
import subprocess
from collections import defaultdict
def get_task_data():
command = (
"task +PENDING or +WAITING -COMPLETED -DELETED export | "
"jq '[.[] | {uuid: .uuid, id, depends: .depends, description: .description, status: .status }]'"
)
output = subprocess.check_output(command, shell=True)
return json.loads(output)
def parse_task_data(data):
dependency_graph = defaultdict(list)
task_details = {}
dependent_tasks = set()
for task in data:
task_id = task["uuid"]
task_details[task_id] = {
"id": task.get("id", "?"),
"description": task.get("description", "No description"),
"status": task.get("status", "Unknown status"),
}
if task["depends"]:
for dependency in task["depends"]:
dependency_graph[dependency].append(task_id)
dependent_tasks.add(task_id)
root_tasks = set(task_details.keys()) - dependent_tasks
return task_details, dependency_graph, root_tasks
def get_all_parents(task_id, dependency_graph):
return [
parent for parent, children in dependency_graph.items() if task_id in children
]
def build_ascii_dag(
task_id,
task_details,
dependency_graph,
prefix="",
is_last=True,
show_id=True,
visited=None,
):
if visited is None:
visited = set()
if task_id in visited:
return [f"{prefix}{'└── ' if is_last else '├── '}... (cycle detected)"]
visited.add(task_id)
task_info = task_details[task_id]
task_line = f"{prefix}{'└── ' if is_last else '├── '}{task_info['id'] + ': ' if show_id else ''}{task_info['description']} ({task_info['status']})"
lines = [task_line]
children = dependency_graph.get(task_id, [])
for idx, child in enumerate(children):
child_is_last = idx == len(children) - 1
child_prefix = prefix + (" " if is_last else "│ ")
lines.extend(
build_ascii_dag(
child,
task_details,
dependency_graph,
child_prefix,
child_is_last,
show_id,
visited.copy(),
)
)
return lines
def render_dependency_dag(task_details, dependency_graph, root_tasks, show_id):
dag_lines = []
global_visited = set()
def dfs(task_id, prefix="", is_last=True, visited=None):
if visited is None:
visited = set()
if task_id in visited:
return
visited.add(task_id)
global_visited.add(task_id)
task_info = task_details[task_id]
task_line = f"{prefix}{'└── ' if is_last else '├── '}{str(task_info['id']) + ': ' if show_id else ''}{task_info['description']} ({task_info['status']})"
dag_lines.append(task_line)
children = dependency_graph.get(task_id, [])
for idx, child in enumerate(children):
child_is_last = idx == len(children) - 1
child_prefix = prefix + (" " if is_last else "│ ")
dfs(child, child_prefix, child_is_last, visited.copy())
root_tasks_with_children = [
root for root in root_tasks if dependency_graph.get(root, [])
]
for root in sorted(
root_tasks_with_children,
key=lambda x: len(dependency_graph.get(x, [])),
reverse=True,
):
if root not in global_visited:
dfs(root)
dag_lines.append("")
return "\n".join(dag_lines).rstrip()
def main(args):
data = get_task_data()
task_details, dependency_graph, root_tasks = parse_task_data(data)
ascii_dag = render_dependency_dag(
task_details, dependency_graph, root_tasks, show_id=args.show_id
)
print(ascii_dag)
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Generates a task dependency DAG for Taskwarrior tasks."
)
parser.add_argument(
"--show-id",
action="store_true",
default=False,
help="Include task IDs in the output.",
)
args = parser.parse_args()
main(args)

View File

@@ -1,9 +1,7 @@
#!/usr/bin/env bash
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 && $EDITOR "$(cat ~/.zk/current-zettel.txt)"
else
echo 'Not in tmux'
echo 'Choose an option:'
@@ -20,12 +18,12 @@ else
else
# Create session with a window named 'zk' and start nvim
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 && $EDITOR \"\$(cat ~/.zk/current-zettel.txt)\"" Enter
tmux attach -t zk
fi
;;
2)
cd "$ZK_PATH" && $EDITOR "$current_zettel_path"
cd ~/.zk && $EDITOR "$(cat ~/.zk/current-zettel.txt)"
;;
*)
echo 'Not opening Zettelkasten'

View File

@@ -136,7 +136,7 @@ map f5 goto_tab 5
map f6 goto_tab 6
map f7 goto_tab 7
map f8 goto_tab 8
# map kitty_mod+c new_tab # FIXME: conflict with 'copy'
map kitty_mod+c new_tab
map cmd+t
map kitty_mod+q
map cmd+w

View File

@@ -1 +0,0 @@
require("claude-code").setup()

View File

@@ -1,16 +1,16 @@
-- require("codecompanion").setup({
-- extensions = {
-- mcphub = {
-- callback = "mcphub.extensions.codecompanion",
-- opts = {
-- make_vars = true,
-- make_slash_commands = true,
-- show_result_in_chat = true
-- }
-- }
-- },
-- strategies = {
-- chat = { adapter = "openai" },
-- inline = { adapter = "openai" },
-- },
-- })
require("codecompanion").setup({
extensions = {
mcphub = {
callback = "mcphub.extensions.codecompanion",
opts = {
make_vars = true,
make_slash_commands = true,
show_result_in_chat = true
}
}
},
strategies = {
chat = { adapter = "openai" },
inline = { adapter = "openai" },
},
})

View File

@@ -1,6 +1,6 @@
require("conform").setup({
format_after_save = {
lsp_fallback = true,
lsp_fallback = false,
async = false,
timeout_ms = 500,
},
@@ -18,8 +18,8 @@ require("conform").setup({
nix = { "nixfmt" },
javascript = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },
javascriptreact = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },
-- json = { "prettierd", "prettier", stop_after_first = true },
-- jsonc = { "prettierd", "prettier", stop_after_first = true },
json = { "prettierd", "prettier", stop_after_first = true },
jsonc = { "prettierd", "prettier", stop_after_first = true },
python = { "isort", "black" },
svelte = { "eslint_d", "prettierd", "prettier", stop_after_first = true },
typescript = { "eslint_d", "prettierd", "prettier", stop_after_first = true },

View File

@@ -1 +0,0 @@
require("fidget").setup()

View File

@@ -1,78 +0,0 @@
-- require("formatter").setup({
-- logging = true,
-- filetype = {
-- typescriptreact = {
-- -- prettier
-- function()
-- return {
-- exe = "prettier",
-- args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0) },
-- stdin = true,
-- }
-- end,
-- },
-- typescript = {
-- -- prettier
-- function()
-- return {
-- exe = "prettier",
-- args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0) },
-- stdin = true,
-- }
-- end,
-- -- linter
-- -- function()
-- -- return {
-- -- exe = "eslint",
-- -- args = {
-- -- "--stdin-filename",
-- -- vim.api.nvim_buf_get_name(0),
-- -- "--fix",
-- -- "--cache"
-- -- },
-- -- stdin = false
-- -- }
-- -- end
-- },
-- javascript = {
-- -- prettier
-- function()
-- return {
-- exe = "prettier",
-- args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0) },
-- stdin = true,
-- }
-- end,
-- },
-- javascriptreact = {
-- -- prettier
-- function()
-- return {
-- exe = "prettier",
-- args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0) },
-- stdin = true,
-- }
-- end,
-- },
-- json = {
-- -- prettier
-- function()
-- return {
-- exe = "prettier",
-- args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0) },
-- stdin = true,
-- }
-- end,
-- },
-- lua = {
-- -- luafmt
-- function()
-- return {
-- exe = "luafmt",
-- args = { "--indent-count", 2, "--stdin" },
-- stdin = true,
-- }
-- end,
-- },
-- },
-- })

View File

@@ -5,9 +5,7 @@ fzf.setup({ "max-perf" })
vim.keymap.set("n", "<leader>f<leader>", fzf.builtin) -- Help
vim.keymap.set("n", "<leader>fc", fzf.commands)
vim.keymap.set("n", "<leader>ff", fzf.files)
vim.keymap.set("n", "<leader>fg", function()
fzf.live_grep_native({ resume = true })
end)
vim.keymap.set("n", "<leader>fg", fzf.live_grep_native)
vim.keymap.set("n", "<leader>fb", fzf.buffers)
vim.keymap.set("n", "<leader>fd", fzf.diagnostics_workspace)
vim.keymap.set("n", "<leader>fhe", fzf.help_tags)
@@ -15,4 +13,4 @@ vim.keymap.set("n", "<leader>fhi", fzf.search_history)
vim.keymap.set("n", "<leader>fma", fzf.marks)
vim.keymap.set("n", "<leader>fma", fzf.man_pages)
vim.keymap.set("i", "<c-f>", fzf.complete_file)
vim.keymap.set("i", "<c-f>", fzf.complete_path)

View File

@@ -1,10 +1,10 @@
-- require("image").setup({
-- backend = "kitty",
-- kitty_method = "normal",
-- processor = "magick_cli",
-- integrations = {
-- markdown = {
-- filetypes = { "markdown", "pandoc" },
-- },
-- },
-- })
require("image").setup({
backend = "kitty",
kitty_method = "normal",
processor = "magick_cli",
integrations = {
markdown = {
filetypes = { "markdown", "pandoc" },
},
},
})

View File

@@ -1 +0,0 @@
require("kubectl").setup()

View File

@@ -17,9 +17,11 @@ local servers = {
format = false,
},
},
-- emmet_language_server = {},
emmet_language_server = {},
gdscript = {},
helm_ls = { filetypes = { "helm", "yaml.helm-values" } },
helm_ls = {
filetypes = { "yaml", "helm", "yaml.helm-values" },
},
hls = { filetypes = { "haskell", "lhaskell", "cabal" } },
html = {},
jsonls = {
@@ -63,26 +65,8 @@ local servers = {
},
},
-- marksman = {},
-- TODO: This completion ain't working yet
nixd = {
nixpkgs = {
expr = "import <nixpkgs> { }",
},
formatting = {
command = { "nixfmt" },
},
options = {
home_manager = {
expr = '(builtins.getFlake "/home/hektor/.config/home-manager").homeConfigurations.work.options',
},
},
},
nixd = {},
pyright = {},
rust_analyzer = {
settings = {
["rust-analyzer"] = {},
},
},
-- tsserver = {},
svelte = {
plugin = {
@@ -92,43 +76,48 @@ local servers = {
},
},
tailwindcss = {},
terraformls = {},
-- ts_ls = {},
vtsls = {
maxTsServerMemory = 16384,
filetypes = {
"javascript",
"javascriptreact",
"javascript.jsx",
"typescript",
"typescriptreact",
"typescript.tsx",
},
settings = {
complete_function_calls = true,
vtsls = {
enableMoveToFileCodeAction = true,
autoUseWorkspaceTsdk = true,
experimental = { completion = { enableServerSideFuzzyMatch = true } },
},
typescript = {
updateImportsOnFileMove = { enabled = "always" },
suggest = { completeFunctionCalls = true },
inlayHints = {
enumMemberValues = { enabled = true },
functionLikeReturnTypes = { enabled = true },
parameterNames = { enabled = "literals" },
parameterTypes = { enabled = true },
propertyDeclarationTypes = { enabled = true },
variableTypes = { enabled = false },
},
},
},
},
-- vtsls = {},
ts_ls = {},
-- vtsls = {
-- maxTsServerMemory = 16384,
-- filetypes = {
-- "javascript",
-- "javascriptreact",
-- "javascript.jsx",
-- "typescript",
-- "typescriptreact",
-- "typescript.tsx",
-- },
-- settings = {
-- complete_function_calls = true,
-- vtsls = {
-- enableMoveToFileCodeAction = true,
-- autoUseWorkspaceTsdk = true,
-- experimental = {
-- completion = {
-- enableServerSideFuzzyMatch = true,
-- },
-- },
-- },
-- typescript = {
-- updateImportsOnFileMove = { enabled = "always" },
-- suggest = {
-- completeFunctionCalls = true,
-- },
-- inlayHints = {
-- enumMemberValues = { enabled = true },
-- functionLikeReturnTypes = { enabled = true },
-- parameterNames = { enabled = "literals" },
-- parameterTypes = { enabled = true },
-- propertyDeclarationTypes = { enabled = true },
-- variableTypes = { enabled = false },
-- },
-- },
-- },
-- },
yamlls = {
settings = {
yaml = {
validate = true,
schemaStore = {
-- You must disable built-in schemaStore support if you want to use
-- this plugin and its advanced options like `ignore`.

View File

@@ -1,9 +0,0 @@
require("m_taskwarrior_d").setup()
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost" }, {
group = vim.api.nvim_create_augroup("TWTask", { clear = true }),
pattern = "*.md",
callback = function()
vim.cmd("TWSyncTasks")
end,
})

View File

@@ -1 +1 @@
-- require("mcphub").setup({})
require("mcphub").setup({})

View File

@@ -62,12 +62,12 @@ cmp.setup({
["<CR>"] = c_l,
}),
sources = {
{ name = "copilot", group_index = 2 },
{ name = "zk" },
{ name = "copilot", group_index = 2 },
{ name = "nvim_lsp", keyword_length = 8 },
{ name = "luasnip", max_item_count = 16 },
{ name = "luasnip", max_item_count = 16 },
{ name = "path" },
{ name = "buffer", max_item_count = 8 },
{ name = "buffer", max_item_count = 8 },
},
window = {
completion = cmp.config.window.bordered({ border = { "", "", "", "", "", "", "", "" } }),

View File

@@ -12,8 +12,8 @@ require("lint").linters_by_ft = {
editorconfig = { "editorconfig-checker" },
haskell = { "hlint" },
-- html = { "htmlhint" },
javascript = { eslint_linter },
javascriptreact = { eslint_linter },
-- javascript = { eslint_linter },
-- javascriptreact = { eslint_linter },
gdscript = { "gdlint" },
latex = { "chktex" },
-- lua = { "luacheck", "selene" },
@@ -22,9 +22,10 @@ require("lint").linters_by_ft = {
-- python = { "pylint" },
sh = { "shellcheck" },
svelte = { eslint_linter },
typescript = { eslint_linter },
typescriptreact = { eslint_linter },
-- yaml = { "yamllint" },
systemd = { "systemdlint" },
-- typescript = { eslint_linter },
-- typescriptreact = { eslint_linter },
yaml = { "yamllint" },
}
-- TODO: Wouldn't it be possible / nice to only try to load the linters when they are

View File

@@ -1,9 +0,0 @@
require("obsidian").setup({
legacy_commands = false,
workspaces = {
{
name = "test",
path = "~/zk/work",
},
},
})

View File

@@ -4,13 +4,10 @@ local keymap = vim.keymap
local opt = vim.opt
local treesitter_configs = require("nvim-treesitter.configs")
local nixCatsUtils = require("nixCatsUtils")
local is_nix = nixCatsUtils.isNixCats
treesitter_configs.setup({
-- Basically added what I might need from the docs
-- <https://github.com/nvim-treesitter/nvim-treesitter?tab=readme-ov-file#supported-languages>
ensure_installed = is_nix and {} or {
ensure_installed = {
"awk",
"bash",
"bibtex",
@@ -89,7 +86,7 @@ treesitter_configs.setup({
enable = true,
},
sync_install = false,
auto_install = not is_nix,
auto_install = true,
ignore_install = {},
modules = {},
textobjects = {

View File

@@ -1,6 +1,6 @@
vim.cmd([[
" " Change local buffer to directory of current file after the plugin has loaded
" autocmd VimEnter * lcd %:p:h
" Change local buffer to directory of current file after the plugin has loaded
autocmd VimEnter * lcd %:p:h
" " Override wiki index mapping to also cd into the wiki
nm <leader>ww <plug>(wiki-index)

View File

@@ -2,11 +2,11 @@
"nodes": {
"nixCats": {
"locked": {
"lastModified": 1765766809,
"narHash": "sha256-3Xp41+Sb1zIzASa1Uu1k1RMUoJ9CGyYb0GtvvpRPBqg=",
"lastModified": 1764009888,
"narHash": "sha256-hJekfTiW1792txgRSM4LcHnz1lDSY87LYbsJEn2V378=",
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"rev": "fe157e3ed69ed14b55ca81f597eac282caed58a2",
"rev": "16ac3281f322ea15d39843829e42a44d22da3715",
"type": "github"
},
"original": {
@@ -17,11 +17,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1765934234,
"narHash": "sha256-pJjWUzNnjbIAMIc5gRFUuKCDQ9S1cuh3b2hKgA7Mc4A=",
"lastModified": 1764230294,
"narHash": "sha256-Z63xl5Scj3Y/zRBPAWq1eT68n2wBWGCIEF4waZ0bQBE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "af84f9d270d404c17699522fab95bbf928a2d92f",
"rev": "0d59e0290eefe0f12512043842d7096c4070f30e",
"type": "github"
},
"original": {
@@ -79,30 +79,14 @@
"type": "github"
}
},
"plugins-m-taskwarrior-d-nvim": {
"flake": false,
"locked": {
"lastModified": 1764933759,
"narHash": "sha256-4lN/ZQTQ7uMcpjePbf2k913Bs9AYYS6da3iZbckA6oI=",
"owner": "huantrinh1802",
"repo": "m_taskwarrior_d.nvim",
"rev": "279d2c8bcd2779500c1bea71fb9249c97cdb503b",
"type": "github"
},
"original": {
"owner": "huantrinh1802",
"repo": "m_taskwarrior_d.nvim",
"type": "github"
}
},
"plugins-mcphub-nvim": {
"flake": false,
"locked": {
"lastModified": 1765628564,
"narHash": "sha256-nvWqCGRKhbUHsAM/zd+cwFdcoXXxf6EmcCkpN4mElf4=",
"lastModified": 1759035242,
"narHash": "sha256-I6EbgY/2sAdtrxtmH0qbAAQvMCHhOsfolJfblV0fXOk=",
"owner": "ravitemer",
"repo": "mcphub.nvim",
"rev": "5193329d510a68f1f5bf189960642c925c177a3a",
"rev": "8ff40b5edc649959bb7e89d25ae18e055554859a",
"type": "github"
},
"original": {
@@ -166,7 +150,6 @@
"plugins-beancount-nvim": "plugins-beancount-nvim",
"plugins-crazy-node-movement": "plugins-crazy-node-movement",
"plugins-helm-ls-nvim": "plugins-helm-ls-nvim",
"plugins-m-taskwarrior-d-nvim": "plugins-m-taskwarrior-d-nvim",
"plugins-mcphub-nvim": "plugins-mcphub-nvim",
"plugins-nvimkit-nvim": "plugins-nvimkit-nvim",
"plugins-shipwright-nvim": "plugins-shipwright-nvim",

View File

@@ -7,10 +7,6 @@
url = "github:rktjmp/shipwright.nvim";
flake = false;
};
plugins-m-taskwarrior-d-nvim = {
url = "github:huantrinh1802/m_taskwarrior_d.nvim";
flake = false;
};
plugins-crazy-node-movement = {
url = "github:theHamsta/crazy-node-movement";
flake = false;
@@ -51,15 +47,10 @@
forEachSystem = utils.eachSystem nixpkgs.lib.platforms.all;
extra_pkg_config = { };
dependencyOverlays = [
(utils.standardPluginOverlay inputs)
];
dependencyOverlays = [ (utils.standardPluginOverlay inputs) ];
categoryDefinitions =
{
pkgs,
...
}:
{ pkgs, ... }:
{
lspsAndRuntimeDeps = with pkgs; {
general = [
@@ -69,43 +60,20 @@
gawk
gdtoolkit_4
isort
tree-sitter
ormolu
nodePackages.prettier
nixd
nixfmt
nodePackages.prettier
ormolu
prettierd
rustfmt
shellcheck-minimal
stylua
tree-sitter
vscode-langservers-extracted
];
};
startupPlugins = {
general = with pkgs.vimPlugins; [
## plug
vim-plug
vim-sandwich
context_filetype-vim
editorconfig-vim
vim-snippets
unicode-vim
vim-css-color
quarto-nvim
vimtex
wiki-vim
vim-pandoc
vim-pandoc-syntax
# TODO: ferrine/md-img-paste.vim
# TODO: supercollider/scvim
# TODO: tidalcycles/vim-tidal
vim-glsl
# TODO: timtro/glslView-nvim
# TODO: sirtaj/vim-openscad
jupytext-nvim
vim-openscad
## paq
eyeliner-nvim
fzf-lua
ltex_extra-nvim
@@ -143,22 +111,18 @@
image-nvim
pkgs.neovimPlugins.beancount-nvim
pkgs.neovimPlugins.nvimkit-nvim
codecompanion-nvim
# codecompanion-nvim
pkgs.neovimPlugins.mcphub-nvim
copilot-lua
copilot-cmp
pkgs.neovimPlugins.helm-ls-nvim
kitty-scrollback-nvim
fidget-nvim
rustaceanvim
pkgs.neovimPlugins.m-taskwarrior-d-nvim
claude-code-nvim
obsidian-nvim
];
};
optionalPlugins = {
general = with pkgs.vimPlugins; [
];
general = with pkgs.vimPlugins; [ ];
};
sharedLibraries = {
@@ -184,8 +148,8 @@
};
};
defaultPackageName = "nvim";
in
in
forEachSystem (
system:
let
@@ -208,7 +172,7 @@
name = defaultPackageName;
packages = [ defaultPackage ];
inputsFrom = [ ];
shellHook = '''';
shellHook = "";
};
};

View File

@@ -1 +0,0 @@
vim.opt_local.filetype = "sh"

View File

@@ -20,7 +20,6 @@ require("statusline")
require("diagnostic")
require("utils")
require("zk")
require("skeleton")
require("reload")
require("paq-setup") -- when not on nixCats

View File

@@ -34,17 +34,13 @@ require("nixCatsUtils.catPacker").setup({
{ "razak17/tailwind-fold.nvim" },
{ "rmagatti/auto-session" },
{ "kndndrj/nvim-dbee" },
-- { "3rd/image.nvim", build = false },
{ "3rd/image.nvim", build = false },
{ "polarmutex/beancount.nvim" },
-- { "jamesblckwell/nvimkit.nvim" },
{ "olimorris/codecompanion.nvim" },
{ "ravitemer/mcphub.nvim", build = "pnpm install -g mcp-hub@latest" },
{ "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" },
{ "saghen/blink.download" },
{ "ramilito/kubectl.nvim" },
{ "mikesmithgh/kitty-scrollback.nvim" },
{ "chrisgrieser/nvim-early-retirement" },
{ "euclio/vim-markdown-composer" },
})

59
flake.lock generated
View File

@@ -29,11 +29,11 @@
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1765771449,
"narHash": "sha256-ZoHRPmTzwC1ndX3NQB/b/WKtU1WduAJdLI4j8eW/QFM=",
"lastModified": 1764561884,
"narHash": "sha256-vQ3iFPPhxsLqV3c5kgmYP53mVD6id6gsP0tN+oTmqok=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "5bcf9a2aeb4d361c2ff918a146b3fcc1e136b9ca",
"rev": "aba4621459aec251d90d6452e3495b58a8a5e185",
"type": "gitlab"
},
"original": {
@@ -68,11 +68,11 @@
]
},
"locked": {
"lastModified": 1765682243,
"narHash": "sha256-yeCxFV/905Wr91yKt5zrVvK6O2CVXWRMSrxqlAZnLp0=",
"lastModified": 1764544324,
"narHash": "sha256-GVBGjO7UsmzLrlOJV8NlKSxukHaHencrJqWkCA6FkqI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "58bf3ecb2d0bba7bdf363fc8a6c4d49b4d509d03",
"rev": "e4e25a8c310fa45f2a8339c7972dc43d2845a612",
"type": "github"
},
"original": {
@@ -84,10 +84,10 @@
"nix-secrets": {
"flake": false,
"locked": {
"lastModified": 1765747965,
"narHash": "sha256-EHZRRC3piD6vKd4hXiqC+CcDUQCOzrH/CNAF9zBqpDQ=",
"lastModified": 1764371082,
"narHash": "sha256-yxFxEKXFuXFyFIDZY1gla2OyuqcIE3uT8KDDgTmm3cE=",
"ref": "main",
"rev": "a8e8d953f579939bd72b5f5c6ed332910b598554",
"rev": "b9c2ce32cc4c95d7ff01372faea2668407ef8d27",
"shallow": true,
"type": "git",
"url": "ssh://git@github.com/hektor/nix-secrets"
@@ -101,11 +101,11 @@
},
"nixCats": {
"locked": {
"lastModified": 1765766809,
"narHash": "sha256-3Xp41+Sb1zIzASa1Uu1k1RMUoJ9CGyYb0GtvvpRPBqg=",
"lastModified": 1764009888,
"narHash": "sha256-hJekfTiW1792txgRSM4LcHnz1lDSY87LYbsJEn2V378=",
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"rev": "fe157e3ed69ed14b55ca81f597eac282caed58a2",
"rev": "16ac3281f322ea15d39843829e42a44d22da3715",
"type": "github"
},
"original": {
@@ -153,11 +153,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1765472234,
"narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=",
"lastModified": 1764517877,
"narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b",
"rev": "2d293cbfa5a793b4c50d17c05ef9e385b90edf6c",
"type": "github"
},
"original": {
@@ -176,7 +176,6 @@
"plugins-beancount-nvim": "plugins-beancount-nvim",
"plugins-crazy-node-movement": "plugins-crazy-node-movement",
"plugins-helm-ls-nvim": "plugins-helm-ls-nvim",
"plugins-m-taskwarrior-d-nvim": "plugins-m-taskwarrior-d-nvim",
"plugins-mcphub-nvim": "plugins-mcphub-nvim",
"plugins-nvimkit-nvim": "plugins-nvimkit-nvim",
"plugins-shipwright-nvim": "plugins-shipwright-nvim",
@@ -240,30 +239,14 @@
"type": "github"
}
},
"plugins-m-taskwarrior-d-nvim": {
"flake": false,
"locked": {
"lastModified": 1764933759,
"narHash": "sha256-4lN/ZQTQ7uMcpjePbf2k913Bs9AYYS6da3iZbckA6oI=",
"owner": "huantrinh1802",
"repo": "m_taskwarrior_d.nvim",
"rev": "279d2c8bcd2779500c1bea71fb9249c97cdb503b",
"type": "github"
},
"original": {
"owner": "huantrinh1802",
"repo": "m_taskwarrior_d.nvim",
"type": "github"
}
},
"plugins-mcphub-nvim": {
"flake": false,
"locked": {
"lastModified": 1765628564,
"narHash": "sha256-nvWqCGRKhbUHsAM/zd+cwFdcoXXxf6EmcCkpN4mElf4=",
"lastModified": 1759035242,
"narHash": "sha256-I6EbgY/2sAdtrxtmH0qbAAQvMCHhOsfolJfblV0fXOk=",
"owner": "ravitemer",
"repo": "mcphub.nvim",
"rev": "5193329d510a68f1f5bf189960642c925c177a3a",
"rev": "8ff40b5edc649959bb7e89d25ae18e055554859a",
"type": "github"
},
"original": {
@@ -340,11 +323,11 @@
]
},
"locked": {
"lastModified": 1765684837,
"narHash": "sha256-fJCnsYcpQxxy/wit9EBOK33c0Z9U4D3Tvo3gf2mvHos=",
"lastModified": 1764483358,
"narHash": "sha256-EyyvCzXoHrbL467YSsQBTWWg4sR96MH1sPpKoSOelB4=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "94d8af61d8a603d33d1ed3500a33fcf35ae7d3bc",
"rev": "5aca6ff67264321d47856a2ed183729271107c9c",
"type": "github"
},
"original": {

View File

@@ -5,6 +5,7 @@
};
nixos-hardware = {
url = "github:NixOS/nixos-hardware/master";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko/latest";

View File

@@ -6,78 +6,14 @@
...
}:
let
username = "h";
in
{
imports = [
../../modules/desktop/niri
../../modules/git.nix
../../modules/k9s.nix
(import ../../modules/taskwarrior.nix {
inherit config;
inherit pkgs;
})
(import ../../modules/keepassxc.nix { inherit pkgs; })
(import ../../modules/anki.nix {
(import ../astyanax {
inherit inputs;
inherit config;
inherit pkgs;
})
];
home.stateVersion = "25.05";
home.username = username;
home.homeDirectory = "/home/${username}";
xdg.userDirs.createDirectories = false;
xdg.userDirs.download = "${config.home.homeDirectory}/dl";
programs = {
bash = {
enable = true;
enableCompletion = true;
initExtra = ''
for f in /home/${username}/.bashrc.d/*; do
[ -f "$f" ] && source "$f"
done
source /home/${username}/.bash_aliases/all
source /home/${username}/.bash_aliases/lang-js
# host-specific config goes here
# ...
export PATH=${../../../dots/.bin}:$PATH
'';
};
firefox = import ../../modules/firefox.nix {
inherit inputs;
inherit pkgs;
inherit config;
};
fzf = {
enable = true;
enableBashIntegration = true;
};
home-manager.enable = true;
taskwarrior.config.recurrence = lib.mkForce "on";
};
home.packages = import ../packages.nix {
inherit pkgs;
inherit config;
};
home.file = {
".inputrc".source = ../../../dots/.inputrc;
".bashrc.d/prompt".source = ../../../dots/.bashrc.d/prompt;
".bashrc.d/editor".source = ../../../dots/.bashrc.d/editor;
".bash_aliases/all".source = ../../../dots/.bash_aliases/all;
".bash_aliases/lang-js".source = ../../../dots/.bash_aliases/lang-js;
".config/kitty/kitty.conf".source = ../../../dots/.config/kitty/kitty.conf;
".config/kitty/themes/zenwritten_light.conf".source =
../../../dots/.config/kitty/themes/zenwritten_light.conf;
".config/kitty/themes/zenwritten_dark.conf".source =
../../../dots/.config/kitty/themes/zenwritten_dark.conf;
};
programs.taskwarrior.config.recurrence = lib.mkForce "on";
}

View File

@@ -10,14 +10,13 @@ let
in
{
imports = [
../../modules/desktop/niri
../../modules/dconf.nix # TODO: Only enable when on Gnome?
../../modules/git.nix
../../modules/k9s.nix
(import ../../modules/taskwarrior.nix {
inherit config;
inherit pkgs;
})
(import ../../modules/keepassxc.nix { inherit pkgs; })
];
home.stateVersion = "25.05";
@@ -32,12 +31,12 @@ in
enable = true;
enableCompletion = true;
initExtra = ''
for f in /home/${username}/.bashrc.d/*; do
for f in /home/h/.bashrc.d/*; do
[ -f "$f" ] && source "$f"
done
source /home/${username}/.bash_aliases/all
source /home/${username}/.bash_aliases/lang-js
source /home/h/.bash_aliases/all
source /home/h/.bash_aliases/lang-js
# host-specific config goes here
# ...
@@ -55,9 +54,10 @@ in
enableBashIntegration = true;
};
home-manager.enable = true;
keepassxc = import ../../modules/keepassxc.nix;
};
home.packages = import ../packages.nix {
home.packages = import ./packages.nix {
inherit pkgs;
inherit config;
};

View File

@@ -3,34 +3,50 @@
with pkgs;
[
bash-completion
bash-language-server
bat
brightnessctl
entr
eslint_d
feh
fzf
gh
git
haskell-language-server
haskellPackages.pandoc-crossref
haskellPackages.hadolint
htop
jq
kitty
lua-language-server
nixfmt-rfc-style
nmap
nodejs_24
nvimpager
ormolu
pandoc
parallel
pass
pnpm
ripgrep
signal-desktop
silver-searcher
sops
sshfs
stylelint
svelte-language-server
tailwindcss-language-server
tldr
tmux
tmuxp
tree
tree-sitter
typescript-language-server
unzip
vim-language-server
vimPlugins.vim-plug
vtsls
wget
xbanish
xclip
yaml-language-server
]

View File

@@ -13,7 +13,6 @@ in
../../modules/dconf.nix
../../modules/git.nix
../../modules/k9s.nix
(import ../../modules/keepassxc.nix { inherit pkgs; })
];
nixpkgs.config.allowUnfree = true;
@@ -35,6 +34,7 @@ in
inherit config;
};
gh.enable = true;
keepassxc = import ../../modules/keepassxc.nix;
kubecolor.enable = true;
};

View File

@@ -1,98 +0,0 @@
{
inputs,
config,
pkgs,
...
}:
with pkgs;
[
age
aider-chat
argocd
azure-cli
bat
biome
(config.lib.nixGL.wrap bruno)
chromium
clang
claude-code
(config.lib.nixGL.wrap code-cursor)
curl
dconf2nix
dive
emmet-language-server
eslint_d
flameshot
fluxcd
fzf
fzf-git-sh
git-machete
github-copilot-cli
glab
go
hadolint
hello
helm-ls
htop
input-leap
jira-cli-go
jq
k3d
(config.lib.nixGL.wrap kitty)
kubectl
kubernetes
kubernetes-helm
kustomize
lua
lua-language-server
minikube
ncspot
nil
nixd
nixfmt-rfc-style
# nodejs
nodejs_24
nvimpager
(config.lib.nixGL.wrap obsidian)
pavucontrol
# pgadmin4
prettierd
responder
ripgrep
rust-analyzer
rustlings
shellcheck
(config.lib.nixGL.wrap signal-desktop)
silver-searcher
sleuthkit
spotify
starship
stylua
taskopen
taskwarrior3
(config.lib.nixGL.wrap teams-for-linux)
opentofu
sops
tldr
tmux
tree
tree-sitter
tsx
upbound
vault-bin
(config.lib.nixGL.wrap vscode)
vscode-langservers-extracted
vtsls
yaml-language-server
xclip
xmage
yamllint
yarn
(python311.withPackages (ppkgs: [
ppkgs.plyer
ppkgs.dbus-python
]))
# flakes
inputs.nvim.packages.x86_64-linux.nvim
]

View File

@@ -1,16 +1,6 @@
{ config, pkgs, ... }:
{
programs.anki = {
enable = true;
addons = with pkgs.ankiAddons; [
anki-connect
puppy-reinforcement
review-heatmap
];
sync = {
usernameFile = "${config.sops.secrets."anki_sync_user".path}";
keyFile = "${config.sops.secrets."anki_sync_key".path}";
};
};
enable = true;
# sync = {
# username = config.sops.secrets."email/personal".path;
# };
}

View File

@@ -1,183 +0,0 @@
input {
touchpad {
tap
natural-scroll
}
mouse {
accel-profile "flat"
}
}
// NOTE: monitors are managed using `shikane` instead, as I assume this to be
// too limited for multiple multimonitor configurations. Below is an example
// for a simple, fixed, vertical dual monitor setup
// output "eDP-1" {
// position x=0 y=1440
// }
//
// output "DP-5" {
// position x=0 y=0
// }
layout {
gaps 4
struts {}
center-focused-column "never"
preset-column-widths {
proportion 0.382
proportion 0.618
proportion 1.0
}
default-column-width { }
focus-ring {
off
}
border {
width 2
active-color "#555555"
inactive-color "#55555511"
urgent-color "#ff0000"
}
shadow {
on
softness 32
spread 4
offset x=0 y=0
color "#0007"
}
}
spawn-at-startup "wlsunset -l 51.05 -L 3.72"
spawn-at-startup "waybar"
hotkey-overlay {
skip-at-startup
}
prefer-no-csd
screenshot-path "~/doc/screenshots/%Y-%m-%d %H-%M-%S.png"
// https://yalter.github.io/niri/Configuration:-Animations
animations {
slowdown 0.66
}
window-rule {
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
open-floating true
}
window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
block-out-from "screen-capture"
}
window-rule {
geometry-corner-radius 0
clip-to-geometry true
}
gestures {
hot-corners {
off
}
}
binds {
Mod+Slash { show-hotkey-overlay; }
Mod+Return hotkey-overlay-title="Open a Terminal: kitty" { spawn "kitty"; }
Mod+P hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; }
Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; }
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; }
XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; }
XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; }
Mod+Shift+XF86Display { power-off-monitors; }
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; }
Mod+O repeat=false { toggle-overview; }
Mod+Delete repeat=false { close-window; }
Mod+H { focus-column-left; }
Mod+J { focus-window-or-workspace-down; }
Mod+K { focus-window-or-workspace-up; }
Mod+L { focus-column-right; }
Mod+Shift+H { move-column-left; }
Mod+Shift+J { move-window-down-or-to-workspace-down; }
Mod+Shift+K { move-window-up-or-to-workspace-up; }
Mod+Shift+L { move-column-right; }
Mod+Home { focus-column-first; }
Mod+End { focus-column-last; }
Mod+Ctrl+Home { move-column-to-first; }
Mod+Ctrl+End { move-column-to-last; }
Mod+Left { focus-monitor-left; }
Mod+Down { focus-monitor-down; }
Mod+Up { focus-monitor-up; }
Mod+Right { focus-monitor-right; }
Mod+Shift+Left { move-column-to-monitor-left; }
Mod+Shift+Down { move-column-to-monitor-down; }
Mod+Shift+Up { move-column-to-monitor-up; }
Mod+Shift+Right { move-column-to-monitor-right; }
Mod+Ctrl+Up { move-workspace-down; }
Mod+Ctrl+Down { move-workspace-up; }
// Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
// Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
// Mod+Shift+WheelScrollDown cooldown-ms=150 { move-window-down-or-to-workspace-down; }
// Mod+Shift+WheelScrollUp cooldown-ms=150 { move-window-up-or-to-workspace-up; }
// Mod+A { focus-workspace 1; }
// Mod+S { focus-workspace 2; }
// Mod+D { focus-workspace 3; }
// Mod+F { focus-workspace 4; }
// Mod+Shift+A { move-column-to-workspace 1; }
// Mod+Shift+S { move-column-to-workspace 2; }
// Mod+Shift+D { move-column-to-workspace 3; }
// Mod+Shift+F { move-column-to-workspace 4; }
Mod+Tab { focus-workspace-previous; }
Mod+BracketLeft { consume-or-expel-window-left; }
Mod+BracketRight { consume-or-expel-window-right; }
Mod+Comma { consume-window-into-column; }
Mod+Period { expel-window-from-column; }
Mod+N { switch-preset-column-width; }
Mod+Shift+N { switch-preset-window-height; }
Mod+Ctrl+R { reset-window-height; }
Mod+Space { maximize-column; }
Mod+Shift+Space { fullscreen-window; }
Mod+Escape { toggle-window-floating; }
Mod+Shift+Escape { switch-focus-between-floating-and-tiling; }
Mod+Ctrl+F { expand-column-to-available-width; }
Mod+C { center-column; }
Mod+Ctrl+C { center-visible-columns; }
Mod+Minus { set-column-width "-10%"; }
Mod+Equal { set-column-width "+10%"; }
Mod+Shift+Minus { set-window-height "-10%"; }
Mod+Shift+Equal { set-window-height "+10%"; }
Mod+W { toggle-column-tabbed-display; }
Print { screenshot; }
Ctrl+Print { screenshot-screen; }
Alt+Print { screenshot-window; }
Mod+Shift+Delete { quit; }
}

View File

@@ -1,18 +0,0 @@
{ pkgs, ... }:
{
imports = [
../../fuzzel
../../mako
../../shikane
../../waybar
];
home = {
file.".config/niri/config.kdl".source = ./config.kdl;
packages = with pkgs; [
wl-clipboard
wlsunset
];
};
}

View File

@@ -5,6 +5,9 @@
nativeMessagingHosts = with pkgs; [
tridactyl-native
];
policies = {
DefaultDownloadDirectory = "\${home}/dl";
};
profiles = {
default = {
settings = {
@@ -54,7 +57,6 @@
};
};
policies = {
DefaultDownloadDirectory = "\${home}/dl";
ExtensionSettings = {
"jid1-ZAdIEUB7XOzOJw@jetpack" = {
default_area = "navbar";

View File

@@ -1,28 +0,0 @@
{
programs.fuzzel = {
enable = true;
settings = {
main = {
font = "Iosevka Term SS08";
horizontal-pad = 0;
vertical-pad = 0;
};
colors = {
background = "ccccccff";
text = "111111ff";
prompt = "ccccccff";
placeholder = "aaaaaaff";
input = "111111ff";
selection = "eeeeeeff";
selection-text = "111111ff";
selection-match = "333333ff";
counter = "111111ff";
border = "111111ff";
};
border = {
width = 2;
radius = 0;
};
};
};
}

View File

@@ -1,11 +1,4 @@
{ pkgs, ... }:
{
programs.keepassxc = {
enable = true;
settings = {
Browser.Enabled = true;
};
};
# programs.firefox.nativeMessagingHosts = [ pkgs.keepassxc ]; # FIXME: Resolve 'Access error for config file $HOME/.config/keepassxc/keepassxc.ini' error
enable = true;
# TODO: https://mynixos.com/home-manager/option/programs.keepassxc.settings
}

View File

@@ -1,5 +0,0 @@
{
services.mako = {
enable = true;
};
}

View File

@@ -1,6 +0,0 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [ wdisplays ];
services.shikane.enable = true;
}

View File

@@ -1,57 +0,0 @@
[
{
"height": 16,
"spacing": 4,
"modules-left": ["niri/workspaces"],
"modules-right": [
"pulseaudio",
"memory",
"cpu",
"network",
"clock",
"battery",
],
"clock": {
"format": "W{:%V %d %b %H:%M}",
"tooltip-format": "{calendar}",
"format-alt": "{:%Y-%m-%d %H:%M:%S}",
},
"battery": {
"bat": "BAT0",
"adapter": "ADP1",
"interval": 5,
"full-at": 99,
"states": {
"good": 80,
"warning": 20,
"critical": 10,
},
"format": "{capacity}%--",
"format-charging": "{capacity}%++",
"format-plugged": "{capacity}%",
"format-alt": "{time} {power}W",
},
"pulseaudio": {
"format": "VOL {volume}%",
"format-muted": "muted",
"on-click": "pavucontrol",
},
"memory": {
"interval": 2,
"format": "RAM {percentage}%",
"format-alt": "RAM {used:0.1f}G/{total:0.1f}G",
},
"cpu": {
"interval": 2,
"format": "CPU {usage}%",
"format-alt": "CPU {avg_frequency}GHz",
},
"network": {
"interval": 5,
"format-wifi": "{ifname} {ipaddr} {essid}",
"format-ethernet": "{ifname} {ipaddr}",
"format-disconnected": "{ifname} disconnected",
"tooltip-format": "{ifname}: {ipaddr}/{cidr}",
},
},
]

View File

@@ -1,8 +0,0 @@
{
programs.waybar = {
enable = true;
};
home.file.".config/waybar/config.jsonc".source = ./config.jsonc;
home.file.".config/waybar/style.css".source = ./style.css;
}

View File

@@ -1,56 +0,0 @@
* {
font-family:
Iosevka Term SS08,
monospace;
font-size: 12px;
border-radius: 0px;
}
.modules-left,
.modules-center,
.modules-right {
margin: 4px;
margin-bottom: 0;
}
window#waybar {
background-color: transparent;
}
window#waybar.hidden {
opacity: 0.2;
}
#workspaces button {
padding: 0;
background-color: transparent;
}
#workspaces button:hover {
background: #000000;
}
#workspaces button.focused,
#workspaces button.active {
background-color: #111111;
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
#clock,
#battery,
#pulseaudio,
#memory,
#cpu,
#network {
padding: 0 4px;
color: #ffffff;
background-color: #111111;
}
#window,
#workspaces {
margin: 0;
}

View File

@@ -8,28 +8,27 @@
let
username = "h";
wolInterfaces = import ./wol-interfaces.nix;
in
{
imports = [
../../modules/common
../../modules/common.nix
inputs.disko.nixosModules.disko
inputs.sops-nix.nixosModules.sops
inputs.home-manager.nixosModules.default
./hard.nix
../../modules/boot/bootloader.nix
(import ../../modules/disko/zfs-encrypted-root.nix {
../../modules/bootloader.nix
(import ../../modules/disko.zfs-encrypted-root.nix {
device = "/dev/nvme1n1";
inherit lib;
inherit config;
})
../../modules/desktops/niri
../../modules/bluetooth
../../modules/gnome.nix
../../modules/bluetooth.nix
../../modules/keyboard
(import ../../modules/networking { hostName = "andromache"; })
../../modules/users
../../modules/audio
../../modules/localization
(import ../../modules/networking.nix { hostName = "andromache"; })
../../modules/users.nix
../../modules/audio.nix
../../modules/localization.nix
../../modules/fonts
../../modules/ssh/hardened-openssh.nix
(import ../../modules/secrets {
@@ -37,11 +36,10 @@ in
inherit inputs;
inherit config;
})
../../modules/docker
../../modules/docker.nix
];
secrets.username = username;
docker.user = username;
disko.devices = {
disk.data = {
@@ -89,6 +87,10 @@ in
};
};
networking = {
hostId = "80eef97e";
};
services.xserver = {
videoDrivers = [ "nvidia" ];
};
@@ -101,19 +103,17 @@ in
services.syncthing = {
enable = true;
openDefaultPorts = true;
settings = {
devices = {
# "device1" = {
# id = "DEVICE-ID-GOES-HERE";
# };
};
folders = {
"/home/${username}/sync" = {
id = "sync";
devices = [ ];
};
folders = {
"/home/${username}/sync" = {
id = "sync";
devices = [ ];
};
};
devices = {
# "device1" = {
# id = "DEVICE-ID-GOES-HERE";
# };
};
};
services.locate = {
@@ -122,12 +122,9 @@ in
};
networking = {
# TODO: generate unique hostId on actual host with: head -c 8 /etc/machine-id
hostId = "80eef97e";
interfaces = {
eno1 = {
wakeOnLan.enable = true;
macAddress = wolInterfaces.eno1.macAddress;
};
};
firewall = {

View File

@@ -1,3 +0,0 @@
{
eno1.macAddress = "02:68:b3:29:da:98";
}

View File

@@ -9,29 +9,28 @@
let
username = "h";
hostName = "astyanax";
wolInterfaces = import ../andromache/wol-interfaces.nix;
in
{
imports = [
../../modules/common
../../modules/common.nix
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-e14-intel
inputs.disko.nixosModules.disko
inputs.sops-nix.nixosModules.sops
inputs.home-manager.nixosModules.default
./hard.nix
../../modules/boot/bootloader.nix
(import ../../modules/disko/zfs-encrypted-root.nix {
../../modules/bootloader.nix
(import ../../modules/disko.zfs-encrypted-root.nix {
inherit lib;
inherit config;
device = "/dev/nvme0n1";
})
../../modules/desktops/niri
../../modules/bluetooth
../../modules/gnome.nix
../../modules/bluetooth.nix
../../modules/keyboard
(import ../../modules/networking { hostName = hostName; })
../../modules/users
../../modules/audio
../../modules/localization
(import ../../modules/networking.nix { hostName = hostName; })
../../modules/users.nix
../../modules/audio.nix
../../modules/localization.nix
../../modules/fonts
../../modules/ssh/hardened-openssh.nix
(import ../../modules/secrets {
@@ -42,35 +41,9 @@ in
})
];
hardware = {
cpu.intel.updateMicrocode = true;
# https://wiki.nixos.org/wiki/Intel_Graphics
graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
vpl-gpu-rt
];
};
};
# https://wiki.nixos.org/wiki/Intel_Graphics
environment.sessionVariables = {
LIBVA_DRIVER_NAME = "iHD";
};
secrets.username = username;
environment.systemPackages = [
inputs.nvim.packages.x86_64-linux.nvim
(pkgs.writeShellApplication {
name = "wol-andromache";
runtimeInputs = [ pkgs.wakeonlan ];
text = ''
wakeonlan ${wolInterfaces.eno1.macAddress}
'';
})
];
environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nvim ];
home-manager = {
useGlobalPkgs = true;
@@ -83,12 +56,9 @@ in
};
networking = {
# TODO: generate unique hostId on actual host with: head -c 8 /etc/machine-id
hostId = "80eef97e";
};
services.throttled.enable = false;
services.openssh = {
enable = true;
harden = true;

View File

@@ -1,60 +0,0 @@
{ pkgs, ... }:
# Also see <https://wiki.nixos.org/wiki/Install_NixOS_on_Hetzner_Cloud>
{
imports = [
./hard.nix
../../modules/common
../../modules/ssh/hardened-openssh.nix
];
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "ext4";
};
swapDevices = [
{
device = "/dev/disk/by-label/swap";
}
];
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
users.users = {
root.hashedPassword = "!";
username = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOOXPEhdKOVnb6mkeLLUcFGt+mnUR5pMie17JtjrxwgO h@andromache"
];
};
};
security.sudo.wheelNeedsPassword = false;
networking = {
firewall.enable = true;
};
environment.systemPackages = with pkgs; [
vim
git
];
services.fail2ban = {
enable = true;
maxretry = 5;
};
services.openssh = {
enable = true;
harden = true;
};
}

View File

@@ -1,37 +0,0 @@
# 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,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [
"ahci"
"xhci_pci"
"virtio_pci"
"virtio_scsi"
"sd_mod"
"sr_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.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.enp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View File

@@ -11,19 +11,19 @@ let
in
{
imports = [
../../modules/common
../../modules/common.nix
inputs.disko.nixosModules.disko
inputs.sops-nix.nixosModules.sops
inputs.home-manager.nixosModules.default
./hard.nix
./disk.nix
../../modules/boot/bootloader.nix
../../modules/bootloader.nix
../../modules/keyboard
(import ../../modules/networking { hostName = "vm"; })
../../modules/users
../../modules/audio
../../modules/localization
../../modules/x
(import ../../modules/networking.nix { hostName = "vm"; })
../../modules/users.nix
../../modules/audio.nix
../../modules/localization.nix
../../modules/x.nix
../../modules/fonts
../../modules/ssh/hardened-openssh.nix
(import ../../modules/secrets {
@@ -33,7 +33,7 @@ in
})
];
secrets.username = username;
secrets.username = "h";
environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nvim ];

View File

@@ -9,5 +9,4 @@
alsa.support32Bit = true;
pulse.enable = true;
};
services.pulseaudio.extraConfig = "load-module module-switch-on-connect";
}

3
modules/bluetooth.nix Normal file
View File

@@ -0,0 +1,3 @@
{
hardware.bluetooth.enable = true;
}

View File

@@ -1,15 +0,0 @@
{
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Experimental = true;
FastConnectable = true;
};
Policy = {
AutoEnable = true;
};
};
};
}

View File

@@ -1,8 +0,0 @@
{
programs.niri.enable = true;
services.dbus.enable = true;
xdg = {
portal.enable = true;
};
}

9
modules/docker.nix Normal file
View File

@@ -0,0 +1,9 @@
{
virtualisation.docker = {
enable = false;
rootless = {
enable = true;
setSocketVariable = true;
};
};
}

View File

@@ -1,44 +0,0 @@
{ config, lib, ... }:
let
cfg = config.docker;
in
{
options.docker = {
rootless = lib.mkOption {
type = lib.types.bool;
default = false;
};
user = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
};
};
config = lib.mkMerge [
{
warnings = lib.flatten [
(lib.optional (
cfg.rootless && cfg.user != null
) "'virtualisation.docker.user' is ignored when rootless mode is enabled")
(lib.optional (
!cfg.rootless && cfg.user == null
) "'virtualisation.docker.user' is not set (no user is added to the docker group)")
];
}
(lib.mkIf cfg.rootless {
virtualisation.docker = {
enable = false;
rootless = {
enable = true;
setSocketVariable = true;
};
};
})
(lib.mkIf (!cfg.rootless && cfg.user != null) {
virtualisation.docker = {
enable = true;
};
users.users.${cfg.user}.extraGroups = [ "docker" ];
})
];
}

View File

@@ -1,79 +0,0 @@
{ pkgs, ... }:
{
# TODO: see if this works with podman
# TODO: check if docker/podman is enabled
# Rootless K3S
# FIXME
environment.systemPackages = with pkgs; [
k3s
rootlesskit
slirp4netns
];
# running K3S on rootless docker was causing the following error: "failed to find cpuset cgroup (v2)" (in `docker logs k3d-lab-server-0` output)
#
# see <https://docs.k3s.io/advanced#known-issues-with-rootless-mode>
# see <https://rootlesscontaine.rs/getting-started/common/cgroup2/>
# see <https://discourse.nixos.org/t/declarative-rootless-k3s/49839>
systemd.services."user@".serviceConfig.Delegate = "cpu cpuset io memory pids";
# taken from <https://github.com/k3s-io/k3s/blob/main/k3s-rootless.service> as described in <https://docs.k3s.io/advanced#known-issues-with-rootless-mode#Rootless>
systemd.user.services."k3s-rootless" = with pkgs; {
path = with pkgs; [
"${rootlesskit}"
"${slirp4netns}"
"${fuse-overlayfs}"
"${fuse3}"
"/run/wrappers"
];
# systemd unit file for k3s (rootless)
#
# Usage:
# - [Optional] Enable cgroup v2 delegation, see https://rootlesscontaine.rs/getting-started/common/cgroup2/ .
# This step is optional, but highly recommended for enabling CPU and memory resource limtitation.
#
# - Copy this file as `~/.config/systemd/user/k3s-rootless.service`.
# Installing this file as a system-wide service (`/etc/systemd/...`) is not supported.
# Depending on the path of `k3s` binary, you might need to modify the `ExecStart=/usr/local/bin/k3s ...` line of this file.
#
# - Run `systemctl --user daemon-reload`
#
# - Run `systemctl --user enable --now k3s-rootless`
#
# - Run `KUBECONFIG=~/.kube/k3s.yaml kubectl get pods -A`, and make sure the pods are running.
#
# Troubleshooting:
# - See `systemctl --user status k3s-rootless` to check the daemon status
# - See `journalctl --user -f -u k3s-rootless` to see the daemon log
# - See also https://rootlesscontaine.rs/
enable = true;
description = "k3s (Rootless)";
serviceConfig = {
# NOTE: Don't try to run `k3s server --rootless` on a terminal, as it doesn't enable cgroup v2 delegation.
# If you really need to try it on a terminal, prepend `systemd-run --user -p Delegate=yes --tty` to create a systemd scope.
ExecStart = "${k3s}/bin/k3s server --rootless --snapshotter=fuse-overlayfs";
ExecReload = "/run/current-system/sw/bin/kill -s HUP $MAINPID";
TimeoutSec = 0;
RestartSec = 2;
Restart = "always";
StartLimitBurst = 3;
StartLimitInterval = "60s";
LimitNOFILE = "infinity";
LimitNPROC = "infinity";
LimitCORE = "infinity";
TasksMax = "infinity";
Delegate = "yes";
Type = "simple";
KillMode = "mixed";
};
wantedBy = [ "default.target" ];
};
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = 1;
};
}

View File

@@ -27,8 +27,6 @@ in
"taskwarrior_sync_encryption_secret".owner = config.users.users.${cfg.username}.name;
"email_personal".owner = config.users.users.${cfg.username}.name;
"email_work".owner = config.users.users.${cfg.username}.name;
"anki_sync_user".owner = config.users.users.${cfg.username}.name;
"anki_sync_key".owner = config.users.users.${cfg.username}.name;
};
templates."taskrc.d/sync" = {

View File

@@ -10,7 +10,6 @@ in
services.openssh.settings = optionalAttrs cfg.harden {
PermitRootLogin = "no";
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
ChallengeResponseAuthentication = false;
X11Forwarding = false;
AllowAgentForwarding = false;

View File

@@ -4,7 +4,7 @@
services.xserver.windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
config = builtins.readFile ../../dots/.xmonad/xmonad.hs;
config = builtins.readFile ../dots/.xmonad/xmonad.hs;
};
services.xserver = {