Add an activation script.
This commit is contained in:
parent
349255de8d
commit
fe6fb907f7
1 changed files with 16 additions and 5 deletions
21
lib.nix
21
lib.nix
|
|
@ -5,6 +5,8 @@ in
|
|||
{
|
||||
makeServiceConfig = { system, module }:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
nixosConfig = lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = { };
|
||||
|
|
@ -14,10 +16,19 @@ in
|
|||
(serviceName:
|
||||
nixosConfig.config.systemd.units."${serviceName}.service".unit)
|
||||
nixosConfig.config.service-manager.services;
|
||||
|
||||
servicesPath =
|
||||
pkgs.writeTextFile {
|
||||
name = "services";
|
||||
destination = "/services.json";
|
||||
text = lib.generators.toJSON { } services;
|
||||
};
|
||||
activationScript = pkgs.writeShellScript "activate" ''
|
||||
echo "${servicesPath}"
|
||||
'';
|
||||
in
|
||||
nixpkgs.legacyPackages.${system}.writeTextFile {
|
||||
name = "services";
|
||||
destination = "/services.json";
|
||||
text = lib.generators.toJSON { } services;
|
||||
};
|
||||
pkgs.linkFarmFromDrvs "service-manager" [
|
||||
servicesPath
|
||||
activationScript
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue