93 Commits

Author SHA1 Message Date
74973c1449 chore: initial commit for draft MR 2025-12-18 15:56:51 +01:00
545a5927e5 chore(nvim): add commented formatter.nvim config
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:54:13 +01:00
c6b2743cf6 chore(nvim): reorder plugins, remove claude-code from paq-setup
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:53:59 +01:00
430bec1708 style(lsp): fix formatting and indentation
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:53:56 +01:00
d9e25eec77 chore: remove taskdeps script
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:53:04 +01:00
a588604d91 chore(nvim): comment out image.nvim config
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:53:01 +01:00
d9911dd2ce style(cmp): reformat sources list
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:52:57 +01:00
b397fab3f2 feat(ftplugin): add dotenv filetype support
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:52:54 +01:00
1246f42638 feat(nvim): add skeleton module to init
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:52:50 +01:00
06fb7dd4b8 fix(wiki): disable auto lcd on VimEnter
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:52:47 +01:00
4b2d24e1f4 feat(fzf): add resume to live_grep, use complete_file
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:52:42 +01:00
f57d227203 feat(lint): enable eslint for js/ts, disable systemdlint/yamllint
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:52:31 +01:00
82f904c9dc feat(format): enable lsp_fallback, disable json formatters
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:52:24 +01:00
26b5f00643 fix(lsp): update helm_ls, yamlls, disable emmet
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:51:36 +01:00
31f604f8f6 feat(lsp): add terraformls, rust_analyzer, configure nixd
Add support for Terraform and Rust language servers, and configure nixd
with home-manager options for better Nix completions.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:51:17 +01:00
8632e7a1bc feat(lsp): switch from ts_ls to vtsls
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:51:02 +01:00
0a9405ffd6 chore(nvim): disable codecompanion plugin config
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:50:40 +01:00
eceaab3caf chore(nvim): disable mcphub plugin config
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:50:36 +01:00
1dbb9c1e5d chore(nvim): disable nvimkit, normalize paq-setup formatting
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:50:16 +01:00
b3e1e4e939 chore(nvim): disable image.nvim plugin
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:45:36 +01:00
14e1f01784 feat(nvim): add vim-markdown-composer plugin
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:45:12 +01:00
e1e300bee2 feat(nvim): add blink.download plugin
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:44:58 +01:00
1418407e63 feat(nvim): add obsidian plugin
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:44:41 +01:00
1e3a5d291f feat(nvim): add nvim-early-retirement plugin
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:44:18 +01:00
a8100cf3e2 feat(nvim): add kubectl plugin
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 15:40:18 +01:00
6c738b78e7 feat: set up 'claude-code.nvim' plugin 2025-12-18 15:34:49 +01:00
0233c339aa chore: add TODO for unique 'networking.hostId' 2025-12-18 13:40:26 +01:00
57706b7292 refactor: use username variable consistently
Replaced hardcoded "h" username references with variables:
- hosts/vm: use username variable for secrets.username
- home configs: use username variable in bash initExtra paths
- keepassxc: update comment to use $HOME instead of /home/h

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 13:39:43 +01:00
7ce3609579 fix(firefox): merge duplicate policies declarations
Second policies declaration was overwriting the first, causing
DefaultDownloadDirectory setting to be lost. Merged both into single
policies block.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 13:39:43 +01:00
51d0399f21 fix: format rust using 'rustfmt' 2025-12-15 18:18:20 +01:00
d232d8fad6 refactor: decouple 'andromache' home config from 'astyanax' 2025-12-15 12:19:38 +01:00
413c6a4a63 chore: update neovim flake (and main flake) 2025-12-15 12:01:19 +01:00
af20454965 refactor: import shikane 'desktop/niri' instead of directly 2025-12-15 11:57:22 +01:00
ae17c411d4 feat: add plain 'mako' service for notifications 2025-12-14 23:45:58 +01:00
f8bac5414b feat: declare anki config 2025-12-14 22:44:45 +01:00
b8b7f6bce7 fix: migrate 'r5rs' script to neovim 2025-12-14 22:11:14 +01:00
eb0b192b5e fix: ignore directories that contain '.nobackup' in 'save-home' 2025-12-14 22:11:14 +01:00
f60b26c676 chore: format using 'black' 2025-12-14 22:11:14 +01:00
67dcddb55c chore: clean up 'astyanax' packages 2025-12-09 23:43:56 +01:00
ce732af957 feat: add 'fail2ban' to 'hecuba' host 2025-12-09 23:10:24 +01:00
098bbbb5d2 refactor: use environment variable for zettelkasten path 2025-12-09 12:43:07 +01:00
61a5ef7714 feat: add 'rustfmt' for rust formatting 2025-12-08 20:16:18 +01:00
1020a0ea2a chore: relock flake 2025-12-07 23:04:06 +01:00
32e3ee40e1 feat: add 'figet.nvim' to 'nvim' flake 2025-12-07 22:59:05 +01:00
8295557eb4 test(nvim): try out 'm_taskwarrior_d.nvim' plugin 2025-12-07 19:16:07 +01:00
1c71b8c9fc fix: resolve 'nix flake check' errors 2025-12-07 17:42:18 +01:00
debd25f8f8 feat: use 'rustaceanvim' instead for rust development 2025-12-07 17:36:33 +01:00
43f1023449 feat: add 'wl-clipboard' to niri desktop 2025-12-07 14:32:33 +01:00
2b035eb415 fix: work around throttled error 2025-12-07 00:13:59 +01:00
ec595c6f52 fix: declare graphics config for 'astyanax' host 2025-12-07 00:06:22 +01:00
2326ac1e78 fix: resolve treesitter errors on NixOS 2025-12-07 00:05:46 +01:00
14abad0b98 chore: ignore breaking changes warning for 'codecompanion.nvim' 2025-12-07 00:04:56 +01:00
f5ffa8b9d1 enable 'shikane' on 'astyanax' (and add 'wdisplays') 2025-12-06 23:51:50 +01:00
7b9eac546b feat(nvim): set up rust lsp config 2025-12-06 23:49:29 +01:00
36cdaac5ad refactor: enable firewall explicitely for 'hecuba' host 2025-12-04 12:48:55 +01:00
126671ffc7 fix: remove common '.nix' suffix 2025-12-04 12:48:55 +01:00
a1263d8bf1 fix: update waybar to match polybar config (for the most part) 2025-12-04 12:48:55 +01:00
50b2f38f21 refactor: move 'wlsunset' package into home manager module 2025-12-04 12:48:55 +01:00
Hektor Misplon
c335534278 chore: update 'nvim' flake 2025-12-04 02:24:28 +01:00
Hektor Misplon
88d5657cf8 fix: don't autoinstall treesitter grammars when using 'nixCats' 2025-12-04 02:21:30 +01:00
d2a4e35417 fix: declare 'fuzzel' config and add it to 'niri' desktop 2025-12-03 23:49:58 +01:00
7e58bb7bc2 feat: track (currently unused) k3s module 2025-12-03 23:45:55 +01:00
4d6ba61f52 refactor: use 'default.nix' for all modules 2025-12-03 23:43:43 +01:00
683e6e4d10 fix: declare 'waybar' config and add it to 'niri' desktop 2025-12-03 23:36:33 +01:00
dbad023043 fix: declare niri config 2025-12-03 23:36:33 +01:00
355cad6574 fix: try 'writeShellApplication' for 'astyanax' WOL script 2025-12-03 22:35:21 +01:00
c9f69530d8 fix: declare 'andromache' 'eno1' interface MAC address 2025-12-03 21:40:44 +01:00
0197e99b8f feat: add 'hecuba' host config 2025-12-03 19:28:03 +01:00
0bad5c492c fix: further harden 'hardened-openssh' module 2025-12-03 17:14:08 +01:00
1cba6c968a fix: replace 'gnome' desktop with 'niri' 2025-12-03 15:56:09 +01:00
8ae482d846 fix: declare KeePassXC browser integration 2025-12-03 15:56:06 +01:00
8c3e762a46 chore(pkgs): add 'signal-desktop' package 2025-12-03 15:54:33 +01:00
43832361ea fix: disable kitty tab shortcut for now 2025-12-03 15:54:33 +01:00
166d904735 update bluetooth config 2025-12-03 15:54:33 +01:00
67d0733bbd refactor: move bootloader into 'modules/boot' 2025-12-03 15:54:33 +01:00
ae55782bf2 refactor: move 'disko' modules into 'modules/disko' 2025-12-03 15:54:33 +01:00
e10923f74d resolve NixOS build warnings 2025-12-03 15:54:33 +01:00
6b5ac0c370 Merge pull request 'update' (#1) from claude-code-test into main
Reviewed-on: #1
2025-12-03 15:53:43 +01:00
0652389078 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:53:22 +01:00
2913e9578e 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:53:22 +01:00
b72c1d5e86 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:53:22 +01:00
1c844adf91 refactor(work): set up 'packages.local.nix' approach 2025-12-03 15:53:22 +01:00
fdbe4366e1 feat(home): add git config with example configuration for non-NixOS 2025-12-03 15:53:22 +01:00
a9ffcc12ee refactor: move common hosts config into 'modules/common.nix' 2025-12-03 15:53:22 +01:00
9765d93f9f 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:53:22 +01:00
42dbe5ade2 chore: update flake to 'nixos-unstable'
- Switch from 'nixos-25.05' to 'nixos-unstable'
- Update home-manager to follow main branch
2025-12-03 15:53:22 +01:00
bab2c35bff fix(astyanax): correct hostname typo from astynanax to astyanax 2025-12-03 15:53:22 +01:00
ce26b1c206 Add neovim 'typescriptreact' snippets 2025-12-03 15:53:22 +01:00
2d26d6ebd8 don't use rootless docker on 'andromache', but keep it as an option 2025-11-28 20:57:04 +01:00
e0a1ec77ed enable wake on lan on 'andromache' host 2025-11-27 10:37:05 +01:00
68bf971992 declare rootless docker for 'andromache' host 2025-11-26 18:37:11 +01:00
80e74d3283 enable recurrence only on one hosts per 'man task-sync' 2025-11-24 18:47:10 +01:00
f93eecfcb1 refactor 'nixosConfigurations' 2025-11-23 23:29:46 +01:00
84 changed files with 1541 additions and 487 deletions

2
.gitignore vendored
View File

@@ -4,3 +4,5 @@ result
result-* result-*
nixos-efi-vars.fd nixos-efi-vars.fd
home/hosts/work/packages.local.nix

View File

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

View File

@@ -2,8 +2,8 @@
session="r5rs" 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 \; \ split-window -h -t $session \; \
send-keys -t 0 "vim" C-m \; \ send-keys -t 1 "nvim -c \"set ft=scheme\"" C-m \; \
send-keys -t 1 "plt-r5rs --no-prim" C-m \; \ send-keys -t 2 "plt-r5rs --no-prim" C-m \; \
select-pane -t 0 select-pane -t 1

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -17,11 +17,9 @@ local servers = {
format = false, format = false,
}, },
}, },
emmet_language_server = {}, -- emmet_language_server = {},
gdscript = {}, gdscript = {},
helm_ls = { helm_ls = { filetypes = { "helm", "yaml.helm-values" } },
filetypes = { "yaml", "helm", "yaml.helm-values" },
},
hls = { filetypes = { "haskell", "lhaskell", "cabal" } }, hls = { filetypes = { "haskell", "lhaskell", "cabal" } },
html = {}, html = {},
jsonls = { jsonls = {
@@ -65,8 +63,26 @@ local servers = {
}, },
}, },
-- marksman = {}, -- marksman = {},
nixd = {}, -- 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',
},
},
},
pyright = {}, pyright = {},
rust_analyzer = {
settings = {
["rust-analyzer"] = {},
},
},
-- tsserver = {}, -- tsserver = {},
svelte = { svelte = {
plugin = { plugin = {
@@ -76,48 +92,43 @@ local servers = {
}, },
}, },
tailwindcss = {}, tailwindcss = {},
-- vtsls = {}, terraformls = {},
ts_ls = {}, -- ts_ls = {},
-- vtsls = { vtsls = {
-- maxTsServerMemory = 16384, maxTsServerMemory = 16384,
-- filetypes = { filetypes = {
-- "javascript", "javascript",
-- "javascriptreact", "javascriptreact",
-- "javascript.jsx", "javascript.jsx",
-- "typescript", "typescript",
-- "typescriptreact", "typescriptreact",
-- "typescript.tsx", "typescript.tsx",
-- }, },
-- settings = { settings = {
-- complete_function_calls = true, complete_function_calls = true,
-- vtsls = { vtsls = {
-- enableMoveToFileCodeAction = true, enableMoveToFileCodeAction = true,
-- autoUseWorkspaceTsdk = true, autoUseWorkspaceTsdk = true,
-- experimental = { experimental = { completion = { enableServerSideFuzzyMatch = true } },
-- completion = { },
-- enableServerSideFuzzyMatch = true, typescript = {
-- }, updateImportsOnFileMove = { enabled = "always" },
-- }, suggest = { completeFunctionCalls = true },
-- }, inlayHints = {
-- typescript = { enumMemberValues = { enabled = true },
-- updateImportsOnFileMove = { enabled = "always" }, functionLikeReturnTypes = { enabled = true },
-- suggest = { parameterNames = { enabled = "literals" },
-- completeFunctionCalls = true, parameterTypes = { enabled = true },
-- }, propertyDeclarationTypes = { enabled = true },
-- inlayHints = { variableTypes = { enabled = false },
-- enumMemberValues = { enabled = true }, },
-- functionLikeReturnTypes = { enabled = true }, },
-- parameterNames = { enabled = "literals" }, },
-- parameterTypes = { enabled = true }, },
-- propertyDeclarationTypes = { enabled = true },
-- variableTypes = { enabled = false },
-- },
-- },
-- },
-- },
yamlls = { yamlls = {
settings = { settings = {
yaml = { yaml = {
validate = true,
schemaStore = { schemaStore = {
-- You must disable built-in schemaStore support if you want to use -- You must disable built-in schemaStore support if you want to use
-- this plugin and its advanced options like `ignore`. -- this plugin and its advanced options like `ignore`.

View File

@@ -0,0 +1,9 @@
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, ["<CR>"] = c_l,
}), }),
sources = { sources = {
{ name = "copilot", group_index = 2 },
{ name = "zk" }, { name = "zk" },
{ name = "copilot", group_index = 2 },
{ name = "nvim_lsp", keyword_length = 8 }, { 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 },
}, },
window = { window = {
completion = cmp.config.window.bordered({ border = { "", "", "", "", "", "", "", "" } }), completion = cmp.config.window.bordered({ border = { "", "", "", "", "", "", "", "" } }),

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
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
autocmd VimEnter * 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)

View File

@@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixCats": { "nixCats": {
"locked": { "locked": {
"lastModified": 1763330129, "lastModified": 1765766809,
"narHash": "sha256-KbOeWIF52SV53BOeETGO2C5ewaV2Ex9iaXH7G72gOr8=", "narHash": "sha256-3Xp41+Sb1zIzASa1Uu1k1RMUoJ9CGyYb0GtvvpRPBqg=",
"owner": "BirdeeHub", "owner": "BirdeeHub",
"repo": "nixCats-nvim", "repo": "nixCats-nvim",
"rev": "c81551ed87db2aefab30a12cf7425ff94dc0ad64", "rev": "fe157e3ed69ed14b55ca81f597eac282caed58a2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -17,11 +17,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1763464769, "lastModified": 1765934234,
"narHash": "sha256-AJHrsT7VoeQzErpBRlLJM1SODcaayp0joAoEA35yiwM=", "narHash": "sha256-pJjWUzNnjbIAMIc5gRFUuKCDQ9S1cuh3b2hKgA7Mc4A=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6f374686605df381de8541c072038472a5ea2e2d", "rev": "af84f9d270d404c17699522fab95bbf928a2d92f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -79,14 +79,30 @@
"type": "github" "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": { "plugins-mcphub-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1759035242, "lastModified": 1765628564,
"narHash": "sha256-I6EbgY/2sAdtrxtmH0qbAAQvMCHhOsfolJfblV0fXOk=", "narHash": "sha256-nvWqCGRKhbUHsAM/zd+cwFdcoXXxf6EmcCkpN4mElf4=",
"owner": "ravitemer", "owner": "ravitemer",
"repo": "mcphub.nvim", "repo": "mcphub.nvim",
"rev": "8ff40b5edc649959bb7e89d25ae18e055554859a", "rev": "5193329d510a68f1f5bf189960642c925c177a3a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -150,6 +166,7 @@
"plugins-beancount-nvim": "plugins-beancount-nvim", "plugins-beancount-nvim": "plugins-beancount-nvim",
"plugins-crazy-node-movement": "plugins-crazy-node-movement", "plugins-crazy-node-movement": "plugins-crazy-node-movement",
"plugins-helm-ls-nvim": "plugins-helm-ls-nvim", "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-mcphub-nvim": "plugins-mcphub-nvim",
"plugins-nvimkit-nvim": "plugins-nvimkit-nvim", "plugins-nvimkit-nvim": "plugins-nvimkit-nvim",
"plugins-shipwright-nvim": "plugins-shipwright-nvim", "plugins-shipwright-nvim": "plugins-shipwright-nvim",

View File

@@ -7,6 +7,10 @@
url = "github:rktjmp/shipwright.nvim"; url = "github:rktjmp/shipwright.nvim";
flake = false; flake = false;
}; };
plugins-m-taskwarrior-d-nvim = {
url = "github:huantrinh1802/m_taskwarrior_d.nvim";
flake = false;
};
plugins-crazy-node-movement = { plugins-crazy-node-movement = {
url = "github:theHamsta/crazy-node-movement"; url = "github:theHamsta/crazy-node-movement";
flake = false; flake = false;
@@ -65,14 +69,15 @@
gawk gawk
gdtoolkit_4 gdtoolkit_4
isort isort
tree-sitter
ormolu
nodePackages.prettier
nixd nixd
nixfmt nixfmt
nodePackages.prettier
ormolu
prettierd prettierd
rustfmt
shellcheck-minimal shellcheck-minimal
stylua stylua
tree-sitter
vscode-langservers-extracted vscode-langservers-extracted
]; ];
}; };
@@ -143,7 +148,11 @@
copilot-lua copilot-lua
copilot-cmp copilot-cmp
pkgs.neovimPlugins.helm-ls-nvim pkgs.neovimPlugins.helm-ls-nvim
pkgs.vimPlugins.kitty-scrollback-nvim kitty-scrollback-nvim
fidget-nvim
rustaceanvim
pkgs.neovimPlugins.m-taskwarrior-d-nvim
claude-code-nvim
]; ];
}; };

View File

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

View File

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

View File

@@ -34,13 +34,17 @@ require("nixCatsUtils.catPacker").setup({
{ "razak17/tailwind-fold.nvim" }, { "razak17/tailwind-fold.nvim" },
{ "rmagatti/auto-session" }, { "rmagatti/auto-session" },
{ "kndndrj/nvim-dbee" }, { "kndndrj/nvim-dbee" },
{ "3rd/image.nvim", build = false }, -- { "3rd/image.nvim", build = false },
{ "polarmutex/beancount.nvim" }, { "polarmutex/beancount.nvim" },
{ "jamesblckwell/nvimkit.nvim" }, -- { "jamesblckwell/nvimkit.nvim" },
{ 'olimorris/codecompanion.nvim' }, { "olimorris/codecompanion.nvim" },
{ "ravitemer/mcphub.nvim", build = "pnpm install -g mcp-hub@latest" }, { "ravitemer/mcphub.nvim", build = "pnpm install -g mcp-hub@latest" },
{ "zbirenbaum/copilot.lua" }, { "zbirenbaum/copilot.lua" },
{ "zbirenbaum/copilot-cmp" }, { "zbirenbaum/copilot-cmp" },
{ "qvalentin/helm-ls.nvim", ft = "helm" }, { "qvalentin/helm-ls.nvim", ft = "helm" },
{ "saghen/blink.download" },
{ "ramilito/kubectl.nvim" },
{ "mikesmithgh/kitty-scrollback.nvim" }, { "mikesmithgh/kitty-scrollback.nvim" },
{ "chrisgrieser/nvim-early-retirement" },
{ "euclio/vim-markdown-composer" },
}) })

