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 { inputs.nixpkgs.lib.nixosSystem {
specialArgs = args; specialArgs = args;
modules = [ modules = [
./modules/nixos
./hosts/common.nix ./hosts/common.nix
./hosts/${hostname}.nix ./hosts/${hostname}.nix
]; ];

View file

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

View file

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