daily configuration optimization

Fix
- airplay: systemd wantedBy target
- fcitx5: remove redundant systemd service

Remove
- move scripts into configuration

Style
- ghostty: add more transparency to background

Add
- zellij
This commit is contained in:
danny 2025-08-27 22:38:40 +08:00
parent 44c152fdc9
commit 9c9acc3494
24 changed files with 941 additions and 856 deletions

120
flake.lock generated
View file

@ -644,11 +644,11 @@
"zon2nix": "zon2nix"
},
"locked": {
"lastModified": 1755815920,
"narHash": "sha256-LjARhUOGVN4uY4TSswomsyeiNDeeKf/AedP0Hc/IEtc=",
"lastModified": 1756057928,
"narHash": "sha256-JHP75eqmFxMWkdiR97qgwsP17kUS7jownP/NMDfIH1Y=",
"owner": "ghostty-org",
"repo": "ghostty",
"rev": "298f11166d4762741dd84fb48c8f96a09d0fb326",
"rev": "400576f0b0dcb7743c9a11cc07ba831cc29f057a",
"type": "github"
},
"original": {
@ -948,7 +948,7 @@
"hyprlang": "hyprlang",
"hyprutils": "hyprutils",
"hyprwayland-scanner": "hyprwayland-scanner",
"nixpkgs": "nixpkgs_2",
"nixpkgs": "nixpkgs_3",
"pre-commit-hooks": "pre-commit-hooks",
"systems": "systems_5",
"xdph": "xdph"
@ -1397,7 +1397,7 @@
"git-hooks": "git-hooks",
"hercules-ci-effects": "hercules-ci-effects",
"neovim-src": "neovim-src",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_4",
"treefmt-nix": "treefmt-nix"
},
"locked": {
@ -1477,7 +1477,7 @@
"inputs": {
"flake-compat": "flake-compat_7",
"flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_4"
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1755137329,
@ -1495,7 +1495,7 @@
},
"nix-tmodloader": {
"inputs": {
"nixpkgs": "nixpkgs_5"
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1734377184,
@ -1559,6 +1559,22 @@
}
},
"nixpkgs_10": {
"locked": {
"lastModified": 1752596105,
"narHash": "sha256-lFNVsu/mHLq3q11MuGkMhUUoSXEdQjCHvpReaGP1S2k=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dab3a6e781554f965bde3def0aa2fda4eb8f1708",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_11": {
"locked": {
"lastModified": 1727348695,
"narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=",
@ -1575,6 +1591,19 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1755972213,
"narHash": "sha256-VYK7aDAv8H1enXn1ECRHmGbeY6RqLnNwUJkOwloIsko=",
"rev": "73e96df7cff5783f45e21342a75a1540c4eddce4",
"type": "tarball",
"url": "https://releases.nixos.org/nixos/unstable-small/nixos-25.11pre850642.73e96df7cff5/nixexprs.tar.xz"
},
"original": {
"type": "tarball",
"url": "https://channels.nixos.org/nixos-unstable-small/nixexprs.tar.xz"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1754725699,
"narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=",
@ -1590,7 +1619,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1754990257,
"narHash": "sha256-eEq2wlYNF2t89PsNyEv5Sz4lSxdukZCj4SdhZBVAGpI=",
@ -1606,7 +1635,7 @@
"type": "github"
}
},
"nixpkgs_4": {
"nixpkgs_5": {
"locked": {
"lastModified": 1748929857,
"narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=",
@ -1622,22 +1651,6 @@
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1755027561,
"narHash": "sha256-IVft239Bc8p8Dtvf7UAACMG5P3ZV+3/aO28gXpGtMXI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "005433b926e16227259a1843015b5b2b7f7d1fc3",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 1755027561,
@ -1655,6 +1668,22 @@
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1755027561,
"narHash": "sha256-IVft239Bc8p8Dtvf7UAACMG5P3ZV+3/aO28gXpGtMXI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "005433b926e16227259a1843015b5b2b7f7d1fc3",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_8": {
"locked": {
"lastModified": 1744868846,
"narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=",
@ -1670,7 +1699,7 @@
"type": "github"
}
},
"nixpkgs_8": {
"nixpkgs_9": {
"locked": {
"lastModified": 1753934836,
"narHash": "sha256-G06FmIBj0I5bMW1Q8hAEIl5N7IHMK7+Ta4KA+BmneDA=",
@ -1686,22 +1715,6 @@
"type": "github"
}
},
"nixpkgs_9": {
"locked": {
"lastModified": 1752596105,
"narHash": "sha256-lFNVsu/mHLq3q11MuGkMhUUoSXEdQjCHvpReaGP1S2k=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dab3a6e781554f965bde3def0aa2fda4eb8f1708",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nur": {
"inputs": {
"flake-parts": [
@ -1819,7 +1832,7 @@
"nix-index-database": "nix-index-database",
"nix-minecraft": "nix-minecraft",
"nix-tmodloader": "nix-tmodloader",
"nixpkgs": "nixpkgs_6",
"nixpkgs": "nixpkgs_7",
"sops-nix": "sops-nix",
"stylix": "stylix",
"swww": "swww",
@ -1913,7 +1926,7 @@
},
"sops-nix": {
"inputs": {
"nixpkgs": "nixpkgs_7"
"nixpkgs": "nixpkgs_8"
},
"locked": {
"lastModified": 1754988908,
@ -1982,7 +1995,7 @@
"swww": {
"inputs": {
"flake-compat": "flake-compat_8",
"nixpkgs": "nixpkgs_8",
"nixpkgs": "nixpkgs_9",
"rust-overlay": "rust-overlay_3"
},
"locked": {
@ -2310,7 +2323,7 @@
"yazi": {
"inputs": {
"flake-utils": "flake-utils_6",
"nixpkgs": "nixpkgs_9",
"nixpkgs": "nixpkgs_10",
"rust-overlay": "rust-overlay_4"
},
"locked": {
@ -2329,7 +2342,7 @@
},
"zen-browser": {
"inputs": {
"nixpkgs": "nixpkgs_10"
"nixpkgs": "nixpkgs_11"
},
"locked": {
"lastModified": 1755788000,
@ -2380,23 +2393,20 @@
"ghostty",
"flake-utils"
],
"nixpkgs": [
"ghostty",
"nixpkgs"
]
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1742104771,
"narHash": "sha256-LhidlyEA9MP8jGe1rEnyjGFCzLLgCdDpYeWggibayr0=",
"lastModified": 1756000480,
"narHash": "sha256-fR5pdcjO0II5MNdCzqvyokyuFkmff7/FyBAjUS6sMfA=",
"owner": "jcollie",
"repo": "zon2nix",
"rev": "56c159be489cc6c0e73c3930bd908ddc6fe89613",
"rev": "d9dc9ef1ab9ae45b5c9d80c6a747cc9968ee0c60",
"type": "github"
},
"original": {
"owner": "jcollie",
"repo": "zon2nix",
"rev": "56c159be489cc6c0e73c3930bd908ddc6fe89613",
"rev": "d9dc9ef1ab9ae45b5c9d80c6a747cc9968ee0c60",
"type": "github"
}
}

View file

@ -22,7 +22,6 @@
};
ghostty = {
# url = "github:ghostty-org/ghostty?rev=7f9bb3c0e54f585e11259bc0c9064813d061929c";
url = "github:ghostty-org/ghostty";
inputs.nixpkgs.follows = "nixpkgs";
};
@ -134,6 +133,8 @@
inherit (pkgs) lib;
helper = import ./helper { inherit pkgs lib; };
# Declare COMMON modules here
common-settings = {
modules = [
@ -146,6 +147,7 @@
];
args = {
inherit
helper
inputs
system
nix-version
@ -266,6 +268,7 @@
useGlobalPkgs = true;
extraSpecialArgs = {
inherit
helper
inputs
system
nix-version
@ -411,7 +414,7 @@
lib.mapAttrs' (
name: value:
lib.nameValuePair name (
nixpkgs.lib.nixosSystem ({
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
inputs.microvm.nixosModules.microvm
@ -469,10 +472,20 @@
];
}
];
})
}
)
) vmList
);
)
// {
vps = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = common-settings.args;
modules = [
inputs.disko.nixosModules.disko
./system/dev/generic
];
};
};
packages."${system}" = {
vm-1 = self.nixosConfigurations.vm-1.config.microvm.declaredRunner;

46
helper/default.nix Normal file
View file

@ -0,0 +1,46 @@
{
pkgs,
lib,
}:
let
inherit (pkgs) writeShellScript;
inherit (lib) replaceString;
inherit (builtins) toJSON mapAttrs;
in
{
mkToggleScript =
{
service,
start,
stop,
icon ? "",
extra ? { },
}:
let
extraJson = replaceString "\"" "\\\"" (toJSON extra);
in
writeShellScript "${service}-toggle.sh" ''
SERVICE_NAME=${service}
EXTRA_JSON="${extraJson}"
case $1 in toggle)
if systemctl --user is-active --quiet "$SERVICE_NAME"; then
systemctl --user stop "$SERVICE_NAME"
notify-send "${icon} ''\${SERVICE_NAME^}" "stopping"
else
systemctl --user start "$SERVICE_NAME"
notify-send "${icon} ''\${SERVICE_NAME^}" "starting"
fi
esac
if systemctl --user is-active --quiet "$SERVICE_NAME"; then
json1=$(jq -nc --arg text "${icon} ''\${SERVICE_NAME^} starting" --arg class "${start}" \
'{text: $text, tooltip: $text, class: $class, alt: $class}')
else
json1=$(jq -nc --arg text "${icon} ''\${SERVICE_NAME^} stopped" --arg class "${stop}" \
'{text: $text, tooltip: $text, class: $class, alt: $class}')
fi
jq -nc --argjson a "$json1" --argjson b "$EXTRA_JSON" '$a + $b'
'';
}

View file

@ -56,4 +56,4 @@ vim.g.clipboard = {
-- (instead of interacting with the "+" and/or "*" registers explicitly):
vim.opt.clipboard = "unnamedplus"
vim.g.gruvbox_material_transparent_background = 2
vim.opt.spelllang = { "en", "cjk" }

View file

@ -1,22 +0,0 @@
#!/usr/bin/env bash
SERVICE="gamemode"
if [ "$1" = "toggle" ]; then
if systemctl --user is-active --quiet "$SERVICE"; then
systemctl --user stop "$SERVICE"
notify-send "󰊗 Gamemode" "off" >/dev/null 2>&1
else
systemctl --user start "$SERVICE"
notify-send "󰊗 Gamemode" "on" >/dev/null 2>&1
fi
exit 0
fi
if ! systemctl --user is-active --quiet "$SERVICE"; then
echo "{\"text\": \"inactive\", \"tooltip\": \"gamemoded is inactive\", \"alt\": \"inactive\", \"class\": \"inactive\"}"
exit 0
fi
echo "{\"text\": \"active\", \"tooltip\": \"gamemoded is running\", \"alt\": \"active\", \"class\": \"active\"}"
exit 0

View file

@ -1,24 +0,0 @@
#!/usr/bin/env bash
get_icons() {
local session_name="$1"
local result=""
local panes=($(tmux list-panes -t "$session_name" -F '#{pane_current_command}'))
for i in "${panes[@]}"; do
case "$i" in
nvim) result+=" " ;;
zsh | *) result+=" " ;;
esac
done
echo "$result"
}
if (($# != 1)); then
echo "Usage: $0 <session-name>"
exit 1
fi
get_icons "$1"

View file

@ -1,33 +0,0 @@
#!/usr/bin/env bash
#Taken from JaKoolit's dotfiles
bar="▁▂▃▄▅▆▇█"
dict="s/;//g"
bar_length=${#bar}
for ((i = 0; i < bar_length; i++)); do
dict+=";s/$i/${bar:$i:1}/g"
done
config_file="/tmp/bar_cava_config"
cat >"$config_file" <<EOF
[general]
bars = 10
[input]
method = pulse
source = auto
[output]
method = raw
raw_target = /dev/stdout
data_format = ascii
channels = mono
ascii_max_range = 7
EOF
pkill -f "cava -p $config_file"
cava -p "$config_file" | sed -u "$dict"

View file

@ -1,20 +0,0 @@
#!/usr/bin/env bash
INTERFACE="wg0"
if [ "$1" = "toggle" ]; then
if ip link show "$INTERFACE" >/dev/null 2>&1; then
pkexec systemctl stop wg-quick-wg0.service
else
pkexec systemctl start wg-quick-wg0.service
fi
exit 0
fi
if ! ip link show "$INTERFACE" >/dev/null 2>&1; then
echo "{\"text\": \"Not Connected\", \"tooltip\": \"WireGuard is down\", \"alt\": \"disconnected\", \"class\": \"disconnected\"}"
exit 0
fi
echo "{\"text\": \"Connected\", \"tooltip\": \"WireGuard connected\", \"alt\": \"connected\", \"class\": \"connected\"}"
exit 0

View file

@ -16,5 +16,6 @@
../user/virtualization.nix
../user/vscode.nix
../user/yazi.nix
../user/zellij.nix
];
}

View file

@ -5,6 +5,8 @@
let
record = pkgs.writeShellScript "toggle-wf-record" ''
PID_FILE="/tmp/wf-recorder.pid"
if [[ $1 = "toggle" ]]; then
OUTPUT_DIR="$HOME/Videos/recordings"
FILENAME="$OUTPUT_DIR/recording_$(date +%Y%m%d_%H%M%S).mp4"
SINK_DEV="$(${pkgs.pulseaudio.out}/bin/pactl get-default-sink).monitor"
@ -51,6 +53,13 @@ let
echo $! > "$PID_FILE"
echo "Started recording: $FILENAME"
fi
fi
if [ -f "$PID_FILE" ]; then
jq -nc --arg text "on" --arg class "on" '{text: $text, class: $class, alt: $class}'
else
jq -nc --arg text "off" --arg class "off" '{text: $text, class: $class, alt: $class}'
fi
'';
in
record

View file

@ -13,9 +13,9 @@ let
notransTag = "notrans";
browser-bin = "zen";
prefix = if nvidia-offload-enabled then "nvidia-offload" else "";
browser = "${prefix} ${browser-bin}";
terminal = "ghostty";
prefix = if nvidia-offload-enabled then "nvidia-offload " else "";
browser = "${prefix}${browser-bin}";
terminal = "${prefix}ghostty";
filemanager = "${terminal} -e yazi";
screenshotFolder = "--output-folder ~/Pictures/Screenshots";

View file

@ -36,8 +36,12 @@ in
"fullscreen, initialClass:^(cs2)$"
# Zen browser
"opacity 0.9999 override, initialClass:^(zen)(.*)"
# Ghostty
"opacity 0.9999 override, initialClass:^(com.mitchellh.ghostty)$"
# Picture in picture windows
"float, title:^(Picture-in-Picture)$"
"pin, title:^(Picture-in-Picture)$"
@ -53,10 +57,6 @@ in
"move ${right} 8%, class: ^(localsend_app)$"
"size 20% 80%, class: ^(localsend_app)$"
# Airplay
"move ${right} 10%, class: ^(GStreamer)$"
"size 21% 80%, class: ^(GStreamer)$"
# Bluetooth
"move ${right} ${top}, class: ^(blueberry.py)$"
"size 25% 45%, class: ^(blueberry.py)$"
@ -72,6 +72,8 @@ in
"animation slide right 20%, class: ^(localsend_app)$"
# Airplay
"move ${right} 10%, class: ^(GStreamer)$"
"size 21% 80%, class: ^(GStreamer)$"
"pin, class: ^(GStreamer)$"
"float, class: ^(GStreamer)$"
"opacity 1.0 override 1.0 override, class: ^(GStreamer)$"

View file

@ -12,7 +12,6 @@ let
fcitx5-rime # Bopomofo
rime-data
];
in
{
i18n = {
@ -33,27 +32,54 @@ in
MenuFont = lib.mkForce font;
TrayFont = lib.mkForce font;
};
inputMethod = {
GroupOrder."0" = "Default";
"Groups/0" = {
Name = "Default";
"Default Layout" = "us";
DefaultIM = "rime";
};
};
};
"Groups/0/Items/0".Name = "keyboard-us";
"Groups/0/Items/1".Name = "rime";
"Groups/0/Items/2".Name = "mozc";
};
systemd.user.services.fcitx5 = {
Unit = {
WantedBy = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
Description = "Fcitx5 Input Method";
globalOptions = {
Hotkey = {
EnumerateWithRiggerKeys = true;
EnumerateSkipFirst = false;
ModifierOnlyKeyTimeout = 250;
};
"Hotkey/TriggerKeys" = {
"0" = "Super+space";
};
"Hotkey/AltTriggerKeys" = {
"0" = "Shift_L";
};
"Hotkey/EnumerateGroupForwardKeys" = {
"0" = "Super+space";
};
"Hotkey/PrevPage" = {
"0" = "Up";
};
"Hotkey/NextPage" = {
"0" = "Down";
};
Behavior = {
ActiveByDefault = false;
resetStateWhenFocusIn = "no";
ShareInputState = "no";
PreeditEnabledByDefault = true;
ShowInputMethodInformation = true;
ShowInputMethodInformationWhenFocusIn = false;
CompactInputMethodInformation = true;
DefaultPageSize = 5;
PreloadInputMethod = true;
};
};
};
};
Service = {
Type = "simple";
Restart = "always";
RestartSec = 2;
ExecStart = "${pkgs.fcitx5}/bin/fcitx5";
Environment = [
"GTK_IM_MODULE="
"XMODIFIERS=@im=fcitx"
"QT_IM_MODULE=fcitx"
];
};
};
}

View file

@ -31,6 +31,8 @@
settings = {
unfocused-split-opacity = 0.85;
desktop-notifications = false;
background-opacity = 0.1;
background-blur = false;
wait-after-command = false;
shell-integration = "detect";

View file

@ -7,11 +7,52 @@
username,
lib,
pkgs,
helper,
...
}:
let
inherit (helper) mkToggleScript;
inherit (lib) optionalString;
gamemodeToggle = mkToggleScript {
service = "gamemoded";
start = "on";
stop = "off";
icon = "";
extra = {
text = "$(pgrep -c gamemode)";
tooltip = "Running: $(pgrep -c gamemode)";
};
};
airplayToggle = mkToggleScript {
service = "uxplay";
start = "on";
stop = "off";
icon = "󱖑";
};
wgToggle = pkgs.writeShellScript "wg-toggle" ''
INTERFACE="wg0"
if [ "$1" = "toggle" ]; then
if ip link show "$INTERFACE" >/dev/null 2>&1; then
pkexec systemctl stop wg-quick-wg0.service
else
pkexec systemctl start wg-quick-wg0.service
fi
exit 0
fi
if ! ip link show "$INTERFACE" >/dev/null 2>&1; then
echo "{\"text\": \"Not Connected\", \"tooltip\": \"WireGuard is down\", \"alt\": \"disconnected\", \"class\": \"disconnected\"}"
exit 0
fi
echo "{\"text\": \"Connected\", \"tooltip\": \"WireGuard connected\", \"alt\": \"connected\", \"class\": \"connected\"}"
exit 0
'';
mkWall = import ../scripts/mkWall.nix { inherit config pkgs; };
rofiWall = import ../scripts/rofiwall.nix { inherit config pkgs; };
@ -46,13 +87,6 @@ in
"d /tmp/wall_cache 700 ${username} -"
];
# === gamemode === #
systemd.user.services.gamemode = lib.mkIf osConfig.programs.gamemode.enable {
Service = {
ExecStart = "${pkgs.gamemode}/bin/gamemoded -r";
};
};
# === waybar === #
systemd.user.services.waybar = lib.mkIf config.programs.waybar.enable {
Unit = {
@ -61,7 +95,11 @@ in
};
};
programs.waybar = {
programs.waybar =
let
color = "#ebdbb2";
in
{
enable = true;
style =
let
@ -72,7 +110,7 @@ in
lib.mkForce
# css
''
@define-color main #ebdbb2;
@define-color main ${color};
@define-color bg-bg rgba(0, 0, 0, 0);
@define-color fg-bg alpha(#fff, 0.05);
@ -125,7 +163,7 @@ in
color: @main;
}
box.module, label.module, #gamemode {
box.module, label.module {
background: @fg-bg;
color: @main;
border-radius: ${borderRadius};
@ -133,11 +171,6 @@ in
padding: 0px 12px;
}
/* Gamemode center icon */
#gamemode {
padding-right: 6px;
}
box.module button:hover {
background: shade(@fg-bg, 1.5);
}
@ -415,7 +448,39 @@ in
];
};
"custom/cava" = {
exec = "~/.config/scripts/waybarCava.sh";
exec = "${pkgs.writeShellScript "cava-wave" ''
#Taken from JaKoolit's dotfiles
bar=""
dict="s/;//g"
bar_length=''\${#bar}
for ((i = 0; i < bar_length; i++)); do
dict+=";s/$i/''\${bar:$i:1}/g"
done
config_file="/tmp/bar_cava_config"
cat >"$config_file" <<EOF
[general]
bars = 10
[input]
method = pulse
source = auto
[output]
method = raw
raw_target = /dev/stdout
data_format = ascii
channels = mono
ascii_max_range = 7
EOF
pkill -f "cava -p $config_file"
cava -p "$config_file" | sed -u "$dict"
''}";
format = "{}";
on-click = "${terminalRun} cava";
};
@ -474,78 +539,58 @@ in
connected = "󰒘";
disconnected = "";
};
exec = "~/.config/scripts/wgStatus.sh";
exec = "${wgToggle}";
exec-if = "which wg-quick";
on-click = "~/.config/scripts/wgStatus.sh toggle";
on-click = "${wgToggle} toggle";
tooltip = true;
interval = 3;
return-type = "json";
escape = true;
};
gamemode = {
format = "{glyph}";
glyph = "";
hide-not-running = false;
use-icon = true;
icon-name = "input-gaming-symbolic";
icon-spacing = 4;
icon-size = 20;
"custom/gamemode" = {
format-icons = {
on = "󰊗";
off = "󰺷";
};
format = "{icon}<span foreground='${color}'><sub>{text}</sub></span>";
exec = "${gamemodeToggle}";
interval = 3;
tooltip = true;
tooltip-format = "Games running: {count}";
on-click-right = "systemctl is-active --quiet gamemode.service && systemctl stop gamemode.service || systemctl start gamemode.service";
return-type = "json";
escape = true;
on-click = "${gamemodeToggle} toggle";
};
"custom/wallRand" = {
format = "";
on-click = "${rofiWall}";
on-click-right = "${wallRand}";
};
"custom/airplay" =
let
toggleScript = pkgs.writeShellScript "airplayStatus" ''
SERVICE="uxplay"
ICON="󱖑"
if [ "$1" = "toggle" ]; then
if systemctl --user is-active --quiet "$SERVICE"; then
systemctl --user stop "$SERVICE"
notify-send "$ICON Airplay" "off" >/dev/null 2>&1
else
systemctl --user start "$SERVICE"
notify-send "$ICON Airplay" "on" >/dev/null 2>&1
fi
exit 0
fi
if ! systemctl --user is-active --quiet "$SERVICE"; then
echo "{\"text\": \"inactive\", \"tooltip\": \"airplay is inactive\", \"alt\": \"inactive\", \"class\": \"inactive\"}"
exit 0
fi
echo "{\"text\": \"active\", \"tooltip\": \"airplay is running\", \"alt\": \"active\", \"class\": \"active\"}"
exit 0
'';
in
{
"custom/airplay" = {
format = "{icon}";
format-icons = {
active = "󱖑";
inactive = "";
on = "󱖑";
off = "";
};
exec = toggleScript;
exec = "${airplayToggle}";
interval = 3;
tooltip = true;
return-type = "json";
escape = true;
on-click = "${toggleScript} toggle";
on-click = "${airplayToggle} toggle";
};
"custom/bitwarden" = {
format = "󰯄";
on-click = "${rbwSelector}";
};
"custom/recording" = {
exec = "[ -f \"/tmp/wf-recorder.pid\" ] && echo \"󰑋\" || echo \"\" ";
format = "{icon}";
format-icons = {
on = "󰑋";
off = "";
};
exec = "${toggleRecord}";
interval = 1;
on-click = "${toggleRecord}";
on-click = "${toggleRecord} toggle";
};
};
@ -559,7 +604,7 @@ in
];
modules-right = [
"wlr/taskbar"
(optionalString config.programs.gamemode.enable "gamemode")
(optionalString osConfig.programs.gamemode.enable "custom/gamemode")
"temperature"
"custom/recording"
"idle_inhibitor"

6
home/user/zellij.nix Normal file
View file

@ -0,0 +1,6 @@
{ ... }:
{
programs.zellij = {
enable = true;
};
}

View file

@ -23,6 +23,7 @@ in
"zen.view.compact.show-sidebar-and-toolbar-on-hover" = false;
"zen.tabs.vertical.right-side" = true;
"zen.urlbar.behavior" = "float";
"nebula-tab-loading-animation" = 0;
"app.update.auto" = false;
"app.normandy.first_run" = false;

View file

@ -6,6 +6,7 @@
...
}:
let
inherit (lib) optionalString;
monitors = [
"desc:ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271"
"desc:Acer Technologies XV272U V3 1322131231233"
@ -52,141 +53,9 @@ in
../../modules/davinci-resolve.nix
../../modules/webcam.nix
./nginx.nix
];
home-manager = {
users."${username}" = {
imports = [
../../../home/presets/basic.nix
# Bitwarden client
(import ../../../home/user/bitwarden.nix {
email = "danny@net.dn";
baseUrl = "https://bitwarden.net.dn";
})
# Proton Extra Versions
{
home.file.".steam/root/compatibilitytools.d/GE-Proton10-10" = {
source = fetchTarball {
url = "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton10-10/GE-Proton10-10.tar.gz";
sha256 = "sha256:1vkj66x84yqmpqm857hjzmx1s02h2lffcbc60jdfqz9xj34dx5jc";
};
};
home.file.".steam/root/compatibilitytools.d/CachyOS-Proton10-0_v3" = {
source = fetchTarball {
url = "https://github.com/CachyOS/proton-cachyos/releases/download/cachyos-10.0-20250714-slr/proton-cachyos-10.0-20250714-slr-x86_64_v3.tar.xz";
sha256 = "sha256:0hp22hkfv3f1p75im3xpif0pmixkq2i3hq3dhllzr2r7l1qx16iz";
};
};
}
# waybar
(import ../../../home/user/waybar.nix {
settings =
let
id = 5;
in
[
# monitor 1
{
output = "DP-${toString id}";
height = 48;
modules-left = [
"custom/os"
"hyprland/workspaces"
"clock"
"custom/cava"
"mpris"
];
modules-right = (
[
"wlr/taskbar"
]
++ (
if config.programs.gamemode.enable then
[
"gamemode"
]
else
[ ]
)
++ [
"custom/bitwarden"
"custom/airplay"
"custom/wallRand"
"custom/wireguard"
"custom/recording"
"idle_inhibitor"
"network"
"cpu"
"memory"
"pulseaudio"
"custom/swaync"
]
);
}
# monitor 2
{
output = "DP-${toString (id + 1)}";
height = 54;
modules-left = [
"clock"
"mpris"
];
modules-right = [
"wlr/taskbar"
"temperature"
"cpu"
"memory"
"pulseaudio"
];
}
];
})
# Hyprland
(import ../../../home/user/hyprland.nix { inherit monitors; })
{
wayland.windowManager.hyprland = {
settings = {
monitor = [
''desc:ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271, 2560x1440@165, 0x0, 1''
''desc:Acer Technologies XV272U V3 1322131231233, 2560x1440@180, -1440x-600, 1, transform, 1''
];
misc = {
vrr = 0;
};
};
};
}
# Git
(import ../../../home/user/git.nix {
inherit username;
email = "danny10132024@gmail.com";
})
# Cs go
{
home.file.".steam/steam/steamapps/common/Counter-Strike Global Offensive/game/csgo/cfg/autoexec.cfg".text =
''
fps_max "250"
# Wheel Jump
bind "mwheeldown" "+jump"
bind "mwheelup" "+jump"
bind "space" "+jump"
echo "AUTOEXEC LOADED SUCCESSFULLY!"
host_writeconfig
'';
}
];
};
};
# Power Management
services.tlp = {
enable = true;
@ -219,4 +88,117 @@ in
];
};
};
home-manager = {
users."${username}" = {
imports = [
../../../home/presets/basic.nix
# Bitwarden client
(import ../../../home/user/bitwarden.nix {
email = "danny@net.dn";
baseUrl = "https://bitwarden.net.dn";
})
# waybar
(import ../../../home/user/waybar.nix {
settings = [
# monitor 1
{
output = "DP-3";
height = 48;
modules-left = [
"custom/os"
"hyprland/workspaces"
"clock"
"custom/cava"
"mpris"
];
modules-right = [
"wlr/taskbar"
(optionalString config.programs.gamemode.enable "custom/gamemode")
"custom/bitwarden"
"custom/airplay"
"custom/wallRand"
"custom/wireguard"
"custom/recording"
"idle_inhibitor"
"network"
"cpu"
"memory"
"pulseaudio"
"custom/swaync"
];
}
# monitor 2
{
output = "DP-2";
height = 54;
modules-left = [
"clock"
"mpris"
];
modules-right = [
"wlr/taskbar"
"temperature"
"cpu"
"memory"
"pulseaudio"
];
}
];
})
# Hyprland
(import ../../../home/user/hyprland.nix { inherit monitors; })
{
wayland.windowManager.hyprland = {
settings = {
monitor = [
''desc:ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271, 2560x1440@165, 0x0, 1''
''desc:Acer Technologies XV272U V3 1322131231233, 2560x1440@180, -1440x-600, 1, transform, 1''
];
misc = {
vrr = 0;
};
};
};
}
# Git
(import ../../../home/user/git.nix {
inherit username;
email = "danny10132024@gmail.com";
})
];
home.file = {
# CS go
".steam/steam/steamapps/common/Counter-Strike Global Offensive/game/csgo/cfg/autoexec.cfg".text = ''
fps_max "250"
# Wheel Jump
bind "mwheeldown" "+jump"
bind "mwheelup" "+jump"
bind "space" "+jump"
echo "AUTOEXEC LOADED SUCCESSFULLY!"
host_writeconfig
'';
# Proton GE
".steam/root/compatibilitytools.d/GE-Proton10-10" = {
source = fetchTarball {
url = "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton10-10/GE-Proton10-10.tar.gz";
sha256 = "sha256:1vkj66x84yqmpqm857hjzmx1s02h2lffcbc60jdfqz9xj34dx5jc";
};
};
".steam/root/compatibilitytools.d/CachyOS-Proton10-0_v3" = {
source = fetchTarball {
url = "https://github.com/CachyOS/proton-cachyos/releases/download/cachyos-10.0-20250714-slr/proton-cachyos-10.0-20250714-slr-x86_64_v3.tar.xz";
sha256 = "sha256:0hp22hkfv3f1p75im3xpif0pmixkq2i3hq3dhllzr2r7l1qx16iz";
};
};
};
};
};
}