View File

@@ -1,6 +1,4 @@
{ {
pkgs ? import <nixpkgs> { }, pkgs ? import <nixpkgs> { },
}: }:
pkgs.mkShell { pkgs.mkShell { nativeBuildInputs = with pkgs.buildPackages; [ ]; }
nativeBuildInputs = with pkgs.buildPackages; [ ];
}

View File

@@ -0,0 +1,12 @@
local ls = require("luasnip")
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
return {
s("preJ", {
t("<pre>{JSON.stringify("),
i(1, "object"), -- first tab stop
t(", null, 2)}</pre>"),
}),
}

View File

@@ -1,9 +1,11 @@
[include]
path = ~/.gitconfig.email
[core] [core]
editor = nvim editor = nvim
excludesfile = ~/.gitignore excludesfile = ~/.gitignore
[user] [user]
email = hektor.misplon@pm.me
name = Hektor Misplon name = Hektor Misplon
username = hektor username = hektor
signingKey = AEB98353B8D72E465C4236435151AF79E723F21C signingKey = AEB98353B8D72E465C4236435151AF79E723F21C
@@ -76,8 +78,6 @@
[merge] [merge]
tool = nvimdiff tool = nvimdiff
conflictstyle = diff3 conflictstyle = diff3
[pull]
rebase = true
[diff] [diff]
colorMoved = zebra colorMoved = zebra
[commit] [commit]
@@ -85,3 +85,11 @@
[interactive] [interactive]
singleKey = true singleKey = true
[pull]
rebase = true
[rerere]
enabled = true
[includeIf "gitdir:~/work/"]
path = ~/.gitconfig.work

