refactor: start i3/hyprland in home-manager instead of NixOS

This commit is contained in:
Ryan Yin
2023-12-23 13:33:47 +08:00
parent 82cfa4c6f7
commit 73e3707570
20 changed files with 370 additions and 134 deletions

View File

@@ -1,35 +1,55 @@
{pkgs, ...}: {
_: {
# i3 window manager's config, based on https://github.com/endeavouros-team/endeavouros-i3wm-setup
imports = [
./packages.nix
./x11-apps.nix
];
home.file = {
".config/i3/config".source = ./config;
".config/i3/i3blocks.conf".source = ./i3blocks.conf;
".config/i3/scripts" = {
# NOTE:
# We have to enable hyprland/i3's systemd user service in home-manager,
# so that gammastep/wallpaper-switcher's user service can be start correctly!
# they are all depending on hyprland/i3's user graphical-session
xsession = {
enable = true;
windowManager.i3 = {
enable = true;
extraConfig = builtins.readFile ./config;
};
# Path, relative to HOME, where Home Manager should write the X session script.
# and NixOS will use it to start xorg session when system boot up
scriptPath = ".xsession";
};
xdg.configFile = {
"i3/i3blocks.conf".source = ./i3blocks.conf;
"i3/scripts" = {
source = ./scripts;
# copy the scripts directory recursively
recursive = true;
executable = true; # make all scripts executable
};
".config/i3/layouts" = {
"i3/layouts" = {
source = ./layouts;
recursive = true;
};
# rofi is a application launcher and dmenu replacement
".config/rofi" = {
"rofi" = {
source = ./rofi-conf;
# copy the scripts directory recursively
recursive = true;
};
};
home.file = {
".local/bin/bright" = {
source = ./bin/bright;
executable = true;
};
".local/bin/logout" = {
source = ./bin/logout;
executable = true;
};
# xrandr - set primary screen
".screenlayout/monitor.sh".source = ./dual-monitor-4k-1080p.sh;