clanCore module: add clanSchema top level option
This commit is contained in:
@@ -5,9 +5,13 @@
|
|||||||
check-clan-template = pkgs.writeShellScriptBin "check-clan-template" ''
|
check-clan-template = pkgs.writeShellScriptBin "check-clan-template" ''
|
||||||
#!${pkgs.bash}/bin/bash
|
#!${pkgs.bash}/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
export TMPDIR=$(${pkgs.coreutils}/bin/mktemp -d)
|
export TMPDIR=$(${pkgs.coreutils}/bin/mktemp -d)
|
||||||
trap "${pkgs.coreutils}/bin/chmod -R +w '$TMPDIR'; ${pkgs.coreutils}/bin/rm -rf '$TMPDIR'" EXIT
|
trap "${pkgs.coreutils}/bin/chmod -R +w '$TMPDIR'; ${pkgs.coreutils}/bin/rm -rf '$TMPDIR'" EXIT
|
||||||
|
|
||||||
export PATH="${lib.makeBinPath [
|
export PATH="${lib.makeBinPath [
|
||||||
|
pkgs.coreutils
|
||||||
|
pkgs.curl
|
||||||
pkgs.gitMinimal
|
pkgs.gitMinimal
|
||||||
pkgs.gnugrep
|
pkgs.gnugrep
|
||||||
pkgs.jq
|
pkgs.jq
|
||||||
@@ -35,6 +39,9 @@
|
|||||||
|
|
||||||
echo check machine1 appears in nixosConfigurations
|
echo check machine1 appears in nixosConfigurations
|
||||||
nix flake show --json | jq '.nixosConfigurations' | grep -q machine1
|
nix flake show --json | jq '.nixosConfigurations' | grep -q machine1
|
||||||
|
|
||||||
|
echo check machine1 jsonschema can be evaluated
|
||||||
|
nix eval .#nixosConfigurations.machine1.config.clanSchema
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -1,8 +1,18 @@
|
|||||||
{ self, inputs, lib, ... }: {
|
{ self, inputs, lib, ... }: {
|
||||||
flake.nixosModules.clanCore = { pkgs, ... }: {
|
flake.nixosModules.clanCore = { pkgs, options, ... }: {
|
||||||
|
imports = [
|
||||||
|
./secrets
|
||||||
|
./zerotier.nix
|
||||||
|
inputs.sops-nix.nixosModules.sops
|
||||||
|
];
|
||||||
|
options.clanSchema = lib.mkOption {
|
||||||
|
type = lib.types.attrs;
|
||||||
|
description = "The json schema for the .clan options namespace";
|
||||||
|
default = self.lib.jsonschema.parseOptions options.clan;
|
||||||
|
};
|
||||||
options.clanCore = {
|
options.clanCore = {
|
||||||
clanDir = lib.mkOption {
|
clanDir = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.either lib.types.path lib.types.str;
|
||||||
description = ''
|
description = ''
|
||||||
the location of the flake repo, used to calculate the location of facts and secrets
|
the location of the flake repo, used to calculate the location of facts and secrets
|
||||||
'';
|
'';
|
||||||
@@ -23,10 +33,5 @@
|
|||||||
utility outputs for clan management of this machine
|
utility outputs for clan management of this machine
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
imports = [
|
|
||||||
./secrets
|
|
||||||
./zerotier.nix
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user