View File

@@ -0,0 +1,2 @@
[user]
email = your.email@example.com

13
dots/.gitconfig.work Normal file
View File

@@ -0,0 +1,13 @@
[include]
path = ~/.gitconfig.work.email
[core]
longpaths = true
[user]
name = Hektor Misplon
username = hektor.misplon
signingKey = 1C88BE828184CEE6
[commit]
gpgsign = false

View File

@@ -0,0 +1,2 @@
[user]
email = your.work.email@example.com

68
flake.lock generated
View File

@@ -29,11 +29,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1763885608, "lastModified": 1765771449,
"narHash": "sha256-eFRbKKMaEHC5EaL7sxfPVFPFsr0Plzx03e1VkJkcsBA=", "narHash": "sha256-ZoHRPmTzwC1ndX3NQB/b/WKtU1WduAJdLI4j8eW/QFM=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "c94982d5890f4ff0737d57ed97503c1c8d40195c", "rev": "5bcf9a2aeb4d361c2ff918a146b3fcc1e136b9ca",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@@ -68,16 +68,15 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1758463745, "lastModified": 1765682243,
"narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=", "narHash": "sha256-yeCxFV/905Wr91yKt5zrVvK6O2CVXWRMSrxqlAZnLp0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3", "rev": "58bf3ecb2d0bba7bdf363fc8a6c4d49b4d509d03",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-25.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@@ -85,10 +84,10 @@
"nix-secrets": { "nix-secrets": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1763919406, "lastModified": 1765747965,
"narHash": "sha256-WaGxnH7dm63syPt8E4MXbg4XVxQveXPe+cZu3iPz25w=", "narHash": "sha256-EHZRRC3piD6vKd4hXiqC+CcDUQCOzrH/CNAF9zBqpDQ=",
"ref": "main", "ref": "main",
"rev": "4423bf215047474ecb89f4d8ad63a04e734b252a", "rev": "a8e8d953f579939bd72b5f5c6ed332910b598554",
"shallow": true, "shallow": true,
"type": "git", "type": "git",
"url": "ssh://git@github.com/hektor/nix-secrets" "url": "ssh://git@github.com/hektor/nix-secrets"
@@ -102,11 +101,11 @@
}, },
"nixCats": { "nixCats": {
"locked": { "locked": {
"lastModified": 1763330129, "lastModified": 1765766809,
"narHash": "sha256-KbOeWIF52SV53BOeETGO2C5ewaV2Ex9iaXH7G72gOr8=", "narHash": "sha256-3Xp41+Sb1zIzASa1Uu1k1RMUoJ9CGyYb0GtvvpRPBqg=",
"owner": "BirdeeHub", "owner": "BirdeeHub",
"repo": "nixCats-nvim", "repo": "nixCats-nvim",
"rev": "c81551ed87db2aefab30a12cf7425ff94dc0ad64", "rev": "fe157e3ed69ed14b55ca81f597eac282caed58a2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -138,11 +137,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1762847253, "lastModified": 1764440730,
"narHash": "sha256-BWWnUUT01lPwCWUvS0p6Px5UOBFeXJ8jR+ZdLX8IbrU=", "narHash": "sha256-ZlJTNLUKQRANlLDomuRWLBCH5792x+6XUJ4YdFRjtO4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "899dc449bc6428b9ee6b3b8f771ca2b0ef945ab9", "rev": "9154f4569b6cdfd3c595851a6ba51bfaa472d9f3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -154,16 +153,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1763622513, "lastModified": 1765472234,
"narHash": "sha256-1jQnuyu82FpiSxowrF/iFK6Toh9BYprfDqfs4BB+19M=", "narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c58bc7f5459328e4afac201c5c4feb7c818d604b", "rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-25.05", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@@ -177,6 +176,7 @@
"plugins-beancount-nvim": "plugins-beancount-nvim", "plugins-beancount-nvim": "plugins-beancount-nvim",
"plugins-crazy-node-movement": "plugins-crazy-node-movement", "plugins-crazy-node-movement": "plugins-crazy-node-movement",
"plugins-helm-ls-nvim": "plugins-helm-ls-nvim", "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-mcphub-nvim": "plugins-mcphub-nvim",
"plugins-nvimkit-nvim": "plugins-nvimkit-nvim", "plugins-nvimkit-nvim": "plugins-nvimkit-nvim",
"plugins-shipwright-nvim": "plugins-shipwright-nvim", "plugins-shipwright-nvim": "plugins-shipwright-nvim",
@@ -240,14 +240,30 @@
"type": "github" "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": { "plugins-mcphub-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1759035242, "lastModified": 1765628564,
"narHash": "sha256-I6EbgY/2sAdtrxtmH0qbAAQvMCHhOsfolJfblV0fXOk=", "narHash": "sha256-nvWqCGRKhbUHsAM/zd+cwFdcoXXxf6EmcCkpN4mElf4=",
"owner": "ravitemer", "owner": "ravitemer",
"repo": "mcphub.nvim", "repo": "mcphub.nvim",
"rev": "8ff40b5edc649959bb7e89d25ae18e055554859a", "rev": "5193329d510a68f1f5bf189960642c925c177a3a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -324,11 +340,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763870012, "lastModified": 1765684837,
"narHash": "sha256-AHxFfIu73SpNLAOZbu/AvpLhZ/Szhx6gRPj9ufZtaZA=", "narHash": "sha256-fJCnsYcpQxxy/wit9EBOK33c0Z9U4D3Tvo3gf2mvHos=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "4e7d74d92398b933cc0e0e25af5b0836efcfdde3", "rev": "94d8af61d8a603d33d1ed3500a33fcf35ae7d3bc",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -1,11 +1,10 @@
{ {
inputs = { inputs = {
nixpkgs = { nixpkgs = {
url = "github:nixos/nixpkgs?ref=nixos-25.05"; url = "github:nixos/nixpkgs/nixos-unstable";
}; };
nixos-hardware = { nixos-hardware = {
url = "github:NixOS/nixos-hardware/master"; url = "github:NixOS/nixos-hardware/master";
inputs.nixpkgs.follows = "nixpkgs";
}; };
disko = { disko = {
url = "github:nix-community/disko/latest"; url = "github:nix-community/disko/latest";
@@ -20,7 +19,7 @@
flake = false; flake = false;
}; };
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-25.05"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixgl = { nixgl = {
@@ -51,6 +50,9 @@
nvim, nvim,
}@inputs: }@inputs:
let let
lib = inputs.nixpkgs.lib;
utils = import ./utils { inherit lib; };
hostDirNames = utils.dirNames ./hosts;
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
@@ -58,28 +60,21 @@
}; };
in in
{ {
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; # <https://github.com/nix-community/nixd/blob/main/nixd/docs/configuration.md> nix.nixPath = [
nixosConfigurations = { "nixpkgs=${inputs.nixpkgs}"
vm = nixpkgs.lib.nixosSystem { ]; # <https://github.com/nix-community/nixd/blob/main/nixd/docs/configuration.md>
modules = [ ./hosts/vm ]; nixosConfigurations = lib.genAttrs hostDirNames (
host:
nixpkgs.lib.nixosSystem {
modules = [ ./hosts/${host} ];
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
}; }
andromache = nixpkgs.lib.nixosSystem { );
modules = [ ./hosts/andromache ];
specialArgs = { inherit inputs; };
};
astyanax = nixpkgs.lib.nixosSystem {
modules = [ ./hosts/astyanax ];
specialArgs = { inherit inputs; };
};
};
homeConfigurations = { homeConfigurations = {
work = home-manager.lib.homeManagerConfiguration { work = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ ./home/hosts/work ]; modules = [ ./home/hosts/work ];
extraSpecialArgs = { extraSpecialArgs = { inherit inputs; };
inherit inputs;
};
}; };
}; };
}; };

View File

@@ -1 +1,83 @@
import ../astyanax {
lib,
inputs,
config,
pkgs,
...
}:
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 {
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;
};
}

View File

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

View File

@@ -1,53 +0,0 @@
{ pkgs, ... }:
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
nodePackages.ts-node
nvimpager
ormolu
pandoc
parallel
pass
pnpm
ripgrep
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
]

