From 86c16808e1beaf945c60956267514a0663b902ff Mon Sep 17 00:00:00 2001 From: punkfairie Date: Fri, 21 Feb 2025 17:52:12 -0800 Subject: [PATCH] feat(home,nixos): Auto mounting --- modules/home/bundles/desktop/default.nix | 1 + modules/home/services/udiskie/default.nix | 22 +++++++++++++++++++++ modules/nixos/bundles/desktop/default.nix | 5 ++++- modules/nixos/mounts/automounts/default.nix | 17 ++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 modules/home/services/udiskie/default.nix create mode 100644 modules/nixos/mounts/automounts/default.nix diff --git a/modules/home/bundles/desktop/default.nix b/modules/home/bundles/desktop/default.nix index 2171bb2..16f998b 100644 --- a/modules/home/bundles/desktop/default.nix +++ b/modules/home/bundles/desktop/default.nix @@ -27,6 +27,7 @@ in { services = { # syncthing = enabled; + udiskie = enabled; }; }; }; diff --git a/modules/home/services/udiskie/default.nix b/modules/home/services/udiskie/default.nix new file mode 100644 index 0000000..83be2b9 --- /dev/null +++ b/modules/home/services/udiskie/default.nix @@ -0,0 +1,22 @@ +{ + lib, + config, + pkgs, + ... +}: let + cfg = config.marleyos.services.udiskie; +in { + options.marleyos.services.udiskie.enable = lib.mkEnableOption "udiskie"; + + config = lib.mkIf cfg.enable { + services.udiskie = { + enable = true; + settings = { + program_options = { + # FIXME: set default file manager in default progs mod + file_manager = "${lib.getExe pkgs.xfce.thunar}"; + }; + }; + }; + }; +} diff --git a/modules/nixos/bundles/desktop/default.nix b/modules/nixos/bundles/desktop/default.nix index c113529..b9135e7 100644 --- a/modules/nixos/bundles/desktop/default.nix +++ b/modules/nixos/bundles/desktop/default.nix @@ -11,7 +11,10 @@ in { config = lib.mkIf cfg.enable { marleyos = { - mounts.babeshare = enabled; + mounts = { + automounts = enabled; + babeshare = enabled; + }; appearance = { base = enabled; diff --git a/modules/nixos/mounts/automounts/default.nix b/modules/nixos/mounts/automounts/default.nix new file mode 100644 index 0000000..2850e44 --- /dev/null +++ b/modules/nixos/mounts/automounts/default.nix @@ -0,0 +1,17 @@ +{ + lib, + config, + ... +}: let + cfg = config.marleyos.mounts.automounts; +in { + options.marleyos.mounts.automounts.enable = lib.mkEnableOption "automounts"; + + config = lib.mkIf cfg.enable { + boot.supportedFilesystems = { + ntfs = true; + }; + + services.udisks2.enable = true; + }; +}