Add pushState helper
This commit is contained in:
parent
3610987241
commit
22ec74b9d1
2 changed files with 17 additions and 25 deletions
|
|
@ -119,9 +119,7 @@ rec {
|
||||||
])
|
])
|
||||||
```
|
```
|
||||||
'';
|
'';
|
||||||
__functor =
|
__functor = _: helpers.pushState "deferredPermissions";
|
||||||
_: combinator: state:
|
|
||||||
state // { deferredPermissions = state.deferredPermissions ++ [ combinator ]; };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
include-once = {
|
include-once = {
|
||||||
|
|
@ -165,7 +163,7 @@ rec {
|
||||||
if lib.elem key state.includedOnce then
|
if lib.elem key state.includedOnce then
|
||||||
state
|
state
|
||||||
else
|
else
|
||||||
combinator (state // { includedOnce = state.includedOnce ++ [ key ]; });
|
combinator (helpers.pushState "includedOnce" key state);
|
||||||
};
|
};
|
||||||
|
|
||||||
unsafe-add-raw-args = {
|
unsafe-add-raw-args = {
|
||||||
|
|
@ -265,9 +263,7 @@ rec {
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
'';
|
'';
|
||||||
__functor =
|
__functor = _: helpers.pushState "cleanup";
|
||||||
_: cleanup: state:
|
|
||||||
state // { cleanup = state.cleanup ++ [ cleanup ]; };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
fake-passwd = {
|
fake-passwd = {
|
||||||
|
|
@ -997,12 +993,7 @@ rec {
|
||||||
}:
|
}:
|
||||||
compose [
|
compose [
|
||||||
# Just set the options on state so dbus can be called multiple times
|
# Just set the options on state so dbus can be called multiple times
|
||||||
(
|
(helpers.pushState "dbusPermissions" {
|
||||||
state:
|
|
||||||
state
|
|
||||||
// {
|
|
||||||
dbusPermissions = state.dbusPermissions ++ [
|
|
||||||
{
|
|
||||||
inherit
|
inherit
|
||||||
own
|
own
|
||||||
talk
|
talk
|
||||||
|
|
@ -1010,10 +1001,7 @@ rec {
|
||||||
call
|
call
|
||||||
broadcast
|
broadcast
|
||||||
;
|
;
|
||||||
}
|
})
|
||||||
];
|
|
||||||
}
|
|
||||||
)
|
|
||||||
# Then add deferred runtime logic to spin up xdg-dbus-proxy:
|
# Then add deferred runtime logic to spin up xdg-dbus-proxy:
|
||||||
(include-once "dbus" (
|
(include-once "dbus" (
|
||||||
defer (
|
defer (
|
||||||
|
|
@ -1102,7 +1090,7 @@ rec {
|
||||||
_: path: pkg:
|
_: path: pkg:
|
||||||
compose [
|
compose [
|
||||||
(ro-bind (toString pkg) path)
|
(ro-bind (toString pkg) path)
|
||||||
(state: state // { additionalRuntimeClosures = state.additionalRuntimeClosures ++ [ pkg ]; })
|
(helpers.pushState "additionalRuntimeClosures" pkg)
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,4 +11,8 @@ pkgs: rec {
|
||||||
rawOrStr._noescape
|
rawOrStr._noescape
|
||||||
else
|
else
|
||||||
pkgs.lib.strings.escapeShellArg rawOrStr;
|
pkgs.lib.strings.escapeShellArg rawOrStr;
|
||||||
|
|
||||||
|
pushState =
|
||||||
|
key: toPush: state:
|
||||||
|
state // { ${key} = state.${key} ++ [ toPush ]; };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue