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 ip link show "$INTERFACE" >/dev/null 2>&1; then
pkexec wg-quick down "$INTERFACE"
pkexec systemctl stop wg-quick-wg0.service
else
pkexec wg-quick up "$INTERFACE"
pkexec systemctl start wg-quick-wg0.service
fi
exit 0
fi

View file

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

View file

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

View file

@ -1,5 +1,5 @@
[
''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''
]

View file

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

View file

@ -5,19 +5,6 @@
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; [
gh
@ -62,8 +49,8 @@ in
extraPackages = with pkgs; [
lua-language-server
stylua
ripgrep
stylua
vue-language-server
dockerfile-language-server-nodejs
ruff
@ -88,6 +75,9 @@ in
taplo
zls
vscode-js-debug
neocmakelsp
ghostscript
];
plugins = with pkgs.vimPlugins; [
@ -97,8 +87,7 @@ in
extraLuaConfig =
let
plugins = with pkgs.vimPlugins; [
# LazyVim
lazyVim
LazyVim
bufferline-nvim
cmp-buffer

View file

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

View file

@ -13,17 +13,19 @@
./hardware-configuration.nix
./boot.nix
./sops-conf.nix
./nginx.nix
# ./nginx.nix
../../modules/presets/basic.nix
../../modules/gaming.nix
../../modules/secure-boot.nix
../../modules/virtualization.nix
../../modules/wine.nix
../../modules/wireguard.nix
(import ../../modules/nextcloud.nix {
hostname = "pre-nextcloud.net.dn";
datadir = "/mnt/nextcloud";
})
(import ../../modules/rustdesk-server.nix { relayHosts = [ "10.0.0.0/24" ]; })
# (import ../../modules/nextcloud.nix {
# hostname = "192.168.0.3";
# datadir = "/mnt/nextcloud";
# https = false;
# })
];
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; [
prismlauncher
heroic
];
users.users = {
"${settings.personal.username}".openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJFQA42R3fZmjb9QnUgzzOTIXQBC+D2ravE/ZLvdjoOQ danny@lap.dn"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILSHkPa6vmr5WBPXAazY16+Ph1Mqv9E24uLIf32oC2oH danny@phone.dn"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMj/LeB3i/vca3YwGNpAjf922FgiY2svro48fUSQAjOv Shortcuts on :D"
];
};
}

View file

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

View file

@ -8,6 +8,10 @@
[
file
man-pages
man-pages-posix
stdmanpages
# Binary cache platform
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;
};
}