nix: render migrate.json and wrap swarmctl with kubectl
This commit is contained in:
parent
9396941f24
commit
5779bc5719
1 changed files with 291 additions and 1 deletions
11
nix/host-modules/lib/paths-within.nix
Normal file
11
nix/host-modules/lib/paths-within.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# `pathsWithin dir paths`: the entries of `paths` that sit under `dir`, relative
|
||||
# to it. A null entry, and a path elsewhere (or `dir` itself), is left out.
|
||||
{ lib }:
|
||||
dir: paths:
|
||||
lib.concatMap (
|
||||
path:
|
||||
let
|
||||
prefix = "${dir}/";
|
||||
in
|
||||
lib.optional (path != null && lib.hasPrefix prefix path) (lib.removePrefix prefix path)
|
||||
) paths
|
||||
Loading…
Reference in a new issue