treewide: move shared/nixosModules to modules
The idea of this refactor is, as the configuration is getting bigger and more complex, to move everything into a local modules system. The idea is to simplify hosts declaration and add a new layer of abstraction to avoid the long and redundant imports in hosts/default.nix, that I am currently using. First, we're going to move everything to the modules directory, and split options from the proper configuration. That allows us to have an easier time understanding how the options are structured, as they will follow the directory structure and won't be mixed with the module configuration.
This commit is contained in:
parent
acf42ca5e7
commit
bb55875491
25 changed files with 39 additions and 38 deletions
|
@ -11,7 +11,7 @@
|
|||
};
|
||||
|
||||
base = [
|
||||
../shared/nixosModules
|
||||
../modules
|
||||
"${self}/config/nixos"
|
||||
"${self}/config/nixos/core/home-manager.nix"
|
||||
|
||||
|
|
6
modules/default.nix
Normal file
6
modules/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./style
|
||||
./options
|
||||
];
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
imports = [
|
||||
./systemVars.nix
|
||||
./homeVars.nix
|
||||
./style
|
||||
./style.nix
|
||||
./systemVars.nix
|
||||
];
|
||||
}
|
|
@ -67,7 +67,7 @@ in {
|
|||
description = ''
|
||||
Path to an avatar image (used for hyprlock).
|
||||
'';
|
||||
default = ../../../assets/avatar.png; # TODO silly, change this
|
||||
default = ../../assets/avatar.png; # TODO silly, change this
|
||||
};
|
||||
|
||||
gtk = {
|
29
modules/style/default.nix
Normal file
29
modules/style/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = config.local.style;
|
||||
in {
|
||||
imports =
|
||||
[
|
||||
inputs.niri.nixosModules.niri
|
||||
inputs.hyprland.nixosModules.default
|
||||
]
|
||||
++ lib.filesystem.listFilesRecursive ./modules;
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
home.pointerCursor = {
|
||||
inherit (cfg.cursorTheme) name package size;
|
||||
x11.enable = true;
|
||||
gtk.enable = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = config.local.style;
|
||||
in {
|
||||
imports =
|
||||
[
|
||||
inputs.niri.nixosModules.niri
|
||||
inputs.hyprland.nixosModules.default
|
||||
|
||||
./options.nix
|
||||
]
|
||||
++ lib.filesystem.listFilesRecursive ./modules;
|
||||
|
||||
config =
|
||||
mkIf
|
||||
cfg.enable
|
||||
{
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
home.pointerCursor = {
|
||||
inherit (cfg.cursorTheme) name package size;
|
||||
x11.enable = true;
|
||||
gtk.enable = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue