feat: modular home

This commit is contained in:
Ryan Yin
2023-12-24 19:54:39 +08:00
parent 2d44bc6006
commit ac4f625768
10 changed files with 105 additions and 56 deletions

View File

@@ -17,7 +17,7 @@ return {
{ import = "astrocommunity.colorscheme.catppuccin" },
-- Highly experimental plugin that completely replaces
-- the UI for messages, cmdline and the popupmenu.
{ import = "astrocommunity.utility.noice-nvim" },
-- { import = "astrocommunity.utility.noice-nvim" },
-- Fully featured & enhanced replacement for copilot.vim
-- <Tab> work with both auto completion in cmp and copilot
{ import = "astrocommunity.media.vim-wakatime" },
@@ -77,7 +77,7 @@ return {
-- lazy-loading on events
event = { "InsertLeave", "TextChanged" },
opts = function(_, opts)
opts.prompt_style = "notify" -- or stdout
opts.prompt_style = "stdout" -- notify or stdout
end,
},

View File

@@ -10,6 +10,7 @@ with lib; let
in {
imports = [
anyrun.homeManagerModules.default
./nvidia.nix
];
options.modules.desktop.hyprland = {

View File

@@ -13,8 +13,15 @@ env = WLR_NO_HARDWARE_CURSORS,1
# format:
# monitor=name,resolution,position,scale
monitor=DP-2,3840x2160@144,0x0,1.6
workspace=DP-2,1
# monitor=DP-2,3840x2160@144,0x0,1.6
# workspace=DP-2,1
# Shoukei's builtin display(Macbook Pro 2022 13.3 inch)
monitor=eDP-1,2560x1660@60,0x0,1.5
workspace=eDP-1,1
#-- Input ----------------------------------------------------
# Configure mouse and touchpad here.

View File

@@ -12,7 +12,7 @@
wayland.windowManager.hyprland = {
enable = true;
package = hyprland.packages.${pkgs.system}.hyprland;
settings = lib.mkForce {};
settings = {};
extraConfig = builtins.readFile ./hypr-conf/hyprland.conf;
# gammastep/wallpaper-switcher need this to be enabled.
systemd.enable = true;
@@ -62,13 +62,5 @@
"NIXOS_OZONE_WL" = "1"; # for any ozone-based browser & electron apps to run on wayland
"MOZ_ENABLE_WAYLAND" = "1"; # for firefox to run on wayland
"MOZ_WEBRENDER" = "1";
# for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/
"LIBVA_DRIVER_NAME" = "nvidia";
"XDG_SESSION_TYPE" = "wayland";
"GBM_BACKEND" = "nvidia-drm";
"__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
"WLR_NO_HARDWARE_CURSORS" = "1";
"WLR_EGL_NO_MODIFIRES" = "1";
};
}

View File

@@ -0,0 +1,24 @@
{
config,
lib,
...
}:
with lib; let
cfg = config.modules.desktop.hyprland;
in {
options.modules.desktop.hyprland = {
nvidia = mkEnableOption "whether nvidia GPU is used";
};
config = mkIf (cfg.enable && cfg.nvidia) {
systemd.user.sessionVariables = {
# for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/
"LIBVA_DRIVER_NAME" = "nvidia";
"XDG_SESSION_TYPE" = "wayland";
"GBM_BACKEND" = "nvidia-drm";
"__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
"WLR_NO_HARDWARE_CURSORS" = "1";
"WLR_EGL_NO_MODIFIRES" = "1";
};
};
}

View File

@@ -7,6 +7,10 @@
with lib; let
cfg = config.modules.desktop.i3;
in {
imports = [
./nvidia.nix
];
options.modules.desktop.i3 = {
enable = mkEnableOption "i3 window manager";
};

View File

@@ -52,10 +52,4 @@ _: {
# allow fontconfig to discover fonts and configurations installed through home.packages
fonts.fontconfig.enable = true;
systemd.user.sessionVariables = {
"LIBVA_DRIVER_NAME" = "nvidia";
"GBM_BACKEND" = "nvidia-drm";
"__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
};
}

View File

@@ -0,0 +1,20 @@
{
config,
lib,
...
}:
with lib; let
cfg = config.modules.desktop.i3;
in {
options.modules.desktop.i3 = {
nvidia = mkEnableOption "whether nvidia GPU is used";
};
config = mkIf (cfg.enable && cfg.nvidia) {
systemd.user.sessionVariables = {
"LIBVA_DRIVER_NAME" = "nvidia";
"GBM_BACKEND" = "nvidia-drm";
"__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
};
};
}