diff --git a/hosts/lavaridge/default.nix b/hosts/lavaridge/default.nix index c135f4ec..d3e3e409 100644 --- a/hosts/lavaridge/default.nix +++ b/hosts/lavaridge/default.nix @@ -31,6 +31,7 @@ alyraffauf = { base = { enable = true; + sambaAutoMount = true; plymouth.enable = true; zramSwap = {enable = true;}; }; diff --git a/hosts/petalburg/default.nix b/hosts/petalburg/default.nix index a8d252a8..ddf8c4f7 100644 --- a/hosts/petalburg/default.nix +++ b/hosts/petalburg/default.nix @@ -27,6 +27,7 @@ alyraffauf = { base = { enable = true; + sambaAutoMount = true; plymouth.enable = true; zramSwap = {enable = true;}; }; diff --git a/hosts/rustboro/default.nix b/hosts/rustboro/default.nix index f70ac2e6..eb4930b8 100644 --- a/hosts/rustboro/default.nix +++ b/hosts/rustboro/default.nix @@ -21,45 +21,10 @@ networking.hostName = "rustboro"; # Define your hostname. - fileSystems = { - "/mnt/Archive" = { - device = "//mauville/Archive"; - fsType = "cifs"; - options = [ - "gid=100" - "guest" - "nofail" - "uid=${toString config.users.users.aly.uid}" - "x-systemd.after=network.target" - "x-systemd.after=tailscaled.service" - "x-systemd.automount" - "x-systemd.device-timeout=5s" - "x-systemd.idle-timeout=60" - "x-systemd.mount-timeout=5s" - ]; - }; - - "/mnt/Media" = { - device = "//mauville/Media"; - fsType = "cifs"; - options = [ - "gid=100" - "guest" - "nofail" - "uid=${toString config.users.users.aly.uid}" - "x-systemd.after=network.target" - "x-systemd.after=tailscaled.service" - "x-systemd.automount" - "x-systemd.device-timeout=5s" - "x-systemd.idle-timeout=60" - "x-systemd.mount-timeout=5s" - ]; - }; - }; - alyraffauf = { base = { enable = true; + sambaAutoMount = true; plymouth.enable = true; zramSwap = { enable = true; diff --git a/nixosModules/base/networking/default.nix b/nixosModules/base/networking/default.nix index b47baaeb..587553fb 100644 --- a/nixosModules/base/networking/default.nix +++ b/nixosModules/base/networking/default.nix @@ -5,6 +5,7 @@ pkgs, ... }: { + imports = [./sambaAutoMount.nix]; config = lib.mkIf config.alyraffauf.base.enable { age.secrets.wifi.file = ../../../secrets/wifi.age; diff --git a/nixosModules/base/networking/sambaAutoMount.nix b/nixosModules/base/networking/sambaAutoMount.nix new file mode 100644 index 00000000..52e99b69 --- /dev/null +++ b/nixosModules/base/networking/sambaAutoMount.nix @@ -0,0 +1,45 @@ +{ + config, + inputs, + lib, + pkgs, + ... +}: { + config = lib.mkIf config.alyraffauf.base.sambaAutoMount { + fileSystems = { + "/mnt/Archive" = { + device = "//mauville/Archive"; + fsType = "cifs"; + options = [ + "gid=100" + "guest" + "nofail" + "uid=${toString config.users.users.aly.uid}" + "x-systemd.after=network.target" + "x-systemd.after=tailscaled.service" + "x-systemd.automount" + "x-systemd.device-timeout=5s" + "x-systemd.idle-timeout=60" + "x-systemd.mount-timeout=5s" + ]; + }; + + "/mnt/Media" = { + device = "//mauville/Media"; + fsType = "cifs"; + options = [ + "gid=100" + "guest" + "nofail" + "uid=${toString config.users.users.aly.uid}" + "x-systemd.after=network.target" + "x-systemd.after=tailscaled.service" + "x-systemd.automount" + "x-systemd.device-timeout=5s" + "x-systemd.idle-timeout=60" + "x-systemd.mount-timeout=5s" + ]; + }; + }; + }; +} diff --git a/nixosModules/options.nix b/nixosModules/options.nix index c2bd047d..a960a907 100644 --- a/nixosModules/options.nix +++ b/nixosModules/options.nix @@ -22,9 +22,6 @@ lib.mkEnableOption "Virt-manager for virtual machines with TPM and EFI support."; }; - base.enable = - lib.mkEnableOption "Basic system configuration and sane defaults."; - containers = { nixos = { audiobookshelf = { @@ -235,6 +232,9 @@ tailscale.enable = lib.mkEnableOption "Tailscale WireGuard VPN."; }; base = { + enable = + lib.mkEnableOption "Basic system configuration and sane defaults."; + sambaAutoMount = lib.mkEnableOption "Automounting of mauville Samba Shares."; plymouth.enable = lib.mkEnableOption "Plymouth boot screen with catppuccin theme."; power-profiles-daemon.enable = lib.mkOption {