Files
nix/modules/home/hyprland/default.nix

63 lines
1.3 KiB
Nix

{ config, libs, pkgs, ... }:
let
conf = [ "hypr" "waybar" "rofi" "kitty" "mako" "wlogout" ];
confPath = "${config.home.homeDirectory}/.nix/modules/home/hyprland/conf";
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.<user>.config.${i}
xdg.configFile = builtins.listToAttrs
(builtins.map
(name: {
inherit name;
value = {
source = config.lib.file.mkOutOfStoreSymlink "${confPath}/${name}";
};
})
conf
);
}