Forward override to jailed derivations
On Nixos, it may be desirable to install some software using `programs.*.enable = true`. Jail.nix mostly supports this because you can either use `jail-nix.mkOverlay`, or just use Nixos `programs.*.package = jail ...` to inject a jailed version of the package. However, for some modules, like Firefox, the Nixos module calls `override` on the package. Normally, you would just call `override` on the package passed into jail, but this is not possible to do within a Nixos module. To address this, this patch will check to see if a package passed into jail has an `override` field, and if so will add an `override` on the jailed derivation that passes the override function to the entrypoint. Thanks to ~juanjakobo for reporting this! Fixes https://todo.sr.ht/~alexdavid/jail.nix/1
This commit is contained in:
parent
fc6e1a54ba
commit
f55483fb38
2 changed files with 52 additions and 2 deletions
14
lib/jail.nix
14
lib/jail.nix
|
|
@ -111,8 +111,18 @@ let
|
|||
}
|
||||
)
|
||||
|
||||
# forward man pages
|
||||
(jailed: if exe ? man then jailed // { inherit (exe) man; } else jailed)
|
||||
# Add additional properties on the jailed derivation
|
||||
(
|
||||
jailed:
|
||||
jailed
|
||||
# forward man pages
|
||||
// lib.optionalAttrs (exe ? man) { inherit (exe) man; }
|
||||
|
||||
# forward `override`
|
||||
// lib.optionalAttrs (exe ? override) {
|
||||
override = overrideFn: jail name (exe.override overrideFn) permissions;
|
||||
}
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue