Move from features to option based configuration
This commit is contained in:
14
modules/home/default.nix
Normal file
14
modules/home/default.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./git.nix
|
||||
./direnv.nix
|
||||
./git.nix
|
||||
./qt.nix
|
||||
];
|
||||
}
|
||||
26
modules/home/direnv.nix
Normal file
26
modules/home/direnv.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib; let
|
||||
cfg = config.simmer.direnv;
|
||||
in
|
||||
{
|
||||
options.simmer.direnv = {
|
||||
enable = mkOption {
|
||||
description = "Whether to install and configure direnv";
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
26
modules/home/git.nix
Normal file
26
modules/home/git.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib; let
|
||||
cfg = config.simmer.git;
|
||||
in
|
||||
{
|
||||
options.simmer.git = {
|
||||
enable = mkOption {
|
||||
description = "Whether to install and configure git";
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Ethan Simmons";
|
||||
userEmail = "eesimmons9105@gmail.com";
|
||||
};
|
||||
};
|
||||
}
|
||||
37
modules/home/gtk.nix
Normal file
37
modules/home/gtk.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib; let
|
||||
cfg = config.simmer.gtk;
|
||||
gui = config.simmer.gui;
|
||||
in
|
||||
{
|
||||
options.simmer.gtk = {
|
||||
theme.enable = mkOption {
|
||||
description = "Whether to enable gtk themes";
|
||||
type = types.bool;
|
||||
default = gui.enable;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
gtk = mkIf cfg.enable {
|
||||
enable = true;
|
||||
cursorTheme = {
|
||||
name = "phinger-cursors-dark";
|
||||
package = pkgs.phinger-cursors;
|
||||
};
|
||||
iconTheme = {
|
||||
name = "awaida-dark";
|
||||
package = pkgs.gnome.adwaita-icon-theme;
|
||||
};
|
||||
theme = {
|
||||
name = "adw-gtk3-dark";
|
||||
package = pkgs.adw-gtk3;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
26
modules/home/qt.nix
Normal file
26
modules/home/qt.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib; let
|
||||
cfg = config.simmer.qt;
|
||||
gui = config.simmer.gui;
|
||||
in
|
||||
{
|
||||
options.simmer.qt = {
|
||||
theme.enable = mkOption {
|
||||
description = "Whether to enable qt themes";
|
||||
type = types.bool;
|
||||
default = gui.enable;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
qt.style = mkIf cfg.theme.enable {
|
||||
name = "adwaita-dark";
|
||||
package = pkgs.adwaita-qt;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user