feat(nixosmodules): add udisks2

This commit is contained in:
Mohammad Rafiq 2025-04-27 14:39:47 +08:00
parent d816825ac3
commit 0b393ab562
No known key found for this signature in database
6 changed files with 9 additions and 3 deletions

View file

@ -23,6 +23,7 @@
inputs.nixpkgs.lib.nixosSystem {
specialArgs = args;
modules = [
./modules/nixos
./hosts/common.nix
./hosts/${hostname}.nix
];

View file

@ -2,7 +2,6 @@
{
imports =
[
../nixosModules
../configs/security.nix
../configs/users.nix
../configs/networking.nix
@ -15,5 +14,5 @@
nixosModules.enable = true;
nix-config.enable = true;
boot-config.enable = true;
hardware-config.enable = true;
hardware-config.usbAutoMount = true;
}

View file

@ -11,7 +11,6 @@ in
{
options = {
"${moduleName}" = {
enable = lib.mkEnableOption "Enable ${moduleName}.";
cpu = lib.mkOption {
type = lib.types.str;
default = "";
@ -24,6 +23,7 @@ in
example = "nvidia";
description = "What GPU is being used.";
};
usbAutoMount = lib.mkEnableOption "Enable auto mounting USB drives.";
};
};
@ -77,5 +77,11 @@ in
"nvidia_drm"
];
})
(lib.mkIf cfg.usbAutoMount {
services.udisks2 = {
enable = true;
mountOnMedia = true;
};
})
];
}