Implement files under /etc

This commit is contained in:
R-VdP 2023-02-13 20:24:23 +01:00
parent 8b3bba30af
commit b3c7f71456
No known key found for this signature in database
10 changed files with 494 additions and 242 deletions

View file

@ -0,0 +1,34 @@
{ lib
, pkgs
, config
, ...
}:
{
options.system-manager = {
services = lib.mkOption {
type = with lib.types; listOf str;
};
etcFiles = lib.mkOption {
type = with lib.types; listOf str;
};
};
config = {
# Avoid some standard NixOS assertions
boot = {
loader.grub.enable = false;
initrd.enable = false;
};
assertions = lib.flip map config.system-manager.etcFiles (entry:
{
assertion = lib.hasAttr entry config.environment.etc;
message = lib.concatStringsSep " " [
"The entry ${entry} that was passed to system-manager.etcFiles"
"is not present in environment.etc"
];
}
);
};
}