97 lines
2.3 KiB
Nix
97 lines
2.3 KiB
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
inputs,
|
|
outputs,
|
|
helperLib,
|
|
...
|
|
}: let
|
|
cfg = config.myNixOS;
|
|
|
|
# Taking all modules in ./features and adding enables to them
|
|
features =
|
|
helperLib.extendModules
|
|
(name: {
|
|
extraOptions = {
|
|
myNixOS.${name}.enable = lib.mkEnableOption "enable my ${name} configuration";
|
|
};
|
|
|
|
configExtension = config: (lib.mkIf cfg.${name}.enable config);
|
|
})
|
|
(helperLib.filesIn ./features);
|
|
|
|
# taking all module bundles in ./bundles and adding bundle.enables to them
|
|
bundles =
|
|
helperLib.extendModules
|
|
(name: {
|
|
extraOptions = {
|
|
myNixOS.bundles.${name}.enable = lib.mkEnableOption "enable ${name} module bundle";
|
|
};
|
|
|
|
configExtension = config: (lib.mkIf cfg.bundles.${name}.enable config);
|
|
})
|
|
(helperLib.filesIn ./bundles);
|
|
|
|
# taking all module services in ./services and adding service.enables to them
|
|
# services =
|
|
# helperLib.extendModules
|
|
# (name: {
|
|
# extraOptions = {
|
|
# myNixOS.services.${name}.enable = lib.mkEnableOption "enable ${name} module service";
|
|
# };
|
|
#
|
|
# configExtension = config: (lib.mkIf cfg.services.${name}.enable config);
|
|
# })
|
|
# (helperLib.filesIn ./services);
|
|
in {
|
|
imports =
|
|
[
|
|
inputs.home-manager.nixosModules.home-manager
|
|
]
|
|
++ features
|
|
++ bundles
|
|
# ++ services
|
|
;
|
|
|
|
options.myNixOS = {
|
|
sharedSettings = {
|
|
# put settings here that are shared between homemanager and nixos, e.g.
|
|
# hyprland.enable = lib.mkEnableOption "enable hyprland";
|
|
|
|
mainUser = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "prunebutt";
|
|
example = "mainUser";
|
|
description = "The main user that runs the system";
|
|
};
|
|
};
|
|
};
|
|
|
|
|
|
config = {
|
|
nix.settings.experimental-features = ["nix-command" "flakes"];
|
|
programs.nix-ld.enable = true;
|
|
nixpkgs.config.allowUnfree = lib.mkDefault true;
|
|
|
|
myNixOS = {
|
|
bundles.core.enable = lib.mkDefault true;
|
|
bundles.users.enable = lib.mkDefault true;
|
|
|
|
defaultLocale.enable = lib.mkDefault true;
|
|
};
|
|
};
|
|
|
|
}
|
|
# imports = [
|
|
# ./neo.nix
|
|
# ./locale.nix
|
|
# ./pipewire.nix
|
|
# ];
|
|
#
|
|
# locale.enable = lib.mkDefault true;
|
|
# neo.enable = lib.mkDefault true;
|
|
#
|
|
# pipewire.enable = lib.mkDefault true;
|
|
# pipewire.useJack = lib.mkDefault false;
|
|
# }
|