Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2026-01-01 17:15:04 +01:00
parent 1b0eb2f7bf
commit 8e6270ca34
72 changed files with 1245 additions and 2252 deletions

View File

@@ -1,12 +0,0 @@
# Alacritty is a fast, cross-platform, OpenGL terminal emulator.
{
programs.alacritty = {
enable = true;
settings = {
window.padding = {
x = 10;
y = 10;
};
};
};
}

View File

@@ -1,6 +1,6 @@
# This file is used to sign git commits using an SSH key.
{
# Obviously, change this to your own SSH key.
# CHANGEME: change this to your own SSH key.
home.file.".ssh/allowed_signers".text = "* ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIINhWby7lUUXQNKbRu9/UOrGjWDf3fvoAwGHomWv/+lL";
programs.git.settings = {

View File

@@ -0,0 +1,15 @@
{
pkgs,
inputs,
...
}: {
home.packages = with pkgs; [
wireshark
nmap
john
hashcat
inputs.eleakxir.packages.${stdenv.hostPlatform.system}.leak-utils
caido
nuclei
];
}

View File

@@ -1,97 +0,0 @@
# Kitty is a fast, featureful, GPU based terminal emulator
{
programs.kitty = {
enable = true;
keybindings = {
"ctrl+shift+tab" = "new_tab_with_cwd";
"ctrl+shift+enter" = "new_window_with_cwd";
"ctrl+j" = ''kitten pass_keys.py bottom ctrl+j'';
"ctrl+k" = ''kitten pass_keys.py top ctrl+k'';
"ctrl+h" = ''kitten pass_keys.py left ctrl+h'';
"ctrl+l" = ''kitten pass_keys.py right ctrl+l'';
};
settings = {
scrollback_lines = 10000;
initial_window_width = 1200;
initial_window_height = 600;
update_check_interval = 0;
enable_audio_bell = false;
confirm_os_window_close = "0";
remember_window_size = "no";
disable_ligatures = "never";
url_style = "curly";
copy_on_select = "clipboard";
cursor_shape = "Underline";
cursor_underline_thickness = 3;
cursor_trail = 3;
cursor_trail_decay = "0.1 0.4";
window_padding_width = 10;
open_url_with = "default";
allow_remote_control = "yes";
listen_on = "unix:/tmp/mykitty";
};
};
xdg.configFile = {
"kitty/pass_keys.py".text = ''
import re
from kittens.tui.handler import result_handler
from kitty.key_encoding import KeyEvent, parse_shortcut
def is_window_vim(window, vim_id):
fp = window.child.foreground_processes
return any(re.search(vim_id, p['cmdline'][0] if len(p['cmdline']) else "", re.I) for p in fp)
def encode_key_mapping(window, key_mapping):
mods, key = parse_shortcut(key_mapping)
event = KeyEvent(
mods=mods,
key=key,
shift=bool(mods & 1),
alt=bool(mods & 2),
ctrl=bool(mods & 4),
super=bool(mods & 8),
hyper=bool(mods & 16),
meta=bool(mods & 32),
).as_window_system_event()
return window.encoded_key(event)
def main():
pass
@result_handler(no_ui=True)
def handle_result(args, result, target_window_id, boss):
direction = args[1]
key_mapping = args[2]
vim_id = args[3] if len(args) > 3 else "n?vim"
window = boss.window_id_map.get(target_window_id)
if window is None:
return
if is_window_vim(window, vim_id):
for keymap in key_mapping.split(">"):
encoded = encode_key_mapping(window, keymap)
window.write_to_child(encoded)
else:
boss.active_tab.neighboring_window(direction)
'';
"kitty/neighboring_window.py".text = ''
def main():
pass
def handle_result(args, result, target_window_id, boss):
return boss.active_tab.current_layout.name
handle_result.no_ui = True
'';
};
}

View File

@@ -0,0 +1,19 @@
{pkgs, ...}: let
nightshift-toggle =
pkgs.writeShellScriptBin "nightshift-toggle"
# bash
''
if pidof "hyprsunset"; then
pkill hyprsunset
${pkgs.libnotify}/bin/notify-send "Night Shift Disabled" "Returning to full spectrum light. Filter disabled."
else
${pkgs.hyprsunset}/bin/hyprsunset -t 4500 &
${pkgs.libnotify}/bin/notify-send "Night Shift Activated" "Welcome to the warm side. Blue light filtering is now active."
fi
'';
in {
home.packages = with pkgs; [
hyprsunset
nightshift-toggle
];
}

View File

@@ -0,0 +1,77 @@
# - ## Nixy
#-
#- Nixy is a simple script that I use to manage my NixOS system. It's a simple script that provides a menu to rebuild, test, update, collect garbage, clean boot menu, etc.
#-
#- - `nixy` - UI wizard to manage the system.
#- - `nixy rebuild` - Rebuild the system.
#- - `nixy ...` - ... see the script for more commands.
{ pkgs, config, ... }:
let
configDirectory = config.var.configDirectory;
nixy = pkgs.writeShellScriptBin "nixy"
# bash
''
function exec() {
$@
}
function ui(){
DEFAULT_ICON="󰘳"
# "icon;name;command"[]
apps=(
"󰑓;Rebuild;nixy rebuild"
"󰐊;Test;nixy test"
"󰚰;Update;nixy update"
";Collect Garbage;nixy gc"
"󰍜;Clean Boot Menu;nixy cb"
";List generation;nixy listgen"
"󰌌;Hyprland Keybindings;nvim ${configDirectory}/docs/KEYBINDINGS-HYPRLAND.md"
"󰋩;Wallpapers;zen https://github.com/anotherhadi/nixy-wallpapers"
)
# Apply default icons if empty:
for i in "''${!apps[@]}"; do
apps[i]=$(echo "''${apps[i]}" | sed 's/^;/'$DEFAULT_ICON';/')
done
fzf_result=$(printf "%s\n" "''${apps[@]}" | awk -F ';' '{print $1" "$2}' | fzf)
[[ -z $fzf_result ]] && exit 0
fzf_result=''${fzf_result/ /;}
line=$(printf "%s\n" "''${apps[@]}" | grep "$fzf_result")
command=$(echo "$line" | sed 's/^[^;]*;//;s/^[^;]*;//')
exec "$command"
exit $?
}
[[ $1 == "" ]] && ui
if [[ $1 == "rebuild" ]];then
cd ${configDirectory} && git add . && sudo nixos-rebuild switch --flake
elif [[ $1 == "test" ]];then
cd ${configDirectory} && git add . && sudo nixos-rebuild test --flake
elif [[ $1 == "update" ]];then
cd ${configDirectory} && nix flake update
elif [[ $1 == "gc" ]];then
echo "Starting Nix garbage collection..."
cd ${configDirectory} && \
echo "Cleaning up system garbage..." && \
sudo nix-collect-garbage -d && \
echo "Cleaning up user garbage..." && \
nix-collect-garbage -d && \
echo "Collecting garbage from Nix store..." && \
nix-store --gc && \
echo "Optimizing Nix store..." && \
nix-store --optimise
echo "Nix garbage collection complete."
elif [[ $1 == "cb" ]];then
sudo /run/current-system/bin/switch-to-configuration boot
elif [[ $1 == "listgen" ]];then
sudo nix-env -p /nix/var/nix/profiles/system --list-generations
else
echo "Unknown argument"
fi
'';
in { home.packages = [ nixy ]; }

View File

@@ -91,7 +91,7 @@
go.enable = true;
markdown = {
enable = true;
format.type = "prettierd";
format.type = ["prettierd"];
extensions = {
markview-nvim = {
enable = true;

View File

@@ -0,0 +1,19 @@
{pkgs, ...}: {
home.packages = with pkgs; [
protonvpn-gui
proton-pass
proton-authenticator
];
# Fix Proton Authenticator desktop entry
xdg.desktopEntries = {
"Proton Authenticator" = {
name = "Proton Authenticator";
exec = "env WEBKIT_DISABLE_COMPOSITING_MODE=1 ${pkgs.proton-authenticator}/bin/proton-authenticator";
icon = "proton-authenticator";
type = "Application";
categories = ["Utility"];
terminal = false;
};
};
}

View File

@@ -1,7 +0,0 @@
# Tailscale is a VPN service that works on top of WireGuard.
# It allows me to access my servers and devices from anywhere.
{inputs, ...}: {
home.packages = with inputs.nixpkgs-stable.legacyPackages.x86_64-linux; [tailscale tailscale-systray];
# wayland.windowManager.hyprland.settings.exec-once = ["${pkgs.tailscale-systray}/bin/tailscale-systray"];
}

View File

@@ -73,26 +73,25 @@ in {
'';
home.file.".config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml".text = ''
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.1" encoding="UTF-8"?>
<channel name="thunar" version="1.0">
<property name="last-view" type="string" value="ThunarIconView"/>
<property name="last-icon-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_100_PERCENT"/>
<property name="last-window-maximized" type="bool" value="true"/>
<property name="last-separator-position" type="int" value="170"/>
<property name="last-separator-position" type="int" value="230"/>
<property name="last-statusbar-visible" type="bool" value="false"/>
<property name="last-menubar-visible" type="bool" value="false"/>
<property name="misc-single-click" type="bool" value="false"/>
<property name="shortcuts-icon-emblems" type="bool" value="true"/>
<property name="tree-icon-emblems" type="bool" value="true"/>
<property name="misc-file-size-binary" type="bool" value="true"/>
<property name="misc-thumbnail-draw-frames" type="bool" value="false"/>
<property name="misc-text-beside-icons" type="bool" value="true"/>
<property name="misc-change-window-icon" type="bool" value="true"/>
<property name="misc-file-size-binary" type="bool" value="false"/>
<property name="misc-thumbnail-draw-frames" type="bool" value="true"/>
<property name="misc-text-beside-icons" type="bool" value="false"/>
<property name="misc-change-window-icon" type="bool" value="false"/>
<property name="hidden-bookmarks" type="array">
<value type="string" value="computer:///"/>
<value type="string" value="recent:///"/>
<value type="string" value="file:///"/>
<value type="string" value="network:///"/>
</property>
<property name="hidden-devices" type="array">
@@ -103,35 +102,60 @@ in {
<property name="last-location-bar" type="string" value="ThunarLocationButtons"/>
<property name="last-show-hidden" type="bool" value="false"/>
<property name="last-details-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_38_PERCENT"/>
<property name="last-details-view-column-widths" type="string" value="50,50,127,50,50,50,50,50,751,50,50,75,50,145"/>
<property name="last-toolbar-items" type="string" value="menu:1,back:1,forward:0,open-parent:0,open-home:0,undo:0,redo:0,zoom-in:0,zoom-out:0,zoom-reset:0,view-as-icons:0,view-as-detailed-list:0,view-as-compact-list:0,toggle-split-view:0,location-bar:1,reload:0,search:1,uca-action-1710183590071525-1:0,new-tab:0,new-window:0,view-switcher:0"/>
<property name="last-details-view-column-widths" type="string" value="50,50,118,111,50,50,50,50,993,50,50,84,50,151"/>
<property name="last-toolbar-items" type="string" value="menu:1,undo:1,back:1,forward:1,open-parent:0,open-home:0,redo:0,zoom-in:0,zoom-out:0,zoom-reset:0,location-bar:1,view-switcher:1,search:1,view-as-icons:0,view-as-detailed-list:0,view-as-compact-list:0,toggle-split-view:0,reload:0,new-tab:0,new-window:0,uca-action-1700000000000001:0"/>
<property name="last-side-pane" type="string" value="THUNAR_SIDEPANE_TYPE_SHORTCUTS"/>
<property name="last-image-preview-visible" type="bool" value="false"/>
<property name="misc-use-csd" type="bool" value="true"/>
<property name="default-view" type="string" value="ThunarIconView"/>
<property name="misc-thumbnail-max-file-size" type="uint64" value="1073741824"/>
<property name="misc-symbolic-icons-in-toolbar" type="bool" value="true"/>
<property name="misc-date-style" type="string" value="THUNAR_DATE_STYLE_SIMPLE"/>
<property name="shortcuts-icon-size" type="string" value="THUNAR_ICON_SIZE_16"/>
<property name="tree-icon-size" type="string" value="THUNAR_ICON_SIZE_16"/>
<property name="misc-symbolic-icons-in-sidepane" type="bool" value="true"/>
<property name="misc-open-new-window-as-tab" type="bool" value="false"/>
<property name="misc-full-path-in-tab-title" type="bool" value="true"/>
<property name="misc-show-delete-action" type="bool" value="false"/>
</channel>
'';
xdg.configFile."Thunar/uca.xml".text = ''
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<icon>utilities-terminal</icon>
<name>Open Terminal Here</name>
<unique-id>1700000000000001</unique-id>
<command>kitty -d %f</command>
<description>Opens Kitty terminal in the selected folder</description>
<patterns>*</patterns>
<startup-notify/>
<directories/>
</action>
<action>
<icon></icon>
<name>Extract here</name>
<action>
<icon>utilities-terminal</icon>
<name>Open Terminal Here</name>
<unique-id>1700000000000001</unique-id>
<command>kitty -d %f</command>
<description>Opens Kitty terminal in the selected folder</description>
<patterns>*</patterns>
<startup-notify/>
<directories/>
</action>
<action>
<icon></icon>
<name>Extract here</name>
<submenu></submenu>
<unique-id>1689618425925956-3</unique-id>
<command>xarchiver -x . %f</command>
<description>Extracts the archive into the directory it is located in.</description>
<range>*</range>
<patterns>*.tar.bz2;*.tar.gz;*.tar.xz;*.tar.Z;*.tar;*.taz;*.tb2;*.tbz;*.tbz2;*.tgz;*.txz;*.zip;*.bz2;*.docx;*.apk;*.gz;*.odt;</patterns>
<other-files/>
</action>
<action>
<icon>package-x-generic</icon>
<name>Compress here (tar.gz)</name>
<submenu></submenu>
<unique-id>1689618425925956-3</unique-id>
<command>xarchiver -x . %f</command>
<description>Extracts the archive into the directory it is located in.</description>
<unique-id>1700000000000003</unique-id>
<command>tar -czvf %n.tar.gz %N</command>
<description>Creates a compressed archive (.tar.gz) of selected files/folders.</description>
<range>*</range>
<patterns>*.tar.bz2;*.tar.gz;*.tar.xz;*.tar.Z;*.tar;*.taz;*.tb2;*.tbz;*.tbz2;*.tgz;*.txz;*.zip;*.bz2;*.docx;*.apk;*.gz;*.odt;</patterns>
<patterns>*</patterns>
<directories/>
<other-files/>
</action>
</action>
</actions>
'';
}

View File

@@ -0,0 +1,12 @@
{pkgs, ...}: {
programs.vivaldi = {
enable = true;
commandLineArgs = [
"--no-default-browser-check"
];
};
home.sessionVariables = {
DEFAULT_BROWSER = "${pkgs.vivaldi}/bin/vivaldi";
};
}

View File

@@ -0,0 +1,15 @@
# TODO: Misc section with VLC, Zathura etc
# Zathura is a PDF viewer
{
programs.zathura = {
enable = true;
options = {
guioptions = "v";
adjust-open = "width";
statusbar-basename = true;
render-loading = false;
scroll-step = 120;
};
};
}