mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-24 02:11:29 +01:00
feat(hosts): cifs mount
This commit is contained in:
@@ -104,7 +104,6 @@ See [./secrets](./secrets) for details.
|
||||
> :red_circle: **IMPORTANT**: **You should NOT deploy this flake directly on your machine
|
||||
> :exclamation: It will not succeed.** This flake contains my hardware configuration(such as
|
||||
> [hardware-configuration.nix](hosts/idols-ai/hardware-configuration.nix),
|
||||
> [cifs-mount.nix](https://github.com/ryan4yin/nix-config/blob/v0.1.1/hosts/idols_ai/cifs-mount.nix),
|
||||
> [Nvidia Support](https://github.com/ryan4yin/nix-config/blob/v0.1.1/hosts/idols-ai/default.nix#L77-L91),
|
||||
> etc.) which is not suitable for your hardwares, and requires my private secrets repository
|
||||
> [ryan4yin/nix-secrets](https://github.com/ryan4yin/nix-config/tree/main/secrets) to deploy. You
|
||||
|
||||
@@ -37,14 +37,13 @@
|
||||
"ntfs"
|
||||
"fat"
|
||||
"vfat"
|
||||
"cifs" # mount windows share
|
||||
];
|
||||
|
||||
# clear /tmp on boot to get a stateless /tmp directory.
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
boot.initrd = {
|
||||
# unlocked luks devices via a keyfile or prompt a passphrase.
|
||||
luks.devices."crypted-nixos" = {
|
||||
luks.devices."encrypted-nixos" = {
|
||||
device = "/dev/nvme0n1p4";
|
||||
# the keyfile(or device partition) that should be used as the decryption key for the encrypted device.
|
||||
# if not specified, you will be prompted for a passphrase instead.
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
config,
|
||||
myvars,
|
||||
...
|
||||
}: {
|
||||
# mount a smb/cifs share
|
||||
fileSystems."/home/${myvars.username}/SMB-Downloads" = {
|
||||
device = "//192.168.5.194/Downloads";
|
||||
fsType = "cifs";
|
||||
options = [
|
||||
# https://www.freedesktop.org/software/systemd/man/latest/systemd.mount.html
|
||||
"nofail,_netdev"
|
||||
"uid=1000,gid=100,dir_mode=0755,file_mode=0755"
|
||||
"vers=3.0,credentials=${config.age.secrets.smb-credentials.path}"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -8,7 +8,7 @@ let
|
||||
hostName = "ai"; # Define your hostname.
|
||||
in {
|
||||
imports = [
|
||||
./cifs-mount.nix
|
||||
./netdev-mount.nix
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
"ntfs"
|
||||
"fat"
|
||||
"vfat"
|
||||
"cifs" # mount windows share
|
||||
];
|
||||
|
||||
boot.initrd = {
|
||||
|
||||
37
hosts/idols-ai/netdev-mount.nix
Normal file
37
hosts/idols-ai/netdev-mount.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
config,
|
||||
myvars,
|
||||
...
|
||||
}: {
|
||||
# supported file systems, so we can mount any removable disks with these filesystems
|
||||
boot.supportedFilesystems = [
|
||||
# "cifs"
|
||||
"davfs"
|
||||
];
|
||||
|
||||
# mount a smb/cifs share
|
||||
# fileSystems."/home/${myvars.username}/SMB-Downloads" = {
|
||||
# device = "//windows-server-nas/Downloads";
|
||||
# fsType = "cifs";
|
||||
# options = [
|
||||
# # https://www.freedesktop.org/software/systemd/man/latest/systemd.mount.html
|
||||
# "nofail,_netdev"
|
||||
# "uid=1000,gid=100,dir_mode=0755,file_mode=0755"
|
||||
# "vers=3.0,credentials=${config.age.secrets.smb-credentials.path}"
|
||||
# ];
|
||||
# };
|
||||
|
||||
# mount a webdav share
|
||||
# https://wiki.archlinux.org/title/Davfs2
|
||||
# fileSystems."/home/${myvars.username}/webdav-downloads" = {
|
||||
# device = "https://webdav.writefor.fun/Downloads";
|
||||
# fsType = "davfs";
|
||||
# options = [
|
||||
# # https://www.freedesktop.org/software/systemd/man/latest/systemd.mount.html
|
||||
# "nofail,_netdev"
|
||||
# "uid=1000,gid=100,dir_mode=0755,file_mode=0755"
|
||||
# ];
|
||||
# };
|
||||
# davfs2 reads its credentials from /etc/davfs2/secrets
|
||||
# environment.etc."davfs2/secrets".source = config.age.secrets."davfs-secrets".path;
|
||||
}
|
||||
@@ -23,7 +23,6 @@ in {
|
||||
"fat"
|
||||
"vfat"
|
||||
"exfat"
|
||||
"cifs" # mount windows share
|
||||
];
|
||||
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
|
||||
@@ -25,7 +25,6 @@ in {
|
||||
"fat"
|
||||
"vfat"
|
||||
"exfat"
|
||||
"cifs" # mount windows share
|
||||
];
|
||||
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
"ntfs"
|
||||
"fat"
|
||||
"vfat"
|
||||
"cifs" # mount windows share
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
|
||||
@@ -17,7 +17,6 @@ in {
|
||||
"vfat"
|
||||
"exfat"
|
||||
"nfs" # required by longhorn
|
||||
"cifs" # mount windows share
|
||||
];
|
||||
|
||||
boot.kernelModules = ["kvm-amd" "vfio-pci"];
|
||||
|
||||
Reference in New Issue
Block a user