36
home/hosts/packages.nix Normal file
View File

@@ -0,0 +1,36 @@
{ pkgs, ... }:
with pkgs;
[
bash-completion
bat
entr
feh
fzf
gh
git
haskellPackages.pandoc-crossref
htop
jq
kitty
nixfmt-rfc-style
nmap
nodejs_24
nvimpager
pandoc
parallel
pass
pnpm
ripgrep
signal-desktop
silver-searcher
sops
sshfs
tldr
tmux
tmuxp
tree
unzip
vimPlugins.vim-plug
wget
]

View File

@@ -10,38 +10,37 @@ let
in in
{ {
imports = [ imports = [
../../modules/dconf.nix # TODO: Only enable when on Gnome? ../../modules/dconf.nix
../../modules/git.nix
../../modules/k9s.nix
(import ../../modules/keepassxc.nix { inherit pkgs; })
]; ];
nixpkgs.config.allowUnfree = true;
home.stateVersion = "25.05"; home.stateVersion = "25.05";
home.username = username; home.username = username;
home.homeDirectory = "/home/${username}"; home.homeDirectory = "/home/${username}";
sops = { targets.genericLinux.nixGL = {
defaultSopsFile = "${builtins.toString inputs.nix-secrets}/secrets.yaml";
defaultSopsFormat = "yaml";
age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
secrets."test" = { };
};
nixGL = {
packages = inputs.nixgl.packages; packages = inputs.nixgl.packages;
defaultWrapper = "mesa"; defaultWrapper = "mesa";
}; };
programs = { programs = {
anki = import ../../modules/anki.nix; # editorconfig.enable = true;
firefox = import ../../modules/firefox.nix { firefox = import ../../modules/firefox.nix {
inherit inputs; inherit inputs;
inherit pkgs; inherit pkgs;
inherit config; inherit config;
}; };
git = import ../../modules/git.nix; gh.enable = true;
keepassxc = import ../../modules/keepassxc.nix; kubecolor.enable = true;
}; };
home.packages = import ./packages.nix { home.packages = import ./packages.nix {
inherit pkgs; inherit inputs;
inherit config; inherit config;
inherit pkgs;
}; };
} }

