fix: wireguard status for waybar

This commit is contained in:
DACHXY 2025-06-03 11:21:00 +08:00
parent e928d2e4c9
commit cc803cae27
11 changed files with 68 additions and 57 deletions

View file

@ -4,9 +4,9 @@ INTERFACE="wg0"
if [ "$1" = "toggle" ]; then if [ "$1" = "toggle" ]; then
if ip link show "$INTERFACE" >/dev/null 2>&1; then if ip link show "$INTERFACE" >/dev/null 2>&1; then
pkexec wg-quick down "$INTERFACE" pkexec systemctl stop wg-quick-wg0.service
else else
pkexec wg-quick up "$INTERFACE" pkexec systemctl start wg-quick-wg0.service
fi fi
exit 0 exit 0
fi fi

View file

@ -4,6 +4,7 @@
enable = true; enable = true;
silent = true; silent = true;
enableBashIntegration = true; enableBashIntegration = true;
silent = true;
nix-direnv.enable = true; nix-direnv.enable = true;
}; };
}; };

View file

@ -16,7 +16,7 @@
QT_IM_MODULES = "wayland;fcitx;ibus"; QT_IM_MODULES = "wayland;fcitx;ibus";
MOZ_ENABLE_WAYLAND = "1"; MOZ_ENABLE_WAYLAND = "1";
SDL_VIDEODRIVER = "wayland"; SDL_VIDEODRIVER = "wayland,x11";
WLR_NO_HARDWARE_CURSORS = "1"; WLR_NO_HARDWARE_CURSORS = "1";
CLUTTER_BACKEND = "wayland"; CLUTTER_BACKEND = "wayland";
EGL_PLATFORM = "wayland"; EGL_PLATFORM = "wayland";

View file

@ -1,5 +1,5 @@
[ [
''desc:ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271, 2560x1440@165, 0x0, 1'' ''desc:ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271, 2560x1440@165, 0x0, 1''
''desc:Acer Technologies XV272U V3 1322131231233, 2560x1440@180, -1440x-430, 1, transform, 1'' ''desc:Acer Technologies XV272U V3 1322131231233, 2560x1440@180, -1440x-600, 1, transform, 1''
''desc:LG Display 0x0665, preferred, 0x0, 1.25'' ''desc:LG Display 0x0665, preferred, 0x0, 1.25''
] ]

View file

