refactor(treewide)

This commit is contained in:
ooks-io 2024-06-11 22:37:17 +12:00
parent 25d48ac2ac
commit c4fc882042
99 changed files with 634 additions and 477 deletions

View file

@ -4,11 +4,11 @@ let
inherit (lib) mkDefault mkIf;
monitors = osConfig.ooknet.host.hardware.monitors;
cfg = config.ooknet.theme.wallpaper;
cfg = config.ooknet.wallpaper;
in
{
config = mkIf cfg.enable {
ooknet.theme.wallpaper.path =
ooknet.wallpaper.path =
let
largest = f: xs: builtins.head (builtins.sort (a: b: a > b) (map f xs));
largestWidth = largest (x: x.width) monitors;

View file

@ -0,0 +1,7 @@
{
imports = [
./home-manager.nix
./mime-apps.nix
./user-dirs.nix
];
}

View file

@ -12,11 +12,15 @@
enable = true;
createDirectories = true;
desktop = "${config.home.homeDirectory}/Desktop";
code = "${config.home.homeDirectory}/Code";
documents = "${config.home.homeDirectory}/Documents";
music = "${config.home.homeDirectory}/Media/Music";
videos = "${config.home.homeDirectory}/Media/Videos";
pictures = "${config.home.homeDirectory}/Media/Pictures";
extraConfig = {
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
XDG_CODE_DIR = "${config.home.homeDirectory}/Code";
XDG_RECORDINGs_DIR = "${config.xdg.userDirs.videos}/Recordings";
};
};
};
}

View file

@ -1,10 +1,8 @@
{
imports = [
./editor # Still need to implement nvim
./fileManager
./multiplexer # Still need to implement tmux and screen
./prompt # only Starship is currently implemented
./shell
./utility
./tools
];
}

View file

@ -1,27 +1,6 @@
{ lib, ... }:
{
imports = [
./helix
# ./nvim
];
options.ooknet.console.editor = {
helix = {
enable = lib.mkEnableOption "Enable helix text editor";
default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Set helix as the default text editor in environment variables";
};
};
nvim = {
enable = lib.mkEnableOption "Enable nvim text editor";
default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Set nvim as the default text editor in environment variables";
};
};
};
}

View file

@ -1,17 +1,7 @@
{ lib, config, ... }:
{
imports = [
./zellij
#./screen
./tmux
];
options.ooknet.console.multiplexer = {
zellij = {
enable = lib.mkEnableOption "Enable zellij multiplexer";
};
tmux = {
enable = lib.mkEnableOption "Enable tmux multiplexer";
};
};
}

View file

