secrets: cleanup activation scripts
This commit is contained in:
@@ -13,11 +13,13 @@
|
||||
# Configure all agenix secrets
|
||||
age.secrets = {
|
||||
# ZFS encryption key
|
||||
# path is set to /etc/zfs-key to match the ZFS dataset keylocation property
|
||||
zfs-key = {
|
||||
file = ../secrets/zfs-key.age;
|
||||
mode = "0400";
|
||||
owner = "root";
|
||||
group = "root";
|
||||
path = "/etc/zfs-key";
|
||||
};
|
||||
|
||||
# Secureboot keys archive
|
||||
@@ -53,9 +55,9 @@
|
||||
|
||||
slskd_env = {
|
||||
file = ../secrets/slskd_env.age;
|
||||
mode = "0400";
|
||||
owner = "root";
|
||||
group = "root";
|
||||
mode = "0500";
|
||||
owner = config.services.slskd.user;
|
||||
group = config.services.slskd.group;
|
||||
};
|
||||
|
||||
# Network configuration
|
||||
|
||||
@@ -4,24 +4,7 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
# DO NOT CHANGE
|
||||
# path is set via a zfs property
|
||||
zfs-key = "/etc/zfs-key";
|
||||
in
|
||||
{
|
||||
system.activationScripts = {
|
||||
# Copy decrypted ZFS key from agenix to expected location
|
||||
# /etc is on tmpfs due to impermanence, so no persistent storage risk
|
||||
"zfs-key".text = ''
|
||||
#!/bin/sh
|
||||
rm -f ${zfs-key} || true
|
||||
cp ${config.age.secrets.zfs-key.path} ${zfs-key}
|
||||
chmod 0400 ${zfs-key}
|
||||
chown root:root ${zfs-key}
|
||||
'';
|
||||
};
|
||||
|
||||
boot.zfs.package = pkgs.zfs;
|
||||
boot.initrd.kernelModules = [ "zfs" ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user