View File

@@ -0,0 +1,98 @@
{
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,4 +1,19 @@
{ pkgs, config, ... }: {
inputs,
config,
pkgs,
...
}:
with pkgs; let
[ ] localPackages =
if builtins.pathExists ./packages.local.nix then
import ./packages.local.nix { inherit inputs config pkgs; }
else
[ ];
in
(with pkgs; [
inputs.nvim.packages.x86_64-linux.nvim
])
++ localPackages

View File

@@ -1,3 +1,16 @@
{ config, pkgs, ... }:
{ {
enable = true; 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}";
};
};
} }

View File

@@ -7,5 +7,107 @@
"org/gnome/desktop/interface" = { "org/gnome/desktop/interface" = {
color-scheme = "prefer-dark"; color-scheme = "prefer-dark";
}; };
"org/gnome/desktop/applications/terminal" = {
exec = "kitty";
exec-arg = "";
};
"org/gnome/desktop/background" = {
color-shading-type = "solid";
picture-opacity = 100;
picture-options = "zoom";
picture-uri = "none";
picture-uri-dark = "none";
primary-color = "#555555";
secondary-color = "#555555";
show-desktop-icons = false;
};
# "org/gnome/desktop/input-sources" = {
# sources = [
# (mkTuple [
# "xkb"
# "us"
# ])
# ];
# xkb-options = [ "caps:none" ];
# };
"org/gnome/desktop/wm/keybindings" = {
close = [ "<Shift><Super>Delete" ];
cycle-group = [ ];
cycle-group-backward = [ ];
cycle-panels = [ ];
cycle-panels-backward = [ ];
cycle-windows = [ ];
cycle-windows-backward = [ ];
maximize = [ "<Super> " ];
minimize = [ ];
move-to-workspace-1 = [ "<Super><Shift>a" ];
move-to-workspace-2 = [ "<Super><Shift>s" ];
move-to-workspace-3 = [ "<Super><Shift>d" ];
move-to-workspace-4 = [ "<Super><Shift>f" ];
move-to-workspace-5 = [ "<Super><Shift>g" ];
move-to-workspace-last = [ ];
move-to-workspace-left = [ "<Super><Shift>h" ];
move-to-workspace-right = [ "<Super><Shift>l" ];
panel-run-dialog = [ ];
switch-applications = [ "<Super>j" ];
switch-applications-backward = [ "<Super>k" ];
switch-group = [ ];
switch-group-backward = [ ];
switch-input-source = [ ];
switch-input-source-backward = [ ];
switch-panels = [ ];
switch-panels-backward = [ ];
switch-to-workspace-1 = [ "<Super>a" ];
switch-to-workspace-2 = [ "<Super>s" ];
switch-to-workspace-3 = [ "<Super>d" ];
switch-to-workspace-4 = [ "<Super>f" ];
switch-to-workspace-5 = [ "<Super>g" ];
switch-to-workspace-last = [ ];
switch-to-workspace-left = [ "<Super>h" ];
switch-to-workspace-right = [ "<Super>l" ];
switch-windows = [ ];
switch-windows-backward = [ ];
toggle-maximized = [ "<Super>space" ];
unmaximize = [ ];
};
"org/gnome/desktop/wm/preferences" = {
num-workspaces = 5;
workspace-names = [
"sh"
"www"
"dev"
"info"
"etc"
];
};
"org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = [
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/"
];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
binding = "Print";
command = "flameshot gui";
name = "flameshot";
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = {
binding = "<Super>Return";
command = "kitty";
name = "Kitty";
};
"org/gnome/shell/keybindings" = {
screenshot = [ "Print" ];
toggle-application-view = [ "<Super>p" ];
toggle-quick-settings = [ ];
};
}; };
} }

