mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 17:49:07 +01:00
lib: Add existingPath type to validate path existence at eval time
This commit is contained in:
parent
bcf3650d2e
commit
d83843e5e1
5 changed files with 10 additions and 6 deletions
|
|
@ -9,7 +9,7 @@
|
|||
options.custom.programs.ssh = {
|
||||
enable = lib.mkEnableOption "";
|
||||
publicKeyFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
type = self.lib.types.existingPath;
|
||||
default = "${self}/users/${config.home.username}/@${osConfig.networking.hostName}/keys/ssh.pub";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ in
|
|||
|> lib.trim;
|
||||
};
|
||||
secretsFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
type = self.lib.types.existingPath;
|
||||
default = "${self}/users/${config.home.username}/@${osConfig.networking.hostName}/secrets.json";
|
||||
};
|
||||
secrets = lib.mkOption {
|
||||
|
|
|
|||
|
|
@ -28,15 +28,15 @@ in
|
|||
};
|
||||
|
||||
caCertificateFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
type = self.lib.types.existingPath;
|
||||
default = ./ca.crt;
|
||||
};
|
||||
publicKeyFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
type = self.lib.types.existingPath;
|
||||
default = "${self}/hosts/${netCfg.hostName}/keys/nebula.pub";
|
||||
};
|
||||
certificateFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
type = self.lib.types.existingPath;
|
||||
default = "${self}/hosts/${netCfg.hostName}/keys/nebula.crt";
|
||||
};
|
||||
privateKeyFile = lib.mkOption {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ in
|
|||
default = "${self}/hosts/${config.networking.hostName}/keys/age.pub" |> lib.readFile |> lib.trim;
|
||||
};
|
||||
secretsFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
type = self.lib.types.existingPath;
|
||||
default = "${self}/hosts/${config.networking.hostName}/secrets.json";
|
||||
};
|
||||
secrets = lib.mkOption {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue