add(nixos): mount truenas share

This commit is contained in:
Léana 江 2023-12-27 12:00:05 +01:00 committed by Léana 江
parent 7bf69d1f3c
commit e51fe54d57
6 changed files with 41 additions and 23 deletions

View file

@ -4,6 +4,8 @@
imports = [
./hardware-configuration.nix
# ./agenix.nix
./battery.nix
./gui.nix
./locale.nix
@ -19,6 +21,7 @@
programs.fish.enable = true;
environment.shells = [pkgs.fish];
users.users.leana = {
uid = 1000;
shell = pkgs.fish;
isNormalUser = true;
description = "leana";
@ -32,7 +35,6 @@
};
hardware.pulseaudio.enable = true;
nix = {
package = pkgs.nixFlakes;
extraOptions = ''

View file

@ -1,4 +1,5 @@
{
config,
hostname,
pkgs,
...
@ -12,4 +13,19 @@
hardware.bluetooth.enable = true;
services.blueman.enable = true;
age.identityPaths = ["/home/leana/.ssh/id_ed25519"];
age.secrets.truenas_smb = {
file = ../../secrets/truenas_smb.age;
};
environment.systemPackages = [pkgs.cifs-utils];
fileSystems."/mnt/data" = {
device = "//10.0.0.20/data";
fsType = "cifs";
options = let
prevent_hanging = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
auth = "credentials=${config.age.secrets.truenas_smb.path}";
uid = "uid=${toString config.users.users.leana.uid}";
in ["${prevent_hanging},${auth},${uid}"];
};
}