View File

@@ -0,0 +1,183 @@
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

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

View File

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

View File

@@ -0,0 +1,28 @@
{
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

@@ -2,6 +2,7 @@
programs.git.enable = true; programs.git.enable = true;
home.file = { home.file = {
".gitconfig".source = ../../dots/.gitconfig; ".gitconfig".source = ../../dots/.gitconfig;
".gitconfig.work".source = ../../dots/.gitconfig.work;
".gitignore".source = ../../dots/.gitignore; ".gitignore".source = ../../dots/.gitignore;
}; };
} }

11
home/modules/k9s.nix Normal file
View File

@@ -0,0 +1,11 @@
{
programs.k9s = {
enable = true;
settings.k9s = {
ui = {
logoless = true;
reactive = true;
};
};
};
}

View File

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

View File

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

View File

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

View File

@@ -44,7 +44,7 @@
# config.sops.secrets."taskwarrior_sync_encryption_secret".path # config.sops.secrets."taskwarrior_sync_encryption_secret".path
# }"; # }";
# }; # };
recurrence = "off"; # TODO: enable only on andromache recurrence = "off";
}; };
extraConfig = "include ${config.sops.templates."taskrc.d/sync".path}"; extraConfig = "include ${config.sops.templates."taskrc.d/sync".path}";
}; };

