Fix up now-broken modules

This commit is contained in:
Julia Lange 2025-11-19 09:14:08 -08:00
parent bcb09055f8
commit 836da8b798
Signed by: Julia
SSH key fingerprint: SHA256:5DJcfxa5/fKCYn57dcabJa2vN2e6eT0pBerYi5SUbto
5 changed files with 254 additions and 247 deletions

View file

@ -21,17 +21,17 @@
flake = { flake = {
homeConfigurations = let homeConfigurations = let
userConfig = extraModules: userConfig = system: extraModules:
inputs.home-manager.lib.homeManagerConfiguration { inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs; extraSpecialArgs = { inherit inputs; };
modules = extraModules; pkgs = inputs.nixpkgs.legacyPackages.${system};
modules = [ ./hmModules ] ++ extraModules;
}; };
in { in {
"pan@juri" = userConfig [ ./users/juri ]; "pan@juri" = userConfig "x86_64-linux" [ ./users/juri ];
"pan@jibril" = userConfig [ ./users/jibril ]; "pan@jibril" = userConfig "x86_64-linux" [ ./users/jibril ];
"pan@onizuka" = userConfig [ ./users/onizuka ]; "pan@onizuka" = userConfig "x86_64-linux" [ ./users/onizuka ];
}; };
homeModules = { my-modules = ./hmModules; };
}; };
}; };

View file