View file

@ -1,4 +0,0 @@
{
boot.swraid.enable = true;
boot.swraid.mdadmConf = "\n MAILADDR smitty\n ARRAY /dev/md126 metadata=1.2 name=stuff:0\n UUID=f3c41e6f:7e27b57f:8b44503a:42538a51\n ";
}

View file

@ -10,15 +10,16 @@
(modulesPath + "/installer/scan/not-detected.nix")
(modulesPath + "/profiles/qemu-guest.nix")
./disk.nix
./boot.nix
./hardware-configuration.nix
../../modules/nixsettings.nix
];
# boot.loader.systemd-boot.enable = true;
boot.loader.grub = {
enable = true;
devices = [ "/dev/sda" ];
efiSupport = true;
efiInstallAsRemovable = true;
devices = [ "/dev/md126" ];
};
boot.kernelPackages = pkgs.linuxPackages_latest;
@ -42,7 +43,7 @@
];
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBzLpMKn0Q24ACC6k/7lOX0FIdcFhq15NY6849yROeUK danny@dn-pre7780"
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJSAOufpee7f8D8ONIIGU3qsN+8+DGO7BfZnEOTYqtQ5 danny@pre7780.dn''
];
system.stateVersion = nix-version;

View file

@ -3,7 +3,7 @@
disko.devices = {
disk = {
main = {
device = "/dev/disk/by-id/md-uuid-f3c41e6f:7e27b57f:8b44503a:42538a51";
device = "/dev/sda";
type = "disk";
content = {
type = "gpt";

View file

@ -0,0 +1,22 @@
# 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 = [ ];
boot.initrd.availableKernelModules = [ "virtio_scsi" "sd_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.ens4.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -25,9 +25,9 @@ in
];
systemd.user.services.uxplay = {
wantedBy = [ "multi-user.target" ];
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "oneshot";
Type = "simple";
ExecStart = "${pkgs.uxplay}/bin/uxplay ${
optionalString (hostname != null) "-n ${hostname} -fs -fps 60 -nh"
} -p";

View file

@ -1,9 +1,31 @@
{ pkgs, config, ... }:
let
getIconScript = pkgs.writeShellScript "get-icon" (
builtins.readFile ../../home/config/scripts/getIcons.sh
);
getIconScript = pkgs.writeShellScript "get-icon" ''
get_icons() {
local session_name="$1"
local result=""
local panes=($(tmux list-panes -t "$session_name" -F '#{pane_current_command}'))
for i in "''\${panes[@]}"; do
case "$i" in
nvim) result+=" " ;;
zsh | *) result+=" " ;;
esac
done
echo "$result"
}
if (($# != 1)); then
echo "Usage: $0 <session-name>"
exit 1
fi
get_icons "$1"
'';
prefixKey = "C-Space";
tmuxConfigPath = "/etc/tmux.conf";
in