View File

@@ -0,0 +1,57 @@
[
{
"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

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

View File

@@ -0,0 +1,56 @@
* {
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,28 @@
let let
username = "h"; username = "h";
wolInterfaces = import ./wol-interfaces.nix;
in in
{ {
system.stateVersion = "25.05";
imports = [ imports = [
../../modules/common
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
./hard.nix ./hard.nix
../../modules/bootloader.nix ../../modules/boot/bootloader.nix
(import ../../modules/disko.zfs-encrypted-root.nix { (import ../../modules/disko/zfs-encrypted-root.nix {
device = "/dev/nvme1n1"; device = "/dev/nvme1n1";
inherit lib; inherit lib;
inherit config; inherit config;
}) })
../../modules/gnome.nix ../../modules/desktops/niri
../../modules/bluetooth.nix ../../modules/bluetooth
../../modules/keyboard ../../modules/keyboard
(import ../../modules/networking.nix { hostName = "andromache"; }) (import ../../modules/networking { hostName = "andromache"; })
../../modules/users.nix ../../modules/users
../../modules/audio.nix ../../modules/audio
../../modules/localization.nix ../../modules/localization
../../modules/fonts ../../modules/fonts
../../modules/ssh/hardened-openssh.nix ../../modules/ssh/hardened-openssh.nix
(import ../../modules/secrets { (import ../../modules/secrets {
@@ -37,9 +37,11 @@ in
inherit inputs; inherit inputs;
inherit config; inherit config;
}) })
../../modules/docker
]; ];
secrets.username = username; secrets.username = username;
docker.user = username;
disko.devices = { disko.devices = {
disk.data = { disk.data = {
@@ -76,27 +78,17 @@ in
environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nvim ]; environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nvim ];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nixpkgs.config.allowUnfree = true;
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
users.${username} = import ../../home/hosts/andromache { users.${username} = import ../../home/hosts/andromache {
inherit lib;
inherit inputs; inherit inputs;
inherit config; inherit config;
inherit pkgs; inherit pkgs;
}; };
}; };
networking = {
hostId = "80eef97e";
};
services.xserver = { services.xserver = {
videoDrivers = [ "nvidia" ]; videoDrivers = [ "nvidia" ];
}; };
@@ -109,16 +101,18 @@ in
services.syncthing = { services.syncthing = {
enable = true; enable = true;
openDefaultPorts = true; openDefaultPorts = true;
folders = { settings = {
"/home/${username}/sync" = { devices = {
id = "sync"; # "device1" = {
devices = [ ]; # id = "DEVICE-ID-GOES-HERE";
# };
};
folders = {
"/home/${username}/sync" = {
id = "sync";
devices = [ ];
};
}; };
};
devices = {
# "device1" = {
# id = "DEVICE-ID-GOES-HERE";
# };
}; };
}; };
@@ -126,4 +120,18 @@ in
enable = true; enable = true;
package = pkgs.plocate; package = pkgs.plocate;
}; };
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 = {
allowedUDPPorts = [ 9 ];
};
};
} }

View File

