change file copy to soft link

This commit is contained in:
2025-04-26 19:35:04 +08:00
parent ccf46b865e
commit 3088f2aea8
6 changed files with 29 additions and 57 deletions

View File

@@ -1,5 +1,9 @@
{ 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 = [
./env.nix
@@ -12,16 +16,7 @@
package = pkgs.hyprland;
# Whether to enable XWayland
xwayland.enable = true;
# 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)";
};
};
systemd.enable = false;
};
home.packages = with pkgs; [
@@ -52,42 +47,17 @@
swaylock.enable = true;
};
# hyprland configs, based on https://github.com/notwidow/hyprland
home.file.".config/hypr" = {
source = ./conf/hypr;
# copy the scripts directory recursively
recursive = true;
};
home.file.".config/rofi" = {
source = ./conf/rofi;
recursive = true;
};
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;
};
# 使用map函数循环 conf 变量,动态的生成 home.file.<user>.config.${i}
xdg.configFile = builtins.listToAttrs
(builtins.map
(name: {
inherit name;
value = {
source = config.lib.file.mkOutOfStoreSymlink "${confPath}/${name}";
};
})
conf
);
}

View File

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