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