Refactor home modules into config + options
This commit is contained in:
@ -12,10 +12,10 @@ with mylib.modules; let
|
||||
cfgfp = config.modules.flatpak;
|
||||
in {
|
||||
imports = [
|
||||
../flatpak.nix
|
||||
../flatpak
|
||||
];
|
||||
|
||||
options.modules.audio = import ./options.nix { inherit lib; };
|
||||
options.modules.audio = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "Audio module";
|
||||
|
||||
|
@ -8,20 +8,20 @@
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./audio/default.nix
|
||||
./emacs/default.nix
|
||||
./email/default.nix
|
||||
./firefox/default.nix
|
||||
./fish/default.nix
|
||||
./flatpak/default.nix
|
||||
./gaming/default.nix
|
||||
./gnome/default.nix
|
||||
./hyprland/default.nix
|
||||
./kitty/default.nix
|
||||
./misc/default.nix
|
||||
./neovim/default.nix
|
||||
./nextcloud/default.nix
|
||||
./plasma/default.nix
|
||||
./ranger/default.nix
|
||||
./audio
|
||||
./emacs
|
||||
./email
|
||||
./firefox
|
||||
./fish
|
||||
./flatpak
|
||||
./gaming
|
||||
./gnome
|
||||
./hyprland
|
||||
./kitty
|
||||
./misc
|
||||
./neovim
|
||||
./nextcloud
|
||||
./plasma
|
||||
./ranger
|
||||
];
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ in {
|
||||
|
||||
# Options is a vector of options this module defines
|
||||
# This module defines only the "emacs" option and suboptions "enable" and "doom"
|
||||
options.modules.emacs = import ./options.nix { inherit lib; };
|
||||
options.modules.emacs = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
# Config is the merged set of all module configurations
|
||||
# Here we define what happens to the config if the module is active (but only if the module is active)
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "Emacs module";
|
||||
|
||||
|
@ -14,7 +14,7 @@ with lib;
|
||||
with mylib.modules; let
|
||||
cfg = config.modules.email;
|
||||
in {
|
||||
options.modules.email = import ./options.nix { inherit lib; };
|
||||
options.modules.email = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
# TODO: Add Maildir to nextcloud sync
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "Email";
|
||||
autosync = mkEnableOpt "Automatically call \"notmuch new\" via systemd timer";
|
||||
|
@ -12,7 +12,7 @@ with lib;
|
||||
with mylib.modules; let
|
||||
cfg = config.modules.firefox;
|
||||
in {
|
||||
options.modules.firefox = import ./options.nix { inherit lib; };
|
||||
options.modules.firefox = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs;
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "Firefox";
|
||||
wayland = mkBoolOpt false "Enable firefox wayland support";
|
||||
|
@ -10,7 +10,7 @@ with lib;
|
||||
with mylib.modules; let
|
||||
cfg = config.modules.fish;
|
||||
in {
|
||||
options.modules.fish = import ./options.nix { inherit lib; };
|
||||
options.modules.fish = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.fish = {
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "Fish";
|
||||
}
|
@ -14,7 +14,7 @@ with mylib.modules;
|
||||
let
|
||||
cfg = config.modules.flatpak;
|
||||
in {
|
||||
options.modules.flatpak = import ./options.nix { inherit lib; };
|
||||
options.modules.flatpak = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "Flatpak module";
|
||||
fontFix = mkBoolOpt true "Link fonts to ~/.local/share/fonts so flatpak apps can find them";
|
||||
|
@ -12,14 +12,14 @@ with mylib.modules; let
|
||||
in {
|
||||
imports = [
|
||||
# NOTE: I don't know if this is the right approach or if I should use config.modules.flatpak
|
||||
./flatpak.nix
|
||||
../flatpak
|
||||
];
|
||||
|
||||
# TODO: Enable flatpak MangoHud, there are multiple versions, Steam.Utility.MangoHud works but can't be configured (in ~/.config/MangoHud), other versions don't even work (need to figure that out as Steam.Utility.MangoHud is EOL...)
|
||||
# TODO: SteamTinkerLaunch option
|
||||
# TODO: Dolphin + SteamRomManager option
|
||||
|
||||
options.modules.gaming = import ./options.nix { inherit lib; };
|
||||
options.modules.gaming = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "Gaming module";
|
||||
|
||||
|
@ -10,7 +10,7 @@ with lib;
|
||||
with mylib.modules; let
|
||||
cfg = config.modules.gnome;
|
||||
in {
|
||||
options.modules.gnome = import ./options.nix { inherit lib; };
|
||||
options.modules.gnome = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "Gnome Desktop";
|
||||
# TODO: Add option for dash-to-dock
|
||||
|
@ -10,7 +10,7 @@ with lib;
|
||||
with mylib.modules; let
|
||||
cfg = config.modules.hyprland;
|
||||
in {
|
||||
options.modules.hyprland = import ./options.nix { inherit lib; };
|
||||
options.modules.hyprland = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
config = let
|
||||
# Taken from https://github.com/Ruixi-rebirth/flakes/blob/main/modules/programs/wayland/waybar/workspace-patch.nix
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "Hyprland Window Manager + Compositor";
|
||||
|
||||
|
@ -11,7 +11,7 @@ with mylib.modules; let
|
||||
cfg = config.modules.kitty;
|
||||
# cfgnv = config.modules.neovim;
|
||||
in {
|
||||
options.modules.kitty = import ./options.nix { inherit lib; };
|
||||
options.modules.kitty = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.kitty = {
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "Kitty";
|
||||
}
|
@ -10,7 +10,7 @@ with lib;
|
||||
with mylib.modules; let
|
||||
cfg = config.modules.misc;
|
||||
in {
|
||||
options.modules.misc = import ./options.nix { inherit lib; };
|
||||
options.modules.misc = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs;
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "Misc module";
|
||||
|
||||
|
@ -10,7 +10,7 @@ with lib;
|
||||
with mylib.modules; let
|
||||
cfg = config.modules.neovim;
|
||||
in {
|
||||
options.modules.neovim = import ./options.nix { inherit lib; };
|
||||
options.modules.neovim = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# TODO: Configure by option
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "NeoVim";
|
||||
alias = mkBoolOpt false "Link nvim to vim/vi";
|
||||
|
@ -13,7 +13,7 @@ with lib;
|
||||
with mylib.modules; let
|
||||
cfg = config.modules.nextcloud;
|
||||
in {
|
||||
options.modules.nextcloud = import ./options.nix { inherit lib; };
|
||||
options.modules.nextcloud = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "Nextcloud Client";
|
||||
autostart = mkBoolOpt false "Autostart the Nextcloud client (systemd)";
|
||||
|
@ -11,7 +11,7 @@ with lib;
|
||||
with mylib.modules; let
|
||||
cfg = config.modules.plasma;
|
||||
in {
|
||||
options.modules.plasma = import ./options.nix { inherit lib; };
|
||||
options.modules.plasma = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "Plasma Desktop";
|
||||
}
|
@ -10,7 +10,7 @@ with lib;
|
||||
with mylib.modules; let
|
||||
cfg = config.modules.ranger;
|
||||
in {
|
||||
options.modules.ranger = import ./options.nix { inherit lib; };
|
||||
options.modules.ranger = import ./options.nix { inherit lib mylib; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs;
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
lib
|
||||
lib,
|
||||
mylib
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules;
|
||||
{
|
||||
enable = mkEnableOpt "Ranger";
|
||||
preview = mkBoolOpt false "Enable Ranger image preview";
|
||||
|
Reference in New Issue
Block a user