Compare commits

...

32 Commits

Author SHA1 Message Date
syedm a647e92782 Minor changes 2026-07-21 20:41:20 +01:00
syedm 2daaf64e9b Make nixd/nixfmt global 2026-07-12 18:36:17 +01:00
syedm ac284e6cfb Cleanup 2026-07-12 18:25:07 +01:00
syedm 1edf4af07f Fix formatting 2026-07-12 18:07:46 +01:00
syedm ebf3e773c6 Fix fish startup code 2026-07-11 18:04:48 +01:00
syedm 0db4036c29 Make editor function work with flakes 2026-07-11 17:33:35 +01:00
syedm e7fa524261 Fix battery script 2026-07-10 20:19:04 +01:00
syedm 6154c9cf0d Update logo 2026-07-10 19:53:11 +01:00
syedm b3f3040174 Change nvidia version to make hibernation work 2026-07-09 23:32:00 +01:00
syedm 80271685e6 Switch to unstable branch 2026-07-09 21:48:10 +01:00
syedm 35e165b801 Add hinernation on low battery feature 2026-07-09 18:46:21 +01:00
syedm 27759c824a minor fixes 2026-07-09 17:49:47 +01:00
syedm 80e245483a Update mobile ssh key 2026-07-09 15:31:37 +01:00
syedm 1b1d754950 Make hibernation and suspend work 2026-07-09 13:53:54 +01:00
syedm 8df3c6bf45 Allow systemd hibernation 2026-07-09 10:52:27 +01:00
syedm c9eca9eb1e Keep ollama models alive longer 2026-07-08 23:43:24 +01:00
syedm 514e10f696 Disable x11 timeout 2026-07-08 23:10:11 +01:00
syedm 86e9663531 Add ollama and split tardis/default.nix 2026-07-08 22:41:57 +01:00
syedm 13f8a22760 Fix nix impurities 2026-07-08 22:12:54 +01:00
syedm 1c64936338 Fix incorrect file extention 2026-07-08 22:03:12 +01:00
syedm 5ac70285e4 Use msjd as flake 2026-07-08 22:02:31 +01:00
syedm 015131bade Harden ssh 2026-07-08 20:27:52 +01:00
syedm 999de8e02b Add ipv6 & logging support to ddns 2026-07-08 20:14:40 +01:00
syedm 737c5c8d8a Add IPv6 to ddns 2026-07-08 19:27:55 +01:00
syedm 315274e323 Fix networking bit 2026-07-08 19:23:52 +01:00
syedm b671cdd1c4 Enable firewall explicitly 2026-07-08 18:49:51 +01:00
syedm 0c9bfa8714 Minor fixes 2026-07-08 18:45:42 +01:00
syedm e13a9fa82d Update fish prompt and add to root user 2026-07-08 11:31:02 +01:00
syedm 700096aca1 Minor fixes 2026-07-08 10:32:18 +01:00
syedm 4e229aac5e Split common and tardis specific home-manager modules 2026-07-08 08:29:38 +01:00
syedm 3aa23d4ce1 Fix fish nix function recurse error 2026-07-08 08:15:50 +01:00
syedm 32b5474307 Add startx to fish config 2026-07-08 07:41:15 +01:00
42 changed files with 888 additions and 422 deletions
Generated
+7 -8
View File
@@ -7,16 +7,15 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1783221248, "lastModified": 1783618078,
"narHash": "sha256-ESQnuNHEDChsB4IxoLRhscVahqkDWkTb+qdIz8euYt4=", "narHash": "sha256-F43DGcBoIO8xOZFAfodg3jy0VghB9NGdb6xbTYAIx1A=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "af2beae5f0fae0a4310cc0e6aef2572f56090353", "rev": "144f4e36d0186195037da9fce80a727108978070",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-26.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@@ -57,16 +56,16 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1783148766, "lastModified": 1783224372,
"narHash": "sha256-uslt2pqShTIXDdAHRHv2QkYLsVdY8Oqwz0EA48/RSM8=", "narHash": "sha256-8i/87eeoqiGE4yOTjwSA3Eh/ziJRQEmd/unYU+K27sk=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a50de1b7d8a586adc18d2395c19de7d6058e6030", "rev": "d407951447dcd00442e97087bf374aad70c04cea",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-26.05", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
+45 -24
View File
@@ -1,40 +1,61 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
kutu.url = "git+https://git.syedm.dev/syedm/kutu.rb.git"; kutu.url = "git+https://git.syedm.dev/syedm/kutu.rb.git";
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-26.05"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = inputs@{ nixpkgs, kutu, home-manager, ... }: outputs =
let {
system = "x86_64-linux"; kutu,
in { nixpkgs,
nixosConfigurations = { home-manager,
syedm = nixpkgs.lib.nixosSystem { ...
}:
let
system = "x86_64-linux";
commonModules = [
./hosts/common.nix
home-manager.nixosModules.home-manager
{
home-manager.users.me = import ./home/common.nix;
home-manager.users.root = import ./home/root.nix;
}
];
pkgs = import nixpkgs {
inherit system; inherit system;
specialArgs = { inherit inputs; }; };
modules = [ in
./hosts/common.nix {
./hosts/syedm nixosConfigurations = {
home-manager.nixosModules.home-manager syedm = nixpkgs.lib.nixosSystem {
{ home-manager.users.me = import ./home; } inherit system;
]; modules = commonModules ++ [
./hosts/syedm
];
};
tardis = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit kutu; };
modules = commonModules ++ [
./hosts/tardis
{ home-manager.users.me = import ./home/tardis.nix; }
];
};
}; };
tardis = nixpkgs.lib.nixosSystem { # For development
inherit system; devShells.${system}.default = pkgs.mkShell {
specialArgs = { inherit inputs; }; packages = with pkgs; [
modules = [ lua-language-server
./hosts/common.nix stylua
./hosts/tardis
home-manager.nixosModules.home-manager
{ home-manager.users.me = import ./home; }
]; ];
}; };
}; };
};
} }
+16 -12
View File
@@ -1,18 +1,23 @@
{ config, pkgs, ... }: { pkgs, ... }:
let let
batteryNotify = pkgs.writeShellScript "battery-notify" '' battery = pkgs.writeShellScript "battery" ''
BAT="/sys/class/power_supply/BAT1" BAT="/sys/class/power_supply/BAT1"
LEVEL=$(cat "$BAT/capacity") LEVEL=$(cat "$BAT/capacity")
STATUS=$(cat "$BAT/status") STATUS=$(cat "$BAT/status")
if [ "$STATUS" = "Discharging" ] && [ "$LEVEL" -lt 3 ]; then
${pkgs.systemd}/bin/systemctl hibernate
exit 0
fi
if [ "$STATUS" = "Discharging" ] && [ "$LEVEL" -lt 20 ]; then if [ "$STATUS" = "Discharging" ] && [ "$LEVEL" -lt 20 ]; then
${pkgs.dunst}/bin/dunstify \ ${pkgs.dunst}/bin/dunstify \
-r 9991 \ -r 9991 \
-t 0 \ -t 0 \
-u critical \ -u critical \
"Battery Low" \ "Battery Low" \
"Battery is at ''${LEVEL}%" "Battery is at ''${LEVEL}%" 2>/dev/null || true
else else
${pkgs.dunst}/bin/dunstify \ ${pkgs.dunst}/bin/dunstify \
-C 9991 2>/dev/null || true -C 9991 2>/dev/null || true
@@ -20,27 +25,26 @@ let
''; '';
in in
{ {
systemd.user.services.battery-notify = { systemd.user.services.battery = {
Unit = { Unit = {
Description = "Low battery notification"; Description = "Battery management";
After = [ "dunst.service" ];
Requires = [ "dunst.service" ];
}; };
Service = { Service = {
Type = "oneshot"; Type = "oneshot";
ExecStart = batteryNotify; ExecStart = battery;
}; };
}; };
systemd.user.timers.battery-notify = { systemd.user.timers.battery = {
Unit = { Unit = {
Description = "Check battery level every 20 seconds"; Description = "Check battery level every 15 seconds";
}; };
Timer = { Timer = {
OnBootSec = "20s"; OnBootSec = "15s";
OnUnitActiveSec = "20s"; OnUnitInactiveSec = "15s";
AccuracySec = "1s";
}; };
Install = { Install = {
+6 -15
View File
@@ -2,21 +2,17 @@
{ {
imports = [ imports = [
./battery
./btop ./btop
./dunst
./eza ./eza
./fastfetch ./fastfetch
./fish ./fish
./gitui ./gitui
./kitty
./kutu
./nvim ./nvim
./picom
./rofi
./yazi ./yazi
]; ];
nixpkgs.config.allowUnfree = true;
home.username = "me"; home.username = "me";
home.homeDirectory = "/home/me"; home.homeDirectory = "/home/me";
@@ -36,15 +32,10 @@
}; };
}; };
xsession = { home.file.".config/nixpkgs/config.nix".text = ''
enable = true; {
windowManager.command = "kutu.rb"; allowUnfree = true;
}; }
home.file.".xinitrc".text = ''
if [ -f ~/.xsession ]; then
exec ~/.xsession
fi
''; '';
home.stateVersion = "26.05"; home.stateVersion = "26.05";
+244 -82
View File
@@ -3,119 +3,281 @@
{ {
programs.eza = { programs.eza = {
enable = true; enable = true;
theme = { theme = {
colourful = true; colourful = true;
filekinds = { filekinds = {
normal = { foreground = "#c0caf5"; }; normal = {
directory = { foreground = "#7aa2f7"; }; foreground = "#c0caf5";
symlink = { foreground = "#2ac3de"; }; };
pipe = { foreground = "#414868"; }; directory = {
block_device = { foreground = "#e0af68"; }; foreground = "#7aa2f7";
char_device = { foreground = "#e0af68"; }; };
socket = { foreground = "#414868"; }; symlink = {
special = { foreground = "#9d7cd8"; }; foreground = "#2ac3de";
executable = { foreground = "#9ece6a"; }; };
mount_point = { foreground = "#b4f9f8"; }; pipe = {
foreground = "#414868";
};
block_device = {
foreground = "#e0af68";
};
char_device = {
foreground = "#e0af68";
};
socket = {
foreground = "#414868";
};
special = {
foreground = "#9d7cd8";
};
executable = {
foreground = "#9ece6a";
};
mount_point = {
foreground = "#b4f9f8";
};
}; };
perms = { perms = {
user_read = { foreground = "#2ac3de"; }; user_read = {
user_write = { foreground = "#bb9af7"; }; foreground = "#2ac3de";
user_execute_file = { foreground = "#9ece6a"; }; };
user_execute_other = { foreground = "#9ece6a"; }; user_write = {
group_read = { foreground = "#2ac3de"; }; foreground = "#bb9af7";
group_write = { foreground = "#ff9e64"; }; };
group_execute = { foreground = "#9ece6a"; }; user_execute_file = {
other_read = { foreground = "#2ac3de"; }; foreground = "#9ece6a";
other_write = { foreground = "#ff007c"; }; };
other_execute = { foreground = "#9ece6a"; }; user_execute_other = {
special_user_file = { foreground = "#ff007c"; }; foreground = "#9ece6a";
special_other = { foreground = "#db4b4b"; }; };
attribute = { foreground = "#737aa2"; }; group_read = {
foreground = "#2ac3de";
};
group_write = {
foreground = "#ff9e64";
};
group_execute = {
foreground = "#9ece6a";
};
other_read = {
foreground = "#2ac3de";
};
other_write = {
foreground = "#ff007c";
};
other_execute = {
foreground = "#9ece6a";
};
special_user_file = {
foreground = "#ff007c";
};
special_other = {
foreground = "#db4b4b";
};
attribute = {
foreground = "#737aa2";
};
}; };
size = { size = {
major = { foreground = "#2ac3de"; }; major = {
minor = { foreground = "#9d7cd8"; }; foreground = "#2ac3de";
number_byte = { foreground = "#a9b1d6"; }; };
number_kilo = { foreground = "#89ddff"; }; minor = {
number_mega = { foreground = "#2ac3de"; }; foreground = "#9d7cd8";
number_giga = { foreground = "#ff9e64"; }; };
number_huge = { foreground = "#ff007c"; }; number_byte = {
unit_byte = { foreground = "#a9b1d6"; }; foreground = "#a9b1d6";
unit_kilo = { foreground = "#89ddff"; }; };
unit_mega = { foreground = "#2ac3de"; }; number_kilo = {
unit_giga = { foreground = "#ff9e64"; }; foreground = "#89ddff";
unit_huge = { foreground = "#ff007c"; }; };
number_mega = {
foreground = "#2ac3de";
};
number_giga = {
foreground = "#ff9e64";
};
number_huge = {
foreground = "#ff007c";
};
unit_byte = {
foreground = "#a9b1d6";
};
unit_kilo = {
foreground = "#89ddff";
};
unit_mega = {
foreground = "#2ac3de";
};
unit_giga = {
foreground = "#ff9e64";
};
unit_huge = {
foreground = "#ff007c";
};
}; };
users = { users = {
user_you = { foreground = "#3d59a1"; }; user_you = {
user_root = { foreground = "#bb9af7"; }; foreground = "#3d59a1";
user_other = { foreground = "#2ac3de"; }; };
group_yours = { foreground = "#89ddff"; }; user_root = {
group_root = { foreground = "#bb9af7"; }; foreground = "#bb9af7";
group_other = { foreground = "#c0caf5"; }; };
user_other = {
foreground = "#2ac3de";
};
group_yours = {
foreground = "#89ddff";
};
group_root = {
foreground = "#bb9af7";
};
group_other = {
foreground = "#c0caf5";
};
}; };
links = { links = {
normal = { foreground = "#89ddff"; }; normal = {
multi_link_file = { foreground = "#2ac3de"; }; foreground = "#89ddff";
};
multi_link_file = {
foreground = "#2ac3de";
};
}; };
git = { git = {
new = { foreground = "#9ece6a"; }; new = {
modified = { foreground = "#bb9af7"; }; foreground = "#9ece6a";
deleted = { foreground = "#db4b4b"; }; };
renamed = { foreground = "#2ac3de"; }; modified = {
typechange = { foreground = "#2ac3de"; }; foreground = "#bb9af7";
ignored = { foreground = "#545c7e"; }; };
conflicted = { foreground = "#ff9e64"; }; deleted = {
foreground = "#db4b4b";
};
renamed = {
foreground = "#2ac3de";
};
typechange = {
foreground = "#2ac3de";
};
ignored = {
foreground = "#545c7e";
};
conflicted = {
foreground = "#ff9e64";
};
}; };
git_repo = { git_repo = {
branch_main = { foreground = "#737aa2"; }; branch_main = {
branch_other = { foreground = "#b4f9f8"; }; foreground = "#737aa2";
git_clean = { foreground = "#292e42"; }; };
git_dirty = { foreground = "#bb9af7"; }; branch_other = {
foreground = "#b4f9f8";
};
git_clean = {
foreground = "#292e42";
};
git_dirty = {
foreground = "#bb9af7";
};
}; };
security_context = { security_context = {
colon = { foreground = "#545c7e"; }; colon = {
user = { foreground = "#737aa2"; }; foreground = "#545c7e";
role = { foreground = "#2ac3de"; }; };
typ = { foreground = "#3d59a1"; }; user = {
range = { foreground = "#9d7cd8"; }; foreground = "#737aa2";
};
role = {
foreground = "#2ac3de";
};
typ = {
foreground = "#3d59a1";
};
range = {
foreground = "#9d7cd8";
};
}; };
file_type = { file_type = {
image = { foreground = "#89ddff"; }; image = {
video = { foreground = "#b4f9f8"; }; foreground = "#89ddff";
music = { foreground = "#73daca"; }; };
lossless = { foreground = "#41a6b5"; }; video = {
crypto = { foreground = "#db4b4b"; }; foreground = "#b4f9f8";
document = { foreground = "#a9b1d6"; }; };
compressed = { foreground = "#ff9e64"; }; music = {
temp = { foreground = "#737aa2"; }; foreground = "#73daca";
compiled = { foreground = "#737aa2"; }; };
build = { foreground = "#1abc9c"; }; lossless = {
source = { foreground = "#bb9af7"; }; foreground = "#41a6b5";
};
crypto = {
foreground = "#db4b4b";
};
document = {
foreground = "#a9b1d6";
};
compressed = {
foreground = "#ff9e64";
};
temp = {
foreground = "#737aa2";
};
compiled = {
foreground = "#737aa2";
};
build = {
foreground = "#1abc9c";
};
source = {
foreground = "#bb9af7";
};
}; };
punctuation = { foreground = "#292e42"; }; punctuation = {
date = { foreground = "#e0af68"; }; foreground = "#292e42";
inode = { foreground = "#737aa2"; }; };
blocks = { foreground = "#737aa2"; }; date = {
header = { foreground = "#a9b1d6"; }; foreground = "#e0af68";
octal = { foreground = "#ff9e64"; }; };
flags = { foreground = "#9d7cd8"; }; inode = {
foreground = "#737aa2";
};
blocks = {
foreground = "#737aa2";
};
header = {
foreground = "#a9b1d6";
};
octal = {
foreground = "#ff9e64";
};
flags = {
foreground = "#9d7cd8";
};
symlink_path = { foreground = "#89ddff"; }; symlink_path = {
control_char = { foreground = "#ff9e64"; }; foreground = "#89ddff";
broken_symlink = { foreground = "#ff007c"; }; };
broken_path_overlay = { foreground = "#ff007c"; }; control_char = {
foreground = "#ff9e64";
};
broken_symlink = {
foreground = "#ff007c";
};
broken_path_overlay = {
foreground = "#ff007c";
};
}; };
}; };
} }
+1 -1
View File
@@ -8,7 +8,7 @@
logo = { logo = {
type = "kitty-direct"; type = "kitty-direct";
source = ./logo.png; source = ./logo.png;
width = 23; width = 20;
height = 10; height = 10;
padding = { padding = {
top = 0; top = 0;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 28 KiB

+24 -6
View File
@@ -1,14 +1,15 @@
set -gx fish_greeting set -gx fish_greeting
function nix function nix
if test "$argv[1]" = "develop" if test "$argv[1]" = "develop"; and test (count $argv) -eq 1
nix develop -c fish $argv[2..-1] command nix develop -c fish $argv[2..-1]
else if test "$argv[1]" = "shell" else if test "$argv[1]" = "shell"
env IN_NIX_SHELL=shell nix $argv env IN_NIX_SHELL=shell nix $argv -c fish
else else
nix $argv command nix $argv
end end
end end
function a function a
for arg in $argv for arg in $argv
if string match -q '*/' $arg if string match -q '*/' $arg
@@ -19,6 +20,15 @@ function a
end end
end end
end end
function g
if git rev-parse --git-dir >/dev/null 2>&1
gitui
else
echo "Not inside a Git repository."
end
end
function y function y
set tmp (mktemp -t "yazi-cwd.XXXXXX") set tmp (mktemp -t "yazi-cwd.XXXXXX")
yazi $argv --cwd-file="$tmp" yazi $argv --cwd-file="$tmp"
@@ -26,13 +36,21 @@ function y
builtin cd -- "$cwd" builtin cd -- "$cwd"
end end
end end
function editor function editor
set pos (cat ~/dotfiles/.pos) set pos (cat ~/dotfiles/.pos)
y $pos y $pos
if test -e ./p.vim if test -e ./p.vim
nvim -S ./p.vim set cmd nvim -S ./p.vim
else else
nvim set cmd nvim
end
if test -e ./flake.nix
and not contains -- "$IN_NIX_SHELL" pure impure
and command nix develop --command true 2>/dev/null
command nix develop --command $cmd
else
command $cmd
end end
echo $PWD > ~/dotfiles/.pos echo $PWD > ~/dotfiles/.pos
end end
-2
View File
@@ -14,8 +14,6 @@
vi = "${pkgs.neovim}/bin/nvim"; vi = "${pkgs.neovim}/bin/nvim";
vim = "${pkgs.neovim}/bin/nvim"; vim = "${pkgs.neovim}/bin/nvim";
g = "${pkgs.gitui}/bin/gitui";
}; };
shellInit = builtins.readFile ./config.fish; shellInit = builtins.readFile ./config.fish;
+92 -13
View File
@@ -1,25 +1,31 @@
if test "$KITTY_STR" = "1" if test (tty) = /dev/tty1; and type -q startx; and test -z "$DISPLAY"; and test -z "$WAYLAND_DISPLAY"
if not set -q _FASTFETCH_RUN exec startx
set -gx _FASTFETCH_RUN 1 end
fastfetch
end if test "$KITTY_STR" = "1"; and not set -q _FASTFETCH_RUN
set -gx _FASTFETCH_RUN 1
fastfetch
end end
function postexec_test --on-event fish_postexec function postexec_test --on-event fish_postexec
echo echo
end end
set -g fish_prompt_pwd_dir_length 0
function fish_prompt function fish_prompt
set -l last_status $status set -l last_status $status
set -l markers set -l markers
set -l user $USER set -l user $USER
set -l host (hostname) set -l host (hostname)
printf '\e[24m'
if test -n "$IN_NIX_SHELL" if test -n "$IN_NIX_SHELL"
if test "$IN_NIX_SHELL" = "shell" if test "$IN_NIX_SHELL" = "shell"
set -a markers "nix-shell" set -a markers "nix shell"
else if test "$IN_NIX_SHELL" = "pure"; or test "$IN_NIX_SHELL" = "impure" else if test "$IN_NIX_SHELL" = "pure"; or test "$IN_NIX_SHELL" = "impure"
set -a markers "nix-develop" set -a markers "nix develop"
end end
end end
@@ -49,20 +55,93 @@ function fish_prompt
set_color 9ece6a set_color 9ece6a
echo -n "$host " echo -n "$host "
set_color 89ddff set -l pwd
echo -n (prompt_pwd)
set_color bb9af7 if git rev-parse --show-toplevel >/dev/null 2>&1
echo -n (fish_git_prompt) set -l root (git rev-parse --show-toplevel)
set -l rel (string replace "$root/" "" "$PWD")
set pwd (basename "$root")
if test "$rel" = "$PWD"
set pwd (basename "$root")
else
set pwd (basename "$root")"/"$rel
end
else
set pwd (prompt_pwd)
end
set_color 89ddff
echo -n $pwd
set -l git_info (git status --porcelain=v2 --branch 2>/dev/null)
if test $status -eq 0
set -l branch
set -l ahead 0
set -l behind 0
set -l staged 0
set -l modified 0
set -l untracked 0
for line in $git_info
switch $line
case '# branch.head*'
set branch (string split ' ' $line)[3]
case '# branch.ab*'
set -l parts (string split ' ' $line)
set ahead (string sub -s 2 -- $parts[3])
set behind (string sub -s 2 -- $parts[4])
case '1*' '2*'
set -l xy (string sub -s 3 -l 2 $line)
if test (string sub -s 1 -l 1 $xy) != "."
set staged (math $staged + 1)
end
if test (string sub -s 2 -l 1 $xy) != "."
set modified (math $modified + 1)
end
case '?*'
set untracked (math $untracked + 1)
end
end
set_color bb9af7
echo -n " [$branch"
test $ahead -gt 0; and echo -n "$ahead"
test $behind -gt 0; and echo -n "$behind"
test $staged -gt 0; and echo -n " +$staged"
test $modified -gt 0; and echo -n " ~$modified"
test $untracked -gt 0; and echo -n " ?$untracked"
echo -n "]"
end
if test (count $markers) -gt 0 if test (count $markers) -gt 0
set_color ff9e64 set_color ff9e64
echo -n " ("(string join " " $markers)")" echo -n " ("(string join " " $markers)")"
end end
set_color white
if test (count (jobs)) -gt 0
echo -n "  "(count (jobs))
end
if set -q SSH_CONNECTION
echo -n " on ssh"
end
echo echo
set_color 73daca
echo -n "λ " if fish_is_root_user
set_color ff007c
echo -n "# "
else
set_color 73daca
echo -n "λ "
end
set_color normal set_color normal
end end
-3
View File
@@ -32,9 +32,6 @@
window_margin_width = 8; window_margin_width = 8;
allow_remote_control = "yes";
listen_on = "unix:/tmp/mykitty";
foreground = "#CDD6F4"; foreground = "#CDD6F4";
background = "#080014"; background = "#080014";
selection_foreground = "#080014"; selection_foreground = "#080014";
+4 -4
View File
@@ -84,8 +84,8 @@ bind_key 55, true, "CM_LAUNCHER=rofi clipmenu"
bind_key 39, true, :toggle_floating bind_key 39, true, :toggle_floating
bind_mouse 9, false, :workspace_next bind_mouse 8, false, :workspace_next
bind_mouse 9, true, :move_window_next_workspace bind_mouse 8, true, :move_window_next_workspace
bind_mouse 8, false, :workspace_previous bind_mouse 9, false, :workspace_previous
bind_mouse 8, true, :move_window_previous_workspace bind_mouse 9, true, :move_window_previous_workspace
+3 -1
View File
@@ -4,7 +4,9 @@ let
script = pkgs.substitute { script = pkgs.substitute {
src = ./config.rb; src = ./config.rb;
substitutions = [ substitutions = [
"--replace-fail" "@src@" "${./scripts}" "--replace-fail"
"@src@"
"${./scripts}"
]; ];
}; };
in in
+2 -2
View File
@@ -28,13 +28,13 @@ case "$sel" in
*Hibernate*) *Hibernate*)
confirm=$(printf "No\nYes" | dmenu -i -p "Are you sure you want to hibernate? :" \ confirm=$(printf "No\nYes" | dmenu -i -p "Are you sure you want to hibernate? :" \
-nf '#e0af68' -nb '#1f2335' -sb '#f7768e' -sf '#1a1b26' -fn 'AgaveNerdFont-16') -nf '#e0af68' -nb '#1f2335' -sb '#f7768e' -sf '#1a1b26' -fn 'AgaveNerdFont-16')
[ "$confirm" = "Yes" ] && exec systemctl hibernate [ "$confirm" = "Yes" ] && exec systemctl --system hibernate
;; ;;
*Stop\ KutuWM*) *Stop\ KutuWM*)
exec kutu-run.rb stop exec kutu-run.rb stop
;; ;;
*Suspend*) *Suspend*)
exec systemctl suspend exec systemctl --system suspend
;; ;;
*Lock*) *Lock*)
~/dotfiles/scripts/lock.sh & ~/dotfiles/scripts/lock.sh &
+18 -6
View File
@@ -1,17 +1,29 @@
#!/usr/bin/env bash #!/usr/bin/env bash
declare -A aliases=(
[prism]="nvidia-offload prismlauncher"
[editor]="kitty -e fish -c editor"
[yazi]="kitty -e fish -c yazi"
[btop]="kitty -e fish -c btop"
)
choice=$( choice=$(
( {
printf "%s\n" prism printf '%s\n' "${!aliases[@]}"
compgen -c compgen -c
) | } |
grep -v -E '^(if|fi|case|esac|for|done|while|until|select|function|return|continue|break|time|exec|source|alias|builtin|read|export|unset|local|set|declare|typeset|:|\.|\[|coproc|l|ll|ls|then|else|elif|do|in|\{|\}|!|\[\[|\]\]|_.*|compgen)$' | grep -v -E '^(\..*|if|fi|case|esac|for|done|while|until|select|function|return|continue|break|time|exec|source|alias|builtin|read|export|unset|local|set|declare|typeset|:|\.|\[|coproc|l|ll|ls|then|else|elif|do|in|\{|\}|!|\[\[|\]\]|_.*|compgen)$' |
sort | sort -u |
dmenu -i -p "Enter command  " \ dmenu -i -p "Enter command  " \
-nf '#4abaaf' -nb '#1f2335' -sb '#7aa2f7' -sf '#102030' -fn 'AgaveNerdFont-16' -nf '#4abaaf' -nb '#1f2335' -sb '#7aa2f7' -sf '#102030' -fn 'AgaveNerdFont-16'
) )
[ -z "$choice" ] && exit 0 [ -z "$choice" ] && exit 0
fish -c "$choice" >/dev/null 2>&1 & if [[ -v "aliases[$choice]" ]]; then
eval "${aliases[$choice]}" >/dev/null 2>&1 &
else
"$choice" >/dev/null 2>&1 &
fi
disown disown
+3
View File
@@ -1,5 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
xset s off
xset -dpms
xsetroot -cursor_name left_ptr xsetroot -cursor_name left_ptr
setxkbmap us setxkbmap us
+4 -5
View File
@@ -8,9 +8,9 @@
vimAlias = true; vimAlias = true;
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.vimPlugins; [
nvim-notify
gitsigns-nvim gitsigns-nvim
mini-pairs mini-pairs
mini-surround
rainbow-delimiters-nvim rainbow-delimiters-nvim
neo-tree-nvim neo-tree-nvim
lualine-nvim lualine-nvim
@@ -27,7 +27,7 @@
(pkgs.vimUtils.buildVimPlugin { (pkgs.vimUtils.buildVimPlugin {
name = "PicVim"; name = "PicVim";
src = builtins.fetchGit { src = fetchGit {
url = "https://github.com/SyedM-dev/PicVim"; url = "https://github.com/SyedM-dev/PicVim";
rev = "5114853ed8f24661e48b726135bf78860d9339d5"; rev = "5114853ed8f24661e48b726135bf78860d9339d5";
}; };
@@ -43,9 +43,8 @@
]; ];
extraPackages = with pkgs; [ extraPackages = with pkgs; [
lua-language-server nixd
clang-tools nixfmt
stylua
]; ];
}; };
+1
View File
@@ -1,3 +1,4 @@
require("formatting")
require("extra") require("extra")
require("keymaps") require("keymaps")
require("lsp") require("lsp")
+11
View File
@@ -0,0 +1,11 @@
require("conform").setup({
formatters_by_ft = {
lua = { "stylua" },
nix = { "nixfmt" },
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
})
+11 -16
View File
@@ -5,24 +5,19 @@ vim.lsp.config("lua_ls", {
capabilities = capabilities, capabilities = capabilities,
settings = { settings = {
Lua = { Lua = {
diagnostics = { diagnostics = { globals = { "vim" } },
globals = { workspace = { library = vim.api.nvim_get_runtime_file("", true) },
"vim", telemetry = { enable = false },
},
},
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
},
telemetry = {
enable = false,
},
}, },
}, },
}) })
vim.lsp.config("clangd", { local servers = { "clangd", "solargraph", "hls", "nixd" }
capabilities = capabilities,
})
vim.lsp.enable("lua_ls") for _, server in ipairs(servers) do
vim.lsp.enable("clangd") vim.lsp.config(server, { capabilities = capabilities })
end
vim.list_extend(servers, { "lua_ls" })
vim.lsp.enable(servers)
+6 -13
View File
@@ -1,12 +1,16 @@
-- Plugins -- Plugins
require("picvim").setup({}) require("picvim").setup({})
require("notify").setup({})
require("gitsigns").setup({}) require("gitsigns").setup({})
require("mini.pairs").setup({}) require("mini.pairs").setup({})
require("mini.surround").setup({
mappings = {
add = "s",
},
})
require("rainbow-delimiters.setup").setup({}) require("rainbow-delimiters.setup").setup({})
require("neo-tree").setup({ require("neo-tree").setup({
@@ -56,17 +60,6 @@ require("nvim-cursorline").setup({
}, },
}) })
require("conform").setup({
formatters_by_ft = {
lua = { "stylua" },
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
})
local cmp = require("cmp") local cmp = require("cmp")
cmp.setup({ cmp.setup({
window = { window = {
-42
View File
@@ -1,42 +0,0 @@
# General settings
fading = true;
vsync = true;
backend = "glx";
fade-delta = 4;
inactive-opacity = 0.9;
# Window corner radius
corner-radius = 7.0;
round-borders = 1;
# Blur settings
blur-method = "gaussian";
blur-size = 7;
blur-deviation = 3;
# Opacity rules
opacity-rule = [
"100:class_g = 'Polybar'"
];
# Exclusions for corner radius
corner-radius-exclude = [
"class_g = 'Dunst'",
"class_i = 'Dunst'",
"name = 'Dunst'",
"class_i = 'dmenu'",
"class_g = 'dmenu'",
"name - 'dmenu'"
];
# Exclusions for background blur
blur-background-exclude = [
"class_g ~= 'slop'",
"class_i ~= 'slop'",
"name ~= 'slop'",
"window_type = 'menu'",
"window_type = 'tooltip'",
"role = 'xborder'",
"window_type = 'popup_menu'",
"window_type = 'dropdown_menu'"
];
+13
View File
@@ -0,0 +1,13 @@
{ ... }:
{
imports = [
./fish
./eza
];
home.username = "root";
home.homeDirectory = "/root";
home.stateVersion = "26.05";
}
+23
View File
@@ -0,0 +1,23 @@
{ ... }:
{
imports = [
./battery
./dunst
./kitty
./kutu
./picom
./rofi
];
xsession = {
enable = true;
windowManager.command = "kutu.rb";
};
home.file.".xinitrc".text = ''
if [ -f ~/.xsession ]; then
exec ~/.xsession
fi
'';
}
+2 -2
View File
@@ -1,4 +1,4 @@
{pkgs, ...}: { pkgs, ... }:
let let
tkn-repo = pkgs.fetchFromGitHub { tkn-repo = pkgs.fetchFromGitHub {
@@ -43,6 +43,6 @@ in
require("git"):setup { require("git"):setup {
order = 1500, order = 1500,
} }
''; '';
}; };
} }
+22 -7
View File
@@ -1,10 +1,16 @@
{ config, lib, pkgs, ... }: {
config,
pkgs,
...
}:
{ {
imports = imports = [
[ ../modules/secrets
../modules/secrets ];
];
boot.resumeDevice =
if config.swapDevices != [ ] then (builtins.head config.swapDevices).device else null;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
@@ -34,14 +40,21 @@
useXkbConfig = true; useXkbConfig = true;
}; };
users.users.root.shell = pkgs.fish;
users.users.me = { users.users.me = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.fish; shell = pkgs.fish;
extraGroups = [ "wheel" "video" "networkmanager" "input" ]; extraGroups = [
"wheel"
"video"
"networkmanager"
"input"
];
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMPFh01e9doyInt0980V8T4xaakcSaOyXaxxYE4+oSwM me@syedm # server" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMPFh01e9doyInt0980V8T4xaakcSaOyXaxxYE4+oSwM me@syedm # server"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJFUwk54CNtSLUyXSTLsIs5KXgEsjOgE4HGlA4FacKjV me@tardis # msi laptop" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJFUwk54CNtSLUyXSTLsIs5KXgEsjOgE4HGlA4FacKjV me@tardis # msi laptop"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILMeU7L0yQ4+O1GME4D4UM4f6nqua+pWt/zdsMvyHV94 u0_a309@localhost # mobile" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC13WMc8GJE3lB1YJ6MtYW7PLqfT9H0uGz76pQBDxIzz me@might # mobile"
]; ];
}; };
@@ -53,6 +66,8 @@
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
neovim
gitui
libinput libinput
gnupg gnupg
age age
+27 -11
View File
@@ -1,18 +1,23 @@
{ config, lib, pkgs, ... }: { ... }:
{ {
imports = imports = [
[ ./hardware-configuration.nix
./hardware-configuration.nix
../../modules/cloudflare-ddns ../../modules/cloudflare-ddns
../../modules/gitea ../../modules/gitea
../../modules/msjd.nix ../../modules/msjd
]; ];
networking.hostName = "syedm"; networking.hostName = "syedm";
services.openssh.enable = true; services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
services.caddy = { services.caddy = {
enable = true; enable = true;
@@ -27,6 +32,17 @@
''; '';
}; };
networking.firewall.allowedTCPPorts = [ 22 80 443 ]; networking = {
networking.firewall.allowedUDPPorts = []; tempAddresses = "disabled";
firewall = {
enable = true;
allowedTCPPorts = [
22
80
443
];
allowedUDPPorts = [ ];
allowPing = true;
};
};
} }
+32 -17
View File
@@ -1,29 +1,44 @@
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [
[ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"sd_mod"
"sdhci_pci"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/c5fedde6-79d4-4a44-92e4-2aa764553875"; device = "/dev/disk/by-uuid/c5fedde6-79d4-4a44-92e4-2aa764553875";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/510C-E000"; device = "/dev/disk/by-uuid/510C-E000";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ]; options = [
}; "fmask=0077"
"dmask=0077"
swapDevices =
[ { device = "/dev/disk/by-uuid/712d25ef-146d-4c66-b6d4-1b64491a974e"; }
]; ];
};
swapDevices = [
{ device = "/dev/disk/by-uuid/712d25ef-146d-4c66-b6d4-1b64491a974e"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+31 -82
View File
@@ -1,46 +1,39 @@
{ config, lib, pkgs, inputs, ... }: {
kutu,
lib,
pkgs,
...
}:
{ {
imports = imports = [
[ ./hardware-configuration.nix
./hardware-configuration.nix
];
boot.blacklistedKernelModules = [ ../../modules/ollama
"nouveau" ../../modules/workstation/graphics.nix
../../modules/workstation/audio.nix
../../modules/workstation/xserver.nix
../../modules/workstation/keyd.nix
]; ];
boot.kernelParams = [ "video=efifb:1920x1080" ]; environment.systemPackages = lib.mkAfter (
with pkgs;
[
firefox
xdg-utils
dmenu
pulseaudio
brightnessctl
maim
xclip
xsel
lunar-client
jdk21
spotify
boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ]; kutu.packages.${stdenv.hostPlatform.system}.default
]
hardware.graphics.enable = true; );
hardware.nvidia = {
modesetting.enable = true;
open = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
intelBusId = "PCI:0@0:2:0";
nvidiaBusId = "PCI:1@0:0:0";
};
};
environment.systemPackages = lib.mkAfter (with pkgs; [
firefox
xdg-utils
dmenu
pulseaudio
brightnessctl
maim
xclip
xsel
inputs.kutu.packages.${stdenv.hostPlatform.system}.default
]);
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
nerd-fonts.hurmit nerd-fonts.hurmit
@@ -48,51 +41,7 @@
unifont unifont
]; ];
services.xserver = { programs.steam.enable = true;
enable = true;
displayManager.startx.enable = true;
videoDrivers = [ "nvidia" ];
xkb = {
layout = "us";
variant = "";
options = "terminate:ctrl_alt_bksp";
};
};
services.dbus.enable = true;
services.clipmenu.enable = true;
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
];
config.common.default = "*";
};
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
services.pulseaudio.enable = false;
services.power-profiles-daemon.enable = true;
services.keyd = {
enable = true;
keyboards.default = {
ids = [ "*" ];
settings.main = {
"leftmeta+leftshift+f23" = "rightcontrol";
};
};
};
networking.hostName = "tardis"; networking.hostName = "tardis";
} }
+29 -17
View File
@@ -1,29 +1,41 @@
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [
[ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "vmd" "nvme" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"vmd"
"nvme"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/29a53eeb-befc-4512-9255-e1c5f1cf55ae"; device = "/dev/disk/by-uuid/29a53eeb-befc-4512-9255-e1c5f1cf55ae";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/0951-B8D1"; device = "/dev/disk/by-uuid/0951-B8D1";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ]; options = [
}; "fmask=0077"
"dmask=0077"
swapDevices =
[ { device = "/dev/disk/by-uuid/659310da-4655-461e-a992-6e62d7a0362d"; }
]; ];
};
swapDevices = [
{ device = "/dev/disk/by-uuid/659310da-4655-461e-a992-6e62d7a0362d"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+91 -22
View File
@@ -2,32 +2,101 @@
source /run/secrets.env source /run/secrets.env
cache=/var/lib/cloudflare-ddns/old_ip log() {
IP=$(@curl@/bin/curl -s 'https://api.ipify.org') echo "$(date '+%Y-%m-%d %H:%M:%S') [cloudflare-ddns] $*"
}
log "Starting DDNS update"
cache_v4=/var/lib/cloudflare-ddns/old_ip_v4
cache_v6=/var/lib/cloudflare-ddns/old_ip_v6
IP_V4=$(@curl@/bin/curl -4 -s 'https://api.ipify.org')
IP_V6=$(@curl@/bin/curl -6 -s 'https://api6.ipify.org')
log "Detected IPv4: ${IP_V4:-none}"
log "Detected IPv6: ${IP_V6:-none}"
arr=("" "git." "www." "acs.") arr=("" "git." "www." "acs.")
if [[ -f "$cache" ]]; then if [[ -n "$IP_V4" ]]; then
old_ip=$(cat "$cache") old_ip_v4=$([[ -f "$cache_v4" ]] && cat "$cache_v4" || echo "")
else
old_ip=""
fi
if [[ "$IP" != "$old_ip" ]]; then log "Old IPv4: ${old_ip_v4:-none}"
for sub in "${arr[@]}"; do
RECORD_ID=$(@curl@/bin/curl -s -X GET \
"https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
| @jq@/bin/jq -r ".result[] | select(.name==\"${sub}syedm.dev\" and .type==\"A\") | .id")
if [ -n "$RECORD_ID" ]; then if [[ "$IP_V4" != "$old_ip_v4" ]]; then
@curl@/bin/curl -s -X PUT \ log "IPv4 changed, updating A records"
"https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$RECORD_ID" \
for sub in "${arr[@]}"; do
name="${sub}syedm.dev"
log "Checking A record for $name"
RECORD_ID=$(@curl@/bin/curl -s -X GET \
"https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" | @jq@/bin/jq \
-d "{\"type\":\"A\",\"name\":\"${sub}syedm.dev\",\"content\":\"$IP\",\"ttl\":3600,\"proxied\":false}" -r ".result[] | select(.name==\"${name}\" and .type==\"A\") | .id")
fi
done
echo "$IP" > "$cache" if [ -n "$RECORD_ID" ]; then
log "Updating $name -> $IP_V4"
@curl@/bin/curl -s -X PUT \
"https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$RECORD_ID" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"type\":\"A\",\"name\":\"$name\",\"content\":\"$IP_V4\",\"ttl\":3600,\"proxied\":false}"
log "Updated $name"
else
log "No A record found for $name"
fi
done
echo "$IP_V4" > "$cache_v4"
else
log "IPv4 unchanged"
fi
fi fi
if [[ -n "$IP_V6" ]]; then
old_ip_v6=$([[ -f "$cache_v6" ]] && cat "$cache_v6" || echo "")
log "Old IPv6: ${old_ip_v6:-none}"
if [[ "$IP_V6" != "$old_ip_v6" ]]; then
log "IPv6 changed, updating AAAA records"
for sub in "${arr[@]}"; do
name="${sub}syedm.dev"
log "Checking AAAA record for $name"
RECORD_ID=$(@curl@/bin/curl -s -X GET \
"https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" | @jq@/bin/jq \
-r ".result[] | select(.name==\"${name}\" and .type==\"AAAA\") | .id")
if [ -n "$RECORD_ID" ]; then
log "Updating $name -> $IP_V6"
@curl@/bin/curl -s -X PUT \
"https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$RECORD_ID" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"type\":\"AAAA\",\"name\":\"$name\",\"content\":\"$IP_V6\",\"ttl\":3600,\"proxied\":false}"
log "Updated $name"
else
log "No AAAA record found for $name"
fi
done
echo "$IP_V6" > "$cache_v6"
else
log "IPv6 unchanged"
fi
fi
log "DDNS update finished"
@@ -1,7 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
projectDir ="${config.users.users."me".home}/main/msjd"; msjd = "${config.users.users."me".home}/main/msjd";
in in
{ {
systemd.services.msjd = { systemd.services.msjd = {
@@ -10,8 +10,8 @@ in
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { serviceConfig = {
WorkingDirectory = projectDir; WorkingDirectory = msjd;
ExecStart = "${pkgs.nodejs}/bin/node index.mjs"; ExecStart = "${pkgs.nodejs}/bin/node ${msjd}/index.mjs";
User = "me"; User = "me";
Restart = "always"; Restart = "always";
@@ -21,6 +21,8 @@ in
"NODE_ENV=production" "NODE_ENV=production"
"PORT=3709" "PORT=3709"
]; ];
EnvironmentFile = "/run/secrets.env";
}; };
}; };
} }
+12
View File
@@ -0,0 +1,12 @@
{ pkgs, ... }:
{
services.ollama = {
enable = true;
package = pkgs.ollama-cuda;
loadModels = [ "deepseek-coder-v2:16b" "qwen3.5:9b" ];
environmentVariables = {
OLLAMA_KEEP_ALIVE = "20m";
};
};
}
Binary file not shown.
Binary file not shown.
+3
View File
@@ -12,6 +12,9 @@ case "${1:-}" in
gpg) gpg)
ENCRYPTED_FILE="$SCRIPT_DIR/gpg.age" ENCRYPTED_FILE="$SCRIPT_DIR/gpg.age"
;; ;;
data)
ENCRYPTED_FILE="$SCRIPT_DIR/data.age"
;;
*) *)
echo "Usage: $0 {env|gpg}" echo "Usage: $0 {env|gpg}"
exit 1 exit 1
+1
View File
@@ -1,2 +1,3 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMPFh01e9doyInt0980V8T4xaakcSaOyXaxxYE4+oSwM me@syedm ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMPFh01e9doyInt0980V8T4xaakcSaOyXaxxYE4+oSwM me@syedm
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJFUwk54CNtSLUyXSTLsIs5KXgEsjOgE4HGlA4FacKjV me@tardis ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJFUwk54CNtSLUyXSTLsIs5KXgEsjOgE4HGlA4FacKjV me@tardis
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC13WMc8GJE3lB1YJ6MtYW7PLqfT9H0uGz76pQBDxIzz me@might
+9 -6
View File
@@ -1,7 +1,10 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 ZK0gQw 9LrC4V6ibhKKKoE8Dtm+caoI2z6tT6oBnfNAl5qlcQ8 -> ssh-ed25519 ZK0gQw LFaoeASGNuaep1d8w4AAXK8/+ZAJ1mHWlpDXbdvy1kU
NWqFWrj49jp2e8our9rpYpHZZny8t4mKGogeRNMFCkk W41oJ2txqtPGWvu31mN/ePElPbXMhobfO8quLnJdaxA
-> ssh-ed25519 CjJArg bxVL+Is1oNN4QLRW24hPOpFFAhGmGyF611o3oASaJFk -> ssh-ed25519 CjJArg Y4Mzxv8xQVZkruFvv5PW/EuuIlw4OY5GyXpgL4U8oSU
K8a5oDyvQ4k0YeDBseS2/SmvPhu39LWyRuFkWi0gm2s 0BZUBHGccwRwmiX+kUSknxvFcVzU+08CNYDBOu672Nk
--- wjAuZMd2h4fvKfKtIdHmEYPO1sEC64tmU4uZarAK4io -> ssh-ed25519 XBr0gw c9NY4KTZ2mREDODdjQ6KcLTrjE8xmCUj8S0JWpIiAmM
Ô@àˆó,RîžÐÙ$øôG—8Š‘WÇì×®µ–žñ[ DuJ07/bgasnpQljzq5uK4XeEh+0dksOKKIhH0GK8c6A
--- cjrU8h3oY1Vn3XkrupPzTk0pY/VxMUXXeh8mnzmV6jg
´ˆÏ™Bé6Q9|8iô@;àíI{<™b‰¬xí ÊÂ^@Üè®ã·ãBáÛ$<L#àKÚe%Çþ|Š‘s^îÙØuñ$0iY)ˆUpŸu$Ø;R,.¢3Âðø@E©Ý h>¿è´ä˜M¡k£Ú¤šöNnh»xÖCà`!—}œŠV:Kˆ—ÐþEð˰B]Ëô£÷fô7íõ=¹²4×ç½yÖ-Åa…M#Þåi ý hÝŽÍÒÇR3½Âù½&ù¾’šä¨[G#B?Ñ&òuš7HV©ÁX°M;^Iìj\EŒt¨ÿ2»û¢×8ÀÃ6Ôo [A°Ã‹Ñ› }Nž QèH+±ÄÂ9ÿ+é×”Rs
Ôª€AbJy»á(wìîÍ̧ÎJ¬]gÄ
+17
View File
@@ -0,0 +1,17 @@
{ ... }:
{
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
services.pulseaudio.enable = false;
services.power-profiles-daemon.enable = true;
}
+35
View File
@@ -0,0 +1,35 @@
{ config, pkgs, ... }:
{
boot.blacklistedKernelModules = [ "nouveau" ];
# This version is being hardcoded here so that we dont follow nixos-unstable if it updates beyond what the nvidia driver supports.
boot.kernelPackages = pkgs.linuxPackages_6_18;
boot.kernelParams = [
"mem_sleep_default=deep"
"video=efifb:1920x1080"
];
hardware.graphics = {
enable = true;
enable32Bit = true;
};
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
# This nvidia version is used as any version later than this fail to suspend by hanging the system.
# This seems to stem from certain hardware issues with my msi laptop motherboard.
package = config.boot.kernelPackages.nvidiaPackages.legacy_580;
open = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
intelBusId = "PCI:0@0:2:0";
nvidiaBusId = "PCI:1@0:0:0";
};
};
}
+13
View File
@@ -0,0 +1,13 @@
{ ... }:
{
services.keyd = {
enable = true;
keyboards.default = {
ids = [ "*" ];
settings.main = {
"leftmeta+leftshift+f23" = "rightcontrol";
};
};
};
}
+25
View File
@@ -0,0 +1,25 @@
{ config, pkgs, ... }:
{
services.xserver = {
enable = true;
displayManager.startx.enable = true;
videoDrivers = [ "nvidia" ];
xkb = {
layout = "us";
variant = "";
options = "terminate:ctrl_alt_bksp";
};
};
services.dbus.enable = true;
services.clipmenu.enable = true;
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
];
config.common.default = "*";
};
}