@ -102,6 +102,18 @@ in
# === hyprlock === # # === hyprlock === #
programs.hyprlock = { programs.hyprlock = {
enable = true; enable = true;
package = (
pkgs.hyprlock.overrideAttrs (
final: prev: {
src = pkgs.fetchFromGitHub {
owner = "hyprwm";
repo = "hyprlock";
rev = "da1d076d849fc0f298c1d287bddd04802bf7d0f9";
hash = "sha256-IypoV7crmhQ4llD0n4qqO4XTRNAAbHfA+2oiTiq2qpk=";
};
}
)
);
importantPrefixes = [ importantPrefixes = [
"$" "$"
"monitor" "monitor"
@ -115,10 +127,7 @@ in
font2 = "SF Pro Display Bold"; font2 = "SF Pro Display Bold";
mainMonitor = mainMonitor =
if ((builtins.length settings.hyprland.monitors) > 0) then if ((builtins.length settings.hyprland.monitors) > 0) then
# TODO: Identifying monitor by desc is broken builtins.elemAt settings.hyprland.monitors 0
# https://github.com/hyprwm/hyprlock/issues/737
# builtins.elemAt settings.hyprland.monitors 0
"DP-2"
else else
""; "";
in in

View file

@ -5,19 +5,6 @@
inputs, inputs,
... ...
}: }:
let
lazyVim = (
pkgs.vimPlugins.LazyVim.overrideAttrs (previous: {
version = "2025-02-15";
src = pkgs.fetchFromGitHub {
owner = "LazyVim";
repo = "LazyVim";
rev = "main";
sha256 = "sha256-lwT39h97ZyF/SFJhkOqZ2vU5f3QpCpe7L1MVDPEXN28=";
};
})
);
in
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
gh gh
@ -62,8 +49,8 @@ in
extraPackages = with pkgs; [ extraPackages = with pkgs; [
lua-language-server lua-language-server
stylua
ripgrep ripgrep
stylua
vue-language-server vue-language-server
dockerfile-language-server-nodejs dockerfile-language-server-nodejs
ruff ruff
@ -88,6 +75,9 @@ in
taplo taplo
zls zls
vscode-js-debug vscode-js-debug
neocmakelsp
ghostscript
]; ];
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.vimPlugins; [
@ -97,8 +87,7 @@ in
extraLuaConfig = extraLuaConfig =
let let
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.vimPlugins; [
# LazyVim LazyVim
lazyVim
bufferline-nvim bufferline-nvim
cmp-buffer cmp-buffer

View file

@ -1,10 +1,8 @@
{ {
pkgs, pkgs,
settings,
config, config,
... ...
}: }:
{ {
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
@ -25,36 +23,31 @@
]; ];
}; };
users.groups.windows = {
gid = 1200;
members = [ settings.personal.username ];
};
fileSystems."/mnt/windows" = { fileSystems."/mnt/windows" = {
enable = true; enable = true;
device = "/dev/disk/by-uuid/460237D00237C429"; device = "/dev/disk/by-uuid/460237D00237C429";
fsType = "ntfs-3g"; fsType = "ntfs-3g";
options = [ options = [
"uid=1000"
"gid=100"
"umask=000"
"nofail" "nofail"
"users" "users"
"uid=992" "exec"
"gid=${builtins.toString config.users.groups.windows.gid}"
"dmask=007"
"fmask=007"
]; ];
}; };
fileSystems."/mnt/nextcloud" = { # fileSystems."/mnt/nextcloud" = {
enable = true; # enable = true;
depends = [ "/mnt/windows" ]; # depends = [ "/mnt/windows" ];
device = "/mnt/windows/Linux/nextcloud"; # device = "/mnt/windows/Linux/nextcloud";
#
fsType = "none"; # fsType = "none";
options = [ # options = [
"nofail" # "nofail"
"bind" # "bind"
]; # ];
}; # };
boot.supportedFilesystems = [ "ntfs" ]; boot.supportedFilesystems = [ "ntfs" ];
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;

View file

@ -13,17 +13,19 @@
./hardware-configuration.nix ./hardware-configuration.nix
./boot.nix ./boot.nix
./sops-conf.nix ./sops-conf.nix
./nginx.nix # ./nginx.nix
../../modules/presets/basic.nix ../../modules/presets/basic.nix
../../modules/gaming.nix ../../modules/gaming.nix
../../modules/secure-boot.nix ../../modules/secure-boot.nix
../../modules/virtualization.nix ../../modules/virtualization.nix
../../modules/wine.nix ../../modules/wine.nix
../../modules/wireguard.nix ../../modules/wireguard.nix
(import ../../modules/nextcloud.nix { (import ../../modules/rustdesk-server.nix { relayHosts = [ "10.0.0.0/24" ]; })
hostname = "pre-nextcloud.net.dn"; # (import ../../modules/nextcloud.nix {
datadir = "/mnt/nextcloud"; # hostname = "192.168.0.3";
}) # datadir = "/mnt/nextcloud";
# https = false;
# })
]; ];
home-manager = { home-manager = {
@ -38,19 +40,16 @@
}; };
}; };
# Disable integrated bluetooth adapter
services.udev.extraRules = ''
SUBSYSTEM=="usb", ATTRS{idVendor}=="8087", ATTRS{idProduct}=="0033", ATTR{authorized}="0"
'';
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
prismlauncher prismlauncher
heroic
]; ];
users.users = { users.users = {
"${settings.personal.username}".openssh.authorizedKeys.keys = [ "${settings.personal.username}".openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJFQA42R3fZmjb9QnUgzzOTIXQBC+D2ravE/ZLvdjoOQ danny@lap.dn" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJFQA42R3fZmjb9QnUgzzOTIXQBC+D2ravE/ZLvdjoOQ danny@lap.dn"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILSHkPa6vmr5WBPXAazY16+Ph1Mqv9E24uLIf32oC2oH danny@phone.dn" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILSHkPa6vmr5WBPXAazY16+Ph1Mqv9E24uLIf32oC2oH danny@phone.dn"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMj/LeB3i/vca3YwGNpAjf922FgiY2svro48fUSQAjOv Shortcuts on :D"
]; ];
}; };
} }

View file

@ -3,6 +3,7 @@
datadir ? null, datadir ? null,
dataBackupPath ? null, dataBackupPath ? null,
dbBackupPath ? null, dbBackupPath ? null,
https ? true,
}: }:
{ {
config, config,
@ -42,7 +43,7 @@
package = pkgs.nextcloud31; package = pkgs.nextcloud31;
configureRedis = true; configureRedis = true;
hostName = hostname; hostName = hostname;
https = true; https = if https then true else false;
datadir = lib.mkIf (datadir != null) datadir; datadir = lib.mkIf (datadir != null) datadir;
phpExtraExtensions = phpExtraExtensions =
all: with all; [ all: with all; [

View file

@ -8,6 +8,10 @@
[ [
file file
man-pages
man-pages-posix
stdmanpages
# Binary cache platform # Binary cache platform
cachix cachix

View file

@ -0,0 +1,15 @@
{
relayHosts ? [ ],
}:
{
lib,
...
}:
{
services.rustdesk-server = {
enable = lib.mkDefault true;
openFirewall = lib.mkDefault true;
relay.enable = lib.mkDefault false;
signal.relayHosts = relayHosts;
};
}