diff --git a/flake.nix b/flake.nix index 99c466c..e746b32 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,7 @@ inputs.nixpkgs.lib.nixosSystem { specialArgs = args; modules = [ + ./modules/nixos ./hosts/common.nix ./hosts/${hostname}.nix ]; diff --git a/hosts/common.nix b/hosts/common.nix index b6fc328..90517b9 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -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; } diff --git a/nixosModules/boot.nix b/modules/nixos/boot.nix similarity index 100% rename from nixosModules/boot.nix rename to modules/nixos/boot.nix diff --git a/nixosModules/default.nix b/modules/nixos/default.nix similarity index 100% rename from nixosModules/default.nix rename to modules/nixos/default.nix diff --git a/nixosModules/hardware.nix b/modules/nixos/hardware.nix similarity index 91% rename from nixosModules/hardware.nix rename to modules/nixos/hardware.nix index d71ff1b..b906e40 100644 --- a/nixosModules/hardware.nix +++ b/modules/nixos/hardware.nix @@ -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; + }; + }) ]; } diff --git a/nixosModules/nix-config.nix b/modules/nixos/nix-config.nix similarity index 100% rename from nixosModules/nix-config.nix rename to modules/nixos/nix-config.nix