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

@ -30,11 +30,16 @@
programs.dconf.enable = true; programs.dconf.enable = true;
boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
modules = { modules = {
system = {
};
usrEnv = {
desktop.hyprland.enable = true;
};
other = { other = {
system = { system = {
hostname = "temperance"; hostname = "temperance";
username = "vali"; username = "vali";
gitPath = "/home/vali/repos/nichts"; gitPath = "/home/vali/projects/nichts";
}; };
home-manager = { home-manager = {
enable = true; enable = true;

View file

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

View file

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

View file

@ -1,12 +1,7 @@
{ _: {
lib,
pkgs,
config,
}: let
in {
imports = [ imports = [
./stylix.nix ./stylix.nix
./qt.nix # ./qt.nix
./gtk.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 = { git = {
signingKey = mkOption { signingKey = mkOption {
type = types.str; type = types.str;
default = ""; default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILPiRe9OH/VtWFWyy5QbAVcN7CLxr4zUtRCwmxD6aeN6";
description = "The default gpg key used for signing commits"; description = "The default gpg key used for signing commits";
}; };
}; };

View file

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

View file

@ -6,51 +6,11 @@
... ...
}: let }: let
cfg = config.modules.theming.stylix; cfg = config.modules.theming.stylix;
inherit (config.modules.theming.stylix) scheme image; inherit (config.modules.usrEnv.style.stylix) scheme image cursor fontsizes;
inherit (config.modules.theming.stylix.cursor) size; inherit (lib) mkIf;
inherit (config.modules.theming.stylix.fontsizes) terminal popups applications;
in { in {
imports = [inputs.stylix.nixosModules.stylix]; imports = [inputs.stylix.nixosModules.stylix];
options.modules.theming.stylix = { config = mkIf cfg.enable {
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 {
stylix = { stylix = {
enable = true; enable = true;
homeManagerIntegration.followSystem = true; homeManagerIntegration.followSystem = true;
@ -59,13 +19,13 @@ in {
polarity = "dark"; polarity = "dark";
autoEnable = true; autoEnable = true;
cursor = { cursor = {
inherit size; inherit (cursor) size package name;
package = pkgs.bibata-cursors; # package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic"; # name = "Bibata-Modern-Classic";
}; };
fonts = { fonts = {
sizes = { sizes = {
inherit terminal popups applications; inherit (fontsizes) terminal popups applications;
}; };
monospace = { monospace = {
package = package =

View file

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

View file

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