split modules into user modules

This commit is contained in:
Bryan Ramos 2024-02-28 20:52:53 -05:00
parent 38cc658ca0
commit f445393c87
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
29 changed files with 70 additions and 78 deletions

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.bash; cfg = config.modules.user.bash;
in in
{ options.modules.bash = { enable = mkEnableOption "bash"; }; { options.modules.user.bash = { enable = mkEnableOption "user.bash"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.bash = { programs.bash = {
enable = true; enable = true;

View file

@ -1,10 +1,10 @@
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
with lib; with lib;
let cfg = config.modules.git; let cfg = config.modules.user.git;
in in
{ options.modules.git = { enable = mkEnableOption "git"; }; { options.modules.user.git = { enable = mkEnableOption "user.git"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs = { programs = {
git = { git = {

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.gpg; cfg = config.modules.user.gpg;
in in
{ options.modules.gpg = { enable = mkEnableOption "gpg"; }; { options.modules.user.gpg = { enable = mkEnableOption "user.gpg"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.gpg = { programs.gpg = {
enable = true; enable = true;

View file

@ -1,15 +1,3 @@
{ lib, config, ... }: {
with lib;
let
cfg = config.modules.gui;
in
{ options.modules.gui = { enable = mkEnableOption "gui"; };
imports = [ ./desktopEnvironments ]; imports = [ ./desktopEnvironments ];
config = mkIf cfg.enable {
modules = {
sway.enable = true;
};
};
} }

View file

@ -2,11 +2,11 @@
with lib; with lib;
let let
cfg = config.modules.sway; cfg = config.modules.user.gui.sway;
in in
{ options.modules.sway = { enable = mkEnableOption "sway"; }; { options.modules.user.gui.sway = { enable = mkEnableOption "user.gui.sway"; };
imports = [ ../modules ]; imports = [ ../../modules ];
config = mkIf cfg.enable { config = mkIf cfg.enable {
wayland.windowManager.sway = import ./config/sway.nix { inherit pkgs config lib; }; wayland.windowManager.sway = import ./config/sway.nix { inherit pkgs config lib; };
programs.rofi = import ./config/rofi.nix { inherit pkgs config lib; }; programs.rofi = import ./config/rofi.nix { inherit pkgs config lib; };

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.gui.alacritty; cfg = config.modules.user.gui.alacritty;
in in
{ options.modules.gui.alacritty = { enable = mkEnableOption "gui.alacritty"; }; { options.modules.user.gui.alacritty = { enable = mkEnableOption "user.gui.alacritty"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.alacritty = { programs.alacritty = {
enable = true; enable = true;

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.gui.browsers; cfg = config.modules.user.gui.browsers;
in in
{ options.modules.gui.browsers = { enable = mkEnableOption "gui.browsers"; }; { options.modules.user.gui.browsers = { enable = mkEnableOption "user.gui.browsers"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.firefox.enable = true; programs.firefox.enable = true;

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.gui.corn; cfg = config.modules.user.gui.corn;
in in
{ options.modules.gui.corn = { enable = mkEnableOption "gui.corn"; }; { options.modules.user.gui.corn = { enable = mkEnableOption "user.gui.corn"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
trezor-suite trezor-suite

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.gui.fun; cfg = config.modules.user.gui.fun;
in in
{ options.modules.gui.fun = { enable = mkEnableOption "gui.fun"; }; { options.modules.user.gui.fun = { enable = mkEnableOption "user.gui.fun"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.obs-studio = { programs.obs-studio = {
enable = true; enable = true;

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.gui.neovim; cfg = config.modules.user.gui.neovim;
in in
{ options.modules.gui.neovim = { enable = mkEnableOption "gui.neovim"; }; { options.modules.user.gui.neovim = { enable = mkEnableOption "user.gui.neovim"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.neovim = { programs.neovim = {
enable = true; enable = true;

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.gui.utils; cfg = config.modules.user.gui.utils;
in in
{ options.modules.gui.utils = { enable = mkEnableOption "gui.utils"; }; { options.modules.user.gui.utils = { enable = mkEnableOption "user.gui.utils"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.btop.enable = true; programs.btop.enable = true;
home.packages = with pkgs; [ home.packages = with pkgs; [

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.gui.writing; cfg = config.modules.user.gui.writing;
in in
{ options.modules.gui.writing = { enable = mkEnableOption "gui.writing"; }; { options.modules.user.gui.writing = { enable = mkEnableOption "user.gui.writing"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
mdbook mdbook

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.security; cfg = config.modules.user.security;
in in
{ options.modules.security = { enable = mkEnableOption "security"; }; { options.modules.user.security = { enable = mkEnableOption "user.security"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
pass pass

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.utils; cfg = config.modules.user.utils;
in in
{ options.modules.utils = { enable = mkEnableOption "utils"; }; { options.modules.user.utils = { enable = mkEnableOption "user.utils"; };
imports = [ ./modules ]; imports = [ ./modules ];
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.utils.dev; cfg = config.modules.user.utils.dev;
in in
{ options.modules.utils.dev = { enable = mkEnableOption "utils.dev"; }; { options.modules.user.utils.dev = { enable = mkEnableOption "user.utils.dev"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
nix-init nix-init

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.utils.email; cfg = config.modules.user.utils.email;
in in
{ options.modules.utils.email = { enable = mkEnableOption "utils.email"; }; { options.modules.user.utils.email = { enable = mkEnableOption "user.utils.email"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.aerc = { programs.aerc = {
enable = true; enable = true;

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.utils.irc; cfg = config.modules.user.utils.irc;
in in
{ options.modules.utils.irc = { enable = mkEnableOption "utils.irc"; }; { options.modules.user.utils.irc = { enable = mkEnableOption "user.utils.irc"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
weechat weechat

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.utils.vim; cfg = config.modules.user.utils.vim;
in in
{ options.modules.utils.vim = { enable = mkEnableOption "utils.vim"; }; { options.modules.user.utils.vim = { enable = mkEnableOption "user.utils.vim"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home = { home = {
packages = with pkgs; [ packages = with pkgs; [

View file

@ -20,6 +20,7 @@
home.homeDirectory = "/home/${config.user.name}"; home.homeDirectory = "/home/${config.user.name}";
modules = { modules = {
user = {
bash.enable = true; bash.enable = true;
git.enable = true; git.enable = true;
gpg.enable = true; gpg.enable = true;
@ -33,7 +34,7 @@
}; };
gui = { gui = {
enable = true; sway.enable = true;
alacritty.enable = true; alacritty.enable = true;
browsers.enable = true; browsers.enable = true;
corn.enable = true; corn.enable = true;
@ -44,4 +45,5 @@
}; };
}; };
}; };
};
} }

View file

@ -20,6 +20,7 @@
home.homeDirectory = "/home/${config.user.name}"; home.homeDirectory = "/home/${config.user.name}";
modules = { modules = {
user = {
bash.enable = true; bash.enable = true;
git.enable = true; git.enable = true;
gpg.enable = true; gpg.enable = true;
@ -34,4 +35,5 @@
}; };
}; };
}; };
};
} }