fix(home): Submodule opts weren't being detected correctly

This commit is contained in:
punkfairie 2024-11-16 23:29:38 -08:00
parent 910a7f1695
commit 4dd4d4a1cf
Signed by: punkfairie
GPG key ID: A509E8F77FB9D696
43 changed files with 89 additions and 176 deletions

View file

@ -1,42 +1,4 @@
{ lib, ... }:
with lib;
rec {
## Create a module option with only an enable option.
## ```nix
## options = lib.mkEnableModule "module-name"
## ```
##
#@ String
mkEnableModule = name: {
marleyos."${name}".enable = mkEnableOption "${name}";
};
## Create a NixOS module option.
##
## ```nix
## lib.mkOpt nixpkgs.lib.types.str "My default" "Description of my option."
## ```
##
#@ Type -> Any -> String
mkOpt =
type: default: description:
mkOption {
inherit
type
default
description
;
};
## Create a boolean NixOS module option.
##
## ```nix
## lib.mkBoolOpt true "Description of my option."
## ```
##
#@ Type -> Any -> String
mkBoolOpt = mkOpt types.bool;
_: {
enabled = {
## Quickly enable an option.
##

View file

@ -5,14 +5,14 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule enabled;
inherit (lib) mkEnableOption mkIf;
inherit (lib.marleyos) enabled;
cfg = config.marleyos.appearance.base;
inherit (config.marleyos.theme) colors;
in
{
options.marleyos = mkEnableModule "appearance.base";
options.marleyos.appearance.base.enable = mkEnableOption "base";
config = mkIf cfg.enable {
home.packages = with pkgs; [

View file

@ -1,18 +1,17 @@
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule enabled;
inherit (lib) mkEnableOption mkIf;
inherit (lib.marleyos) enabled;
cfg = config.marleyos.appearance.gtk;
inherit (config.marleyos.theme) colors;
in
{
options.marleyos = mkEnableModule "appearance.gtk";
options.marleyos.appearance.gtk.enable = mkEnableOption "gtk";
config = mkIf cfg.enable {
gtk = {

View file

@ -5,14 +5,13 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.appearance.qt;
inherit (config.marleyos.theme) colors;
in
{
options.marleyos = mkEnableModule "appearance.qt";
options.marleyos.appearance.qt.enable = mkEnableOption "qt";
config = mkIf cfg.enable {
xdg.configFile = mkIf (colors.base == "rose-pine") {

View file

@ -6,8 +6,7 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.amfora;
inherit (config.marleyos.theme) colors;
@ -19,7 +18,7 @@ let
themeFile = themeFiles."${colors.base}";
in
{
options.marleyos = mkEnableModule "programs.amfora";
options.marleyos.programs.amfora = mkEnableOption "amfora";
config = mkIf cfg.enable {
home.packages = with pkgs; [

View file

@ -5,14 +5,14 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule enabled;
inherit (lib) mkEnableOption mkIf;
inherit (lib.marleyos) enabled;
cfg = config.marleyos.programs.bat;
inherit (config.marleyos.theme) colors;
in
{
options.marleyos = mkEnableModule "programs.bat";
options.marleyos.programs.bat = mkEnableOption "bat";
config = mkIf cfg.enable {
programs.bat = {

View file

@ -4,14 +4,14 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule enabled;
inherit (lib) mkEnableOption mkIf;
inherit (lib.marleyos) enabled;
cfg = config.marleyos.programs.btop;
inherit (config.marleyos.theme) colors;
in
{
options.marleyos = mkEnableModule "programs.btop";
options.marleyos.programs.btop = mkEnableOption "btop";
config = mkIf cfg.enable {
programs.btop = {

View file

@ -4,14 +4,14 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule enabled;
inherit (lib) mkEnableOption mkIf;
inherit (lib.marleyos) enabled;
cfg = config.marleyos.programs.cava;
inherit (config.marleyos.theme) colors;
in
{
options.marleyos = mkEnableModule "programs.cava";
options.marleyos.programs.cava = mkEnableOption "cava";
config = mkIf cfg.enable {
programs.cava = {

View file

@ -5,8 +5,7 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.cheat;
inherit (config.marleyos.theme) colors;
@ -14,7 +13,7 @@ let
toYAML = (pkgs.formats.yaml { }).generate;
in
{
options.marleyos = mkEnableModule "programs.cheat";
options.marleyos.programs.cheat = mkEnableOption "cheat";
config = mkIf cfg.enable {
home.packages = with pkgs; [

View file

@ -5,13 +5,12 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.curl;
in
{
options.marleyos = mkEnableModule "programs.curl";
options.marleyos.programs.curl = mkEnableOption "curl";
config = mkIf cfg.enable {
home.packages = with pkgs; [

View file

@ -4,13 +4,12 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.eza;
in
{
options.marleyos = mkEnableModule "programs.eza";
options.marleyos.programs.eza = mkEnableOption "eza";
config = mkIf cfg.enable {
programs.eza = {

View file

@ -5,13 +5,12 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.figlet;
in
{
options.marleyos = mkEnableModule "programs.figlet";
options.marleyos.programs.figlet = mkEnableOption "figlet";
config = mkIf cfg.enable {
home.packages = with pkgs; [

View file

@ -5,14 +5,14 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule enabled;
inherit (lib) mkEnableOption mkIf;
inherit (lib.marleyos) enabled;
cfg = config.marleyos.programs.fish;
inherit (config.marleyos.theme) colors;
in
{
options.marleyos = mkEnableModule "programs.fish";
options.marleyos.programs.fish.enable = mkEnableOption "fish";
config = mkIf cfg.enable {
home.packages = with pkgs; [

View file

@ -4,8 +4,8 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule enabled;
inherit (lib) mkEnableOption mkIf;
inherit (lib.marleyos) enabled;
cfg = config.marleyos.programs.fzf;
inherit (config.marleyos.theme) colors;
@ -19,7 +19,7 @@ let
has-difft = config.programs.git.difftastic.enable;
in
{
options.marleyos = mkEnableModule "programs.fzf";
options.marleyos.programs.fzf.enable = mkEnableOption "fzf";
config = mkIf cfg.enable {
programs.fzf = {

View file

@ -5,13 +5,12 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.gh;
in
{
options.marleyos = mkEnableModule "programs.gh";
options.marleyos.programs.gh.enable = mkEnableOption "gh";
config = mkIf cfg.enable {
programs.gh = {

View file

@ -1,7 +1,6 @@
{
lib,
config,
namespace,
...
}:
let

View file

@ -5,13 +5,12 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.git;
in
{
options.marleyos = mkEnableModule "programs.git";
options.marleyos.programs.git.enable = mkEnableOption "git";
imports = [
./aliases.nix

View file

@ -1,19 +1,17 @@
{
lib,
config,
namespace,
pkgs,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.glow;
toYAML = (pkgs.formats.yaml { }).generate;
in
{
options.marleyos = mkEnableModule "programs.glow";
options.marleyos.programs.glow.enable = mkEnableOption "glow";
config = mkIf cfg.enable {
home.packages = with pkgs; [

View file

@ -1,17 +1,15 @@
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.gpg;
in
{
options.marleyos = mkEnableModule "programs.gpg";
options.marleyos.programs.gpg.enable = mkEnableOption "gpg";
config = mkIf cfg.enable {
programs.gpg = {

View file

@ -1,17 +1,15 @@
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.hyfetch;
in
{
options.marleyos = mkEnableModule "programs.hyfetch";
options.marleyos.programs.hyfetch.enable = mkEnableOption "hyfetch";
imports = [
./neofetch.nix

View file

@ -1,7 +1,6 @@
{
lib,
config,
namespace,
pkgs,
...
}:

View file

@ -1,17 +1,15 @@
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.journalctl;
in
{
options.marleyos = mkEnableModule "programs.journalctl";
options.marleyos.programs.journalctl.enable = mkEnableOption "journalctl";
config = mkIf cfg.enable {
home.shellAbbrs = {

View file

@ -1,18 +1,16 @@
{
lib,
config,
namespace,
pkgs,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.just;
in
{
options.marleyos = mkEnableModule "programs.just";
options.marleyos.programs.just.enable = mkEnableOption "just";
config = mkIf cfg.enable {
home.packages = with pkgs; [

View file

@ -1,19 +1,17 @@
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.lazygit;
has-delta = config.programs.git.delta.enable;
has-difft = config.programs.git.difftastic.enable;
in
{
options.marleyos = mkEnableModule "programs.lazygit";
options.marleyos.programs.lazygit.enable = mkEnableOption "lazygit";
config = mkIf cfg.enable {
programs.lazygit = {

View file

@ -1,17 +1,15 @@
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.less;
in
{
options.marleyos = mkEnableModule "programs.less";
options.marleyos.programs.less.enable = mkEnableOption "less";
config = mkIf cfg.enable {
programs.less.enable = true;

View file

@ -1,17 +1,15 @@
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.man;
in
{
options.marleyos = mkEnableModule "programs.man";
options.marleyos.programs.man.enable = mkEnableOption "man";
config = mkIf cfg.enable {
programs.man.enable = true;

View file

@ -1,17 +1,15 @@
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.ncmpcpp;
in
{
options.marleyos = mkEnableModule "programs.ncmpcpp";
options.marleyos.programs.ncmpcpp.enable = mkEnableOption "ncmpcpp";
config = mkIf cfg.enable {
programs.ncmpcpp.enable = true;

View file

@ -1,18 +1,16 @@
{
lib,
config,
namespace,
pkgs,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.neo;
in
{
options.marleyos = mkEnableModule "programs.neo";
options.marleyos.programs.neo.enable = mkEnableOption "neo";
config = mkIf cfg.enable {
home.packages = with pkgs; [

View file

@ -1,17 +1,15 @@
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.rbw;
in
{
options.marleyos = mkEnableModule "programs.rbw";
options.marleyos.programs.rbw.enable = mkEnableOption "rbw";
config = mkIf cfg.enable {
programs.rbw = {

View file

@ -1,17 +1,15 @@
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.ripgrep;
in
{
options.marleyos = mkEnableModule "programs.ripgrep";
options.marleyos.programs.ripgrep.enable = mkEnableOption "ripgrep";
config = mkIf cfg.enable {
programs.ripgrep.enable = true;

View file

@ -1,17 +1,15 @@
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.ssh;
in
{
options.marleyos = mkEnableModule "programs.ssh";
options.marleyos.programs.ssh.enable = mkEnableOption "ssh";
config = mkIf cfg.enable {
programs.ssh = {

View file

@ -5,17 +5,18 @@
}:
let
inherit (lib)
mkEnableOption
mkIf
mkForce
concatStrings
;
inherit (lib.marleyos) mkEnableModule enabled;
inherit (lib.marleyos) enabled;
cfg = config.marleyos.programs.starship;
inherit (config.marleyos.theme) colors;
in
{
options.marleyos = mkEnableModule "programs.starship";
options.marleyos.programs.starship.enable = mkEnableOption "starship";
imports = [
./nerd-font-symbols.nix

View file

@ -1,7 +1,6 @@
{
lib,
config,
namespace,
...
}:
let

View file

@ -1,17 +1,15 @@
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.systemctl;
in
{
options.marleyos = mkEnableModule "programs.systemctl";
options.marleyos.programs.systemctl.enable = mkEnableOption "systemctl";
config = mkIf cfg.enable {
home.shellAbbrs = {

View file

@ -5,14 +5,13 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.tmux;
inherit (config.marleyos.theme) colors;
in
{
options.marleyos = mkEnableModule "programs.tmux";
options.marleyos.programs.tmux.enable = mkEnableOption "tmux";
config = mkIf cfg.enable {
programs.tmux = {

View file

@ -5,8 +5,7 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.wezterm;
inherit (config.marleyos.theme) colors;
@ -14,7 +13,7 @@ let
isGenericLinux = config.targets.genericLinux.enable;
in
{
options.marleyos = mkEnableModule "programs.wezterm";
options.marleyos.programs.wezterm.enable = mkEnableOption "wezterm";
config = mkIf cfg.enable {
programs.wezterm = {

View file

@ -1,18 +1,16 @@
{
lib,
config,
namespace,
pkgs,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.wget;
in
{
options.marleyos = mkEnableModule "programs.wget";
options.marleyos.programs.wget.enable = mkEnableOption "wget";
config = mkIf cfg.enable {
home.packages = with pkgs; [

View file

@ -4,14 +4,14 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule enabled;
inherit (lib) mkEnableOption mkIf;
inherit (lib.marleyos) enabled;
cfg = config.marleyos.programs.zathura;
inherit (config.marleyos.theme) colors;
in
{
options = mkEnableModule "programs.zathura";
options.marleyos.programs.zathura.enable = mkEnableOption "zathura";
config = mkIf cfg.enable {
programs.zathura = {

View file

@ -1,17 +1,15 @@
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.zoxide;
in
{
options.marleyos = mkEnableModule "programs.zoxide";
options.marleyos.programs.zoxide.enable = mkEnableOption "zoxide";
config = mkIf cfg.enable {
programs.zoxide = {

View file

@ -1,18 +1,16 @@
{
lib,
config,
namespace,
pkgs,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.services.clipboard;
in
{
options.marleyos = mkEnableModule "services.clipboard";
options.marleyos.services.clipboard.enable = mkEnableOption "clipboard";
config = mkIf cfg.enable {
home.packages = with pkgs; [

View file

@ -5,10 +5,11 @@
}:
let
inherit (lib)
mkEnableOption
mkIf
mkMerge
;
inherit (lib.marleyos) mkEnableModule disabled;
inherit (lib.marleyos) disabled;
cfg = config.marleyos.services.dunst;
inherit (config.marleyos.theme) colors;
@ -16,7 +17,7 @@ let
isRosePine = colors.base == "rose-pine";
in
{
options.marleyos = mkEnableModule "services.dunst";
options.marleyos.services.dunst.enable = mkEnableOption "dunst";
config = mkIf cfg.enable {
services.dunst = {

View file

@ -1,18 +1,16 @@
{
lib,
config,
namespace,
pkgs,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.services.syncthing;
in
{
options.marleyos = mkEnableModule "services.syncthing";
options.marleyos.services.syncthing.enable = mkEnableOption "syncthing";
config = mkIf cfg.enable {
home.packages = [

View file

@ -4,13 +4,12 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.xorg.xsession;
in
{
options.marleyos = mkEnableModule "xorg.xsession";
options.marleyos.xorg.xsession.enable = mkEnableOption "xsession";
config = mkIf cfg.enable {
xsession = {