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

@ -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;