@ -1,5 +1,5 @@
{ config, inputs, pkgs, lib, ... }: { config, lib, ... }:
let rootPath = ./.; in # let rootPath = ./.; in
{ {
options.hypr = { options.hypr = {
enable = lib.mkEnableOption "Enables hyprland"; enable = lib.mkEnableOption "Enables hyprland";
@ -35,219 +35,223 @@ let rootPath = ./.; in
screenshot.enable = lib.mkEnableOption "Enables Screenshotting"; screenshot.enable = lib.mkEnableOption "Enables Screenshotting";
}; };
imports = [ inputs.hyprland.homeManagerModules.default ]; config.warnings = lib.mkIf config.hypr.enable [''
hypr.* has been deprecated to allow the removal of hyprland from flake inputs.
''];
config = let # imports = [ inputs.hyprland.homeManagerModules.default ];
lopts = lib.lists.optionals;
in {
nix.settings = {
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
} // lib.mkIf config.hypr.enable {
wayland.windowManager.hyprland = let
mod = config.hypr.mod_key;
# p-s = let
# chw = config.hypr.workspace;
# findDefaultWs = id: if (builtins.hasAttr id chw.workspaces)
# then (builtins.head (builtins.getAttr id chw.workspaces))
# else "";
# in with config.hypr.workspace; lib.mkIf primary-secondary.enable {
# primaryWs = findDefaultWs primary-secondary.primary;
# secondaryWs = findDefaultWs primary-secondary.secondary;
# };
in {
enable = true;
settings = {
monitor = config.hypr.monitor.details;
workspace = let
wsMonitor = monitor: wrksps: map (ws:
if ws == (builtins.head wrksps)
then "name:"+ws+", monitor:"+monitor+", persistent:true, default:true"
else "name:"+ws+", monitor:"+monitor+", persistent:true"
) wrksps;
makeRules = wsAttr: builtins.concatLists (builtins.attrValues (
builtins.mapAttrs wsMonitor wsAttr
));
in makeRules config.hypr.workspace.workspaces
++ [
"w[t1], gapsout:0, gapsin:0"
"w[tg1], gapsout:0, gapsin:0"
"f[1], gapsout:0, gapsin:0"
]
++ lopts config.hypr.workspace.scratchpad.enable [
"special:scratch, on-created-empty: [float; size 50% 50%; center] ${config.defaultApps.terminal}"
];
input = {
accel_profile = "flat";
sensitivity = config.hypr.mouse.sensitivity;
};
general = {
gaps_in = 3;
gaps_out = 3;
border_size = 2;
"col.active_border" = "rgb(F5C2E7)";
"col.inactive_border" = "rgb(1E1D2F)";
layout = "master";
};
decoration = {
rounding = 2;
blur = {
enabled = true;
size = 12;
passes = 2;
special = true;
};
};
animation = [
"windows, 1, 4, default, popin 50%"
"windowsOut, 1, 4, default, popin 50%"
"windowsMove, 1, 3, default"
"border, 1, 3, default"
"fade, 1, 3, default"
"workspaces, 1, 3, default"
];
master = {
mfact = config.hypr.master.mfact;
};
misc = {
focus_on_activate = true;
};
exec-once = lopts config.hypr.polkit.enable [ # config = let
"${pkgs.kdePackages.polkit-kde-agent-1}/bin/libexec/polkit-kde-authentication-agent-1" # lopts = lib.lists.optionals;
] ++ lopts config.hypr.background.enable [ # in {
"${pkgs.swww}/bin/swww-daemon" # nix.settings = {
"${pkgs.swww}/bin/swww img ${config.hypr.background.path}" # substituters = ["https://hyprland.cachix.org"];
] ++ lopts config.ags.enable [ # trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
"ags" # };
] ++ lopts config.beeper.enable [ # } // lib.mkIf config.hypr.enable {
"[workspace name:chat silent] Beeper" # wayland.windowManager.hyprland = let
]; # mod = config.hypr.mod_key;
# # p-s = let
env = with config.hypr; [ # # chw = config.hypr.workspace;
# "HYPR_MON_PRIMARY, ${workspace.primary-secondary.primary}" # # findDefaultWs = id: if (builtins.hasAttr id chw.workspaces)
# "HYPR_MON_SECONDARY, ${workspace.primary-secondary.secondary}" # # then (builtins.head (builtins.getAttr id chw.workspaces))
"HYPR_WORK_DB, ${config.xdg.cacheHome}/hypr/workspace.db" # # else "";
] ++ lopts cursor.enable [ # # in with config.hypr.workspace; lib.mkIf primary-secondary.enable {
"HYPRCURSOR_THEME,${cursor.theme}" # # primaryWs = findDefaultWs primary-secondary.primary;
"HYPRCURSOR_SIZE,${cursor.size}" # # secondaryWs = findDefaultWs primary-secondary.secondary;
] ++ lopts config.nvidia.enable [ # # };
"LIBVA_DRIVER_NAME,nvidia" # in {
"XDG_SESSION_TYPE,wayland" # enable = true;
"GBM_BACKEND,nvidia-drm" # settings = {
"__GLX_VENDOR_LIBRARY_NAME,nvidia" # monitor = config.hypr.monitor.details;
"WLR_RENDERER_ALLOW_SOFTWARE,1" # workspace = let
"WLR_DRM_DEVICES,/dev/dri/card1" # wsMonitor = monitor: wrksps: map (ws:
]; # if ws == (builtins.head wrksps)
# then "name:"+ws+", monitor:"+monitor+", persistent:true, default:true"
windowrulev2 = let # else "name:"+ws+", monitor:"+monitor+", persistent:true"
workspaceDefaults = wsname: applist: map ( # ) wrksps;
app: "workspace " + wsname + ", " + app # makeRules = wsAttr: builtins.concatLists (builtins.attrValues (
) applist; # builtins.mapAttrs wsMonitor wsAttr
allDefault = wsAttr: builtins.concatLists (builtins.attrValues ( # ));
builtins.mapAttrs workspaceDefaults wsAttr # in makeRules config.hypr.workspace.workspaces
)); # ++ [
in allDefault config.hypr.workspace.defaults # "w[t1], gapsout:0, gapsin:0"
++ [ # "w[tg1], gapsout:0, gapsin:0"
"bordersize 0, floating:0, onworkspace:w[t1]" # "f[1], gapsout:0, gapsin:0"
"rounding 0, floating:0, onworkspace:w[t1]" # ]
"bordersize 0, floating:0, onworkspace:w[tg1]" # ++ lopts config.hypr.workspace.scratchpad.enable [
"rounding 0, floating:0, onworkspace:w[tg1]" # "special:scratch, on-created-empty: [float; size 50% 50%; center] ${config.defaultApps.terminal}"
"bordersize 0, floating:0, onworkspace:f[1]" # ];
"rounding 0, floating:0, onworkspace:f[1]" # input = {
] # accel_profile = "flat";
++ lopts config.hypr.xwayland.videobridge.enable [ # sensitivity = config.hypr.mouse.sensitivity;
"opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$" # };
"noanim,class:^(xwaylandvideobridge)$" # general = {
"noinitialfocus,class:^(xwaylandvideobridge)$" # gaps_in = 3;
"maxsize 1 1,class:^(xwaylandvideobridge)$" # gaps_out = 3;
"noblur,class:^(xwaylandvideobridge)$" # border_size = 2;
] ++ map (id: "opacity 1 override, " + id) config.hypr.windows.opaque # "col.active_border" = "rgb(F5C2E7)";
++ [ # "col.inactive_border" = "rgb(1E1D2F)";
"opacity 0.94 fullscreen:0" # layout = "master";
"opacity 0.79 override, class:^(${config.defaultApps.terminal})$" # };
]; # decoration = {
# rounding = 2;
# 1, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh home # blur = {
# 2, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh web # enabled = true;
# 3, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh med # size = 12;
# 4, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh game # passes = 2;
# 5, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh etc # special = true;
# _, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh hell # };
# TAB, exec, $XDG_CONFIG_HOME/hypr/scripts/changesecondary.xsh # };
# # animation = [
# SHIFT, 1, movetoworkspacesilent, name:home # "windows, 1, 4, default, popin 50%"
# SHIFT, 2, movetoworkspacesilent, name:web # "windowsOut, 1, 4, default, popin 50%"
# SHIFT, 3, movetoworkspacesilent, name:med # "windowsMove, 1, 3, default"
# SHIFT, 4, movetoworkspacesilent, name:game # "border, 1, 3, default"
# SHIFT, TAB, movetoworkspacesilent, r-1 # "fade, 1, 3, default"
# "workspaces, 1, 3, default"
bind = let # ];
modPrefix = kb: if (lib.strings.hasPrefix "&" kb) # master = {
then ("${mod}" + kb) # mfact = config.hypr.master.mfact;
else ("${mod}, " + kb); # };
in map modPrefix ([ # misc = {
"Return, exec, ${config.defaultApps.terminal}" # focus_on_activate = true;
"&SHIFT, Q, exit" # };
"h, focusmonitor, l" #
"l, focusmonitor, r" # exec-once = lopts config.hypr.polkit.enable [
"j, cyclenext," # "${pkgs.kdePackages.polkit-kde-agent-1}/bin/libexec/polkit-kde-authentication-agent-1"
"k, cyclenext, prev" # ] ++ lopts config.hypr.background.enable [
"&SHIFT, h, movecurrentworkspacetomonitor, -1" # "${pkgs.swww}/bin/swww-daemon"
"&SHIFT, l, movecurrentworkspacetomonitor, +1" # "${pkgs.swww}/bin/swww img ${config.hypr.background.path}"
"&SHIFT, j, swapnext," # ] ++ lopts config.ags.enable [
"&SHIFT, k, swapnext, prev" # "ags"
"c, killactive" # ] ++ lopts config.beeper.enable [
"f, togglefloating" # "[workspace name:chat silent] Beeper"
"&SHIFT, f, fullscreen" # ];
] ++ (let #
workspaces = builtins.concatLists ( # env = with config.hypr; [
builtins.attrValues config.hypr.workspace.workspaces); # # "HYPR_MON_PRIMARY, ${workspace.primary-secondary.primary}"
wsBinds = with builtins; wrksps: depth: if depth > (length wrksps) # # "HYPR_MON_SECONDARY, ${workspace.primary-secondary.secondary}"
then [] # "HYPR_WORK_DB, ${config.xdg.cacheHome}/hypr/workspace.db"
else let ws = builtins.elemAt wrksps (depth -1); in [ # ] ++ lopts cursor.enable [
"${toString depth}, workspace, name:${ws}" # "HYPRCURSOR_THEME,${cursor.theme}"
"&SHIFT, ${toString depth}, movetoworkspacesilent, name:${ws}" # "HYPRCURSOR_SIZE,${cursor.size}"
] ++ wsBinds wrksps (depth + 1); # ] ++ lopts config.nvidia.enable [
in wsBinds workspaces 1) ++ lopts config.rofi.enable [ # "LIBVA_DRIVER_NAME,nvidia"
"&SHIFT, return, exec, ${pkgs.rofi}/bin/rofi -show run" # "XDG_SESSION_TYPE,wayland"
] ++ lopts config.hypr.screenshot.enable [ # "GBM_BACKEND,nvidia-drm"
"P, exec, ${pkgs.grimblast}/bin/grimblast --freeze copy area" # "__GLX_VENDOR_LIBRARY_NAME,nvidia"
"&SHIFT, P, exec, ${pkgs.grimblast}/bin/grimblast --freeze copysave area" # "WLR_RENDERER_ALLOW_SOFTWARE,1"
] ++ lopts config.hypr.workspace.scratchpad.enable [ # "WLR_DRM_DEVICES,/dev/dri/card1"
"i, togglespecialworkspace, scratch" # ];
]); #
# windowrulev2 = let
bindm = map (kb: "${mod}, " + kb) [ # workspaceDefaults = wsname: applist: map (
"mouse:272, movewindow" # app: "workspace " + wsname + ", " + app
"mouse:273, movewindow" # ) applist;
]; # allDefault = wsAttr: builtins.concatLists (builtins.attrValues (
}; # builtins.mapAttrs workspaceDefaults wsAttr
}; # ));
# in allDefault config.hypr.workspace.defaults
home.packages = with pkgs; [ # ++ [
wlr-randr # Xrandr for wayland # "bordersize 0, floating:0, onworkspace:w[t1]"
wl-clipboard # Clipboard manager for wayland # "rounding 0, floating:0, onworkspace:w[t1]"
] ++ lopts config.hypr.xwayland.videobridge.enable [ # "bordersize 0, floating:0, onworkspace:w[tg1]"
kdePackages.xwaylandvideobridge # "rounding 0, floating:0, onworkspace:w[tg1]"
] ++ lopts config.hypr.cursor.enable [ # "bordersize 0, floating:0, onworkspace:f[1]"
hyprcursor # "rounding 0, floating:0, onworkspace:f[1]"
] ++ lopts config.hypr.screenshot.enable [ # ]
hyprpicker # Colorpicker, needed for screenshot tool # ++ lopts config.hypr.xwayland.videobridge.enable [
inputs.hyprland-contrib.packages.${pkgs.system}.grimblast # "opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$"
]; # "noanim,class:^(xwaylandvideobridge)$"
# "noinitialfocus,class:^(xwaylandvideobridge)$"
xdg.configFile."hypr-scripts" = { # "maxsize 1 1,class:^(xwaylandvideobridge)$"
source = rootPath + "/scripts"; # "noblur,class:^(xwaylandvideobridge)$"
target = "hypr/scripts"; # ] ++ map (id: "opacity 1 override, " + id) config.hypr.windows.opaque
executable = true; # ++ [
}; # "opacity 0.94 fullscreen:0"
# "opacity 0.79 override, class:^(${config.defaultApps.terminal})$"
xdg.dataFile."hypr-icons" = lib.mkIf config.hypr.cursor.enable { # ];
source = rootPath + "/icons"; #
target = "icons/"; # # 1, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh home
recursive = true; # # 2, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh web
}; # # 3, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh med
}; # # 4, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh game
# # 5, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh etc
# # _, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh hell
# # TAB, exec, $XDG_CONFIG_HOME/hypr/scripts/changesecondary.xsh
# #
# # SHIFT, 1, movetoworkspacesilent, name:home
# # SHIFT, 2, movetoworkspacesilent, name:web
# # SHIFT, 3, movetoworkspacesilent, name:med
# # SHIFT, 4, movetoworkspacesilent, name:game
# # SHIFT, TAB, movetoworkspacesilent, r-1
#
# bind = let
# modPrefix = kb: if (lib.strings.hasPrefix "&" kb)
# then ("${mod}" + kb)
# else ("${mod}, " + kb);
# in map modPrefix ([
# "Return, exec, ${config.defaultApps.terminal}"
# "&SHIFT, Q, exit"
# "h, focusmonitor, l"
# "l, focusmonitor, r"
# "j, cyclenext,"
# "k, cyclenext, prev"
# "&SHIFT, h, movecurrentworkspacetomonitor, -1"
# "&SHIFT, l, movecurrentworkspacetomonitor, +1"
# "&SHIFT, j, swapnext,"
# "&SHIFT, k, swapnext, prev"
# "c, killactive"
# "f, togglefloating"
# "&SHIFT, f, fullscreen"
# ] ++ (let
# workspaces = builtins.concatLists (
# builtins.attrValues config.hypr.workspace.workspaces);
# wsBinds = with builtins; wrksps: depth: if depth > (length wrksps)
# then []
# else let ws = builtins.elemAt wrksps (depth -1); in [
# "${toString depth}, workspace, name:${ws}"
# "&SHIFT, ${toString depth}, movetoworkspacesilent, name:${ws}"
# ] ++ wsBinds wrksps (depth + 1);
# in wsBinds workspaces 1) ++ lopts config.rofi.enable [
# "&SHIFT, return, exec, ${pkgs.rofi}/bin/rofi -show run"
# ] ++ lopts config.hypr.screenshot.enable [
# "P, exec, ${pkgs.grimblast}/bin/grimblast --freeze copy area"
# "&SHIFT, P, exec, ${pkgs.grimblast}/bin/grimblast --freeze copysave area"
# ] ++ lopts config.hypr.workspace.scratchpad.enable [
# "i, togglespecialworkspace, scratch"
# ]);
#
# bindm = map (kb: "${mod}, " + kb) [
# "mouse:272, movewindow"
# "mouse:273, movewindow"
# ];
# };
# };
#
# home.packages = with pkgs; [
# wlr-randr # Xrandr for wayland
# wl-clipboard # Clipboard manager for wayland
# ] ++ lopts config.hypr.xwayland.videobridge.enable [
# kdePackages.xwaylandvideobridge
# ] ++ lopts config.hypr.cursor.enable [
# hyprcursor
# ] ++ lopts config.hypr.screenshot.enable [
# hyprpicker # Colorpicker, needed for screenshot tool
# inputs.hyprland-contrib.packages.${pkgs.system}.grimblast
# ];
#
# xdg.configFile."hypr-scripts" = {
# source = rootPath + "/scripts";
# target = "hypr/scripts";
# executable = true;
# };
#
# xdg.dataFile."hypr-icons" = lib.mkIf config.hypr.cursor.enable {
# source = rootPath + "/icons";
# target = "icons/";
# recursive = true;
# };
# };
} }

