nixos: added option to automount mauville Samba shares for user aly at boot

This commit is contained in:
Aly Raffauf 2024-06-18 19:44:31 -04:00
parent 9f10655a6c
commit 47d1432434
6 changed files with 52 additions and 39 deletions

View file

@ -31,6 +31,7 @@
alyraffauf = { alyraffauf = {
base = { base = {
enable = true; enable = true;
sambaAutoMount = true;
plymouth.enable = true; plymouth.enable = true;
zramSwap = {enable = true;}; zramSwap = {enable = true;};
}; };

View file

@ -27,6 +27,7 @@
alyraffauf = { alyraffauf = {
base = { base = {
enable = true; enable = true;
sambaAutoMount = true;
plymouth.enable = true; plymouth.enable = true;
zramSwap = {enable = true;}; zramSwap = {enable = true;};
}; };

View file

@ -21,45 +21,10 @@
networking.hostName = "rustboro"; # Define your hostname. 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 = { alyraffauf = {
base = { base = {
enable = true; enable = true;
sambaAutoMount = true;
plymouth.enable = true; plymouth.enable = true;
zramSwap = { zramSwap = {
enable = true; enable = true;

View file

@ -5,6 +5,7 @@
pkgs, pkgs,
... ...
}: { }: {
imports = [./sambaAutoMount.nix];
config = lib.mkIf config.alyraffauf.base.enable { config = lib.mkIf config.alyraffauf.base.enable {
age.secrets.wifi.file = ../../../secrets/wifi.age; age.secrets.wifi.file = ../../../secrets/wifi.age;

View file

@ -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"
];
};
};
};
}

View file

@ -22,9 +22,6 @@
lib.mkEnableOption "Virt-manager for virtual machines with TPM and EFI support."; lib.mkEnableOption "Virt-manager for virtual machines with TPM and EFI support.";
}; };
base.enable =
lib.mkEnableOption "Basic system configuration and sane defaults.";
containers = { containers = {
nixos = { nixos = {
audiobookshelf = { audiobookshelf = {
@ -235,6 +232,9 @@
tailscale.enable = lib.mkEnableOption "Tailscale WireGuard VPN."; tailscale.enable = lib.mkEnableOption "Tailscale WireGuard VPN.";
}; };
base = { base = {
enable =
lib.mkEnableOption "Basic system configuration and sane defaults.";
sambaAutoMount = lib.mkEnableOption "Automounting of mauville Samba Shares.";
plymouth.enable = plymouth.enable =
lib.mkEnableOption "Plymouth boot screen with catppuccin theme."; lib.mkEnableOption "Plymouth boot screen with catppuccin theme.";
power-profiles-daemon.enable = lib.mkOption { power-profiles-daemon.enable = lib.mkOption {