Compare commits

...

13 Commits

18 changed files with 178 additions and 94 deletions

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,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

@@ -13,14 +13,15 @@ require("conform").setup({
gdscript = { "gdformat" }, gdscript = { "gdformat" },
haskell = { "ormolu" }, haskell = { "ormolu" },
html = { "prettierd", "prettier", stop_after_first = true }, html = { "prettierd", "prettier", stop_after_first = true },
lua = { "stylua" }, -- configured in stylua.toml
markdown = { "prettierd", "prettier", stop_after_first = true },
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 },
lua = { "stylua" }, -- configured in stylua.toml
markdown = { "prettierd", "prettier", stop_after_first = true },
nix = { "nixfmt" },
python = { "isort", "black" }, python = { "isort", "black" },
rust = { "rustfmt", lsp_fallback = "fallback" },
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 },
typescriptreact = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true }, typescriptreact = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },

View File

@@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixCats": { "nixCats": {
"locked": { "locked": {
"lastModified": 1764009888, "lastModified": 1765766809,
"narHash": "sha256-hJekfTiW1792txgRSM4LcHnz1lDSY87LYbsJEn2V378=", "narHash": "sha256-3Xp41+Sb1zIzASa1Uu1k1RMUoJ9CGyYb0GtvvpRPBqg=",
"owner": "BirdeeHub", "owner": "BirdeeHub",
"repo": "nixCats-nvim", "repo": "nixCats-nvim",
"rev": "16ac3281f322ea15d39843829e42a44d22da3715", "rev": "fe157e3ed69ed14b55ca81f597eac282caed58a2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -17,11 +17,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1764947035, "lastModified": 1765644376,
"narHash": "sha256-EYHSjVM4Ox4lvCXUMiKKs2vETUSL5mx+J2FfutM7T9w=", "narHash": "sha256-yqHBL2wYGwjGL2GUF2w3tofWl8qO9tZEuI4wSqbCrtE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a672be65651c80d3f592a89b3945466584a22069", "rev": "23735a82a828372c4ef92c660864e82fbe2f5fbe",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -98,11 +98,11 @@
"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": {

View File

@@ -69,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
]; ];
}; };

42
flake.lock generated
View File

@@ -29,11 +29,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1765080359, "lastModified": 1765771449,
"narHash": "sha256-BvAgmqgswcokD2eWoyO3uB1k1VTdpxDHGSx0RYRFjDg=", "narHash": "sha256-ZoHRPmTzwC1ndX3NQB/b/WKtU1WduAJdLI4j8eW/QFM=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "35f8ab2ecd954b3a348aa0e253878211c48a0aa7", "rev": "5bcf9a2aeb4d361c2ff918a146b3fcc1e136b9ca",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@@ -68,11 +68,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1764998300, "lastModified": 1765682243,
"narHash": "sha256-fZatn/KLfHLDXnF0wy7JxXqGaZmGDTVufT4o/AOlj44=", "narHash": "sha256-yeCxFV/905Wr91yKt5zrVvK6O2CVXWRMSrxqlAZnLp0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "27a6182347ccae90a88231ae0dc5dfa7d15815bb", "rev": "58bf3ecb2d0bba7bdf363fc8a6c4d49b4d509d03",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -84,10 +84,10 @@
"nix-secrets": { "nix-secrets": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1764371082, "lastModified": 1765747965,
"narHash": "sha256-yxFxEKXFuXFyFIDZY1gla2OyuqcIE3uT8KDDgTmm3cE=", "narHash": "sha256-EHZRRC3piD6vKd4hXiqC+CcDUQCOzrH/CNAF9zBqpDQ=",
"ref": "main", "ref": "main",
"rev": "b9c2ce32cc4c95d7ff01372faea2668407ef8d27", "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"
@@ -101,11 +101,11 @@
}, },
"nixCats": { "nixCats": {
"locked": { "locked": {
"lastModified": 1764009888, "lastModified": 1765766809,
"narHash": "sha256-hJekfTiW1792txgRSM4LcHnz1lDSY87LYbsJEn2V378=", "narHash": "sha256-3Xp41+Sb1zIzASa1Uu1k1RMUoJ9CGyYb0GtvvpRPBqg=",
"owner": "BirdeeHub", "owner": "BirdeeHub",
"repo": "nixCats-nvim", "repo": "nixCats-nvim",
"rev": "16ac3281f322ea15d39843829e42a44d22da3715", "rev": "fe157e3ed69ed14b55ca81f597eac282caed58a2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -153,11 +153,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1764950072, "lastModified": 1765472234,
"narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=", "narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f61125a668a320878494449750330ca58b78c557", "rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -259,11 +259,11 @@
"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": {
@@ -340,11 +340,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1765079830, "lastModified": 1765684837,
"narHash": "sha256-i9GMbBLkeZ7MVvy7+aAuErXkBkdRylHofrAjtpUPKt8=", "narHash": "sha256-fJCnsYcpQxxy/wit9EBOK33c0Z9U4D3Tvo3gf2mvHos=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "aeb517262102f13683d7a191c7e496b34df8d24c", "rev": "94d8af61d8a603d33d1ed3500a33fcf35ae7d3bc",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -6,14 +6,78 @@
... ...
}: }:
let
username = "h";
in
{ {
imports = [ imports = [
(import ../astyanax { ../../modules/desktop/niri
inherit inputs; ../../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 config;
inherit pkgs; inherit pkgs;
}) })
]; ];
programs.taskwarrior.config.recurrence = lib.mkForce "on"; 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/h/.bashrc.d/*; do
[ -f "$f" ] && source "$f"
done
source /home/h/.bash_aliases/all
source /home/h/.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

@@ -13,7 +13,6 @@ in
../../modules/desktop/niri ../../modules/desktop/niri
../../modules/git.nix ../../modules/git.nix
../../modules/k9s.nix ../../modules/k9s.nix
(import ../../modules/shikane.nix { inherit pkgs; })
(import ../../modules/taskwarrior.nix { (import ../../modules/taskwarrior.nix {
inherit config; inherit config;
inherit pkgs; inherit pkgs;
@@ -58,7 +57,7 @@ in
home-manager.enable = true; home-manager.enable = true;
}; };
home.packages = import ./packages.nix { home.packages = import ../packages.nix {
inherit pkgs; inherit pkgs;
inherit config; inherit config;
}; };

View File

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

View File

@@ -1,6 +1,16 @@
{ config, pkgs, ... }:
{ {
enable = true; programs.anki = {
# sync = { enable = true;
# username = config.sops.secrets."email/personal".path; 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

@@ -3,6 +3,8 @@
{ {
imports = [ imports = [
../../fuzzel ../../fuzzel
../../mako
../../shikane
../../waybar ../../waybar
]; ];

View File

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

View File

@@ -9,11 +9,6 @@
../../modules/ssh/hardened-openssh.nix ../../modules/ssh/hardened-openssh.nix
]; ];
environment.systemPackages = with pkgs; [
vim
git
];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-label/nixos"; device = "/dev/disk/by-label/nixos";
fsType = "ext4"; fsType = "ext4";
@@ -48,6 +43,16 @@
firewall.enable = true; firewall.enable = true;
}; };
environment.systemPackages = with pkgs; [
vim
git
];
services.fail2ban = {
enable = true;
maxretry = 5;
};
services.openssh = { services.openssh = {
enable = true; enable = true;
harden = true; harden = true;

View File

@@ -27,6 +27,8 @@ in
"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_personal".owner = config.users.users.${cfg.username}.name;
"email_work".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" = {