refactor(modules): clean up folder structure

This commit is contained in:
Mohammad Rafiq 2025-07-07 19:24:36 +08:00
parent d8aa7f62b4
commit 03fca8b28b
No known key found for this signature in database
12 changed files with 32 additions and 38 deletions

View file

@ -1,7 +1,38 @@
{ lib, ... }:
let
inherit (lib.options) mkEnableOption;
inherit (lib.modules) mkIf mkMerge;
in
{
flake.modules.nixos.default =
{ modulesPath, ... }:
{ config, modulesPath, ... }:
let
cfg = config.machine;
in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
options.machine.bluetooth.enable = mkEnableOption "";
options.machine.usb.automount = mkEnableOption "";
config = mkMerge [
(mkIf cfg.usb.automount {
services.udisks2.enable = true;
home-manager.sharedModules = [
{
services.udiskie = {
enable = true;
automount = true;
notify = true;
};
}
];
})
(mkIf cfg.bluetooth.enable {
persistDirs = [ "/var/lib/bluetooth" ];
hardware.bluetooth = {
enable = true;
settings.General.Experimental = true;
};
})
];
};
}

View file

@ -1,37 +0,0 @@
{ lib, ... }:
let
inherit (lib.options) mkEnableOption;
inherit (lib.modules) mkIf mkMerge;
in
{
flake.modules.nixos.default =
{ config, ... }:
let
cfg = config.machine;
in
{
options.machine.bluetooth.enable = mkEnableOption "";
options.machine.usb.automount = mkEnableOption "";
config = mkMerge [
(mkIf cfg.usb.automount {
services.udisks2.enable = true;
home-manager.sharedModules = [
{
services.udiskie = {
enable = true;
automount = true;
notify = true;
};
}
];
})
(mkIf cfg.bluetooth.enable {
persistDirs = [ "/var/lib/bluetooth" ];
hardware.bluetooth = {
enable = true;
settings.General.Experimental = true;
};
})
];
};
}