{ 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 ]; wayland.windowManager.hyprland = { # Whether to enable Hyprland wayland compositor enable = true; # The hyprland package to use package = pkgs.hyprland; # Whether to enable XWayland xwayland.enable = true; systemd.enable = false; }; home.packages = with pkgs; [ waybar # the status bar swww # wallpaper libnotify # for notify-send command mako # notify daemon hyprshot #screenshot rofi # app launcher kitty # terminal wlogout # logout menu killall pavucontrol # audio control nautilus #file manager for GNOME ]; programs = { bash = { initExtra = '' if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then echo 'Welcome! ' fi ''; }; swaylock.enable = true; }; # 使用map函数循环 conf 变量,动态的生成 home.file..config.${i} xdg.configFile = builtins.listToAttrs (builtins.map (name: { inherit name; value = { source = config.lib.file.mkOutOfStoreSymlink "${confPath}/${name}"; }; }) conf ); }