vars: support secrets for partitioning the disk
This commit is contained in:
@@ -25,8 +25,10 @@ in
|
||||
# Before we generate a secret we cannot know the path yet, so we need to set it to an empty string
|
||||
fileModule = file: {
|
||||
path = lib.mkIf file.config.secret (
|
||||
if file.config.neededFor == "activation" then
|
||||
"/var/lib/sops-nix/${file.config.generatorName}/${file.config.name}"
|
||||
if file.config.neededFor == "partitioning" then
|
||||
"/run/partitioning-secrets/${file.config.generatorName}/${file.config.name}"
|
||||
else if file.config.neededFor == "activation" then
|
||||
"/var/lib/sops-nix/activation/${file.config.generatorName}/${file.config.name}"
|
||||
else
|
||||
config.sops.secrets.${"vars/${file.config.generatorName}/${file.config.name}"}.path
|
||||
or "/no-such-path"
|
||||
|
||||
@@ -17,7 +17,9 @@ in
|
||||
let
|
||||
relevantFiles =
|
||||
generator:
|
||||
filterAttrs (_name: f: f.secret && f.deploy && (f.neededFor != "activation")) generator.files;
|
||||
filterAttrs (
|
||||
_name: f: f.secret && f.deploy && (f.neededFor == "users" || f.neededFor == "services")
|
||||
) generator.files;
|
||||
allFiles = flatten (
|
||||
mapAttrsToList (
|
||||
gen_name: generator:
|
||||
|
||||
Reference in New Issue
Block a user