@@ -1,14 +1,29 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = imports = [
[ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "uas" "sd_mod" ]; boot.initrd.availableKernelModules = [
"vmd"
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"uas"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];

View File

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

View File

@@ -8,30 +8,30 @@
let let
username = "h"; username = "h";
hostName = "astynanax"; hostName = "astyanax";
wolInterfaces = import ../andromache/wol-interfaces.nix;
in in
{ {
system.stateVersion = "25.05";
imports = [ imports = [
../../modules/common
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-e14-intel inputs.nixos-hardware.nixosModules.lenovo-thinkpad-e14-intel
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
./hard.nix ./hard.nix
../../modules/bootloader.nix ../../modules/boot/bootloader.nix
(import ../../modules/disko.zfs-encrypted-root.nix { (import ../../modules/disko/zfs-encrypted-root.nix {
inherit lib; inherit lib;
inherit config; inherit config;
device = "/dev/nvme0n1"; device = "/dev/nvme0n1";
}) })
../../modules/gnome.nix ../../modules/desktops/niri
../../modules/bluetooth.nix ../../modules/bluetooth
../../modules/keyboard ../../modules/keyboard
(import ../../modules/networking.nix { hostName = hostName; }) (import ../../modules/networking { hostName = hostName; })
../../modules/users.nix ../../modules/users
../../modules/audio.nix ../../modules/audio
../../modules/localization.nix ../../modules/localization
../../modules/fonts ../../modules/fonts
../../modules/ssh/hardened-openssh.nix ../../modules/ssh/hardened-openssh.nix
(import ../../modules/secrets { (import ../../modules/secrets {
@@ -42,17 +42,36 @@ 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; secrets.username = username;
environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nvim ]; environment.systemPackages = [
inputs.nvim.packages.x86_64-linux.nvim
nix.settings.experimental-features = [ (pkgs.writeShellApplication {
"nix-command" name = "wol-andromache";
"flakes" runtimeInputs = [ pkgs.wakeonlan ];
text = ''
wakeonlan ${wolInterfaces.eno1.macAddress}
'';
})
]; ];
nixpkgs.config.allowUnfree = true;
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
@@ -64,9 +83,12 @@ in
}; };
networking = { networking = {
# TODO: generate unique hostId on actual host with: head -c 8 /etc/machine-id
hostId = "80eef97e"; hostId = "80eef97e";
}; };
services.throttled.enable = false;
services.openssh = { services.openssh = {
enable = true; enable = true;
harden = true; harden = true;

60
hosts/hecuba/default.nix Normal file
View File

@@ -0,0 +1,60 @@
{ 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;
};
}

37
hosts/hecuba/hard.nix Normal file
View File

@@ -0,0 +1,37 @@
# 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

@@ -10,21 +10,20 @@ let
username = "h"; username = "h";
in in
{ {
system.stateVersion = "25.05";
imports = [ imports = [
../../modules/common
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
./hard.nix ./hard.nix
./disk.nix ./disk.nix
../../modules/bootloader.nix ../../modules/boot/bootloader.nix
../../modules/keyboard ../../modules/keyboard
(import ../../modules/networking.nix { hostName = "vm"; }) (import ../../modules/networking { hostName = "vm"; })
../../modules/users.nix ../../modules/users
../../modules/audio.nix ../../modules/audio
../../modules/localization.nix ../../modules/localization
../../modules/x.nix ../../modules/x
../../modules/fonts ../../modules/fonts
../../modules/ssh/hardened-openssh.nix ../../modules/ssh/hardened-openssh.nix
(import ../../modules/secrets { (import ../../modules/secrets {
@@ -34,17 +33,10 @@ in
}) })
]; ];
secrets.username = "h"; secrets.username = username;
environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nvim ]; environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nvim ];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nixpkgs.config.allowUnfree = true;
disko = { disko = {
devices.disk.main.device = "/dev/vda"; devices.disk.main.device = "/dev/vda";
devices.disk.main.imageName = "nixos-vm"; devices.disk.main.imageName = "nixos-vm";

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,10 @@
{
system.stateVersion = "25.05";
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nixpkgs.config.allowUnfree = true;
}

View File

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

View File

@@ -0,0 +1,44 @@
{ 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" ];
})
];
}

79
modules/k3s/default.nix Normal file
View File

@@ -0,0 +1,79 @@
{ 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

@@ -25,6 +25,10 @@ in
"taskwarrior_sync_server_url".owner = config.users.users.${cfg.username}.name; "taskwarrior_sync_server_url".owner = config.users.users.${cfg.username}.name;
"taskwarrior_sync_server_client_id".owner = config.users.users.${cfg.username}.name; "taskwarrior_sync_server_client_id".owner = config.users.users.${cfg.username}.name;
"taskwarrior_sync_encryption_secret".owner = config.users.users.${cfg.username}.name; "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" = { templates."taskrc.d/sync" = {
@@ -35,6 +39,24 @@ in
sync.encryption_secret=${config.sops.placeholder."taskwarrior_sync_encryption_secret"} sync.encryption_secret=${config.sops.placeholder."taskwarrior_sync_encryption_secret"}
''; '';
}; };
templates.".gitconfig.email" = {
owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.gitconfig.email";
content = ''
[user]
email = ${config.sops.placeholder."email_personal"}
'';
};
templates.".gitconfig.work.email" = {
owner = config.users.users.${cfg.username}.name;
path = "/home/${cfg.username}/.gitconfig.work.email";
content = ''
[user]
email = ${config.sops.placeholder."email_work"}
'';
};
}; };
}; };
} }

View File

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

View File

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

7
utils/default.nix Normal file
View File

@@ -0,0 +1,7 @@
{ lib }:
{
dirNames =
path:
builtins.attrNames (lib.filterAttrs (name: type: type == "directory") (builtins.readDir path));
}