Allow consuming jail.nix without flakes
This commit is contained in:
parent
d8500ab273
commit
c37ae887fd
3 changed files with 24 additions and 2 deletions
1
default.nix
Normal file
1
default.nix
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
_: import ./lib
|
||||||
|
|
@ -7,6 +7,11 @@ in {
|
||||||
(jail "hello" pkgs.hello [])
|
(jail "hello" pkgs.hello [])
|
||||||
"Hello, world!";
|
"Hello, world!";
|
||||||
|
|
||||||
|
"can be imported using callPackage" = let
|
||||||
|
jail-nix-without-flake = pkgs.callPackage ../. {};
|
||||||
|
jail-without-flake = jail-nix-without-flake.init pkgs;
|
||||||
|
in assertStdout (jail-without-flake "hello" pkgs.hello []) "Hello, world!";
|
||||||
|
|
||||||
"it allows overriding base permissions shared across all jails" = let
|
"it allows overriding base permissions shared across all jails" = let
|
||||||
jail' = jail-nix.lib.extend {
|
jail' = jail-nix.lib.extend {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
It is currently recommended to install jail.nix as a flake input to your
|
### Flakes
|
||||||
configuration:
|
|
||||||
|
To install jail.nix using flakes, add jail.nix to your flake inputs:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
# flake.nix
|
# flake.nix
|
||||||
|
|
@ -16,6 +17,21 @@ configuration:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### callPackage
|
||||||
|
|
||||||
|
To install jail.nix using a different dependency manager like
|
||||||
|
[niv](https://github.com/nmattia/niv), you can use `pkgs.callPackage`:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
let
|
||||||
|
sources = import ./nix/sources.nix;
|
||||||
|
pkgs = import sources.nixpkgs {};
|
||||||
|
jail-nix = pkgs.callPackage sources."jail.nix" {};
|
||||||
|
jail = jail-nix.init pkgs;
|
||||||
|
in
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Initializing
|
## Initializing
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue