reading base-profile.yaml into config
This commit is contained in:
@@ -29,12 +29,25 @@
|
||||
};
|
||||
};
|
||||
|
||||
flake.lib.fromYAML = pkgs: path:
|
||||
builtins.fromJSON (
|
||||
builtins.readFile (
|
||||
pkgs.runCommand "${builtins.baseNameOf path}.json"
|
||||
{
|
||||
nativeBuildInputs = [ pkgs.remarshal ];
|
||||
}
|
||||
''
|
||||
remarshal -if yaml -of json ${path} > "$out"
|
||||
''
|
||||
)
|
||||
);
|
||||
|
||||
flake.modules.homeManager.resticprofile = { config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.programs.resticprofile;
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
baseProfile = import ../../../resticprofile/base.nix;
|
||||
# baseProfile = builtins.fromJSON (builtins.readFile ./base.yaml)
|
||||
# baseProfile = import ../../../resticprofile/base.nix;
|
||||
baseProfile = inputs.self.lib.fromYAML pkgs ./base-profile.yaml;
|
||||
profiles = lib.recursiveUpdate baseProfile cfg.profiles;
|
||||
in {
|
||||
options.programs.resticprofile = {
|
||||
|
||||
Reference in New Issue
Block a user