Compare commits

...

2 Commits

Author SHA1 Message Date
992fee7199 update network and waybar component 2025-04-26 20:22:51 +08:00
3088f2aea8 change file copy to soft link 2025-04-26 19:35:04 +08:00
7 changed files with 53 additions and 75 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
result

View File

@@ -89,6 +89,13 @@
} }
}, },
"hyprland/window": {
"format": "{title}",
"tooltip-format": "{title}",
"rewrite": { "^(.{30}).+": "$1..." },
"separate-outputs": true
},
"clock": { "clock": {
"format": "{:%Y/%m/%d %H:%M}", "format": "{:%Y/%m/%d %H:%M}",
"format-alt": "{:%I:%M%p 周%u}", "format-alt": "{:%I:%M%p 周%u}",
@@ -103,11 +110,7 @@
"spacing": 0, "spacing": 0,
"tooltip-format": "{title}", "tooltip-format": "{title}",
"on-click": "activate", "on-click": "activate",
"on-click-middle": "close", "on-click-middle": "close"
"ignore-list": ["Alacritty"],
"app_ids-mapping": {
"firefoxdeveloperedition": "firefox-developer-edition"
}
}, },
"tray": { "tray": {

View File

@@ -1,5 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let
conf = [ "hypr" "waybar" "rofi" "kitty" "mako" "wlogout" ];
confPath = "${config.home.homeDirectory}/.nix/modules/home/hyprland/conf";
inherit (lib.my) mkOutOfStoreSymlinks;
in
{ {
imports = [ imports = [
./env.nix ./env.nix
@@ -12,16 +16,7 @@
package = pkgs.hyprland; package = pkgs.hyprland;
# Whether to enable XWayland # Whether to enable XWayland
xwayland.enable = true; xwayland.enable = true;
systemd.enable = false;
# Optional
# Whether to enable hyprland-session.target on hyprland startup
# systemd.enable = true;
settings = lib.mkDefault {
decoration = {
shadow_offset = "0 5";
"col.shadow" = "rgba(00000099)";
};
};
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
@@ -52,42 +47,17 @@
swaylock.enable = true; swaylock.enable = true;
}; };
# hyprland configs, based on https://github.com/notwidow/hyprland # 使用map函数循环 conf 变量,动态的生成 home.file.<user>.config.${i}
home.file.".config/hypr" = { xdg.configFile = builtins.listToAttrs
source = ./conf/hypr; (builtins.map
# copy the scripts directory recursively (name: {
recursive = true; inherit name;
}; value = {
source = config.lib.file.mkOutOfStoreSymlink "${confPath}/${name}";
home.file.".config/rofi" = { };
source = ./conf/rofi; })
recursive = true; conf
}; );
home.file.".config/kitty" = {
source = ./conf/kitty;
recursive = true;
};
home.file.".config/mako" = {
source = ./conf/mako;
recursive = true;
};
# home.file.".config/swww" = {
# source = ./conf/swww;
# recursive = true;
# };
home.file.".config/waybar" = {
source = ./conf/waybar;
recursive = true;
};
home.file.".config/wlogout" = {
source = ./conf/wlogout;
recursive = true;
};
} }

View File

@@ -15,11 +15,7 @@
networking.firewall = lib.mkDefault { networking.firewall = lib.mkDefault {
enable = true; enable = true;
allowedTCPPorts = [ 22 80 443 ]; # 根据需要调整 allowedTCPPorts = [ 22 80 443 ]; # 根据需要调整
allowedUDPPorts = [ 53 ]; # 根据需要调整 allowedUDPPorts = [ 9 53 ]; # 9: wol, 53: dns
# 如果需要,可以添加特定服务的规则
allowedTCPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
];
}; };
# Select internationalisation properties. # Select internationalisation properties.

View File

@@ -1,4 +1,4 @@
args@{ inputs, outputs, lib, pkgs, home-manager, self, username, useremail, hostname, sysversion, ... }: { args@{ self, inputs, outputs, lib, pkgs, home-manager, username, useremail, hostname, sysversion, ... }: {
# You can import other NixOS modules here # You can import other NixOS modules here
imports = [ imports = [
@@ -30,7 +30,7 @@ args@{ inputs, outputs, lib, pkgs, home-manager, self, username, useremail, host
# home-manager.useGlobalPkgs = true; # home-manager.useGlobalPkgs = true;
# home-manager.useUserPackages = true; # home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { home-manager.extraSpecialArgs = {
inherit inputs outputs hostname username useremail sysversion; inherit self inputs outputs hostname username useremail sysversion;
}; };
home-manager.users."${username}" = { ... }: { home-manager.users."${username}" = { ... }: {
imports = [ imports = [

View File

@@ -1,10 +1,9 @@
{ config, ... }: { config, ... }: {
{
programs.ssh = { programs.ssh = {
enable = true; enable = true;
}; };
home.file.".ssh/config" = { home.file.".ssh/config" = {
source = ./config; source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.nix/profiles/apollo/hm/ssh/config";
}; };
} }

View File

@@ -15,24 +15,33 @@
enableIPv6 = true; enableIPv6 = true;
# Set up bridge network
interfaces.eno1 = {
useDHCP = false;
};
bridges = { bridges = {
br0 = { interfaces = [ "eno1" ]; }; br0 = { interfaces = [ "eno1" ]; };
}; };
interfaces.br0 = { # Set up bridge network
useDHCP = false; interfaces = {
ipv4.addresses = [ eno1 = {
{ useDHCP = false;
address = "10.7.43.10"; wakeOnLan = {
prefixLength = 24; enable = true;
} policy = [
]; "magic"
];
};
};
br0 = {
useDHCP = false;
ipv4.addresses = [
{
address = "10.7.43.10";
prefixLength = 24;
}
];
};
}; };
defaultGateway = { defaultGateway = {
address = "10.7.43.30"; address = "10.7.43.30";
interface = "br0"; interface = "br0";