refactoring complete

This commit is contained in:
Charlie Root 2024-07-21 15:11:55 +02:00
commit 5b18428ab0
10 changed files with 164 additions and 161 deletions

View file

@ -3,12 +3,11 @@
lib,
...
}: let
cfg = config.modules.programs.beets;
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.usrEnv.programs.media.beets;
inherit (config.modules.other.system) username;
inherit (config.modules.services.mpd) musicDirectory;
inherit (lib) mkIf;
in {
options.modules.programs.beets.enable = mkEnableOption "beets";
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.beets = {

View file

@ -3,13 +3,11 @@
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.programs.mpv;
username = config.modules.other.system.username;
}: let
cfg = config.modules.usrEnv.programs.media.mpv;
inherit (config.modules.other.system) username;
inherit (lib) mkIf;
in {
options.modules.programs.mpv.enable = mkEnableOption "mpv";
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.mpv = {

View file

@ -1,12 +1,7 @@
{
lib,
pkgs,
config,
}: let
in {
_: {
imports = [
./stylix.nix
./qt.nix
./gtk.nix
# ./qt.nix
# ./gtk.nix
];
}

View file

@ -0,0 +1,47 @@
{
config,
lib,
...
}: let
inherit (lib) types mkEnableOption mkOption;
in {
options.modules.usrEnv.style.stylix = {
enable = mkEnableOption "Stylix style Manager";
scheme = mkOption {
description = "Color Scheme";
type = types.str;
};
image = mkOption {
description = "Image";
type = types.path;
};
cursor = {
size = mkOption {
description = "Cursor Size";
type = types.int;
};
package = mkOption {
description = "Cursor Package";
type = types.package;
};
name = mkOption {
description = "Cursor Name";
type = types.str;
};
};
fontsizes = {
terminal = mkOption {
description = "Terminal font size";
type = types.int;
};
popups = mkOption {
description = "Popup font size";
type = types.int;
};
applications = mkOption {
description = "Application font size";
type = types.int;
};
};
};
}

View file

@ -23,7 +23,7 @@ in {
git = {
signingKey = mkOption {
type = types.str;
default = "";
default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILPiRe9OH/VtWFWyy5QbAVcN7CLxr4zUtRCwmxD6aeN6";
description = "The default gpg key used for signing commits";
};
};

View file

@ -7,9 +7,8 @@
}:
with lib; let
inherit (config.modules.other.system) username;
cfg = config.modules.programs.anyrun;
cfg = config.modules.usrEnv.programs.launchers.anyrun;
in {
options.modules.programs.anyrun.enable = mkEnableOption "anyrun";
config = mkIf cfg.enable {
home-manager.users.${username} = {
imports = [inputs.anyrun.homeManagerModules.default];

View file

@ -6,51 +6,11 @@
...
}: let
cfg = config.modules.theming.stylix;
inherit (config.modules.theming.stylix) scheme image;
inherit (config.modules.theming.stylix.cursor) size;
inherit (config.modules.theming.stylix.fontsizes) terminal popups applications;
inherit (config.modules.usrEnv.style.stylix) scheme image cursor fontsizes;
inherit (lib) mkIf;
in {
imports = [inputs.stylix.nixosModules.stylix];
options.modules.theming.stylix = {
enable = lib.mkEnableOption "stylix";
scheme = lib.mkOption {
description = " Color Scheme";
type = lib.types.str;
};
image = lib.mkOption {
description = "Image";
type = lib.types.path;
};
cursor = {
size = lib.mkOption {
description = "Cursor Size";
type = lib.types.int;
};
package = lib.mkOption {
description = "Cursor Package";
type = lib.types.package;
};
name = lib.mkOption {
description = "Cursor Name";
type = lib.types.str;
};
};
fontsizes = {
terminal = lib.mkOption {
description = "Terminal font size";
type = lib.types.int;
};
popups = lib.mkOption {
description = "Popup font size";
type = lib.types.int;
};
applications = lib.mkOption {
description = "Application font size";
type = lib.types.int;
};
};
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
stylix = {
enable = true;
homeManagerIntegration.followSystem = true;
@ -59,13 +19,13 @@ in {
polarity = "dark";
autoEnable = true;
cursor = {
inherit size;
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
inherit (cursor) size package name;
# package = pkgs.bibata-cursors;
# name = "Bibata-Modern-Classic";
};
fonts = {
sizes = {
inherit terminal popups applications;
inherit (fontsizes) terminal popups applications;
};
monospace = {
package =

View file

@ -5,12 +5,10 @@
...
}:
with lib; let
cfg = config.modules.programs.ncmpcpp;
cfg = config.modules.usrEnv.programs.media.ncmpcpp;
inherit (config.modules.other.system) username;
inherit (config.modules.services.mpd) musicDirectory;
in {
options.modules.programs.ncmpcpp.enable = mkEnableOption "ncmpcpp";
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.ncmpcpp = {

View file

@ -24,7 +24,7 @@ in {
xdg.portal = {
enable = true;
configPackages = [
# hyprland # TODO Fix hyprland package
cfg.package # TODO Fix hyprland package
];
extraPortals = [
pkgs.xdg-desktop-portal-gtk
@ -35,7 +35,7 @@ in {
home-manager.users.${username} = {
wayland.windowManager.hyprland = {
enable = true;
# package = hyprland; TODO Fix hyprland package
inherit (cfg) package;
# Split-monitor-workspaces provides awesome-like workspace behaviour
plugins = [
split-monitor-workspaces
@ -54,58 +54,58 @@ in {
# Monitor config
monitor = [
"eDP-1,1920x1080,0x0,1"
# "DP-2,1920x1080,0x0,1"
# "HDMI-A-2,1920x1080,1920x0,1"
# "HDMI-A-1,1920x1080,3840x0,1"
# "eDP-1,1920x1080,0x0,1"
"DP-2,1920x1080,0x0,1"
"HDMI-A-2,1920x1080,1920x0,1"
"HDMI-A-1,1920x1080,3840x0,1"
# Had the shadow monitor bug, so had to disable all unknown monitors.
"Unknown-1,disable"
];
# Workspace config
workspace = [
"1,monitor:eDP-1, default:true"
"2,monitor:eDP-1"
"3,monitor:eDP-1"
"4,monitor:eDP-1"
"5,monitor:eDP-1"
"6,monitor:eDP-1"
"7,monitor:eDP-1"
"8,monitor:eDP-1"
"9,monitor:eDP-1"
"10,monitor:eDP-1"
# "1,monitor:eDP-1, default:true"
# "2,monitor:eDP-1"
# "3,monitor:eDP-1"
# "4,monitor:eDP-1"
# "5,monitor:eDP-1"
# "6,monitor:eDP-1"
# "7,monitor:eDP-1"
# "8,monitor:eDP-1"
# "9,monitor:eDP-1"
# "10,monitor:eDP-1"
# "1,monitor:HDMI-A-1, default:true"
# "2,monitor:HDMI-A-1"
# "3,monitor:HDMI-A-1"
# "4,monitor:HDMI-A-1"
# "5,monitor:HDMI-A-1"
# "6,monitor:HDMI-A-1"
# "7,monitor:HDMI-A-1"
# "8,monitor:HDMI-A-1"
# "9,monitor:HDMI-A-1"
# "10,monitor:HDMI-A-1"
"1,monitor:HDMI-A-1, default:true"
"2,monitor:HDMI-A-1"
"3,monitor:HDMI-A-1"
"4,monitor:HDMI-A-1"
"5,monitor:HDMI-A-1"
"6,monitor:HDMI-A-1"
"7,monitor:HDMI-A-1"
"8,monitor:HDMI-A-1"
"9,monitor:HDMI-A-1"
"10,monitor:HDMI-A-1"
#"11, monitor:HDMI-A-2, default:true"
#"12, monitor:HDMI-A-2"
#"13, monitor:HDMI-A-2"
#"14, monitor:HDMI-A-2"
#"15, monitor:HDMI-A-2"
#"16, monitor:HDMI-A-2"
#"17, monitor:HDMI-A-2"
#"18, monitor:HDMI-A-2"
#"19, monitor:HDMI-A-2"
#"20, monitor:HDMI-A-2"
#
#"21, monitor:DP-2, default:true"
#"22, monitor:DP-2"
#"23, monitor:DP-2"
#"24, monitor:DP-2"
#"25, monitor:DP-2"
#"26, monitor:DP-2"
#"27, monitor:DP-2"
#"28, monitor:DP-2"
#"29, monitor:DP-2"
#"30, monitor:DP-2"
"11, monitor:HDMI-A-2, default:true"
"12, monitor:HDMI-A-2"
"13, monitor:HDMI-A-2"
"14, monitor:HDMI-A-2"
"15, monitor:HDMI-A-2"
"16, monitor:HDMI-A-2"
"17, monitor:HDMI-A-2"
"18, monitor:HDMI-A-2"
"19, monitor:HDMI-A-2"
"20, monitor:HDMI-A-2"
"21, monitor:DP-2, default:true"
"22, monitor:DP-2"
"23, monitor:DP-2"
"24, monitor:DP-2"
"25, monitor:DP-2"
"26, monitor:DP-2"
"27, monitor:DP-2"
"28, monitor:DP-2"
"29, monitor:DP-2"
"30, monitor:DP-2"
# scratchpads
"special:btop, decorate:false"
@ -205,59 +205,61 @@ in {
"$mainMod, F, fullscreen, 0"
"$mainMod, D, exec, ${pkgs.procps}/bin/pkill anyrun || ${anyrun}/bin/anyrun"
"$mainMod, SPACE, togglefloating, active"
"$mainMod, O, exec, obsidian --ozone-platform=wayland --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --enable-features=WebRTCPipeWireCpaturer --disable-gpu"
# workspaces
# split-workspace is because of the split-workspace plugin
"$mainMod, 1, workspace, 1"
"$mainMod, 2, workspace, 2"
"$mainMod, 3, workspace, 3"
"$mainMod, 4, workspace, 4"
"$mainMod, 5, workspace, 5"
"$mainMod, 6, workspace, 6"
"$mainMod, 7, workspace, 7"
"$mainMod, 8, workspace, 8"
"$mainMod, 9, workspace, 9"
"$mainMod, 0, workspace, 10"
"$mainMod SHIFT, 1, movetoworkspacesilent, 1"
"$mainMod SHIFT, 2, movetoworkspacesilent, 2"
"$mainMod SHIFT, 3, movetoworkspacesilent, 3"
"$mainMod SHIFT, 4, movetoworkspacesilent, 4"
"$mainMod SHIFT, 5, movetoworkspacesilent, 5"
"$mainMod SHIFT, 6, movetoworkspacesilent, 6"
"$mainMod SHIFT, 7, movetoworkspacesilent, 7"
"$mainMod SHIFT, 8, movetoworkspacesilent, 8"
"$mainMod SHIFT, 9, movetoworkspacesilent, 9"
"$mainMod SHIFT, 0, movetoworkspacesilent, 10"
# split-workspace is because of the split-workspace plugin
# "$mainMod, 1, split-workspace, 1"
# "$mainMod, 2, split-workspace, 2"
# "$mainMod, 3, split-workspace, 3"
# "$mainMod, 4, split-workspace, 4"
# "$mainMod, 5, split-workspace, 5"
# "$mainMod, 6, split-workspace, 6"
# "$mainMod, 7, split-workspace, 7"
# "$mainMod, 8, split-workspace, 8"
# "$mainMod, 9, split-workspace, 9"
# "$mainMod, 0, split-workspace, 10"
# "$mainMod SHIFT, 1, split-movetoworkspacesilent, 1"
# "$mainMod SHIFT, 2, split-movetoworkspacesilent, 2"
# "$mainMod SHIFT, 3, split-movetoworkspacesilent, 3"
# "$mainMod SHIFT, 4, split-movetoworkspacesilent, 4"
# "$mainMod SHIFT, 5, split-movetoworkspacesilent, 5"
# "$mainMod SHIFT, 6, split-movetoworkspacesilent, 6"
# "$mainMod SHIFT, 7, split-movetoworkspacesilent, 7"
# "$mainMod SHIFT, 8, split-movetoworkspacesilent, 8"
# "$mainMod SHIFT, 9, split-movetoworkspacesilent, 9"
# "$mainMod SHIFT, 0, split-movetoworkspacesilent, 10"
# "$mainMod, 1, workspace, 1"
# "$mainMod, 2, workspace, 2"
# "$mainMod, 3, workspace, 3"
# "$mainMod, 4, workspace, 4"
# "$mainMod, 5, workspace, 5"
# "$mainMod, 6, workspace, 6"
# "$mainMod, 7, workspace, 7"
# "$mainMod, 8, workspace, 8"
# "$mainMod, 9, workspace, 9"
# "$mainMod, 0, workspace, 10"
# "$mainMod SHIFT, 1, movetoworkspacesilent, 1"
# "$mainMod SHIFT, 2, movetoworkspacesilent, 2"
# "$mainMod SHIFT, 3, movetoworkspacesilent, 3"
# "$mainMod SHIFT, 4, movetoworkspacesilent, 4"
# "$mainMod SHIFT, 5, movetoworkspacesilent, 5"
# "$mainMod SHIFT, 6, movetoworkspacesilent, 6"
# "$mainMod SHIFT, 7, movetoworkspacesilent, 7"
# "$mainMod SHIFT, 8, movetoworkspacesilent, 8"
# "$mainMod SHIFT, 9, movetoworkspacesilent, 9"
# "$mainMod SHIFT, 0, movetoworkspacesilent, 10"
# split-workspace is because of the split-workspace plugin
"$mainMod, 1, split-workspace, 1"
"$mainMod, 2, split-workspace, 2"
"$mainMod, 3, split-workspace, 3"
"$mainMod, 4, split-workspace, 4"
"$mainMod, 5, split-workspace, 5"
"$mainMod, 6, split-workspace, 6"
"$mainMod, 7, split-workspace, 7"
"$mainMod, 8, split-workspace, 8"
"$mainMod, 9, split-workspace, 9"
"$mainMod, 0, split-workspace, 10"
"$mainMod SHIFT, 1, split-movetoworkspacesilent, 1"
"$mainMod SHIFT, 2, split-movetoworkspacesilent, 2"
"$mainMod SHIFT, 3, split-movetoworkspacesilent, 3"
"$mainMod SHIFT, 4, split-movetoworkspacesilent, 4"
"$mainMod SHIFT, 5, split-movetoworkspacesilent, 5"
"$mainMod SHIFT, 6, split-movetoworkspacesilent, 6"
"$mainMod SHIFT, 7, split-movetoworkspacesilent, 7"
"$mainMod SHIFT, 8, split-movetoworkspacesilent, 8"
"$mainMod SHIFT, 9, split-movetoworkspacesilent, 9"
"$mainMod SHIFT, 0, split-movetoworkspacesilent, 10"
# Move Windows
"$mainMod SHIFT, H, movewindow, l"
"$mainMod SHIFT, J, movewindow, d"
"$mainMod SHIFT, K, movewindow, u"
"$mainMod SHIFT, L, movewindow, r"
# Screenshotting
"$mainMod, S, exec, ${pkgs.grimblast}/bin/grimblast copy area"
# File manager
"$mainMod, E, exec, ${pkgs.gnome.nautilus}/bin/nautilus"
# Toggle the four different special workspaces.
@ -267,7 +269,7 @@ in {
"$mainMod, X, togglespecialworkspace, keepassxc"
# Reload hyprland
"$mainMod, R, exec, ${hyprland}/bin/hyprctl reload"
"$mainMod, R, exec, ${cfg.package}/bin/hyprctl reload"
# Restart waybar
"$mainMod CONTROL, B, exec, ${pkgs.procps}/bin/pkill waybar || ${pkgs.waybar}/bin/waybar"
];