test/shellcheck-services: fix error by excluding unavailable services
This commit is contained in:
parent
46f17fe313
commit
49303be2e0
@ -19,6 +19,7 @@ let
|
|||||||
# that only have definitions located in the nix-bitcoin source.
|
# that only have definitions located in the nix-bitcoin source.
|
||||||
nix-bitcoin-services = let
|
nix-bitcoin-services = let
|
||||||
systemdServices = args.options.systemd.services;
|
systemdServices = args.options.systemd.services;
|
||||||
|
configSystemdServices = args.config.systemd.services;
|
||||||
nix-bitcoin-source = toString ../..;
|
nix-bitcoin-source = toString ../..;
|
||||||
nbServices = collectServices true;
|
nbServices = collectServices true;
|
||||||
nonNbServices = collectServices false;
|
nonNbServices = collectServices false;
|
||||||
@ -38,8 +39,11 @@ let
|
|||||||
# is included in nixpkgs stable.
|
# is included in nixpkgs stable.
|
||||||
) systemdServices.definitions systemdServices.files));
|
) systemdServices.definitions systemdServices.files));
|
||||||
in
|
in
|
||||||
# Set difference: nbServices - nonNbServices
|
# Calculate set difference: nbServices - nonNbServices
|
||||||
builtins.filter (nbService: ! nonNbServices ? ${nbService}) (builtins.attrNames nbServices);
|
# and exclude unavailable services (defined via `mkIf false ...`) by checking `configSystemdServices`.
|
||||||
|
builtins.filter (nbService:
|
||||||
|
configSystemdServices ? ${nbService} && (! nonNbServices ? ${nbService})
|
||||||
|
) (builtins.attrNames nbServices);
|
||||||
|
|
||||||
# The concatenated list of values of ExecStart, ExecStop, ... (`scriptAttrs`) of all `nix-bitcoin-services`.
|
# The concatenated list of values of ExecStart, ExecStop, ... (`scriptAttrs`) of all `nix-bitcoin-services`.
|
||||||
serviceCmds = let
|
serviceCmds = let
|
||||||
|
Loading…
Reference in New Issue
Block a user