refactor: put storagebox code in module
Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
parent
fc2d98e503
commit
9e0ebbdafb
4 changed files with 95 additions and 38 deletions
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
|
@ -26,43 +25,13 @@
|
|||
privateKeyFile = config.sops.secrets.wireguardKey.path;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
gocryptfs
|
||||
sshfs
|
||||
];
|
||||
|
||||
programs.ssh.knownHosts.storageBox = {
|
||||
hostNames = [ "u491729.your-storagebox.de" ];
|
||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIICf9svRenC/PLKIL9nk6K/pxQgoiFC41wTNvoIncOxs";
|
||||
};
|
||||
|
||||
fileSystems."/mnt/box" = {
|
||||
device = "u491729@u491729.your-storagebox.de:/home";
|
||||
fsType = "fuse.sshfs";
|
||||
options = [
|
||||
"defaults"
|
||||
"_netdev"
|
||||
"allow_other"
|
||||
"default_permissions"
|
||||
"port=23"
|
||||
"compression=no"
|
||||
"reconnect"
|
||||
"ServerAliveInterval=15"
|
||||
"IdentityFile=${config.sops.secrets.storageboxKey.path}"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/data" = {
|
||||
depends = [
|
||||
"/mnt/box"
|
||||
];
|
||||
device = "/mnt/box/crypt";
|
||||
fsType = "fuse.gocryptfs";
|
||||
options = [
|
||||
"rw"
|
||||
"allow_other"
|
||||
"passfile=${config.sops.secrets.storageboxCryptKey.path}"
|
||||
];
|
||||
services.storagebox = {
|
||||
enable = true;
|
||||
hostname = "u491729.your-storagebox.de";
|
||||
hostKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIICf9svRenC/PLKIL9nk6K/pxQgoiFC41wTNvoIncOxs";
|
||||
user = "u491729";
|
||||
sshKeyFile = config.sops.secrets.storageboxKey.path;
|
||||
passFile = config.sops.secrets.storageboxCryptKey.path;
|
||||
};
|
||||
|
||||
sops = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue