shellcheck-services.nix: update to NixOS 22.11
This commit is contained in:
parent
2e5b287bc8
commit
ba54d3d699
@ -45,18 +45,17 @@ let
|
|||||||
# Return set of services ({ service1 = true; service2 = true; ... })
|
# Return set of services ({ service1 = true; service2 = true; ... })
|
||||||
# which are either defined or not defined within `sourcePrefix`, depending
|
# which are either defined or not defined within `sourcePrefix`, depending
|
||||||
# on `shouldMatch`.
|
# on `shouldMatch`.
|
||||||
collectServices = shouldMatch: lib.listToAttrs (builtins.concatLists (zipListsWith (services: file:
|
collectServices = shouldMatch: lib.listToAttrs (builtins.concatLists (map (def:
|
||||||
let
|
let
|
||||||
|
services = def.value;
|
||||||
|
inherit (def) file;
|
||||||
isMatching = lib.hasPrefix sourcePrefix file;
|
isMatching = lib.hasPrefix sourcePrefix file;
|
||||||
in
|
in
|
||||||
# Nix has no boolean XOR, so use `if`
|
# Nix has no boolean XOR, so use `if`
|
||||||
lib.optionals (if shouldMatch then isMatching else !isMatching) (
|
lib.optionals (if shouldMatch then isMatching else !isMatching) (
|
||||||
(map (service: { name = service; value = true; }) (builtins.attrNames services))
|
(map (service: { name = service; value = true; }) (builtins.attrNames services))
|
||||||
)
|
)
|
||||||
# TODO-EXTERNAL:
|
) systemdServices.definitionsWithLocations));
|
||||||
# Use `systemdServices.definitionsWithLocations` when https://github.com/NixOS/nixpkgs/pull/189836
|
|
||||||
# is included in nixpkgs stable.
|
|
||||||
) systemdServices.definitions systemdServices.files));
|
|
||||||
in
|
in
|
||||||
# Calculate set difference: matchingServices - nonMatchingServices
|
# Calculate set difference: matchingServices - nonMatchingServices
|
||||||
# and exclude unavailable services (defined via `mkIf false ...`) by checking `configSystemdServices`.
|
# and exclude unavailable services (defined via `mkIf false ...`) by checking `configSystemdServices`.
|
||||||
|
Loading…
Reference in New Issue
Block a user