View file

@ -33,7 +33,7 @@
relativenumber = true; relativenumber = true;
}; };
commands = { commands = {
dragon-out = ''%${pkgs.xdragon}/bin/xdragon -a -x "$fx"''; dragon-out = ''%${pkgs.dragon-drop}/bin/dragon-drop -a -x "$fx"'';
trash = lib.mkIf config.trash.enable '' trash = lib.mkIf config.trash.enable ''
%${pkgs.trash-cli}/bin/trash "$fx" %${pkgs.trash-cli}/bin/trash "$fx"
''; '';

View file

@ -1,4 +1,4 @@
{ config, lib, usernameAtHostname, ... }: { config, lib, ... }:
{ {
options = { options = {
@ -9,17 +9,15 @@
browser = lib.mkOption { default = ""; }; browser = lib.mkOption { default = ""; };
}; };
}; };
config = let config = {
st = lib.strings;
in {
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
home.stateVersion = "23.05"; home.stateVersion = "23.05";
home = { home = {
username = builtins.elemAt (st.splitString "@" usernameAtHostname) 0; username = "pan";
homeDirectory = "/home/" + config.home.username; homeDirectory = "/home/pan";
packages = config.extraPkgs; packages = config.extraPkgs;
}; };

View file

@ -1,25 +1,30 @@
{ config, inputs, pkgs, lib, ... }: { config, lib, ... }:
{ {
options.ags = { options.ags = {
enable = lib.mkEnableOption "Enable ags"; enable = lib.mkEnableOption "Enable ags";
}; };
imports = [ inputs.ags.homeManagerModules.default ]; config.warnings = lib.mkIf config.ags.enable [''
ags.enable has been deprecated to allow the removal of ags from flake
inputs.
''];
config = lib.mkIf config.ags.enable { # imports = [ inputs.ags.homeManagerModules.default ];
home.packages = with pkgs; [
libnotify # Notifications through ags
];
programs.ags = {
enable = true;
configDir = ./config;
extraPackages = with pkgs; [ # config = lib.mkIf config.ags.enable {
gtksourceview # home.packages = with pkgs; [
webkitgtk # libnotify # Notifications through ags
accountsservice # ];
]; # programs.ags = {
}; # enable = true;
}; # configDir = ./config;
#
# extraPackages = with pkgs; [
# gtksourceview
# webkitgtk
# accountsservice
# ];
# };
# };
} }