@ -8,7 +8,7 @@ in
{
config = mkIf cfg.enable {
fzf = {
programs.fzf = {
enable = true;
enableFishIntegration = mkIf (admin.shell == "fish") true;
defaultCommand = "rg --files --hidden";

View file

@ -1,7 +1,9 @@
{ pkgs, lib, config, ... }:
let
cfg = config.ooknet.console.utility.tools;
cfg = config.ooknet.tools.utils;
in
{
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [

View file

@ -1,5 +1,5 @@
{
imports = [
./vesktop.nix
]
];
}

View file

@ -5,7 +5,7 @@ let
inherit (lib) mkIf;
cfg = config.ooknet.communication.discord;
discord = config.ooknet.desktop.discord;
fonts = config.ooknet.theme.fonts;
fonts = config.ooknet.fonts;
in
{
@ -20,7 +20,6 @@ in
*/
:root {
/* Palette */
--nix-bg1: #${palette.base00};
--nix-bg2: #${palette.base01};
--nix-bg3: #${palette.base02};

View file

@ -0,0 +1,17 @@
{ lib, config, pkgs, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.gaming.wine;
in
{
config = mkIf cfg.enable {
home.packages = with pkgs; [
winetricks
protontricks
protonup-qt
wineWowPackages.full
];
};
}

View file

@ -1,6 +1,6 @@
{
imports = [
#./spotify --- still needs to be implemented
./tui
./tui.nix
];
}

View file

@ -4,7 +4,7 @@ let
inherit (config.colorscheme) palette;
inherit (lib) mkIf;
cfg = config.ooknet.desktop.media.music.tui;
cfg = config.ooknet.media.music.tui;
zellij = config.ooknet.multiplexer.zellij;
multiplexer= config.ooknet.console.multiplexer;

View file

@ -4,7 +4,7 @@ let
inherit (config.colorscheme) palette;
inherit (lib) mkIf;
fonts = config.ooknet.fonts;
cfg = config.ooknet.desktop.terminal.foot;
cfg = config.ooknet.terminal.foot;
terminal = config.ooknet.desktop.terminal;
in

View file

@ -1,13 +1,12 @@
{ lib, config, osConfig, ... }:
{ lib, osConfig, ... }:
let
inherit (lib) mkIf;
inherit (builtins) elem;
host = osConfig.ooknet.host;
cfg = osConfig.ooknet.programs.kdeconnect;
in
{
config = mkIf (elem "workstation" host.function) {
config = mkIf cfg.enable {
services.kdeconnect = {
enable = true;
indicator = true;

View file

@ -9,6 +9,6 @@ in
{
config = mkIf (launcher == "rofi") {
home.packages = [ inputs.ooks-scripts.packages.${pkgs.system}.powermenu ];
ooknet.binds.powermenu = "powermenu -c dmenu";
ooknet.binds.powerMenu = "powermenu -c dmenu";
};
}

View file

@ -20,30 +20,24 @@ in
"SUPERSHIFT, S, exec, ${binds.steam}"
"SUPER, escape, exec, ${binds.terminalLaunch} --title=BTOP btop"
"SUPER CTRL, return, exec, ${binds.zellijMenu}"
"SUPER, delete, exec, ${binds.powermenu}"
"SUPER, delete, exec, ${binds.powerMenu}"
# Spotify PLayer Controls
"SUPER, bracketright, exec, ${spotifyctl} playback next"
"SUPER, bracketleft, exec, ${spotifyctl} playback previous"
"SUPER, backslash, exec, ${spotifyctl} playback play-pause"
"SUPER, M, exec, ${binds.spotify.launch}"
"SUPER, bracketright, exec, ${binds.spotify.next}"
"SUPER, bracketleft, exec, ${binds.spotify.previous}"
"SUPER, backslash, exec, ${binds.spotify.play}"
# Brightness
",XF86MonBrightnessUp, exec, hyprbrightness up"
",XF86MonBrightnessDown, exec, hyprbrightness down"
# Volume
",XF86AudioRaiseVolume, exec, hyprvolume up"
",XF86AudioLowerVolume, exec, hyprvolume down"
",XF86AudioMute, exec, hyprvolume mute"
# Window Management
"SUPER, Q, killactive"
"SUPER CTRL, backspace, killactive"
"SUPERSHIFT ALT, delete, exec, hyprkillsession"
@ -54,28 +48,24 @@ in
"SUPER, S, togglesplit" # dwindle
# Focus
"SUPER, left, movefocus,l"
"SUPER, right, movefocus,r"
"SUPER, up, movefocus,u"
"SUPER, down, movefocus,d"
# Move
"SUPERSHIFT, left, movewindow,l"
"SUPERSHIFT, right, movewindow,r"
"SUPERSHIFT, up, movewindow,u"
"SUPERSHIFT, down, movewindow,d"
#Resize
"SUPER CTRL, left, resizeactive,-20 0"
"SUPERCTRL, right, resizeactive,20 0"
"SUPER CTRL, up, resizeactive,0 -20"
"SUPERCTRL, down, resizeactive,0 20"
# Switch workspace
"SUPER, 1, workspace,1"
"SUPER, 2, workspace,2"
"SUPER, 3, workspace,3"
@ -91,7 +81,6 @@ in
"SUPER, tab, focusCurrentOrLast"
# Move workspace
"SUPERSHIFT, 1, movetoworkspace,1"
"SUPERSHIFT, 2, movetoworkspace,2"
"SUPERSHIFT, 3, movetoworkspace,3"

View file

@ -1,37 +1,11 @@
{ lib, config, osConfig, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.desktop.wayland;
gpu = osConfig.ooknet.host.hardware.gpu;
in
{
imports = [
./bar
./compositor
./launcher
./lockscreen
./notification
./utility
./windowManager
./launcher
./variables.nix
];
config = mkIf cfg.enable {
home.sessionVariables = {
CLUTTER_BACKEND = "wayland";
NIXOS_OZONE_WL = "1";
GDK_BACKEND = "wayland";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
MOZ_ENABLE_WAYLAND = "1";
MOZ_DBUS_REMOTE = "1";
XDG_SESSION_TYPE = "wayland";
SDL_VIDEODRIVER = "wayland";
} // mkIf (gpu == "nvidia") {
LIBVA_DRIVER_NAME = "nvidia";
GBM_BACKEND = "nvidia-drm";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
WLR_NO_HARDWARE_CURSORS = "1";
};
};
}

View file

@ -9,7 +9,7 @@ in
{
config = mkIf (wayland.locker == "hyprlock") {
ooknet.binds.locker = "hyprlock";
ooknet.binds.lock = "hyprlock";
programs.hyprlock = {
settings = {
enable = true;

View file

@ -9,7 +9,7 @@ let
in
{
config = mkIf (wayland.locker == "swaylock") {
ooknet.binds.locker = "swaylock";
ooknet.binds.lock = "swaylock";
programs.swaylock = {
enable = true;
settings = {

View file

@ -0,0 +1,28 @@
{ lib, config, osConfig, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.wayland;
gpu = osConfig.ooknet.host.hardware.gpu;
in
{
config = mkIf cfg.enable {
home.sessionVariables = {
CLUTTER_BACKEND = "wayland";
NIXOS_OZONE_WL = "1";
GDK_BACKEND = "wayland";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
MOZ_ENABLE_WAYLAND = "1";
MOZ_DBUS_REMOTE = "1";
XDG_SESSION_TYPE = "wayland";
SDL_VIDEODRIVER = "wayland";
} // mkIf (gpu == "nvidia") {
LIBVA_DRIVER_NAME = "nvidia";
GBM_BACKEND = "nvidia-drm";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
WLR_NO_HARDWARE_CURSORS = "1";
};
};
}

View file

@ -0,0 +1,10 @@
{
imports = [
./cursor.nix
./fonts.nix
./gtk.nix
./qt.nix
./theme.nix
./wallpaper.nix
];
}

View file

@ -17,7 +17,7 @@ let
};
in
{
options.ooknet.theme.fonts = {
options.ooknet.fonts = {
enable = lib.mkEnableOption "Whether to enable font profiles";
monospace = mkFontOption "monospace";
regular = mkFontOption "regular";

View file

@ -5,5 +5,5 @@ let
in
{
options.ooknet.gtk.enable = mkEnableOption;
options.ooknet.gtk.enable = mkEnableOption "";
}

View file

@ -0,0 +1,8 @@
{
imports = [
./editor.nix
./multiplexer.nix
./shell.nix
./tools.nix
];
}

8
home/options/default.nix Normal file
View file

@ -0,0 +1,8 @@
{
imports = [
./appearance
./console
./desktop
./profiles
];
}

View file

@ -0,0 +1,15 @@
{
imports = [
./binds.nix
./browser.nix
./communication.nix
./creative.nix
./gaming.nix
./media.nix
./productivity.nix
./security.nix
./terminal.nix
./tools.nix
./wayland.nix
];
}

View file

@ -9,5 +9,6 @@ in
factorio.enable = mkEnableOption "";
bottles.enable = mkEnableOption "";
lutris.enable = mkEnableOption "";
wine.enable = mkEnableOption "";
};
}

View file

@ -7,5 +7,6 @@ in
{
options.ooknet.terminal = {
foot.enable = mkEnableOption "";
kitty.enable = mkEnableOption "";
};
}

View file

@ -6,7 +6,7 @@ let
in
{
ooknet.wayland = {
options.ooknet.wayland = {
enable = mkEnableOption "";
compositor = mkOption {
type = nullOr (enum [ "hyprland" ]);

View file

@ -0,0 +1,6 @@
{
imports = [
./desktop.nix
./console.nix
];
}

View file

@ -1,42 +1,7 @@
{ lib, config, ... }:
let
profileEnabler = let
reducer = l: r: {"${r}".enable = true;} // l;
in
builtins.foldl' reducer {} config.activeProfiles;
in
{
imports = [
./base
./hyprland
#./creative
./productivity
./gaming
./desktop-environments
./themes
./suites
];
options = {
activeProfiles = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
};
profiles = {
base = {
enable = lib.mkEnableOption "Enable the base profile";
};
hyprland = {
enable = lib.mkEnableOption "Enable the hyprland profile";
};
gaming = {
enable = lib.mkEnableOption "Enable the gaming profile";
};
productivity = {
enable = lib.mkEnableOption "Enable the productivity profile";
};
};
};
config.profiles = profileEnabler;
}

View file

@ -0,0 +1,5 @@
{
imports = [
./hyprland.nix
];
}

View file

@ -0,0 +1,16 @@
{ osConfig, lib, ... }:
let
inherit (lib) mkIf;
inherit (builtins) elem;
profiles = osConfig.ooknet.host.profiles;
in
{
config = mkIf (elem "creative" profiles) {
ooknet.creative = {
audacity.enable = true;
inkscape.enable = true;
};
};
}

View file

@ -0,0 +1,7 @@
{
imports = [
./gaming.nix
./creative.nix
./productivity.nix
];
}

View file

@ -1,25 +1,16 @@
{ config, lib, pkgs, ... }:
let
cfg = config.profiles.gaming;
in
{
{ osConfig, lib, ... }:
imports = [
../../modules
];
config = lib.mkIf cfg.enable {
homeModules.desktop = {
gaming = {
lutris.enable = false;
};
let
inherit (lib) mkIf;
inherit (builtins) elem;
profiles = osConfig.ooknet.host.profiles;
in
{
config = mkIf (elem "gaming" profiles) {
ooknet.gaming = {
wine.enable = true;
bottles.enable = true;
};
home.packages = with pkgs; [
bottles
winetricks
protontricks
protonup-qt
wineWowPackages.full
];
};
}

View file

@ -1,20 +1,17 @@
{ config, lib, ... }:
let
cfg = config.profiles.productivity;
in
{
{ osConfig, lib, ... }:
imports = [
../../modules
];
config = lib.mkIf cfg.enable {
homeModules.desktop = {
productivity = {
obsidian.enable = true;
zathura.enable = true;
office.enable = true;
};
let
inherit (lib) mkIf;
inherit (builtins) elem;
profiles = osConfig.ooknet.host.profiles;
in
{
config = mkIf (elem "productiviy" profiles) {
ooknet.productivity = {
notes.obsidian.enable = true;
office.libreoffice.enable = true;
pdf.zathura.enable = true;
};
};
}

View file

@ -1,29 +1,6 @@
{ lib, config, ... }:
# let
# cfg = config.theme;
# in
{
imports = [
./minimal
./phone
./minimal.nix
# ./phone.nix
];
options.theme = {
minimal.enable = lib.mkEnableOption "enable minimal theme";
phone.enable = lib.mkEnableOption "Enable phone theme";
};
# config = {
# assertions = [
# {
# assertion =
# (lib.length (lib.filter (x: x) [
# cfg.minimal or false
# cfg.OTHERTHEMEHERE or false
# ]) <= 1);
# }
# ];
# };
}

View file

@ -7,7 +7,6 @@ let
in
{
imports = [ inputs.nix-colors.homeManagerModule ];
config = mkIf (theme == "phone") {
colorscheme = colorSchemes.gruvbox-material-dark-soft;