Fix formatting using nixpgks-fmt
This commit is contained in:
parent
942ed011c9
commit
add2910abf
2 changed files with 19 additions and 13 deletions
26
nix/lib.nix
26
nix/lib.nix
|
|
@ -3,7 +3,11 @@ let
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
makeServiceConfig = { system, module }:
|
makeServiceConfig =
|
||||||
|
{ system
|
||||||
|
, module
|
||||||
|
,
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
|
|
@ -12,17 +16,17 @@ in
|
||||||
specialArgs = { };
|
specialArgs = { };
|
||||||
modules = [ module ];
|
modules = [ module ];
|
||||||
};
|
};
|
||||||
services = lib.flip lib.genAttrs
|
services =
|
||||||
(serviceName:
|
lib.flip lib.genAttrs
|
||||||
nixosConfig.config.systemd.units."${serviceName}.service".unit)
|
(serviceName:
|
||||||
nixosConfig.config.service-manager.services;
|
nixosConfig.config.systemd.units."${serviceName}.service".unit)
|
||||||
|
nixosConfig.config.service-manager.services;
|
||||||
|
|
||||||
servicesPath =
|
servicesPath = pkgs.writeTextFile {
|
||||||
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" ''
|
activationScript = pkgs.writeShellScript "activate" ''
|
||||||
echo "${servicesPath}"
|
echo "${servicesPath}"
|
||||||
'';
|
'';
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
{ lib, pkgs, ... }:
|
{ lib
|
||||||
|
, pkgs
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
service-1 = "service-1";
|
service-1 = "service-1";
|
||||||
service-2 = "service-2";
|
service-2 = "service-2";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue