diff --git a/.build.yml b/.build.yml index a98c023..e7f4d49 100644 --- a/.build.yml +++ b/.build.yml @@ -1,4 +1,4 @@ -image: nixos/26.05 +image: nixos/25.05 environment: NIX_CONFIG: "experimental-features = nix-command flakes" secrets: diff --git a/default.nix b/default.nix index 86c1e80..f63452f 100644 --- a/default.nix +++ b/default.nix @@ -1 +1 @@ -_: { lib = import ./lib; } +_: import ./lib diff --git a/lib/combinators.nix b/lib/combinators.nix index bb65039..90e1673 100644 --- a/lib/combinators.nix +++ b/lib/combinators.nix @@ -1,51 +1,107 @@ -{ - pkgs, - suppressExperimentalWarnings ? false, - ... -}: -jail: +pkgs: jail: let inherit (pkgs) lib; helpers = import ./helpers.nix pkgs; - rawCombinators = lib.mapAttrs' ( - fileName: _: - lib.nameValuePair (lib.removeSuffix ".nix" fileName) ( - import ./combinators/${fileName} { - inherit - combinators - helpers - jail - lib - pkgs - ; + rawCombinators = + lib.mapAttrs + ( + _: file: + import file { + inherit + combinators + helpers + jail + lib + pkgs + ; + } + ) + { + add-cleanup = ./combinators/add-cleanup.nix; + add-path = ./combinators/add-path.nix; + add-pkg-deps = ./combinators/add-pkg-deps.nix; + add-runtime = ./combinators/add-runtime.nix; + add-seccomp = ./combinators/add-seccomp.nix; + base = ./combinators/base.nix; + bind-nix-store-runtime-closure = ./combinators/bind-nix-store-runtime-closure.nix; + bind-pkg = ./combinators/bind-pkg.nix; + camera = ./combinators/camera.nix; + compose = ./combinators/compose.nix; + dbus = ./combinators/dbus.nix; + defer = ./combinators/defer.nix; + escape = ./combinators/escape.nix; + fake-passwd = ./combinators/fake-passwd.nix; + fwd-env = ./combinators/fwd-env.nix; + gpu = ./combinators/gpu.nix; + gui = ./combinators/gui.nix; + include-once = ./combinators/include-once.nix; + jail-to-host-channel = ./combinators/jail-to-host-channel.nix; + mount-cwd = ./combinators/mount-cwd.nix; + network = ./combinators/network.nix; + no-die-with-parent = ./combinators/no-die-with-parent.nix; + no-new-session = ./combinators/no-new-session.nix; + noescape = ./combinators/noescape.nix; + notifications = ./combinators/notifications.nix; + open-urls-in-browser = ./combinators/open-urls-in-browser.nix; + persist-home = ./combinators/persist-home.nix; + pipewire = ./combinators/pipewire.nix; + pulse = ./combinators/pulse.nix; + readonly = ./combinators/readonly.nix; + readonly-paths-from-var = ./combinators/readonly-paths-from-var.nix; + readonly-runtime-args = ./combinators/readonly-runtime-args.nix; + readwrite = ./combinators/readwrite.nix; + readwrite-runtime-args = ./combinators/readwrite-runtime-args.nix; + reset = ./combinators/reset.nix; + ro-bind = ./combinators/ro-bind.nix; + runtime-deep-ro-bind = ./combinators/runtime-deep-ro-bind.nix; + rw-bind = ./combinators/rw-bind.nix; + set-argv = ./combinators/set-argv.nix; + set-env = ./combinators/set-env.nix; + set-hostname = ./combinators/set-hostname.nix; + share-ns = ./combinators/share-ns.nix; + time-zone = ./combinators/time-zone.nix; + tmpfs = ./combinators/tmpfs.nix; + try-fwd-env = ./combinators/try-fwd-env.nix; + try-readonly = ./combinators/try-readonly.nix; + try-readwrite = ./combinators/try-readwrite.nix; + try-ro-bind = ./combinators/try-ro-bind.nix; + try-rw-bind = ./combinators/try-rw-bind.nix; + unsafe-add-raw-args = ./combinators/unsafe-add-raw-args.nix; + unsafe-dbus = ./combinators/unsafe-dbus.nix; + unsafe-x11 = ./combinators/unsafe-x11.nix; + wayland = ./combinators/wayland.nix; + wrap-entry = ./combinators/wrap-entry.nix; + write-text = ./combinators/write-text.nix; + xwayland = ./combinators/xwayland.nix; } - ) - ) (builtins.readDir ./combinators); + // + ############################################ + # deprecated combinators: + { + persisthome = { + deprecated = true; + sig = "Permission"; + doc = "This was reworked to store data under `~/.local/share/jail.nix` and renamed to [persist-home](#persist-home)."; + impl = + with combinators; + name: + lib.warn + "persisthome is deprecated, use persist-home instead. When doing so, rename ~/.local/share/jails/${name} to ${helpers.dataDirSubPath "home/${name}"}" + (compose [ + (add-runtime "mkdir -p ~/.local/share/jails/${lib.escapeShellArg name}") + (rw-bind (noescape "~/.local/share/jails/${lib.escapeShellArg name}") (noescape "~")) + ]); + }; - combinators = - let - foldCombinator = - acc: names: combinator: - if lib.length names == 0 then - acc - else - let - name = lib.head names; - combinatorImpl = - if combinator.experimental or false && !suppressExperimentalWarnings then - builtins.warn "jail.nix combinator ${name} is experimental!" combinator.impl - else - combinator.impl; - in - if acc ? ${name} then - throw "duplicate combinator ${name}" - else - foldCombinator (acc // { ${name} = combinatorImpl; }) (lib.tail names) combinator; - in - lib.foldl' (acc: { name, value }: foldCombinator acc ([ name ] ++ value.aliases or [ ]) value) { } ( - lib.attrsToList rawCombinators - ); + dbus-unsafe = { + deprecated = true; + sig = "Permission"; + doc = "This was renamed to [unsafe-dbus](#unsafe-dbus)."; + impl = lib.warn "dbus-unsafe is deprecated, use unsafe-dbus instead" combinators.unsafe-dbus; + }; + }; + combinators = lib.mapAttrs (_: combinatorObj: combinatorObj.impl) rawCombinators; in { inherit combinators; diff --git a/lib/combinators/overlay-ro.nix b/lib/combinators/overlay-ro.nix deleted file mode 100644 index cbb5251..0000000 --- a/lib/combinators/overlay-ro.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ combinators, ... }: -let - inherit (combinators) escape unsafe-add-raw-args; -in -{ - experimental = true; - sig = "[String] -> String -> Permission"; - doc = '' - Creates a readonly overlay fs mount at a destination. - - The first argument is a list of sources to be composed, the second is the - destination in the jail where to mount the overlayfs. - - If multiple sources contain the same files, sources specified later in the - sources list will shadow earlier ones. - - At least one source must be specified. - - Example: - ```nix - overlay-ro ["/source/foo" "/source/bar"] "/dest" - ``` - ''; - impl = - sources: dest: - assert builtins.length sources > 0; - unsafe-add-raw-args ( - builtins.concatStringsSep " " ( - map (source: "--overlay-src ${escape source}") sources ++ [ "--ro-overlay ${escape dest}" ] - ) - ); -} diff --git a/lib/combinators/overlay-rw.nix b/lib/combinators/overlay-rw.nix deleted file mode 100644 index d327f3f..0000000 --- a/lib/combinators/overlay-rw.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ combinators, ... }: -let - inherit (combinators) escape unsafe-add-raw-args; -in -{ - experimental = true; - sig = "[String] -> String -> String -> String -> Permission"; - doc = '' - Creates an overlay fs mount at a destination. - - The first argument is a list of sources to be composed. - - The second argument is the rw source, a directory to persist writes to. - - The third argument is the workdir, a scratch space the kernel uses for the - overlayFS (it must be on the same filesystem as the rw source). - - The final argument is the destination in the jail where to mount the overlayfs. - - If multiple sources contain the same files, sources specified later in the - sources list will shadow earlier ones. - - At least one source must be specified. - - Example: - ```nix - overlay-rw ["/source/foo" "/source/bar"] "/tmp/rw" "/tmp/workdir" "/dest" - ``` - ''; - impl = - sources: rwSource: workdir: dest: - assert builtins.length sources > 0; - unsafe-add-raw-args ( - builtins.concatStringsSep " " ( - map (source: "--overlay-src ${escape source}") sources - ++ [ "--overlay ${escape rwSource} ${escape workdir} ${escape dest}" ] - ) - ); -} diff --git a/lib/combinators/overlay-tmp.nix b/lib/combinators/overlay-tmp.nix deleted file mode 100644 index b15ac8f..0000000 --- a/lib/combinators/overlay-tmp.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ combinators, ... }: -let - inherit (combinators) escape unsafe-add-raw-args; -in -{ - experimental = true; - sig = "[String] -> String -> Permission"; - doc = '' - Creates a tempfs overlay mount at a destination. - - The first argument is a list of sources to be composed, the second is the - destination in the jail where to mount the overlayfs. - - If multiple sources contain the same files, sources specified later in the - sources list will shadow earlier ones. - - At least one source must be specified. - - Example: - ```nix - overlay-tmp ["/source/foo" "/source/bar"] "/dest" - ``` - ''; - impl = - sources: dest: - assert builtins.length sources > 0; - unsafe-add-raw-args ( - builtins.concatStringsSep " " ( - map (source: "--overlay-src ${escape source}") sources ++ [ "--tmp-overlay ${escape dest}" ] - ) - ); -} diff --git a/lib/combinators/readonly-paths-from-var.nix b/lib/combinators/readonly-paths-from-var.nix index 8ce1fb2..5a1a9b2 100644 --- a/lib/combinators/readonly-paths-from-var.nix +++ b/lib/combinators/readonly-paths-from-var.nix @@ -31,10 +31,11 @@ in assert lib.isValidPosixName var; include-once "readonly-paths-from-var-${var}" (add-runtime '' IFS=${lib.escapeShellArg separator} read -ra DIRS <<< "''${${var}-}" - if ((''${#DIRS[@]})); then - while IFS= read -r -d ''' P; do + for DIR in "''${DIRS[@]}"; do + if [ -e "$DIR" ]; then + P="$(realpath "$DIR")" RUNTIME_ARGS+=(--ro-bind "$P" "$P") - done < <(realpath -ezq -- "''${DIRS[@]}") - fi + fi + done ''); } diff --git a/lib/jail.nix b/lib/jail.nix index 26ffb43..84edc45 100644 --- a/lib/jail.nix +++ b/lib/jail.nix @@ -1,14 +1,13 @@ -jailNixCfg@{ +{ pkgs, additionalCombinators ? _: { }, basePermissions ? import ./base-permissions.nix pkgs, bubblewrapPackage ? pkgs.bubblewrap, - ... }: let inherit (pkgs) lib; - builtinCombinators = (import ./combinators.nix jailNixCfg jail).combinators; + builtinCombinators = (import ./combinators.nix pkgs jail).combinators; allCombinators = builtinCombinators // additionalCombinators builtinCombinators; diff --git a/tests/flake.lock b/tests/flake.lock index a7355d3..0b1da89 100644 --- a/tests/flake.lock +++ b/tests/flake.lock @@ -2,16 +2,16 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1783389287, - "narHash": "sha256-0xIy4dVLqq47rA+mRy0hXDfjhQd4E5PoIns/RmB7nR4=", + "lastModified": 1769318308, + "narHash": "sha256-Mjx6p96Pkefks3+aA+72lu1xVehb6mv2yTUUqmSet6Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0ad6f47ea4fe188f4bc8f0380f93ae8523337c6c", + "rev": "1cd347bf3355fce6c64ab37d3967b4a2cb4b878c", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-26.05", + "ref": "nixos-25.11", "repo": "nixpkgs", "type": "github" } diff --git a/tests/flake.nix b/tests/flake.nix index 31b0df6..c80b67f 100644 --- a/tests/flake.nix +++ b/tests/flake.nix @@ -1,7 +1,7 @@ { # This is a separate flake file from the one at the root because we don't # want to depend on nixpkgs - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; outputs = { nixpkgs, ... }: let diff --git a/tests/spec/CombinatorsSpec.hs b/tests/spec/CombinatorsSpec.hs index 2c24c54..830f796 100644 --- a/tests/spec/CombinatorsSpec.hs +++ b/tests/spec/CombinatorsSpec.hs @@ -152,7 +152,7 @@ spec = parallel $ inTestM $ do runNixDrv [i| let - jail' = jail-nix.lib.extend { + jail' = jail-nix.extend { inherit pkgs; bubblewrapPackage = pkgs.writeShellApplication { name = "my-bubblewrap"; @@ -284,94 +284,6 @@ spec = parallel $ inTestM $ do |] liftIO $ doesFileExist (tmpDir "fake-browser") `shouldReturn` False - describe "overlay combinators" $ do - let runOverlayTest :: String -> String -> TestM String - runOverlayTest combinatorInvocation shellCmd = do - tmpDir <- getTestDir - let fooSource = tmpDir "source/foo" - let barSource = tmpDir "source/bar" - let rwSource = tmpDir "rwSource" - let workDir = tmpDir "workDir" - liftIO $ do - createDirectoryIfMissing True fooSource - createDirectoryIfMissing True barSource - createDirectoryIfMissing True rwSource - createDirectoryIfMissing True workDir - writeFile (fooSource "only-foo") "only-foo" - writeFile (barSource "only-bar") "only-bar" - writeFile (fooSource "both") "both-foo" - writeFile (barSource "both") "both-bar" - runNixDrv - [i| - let - fooSource = "#{fooSource}"; - barSource = "#{barSource}"; - rwSource = "#{rwSource}"; - workDir = "#{workDir}"; - in - jail "test" (sh "#{shellCmd}") (c: [ - (#{combinatorInvocation}) - ]) - |] - - describe "overlay-tmp" $ do - let runTest = runOverlayTest [i| c.overlay-tmp [ fooSource barSource ] "/dest" |] - it "overlays files from the sources list" $ do - runTest "ls /dest" - `shouldReturnTestM` unindent - [i| - both - only-bar - only-foo - |] - - it "uses sources specified later to shadow files specified in multiple sources" $ do - runTest "cat /dest/both" - `shouldReturnTestM` "both-bar" - - it "creates a writable tmpfs overlay" $ do - runTest "echo baz > /dest/baz && cat /dest/baz" - `shouldReturnTestM` "baz\n" - - describe "overlay-ro" $ do - let runTest = runOverlayTest [i| c.overlay-ro [ fooSource barSource ] "/dest" |] - it "overlays files from the sources list" $ do - runTest "ls /dest" - `shouldReturnTestM` unindent - [i| - both - only-bar - only-foo - |] - - it "uses sources specified later to shadow files specified in multiple sources" $ do - runTest "cat /dest/both" - `shouldReturnTestM` "both-bar" - - it "mounts a read-only destination" $ do - runTest "echo baz > /dest/baz || echo failed" - `shouldReturnTestM` "failed\n" - - describe "overlay-rw" $ do - let runTest = runOverlayTest [i| c.overlay-rw [ fooSource barSource ] rwSource workDir "/dest" |] - it "overlays files from the sources list" $ do - runTest "ls /dest" - `shouldReturnTestM` unindent - [i| - both - only-bar - only-foo - |] - - it "uses sources specified later to shadow files specified in multiple sources" $ do - runTest "cat /dest/both" - `shouldReturnTestM` "both-bar" - - it "writes chagnes to the rw directory" $ do - void $ runTest "echo baz > /dest/baz" - tmpDir <- getTestDir - liftIO $ readFile (tmpDir "rwSource/baz") `shouldReturn` "baz\n" - describe "readonly-paths-from-var" $ do forM_ [":", " "] $ \separator -> describe ("with separator \"" <> separator <> "\"") $ do @@ -429,7 +341,7 @@ spec = parallel $ inTestM $ do it "clears all set permissions - including ones set in base permissions" $ do [i| let - jail' = jail-nix.lib.extend { + jail' = jail-nix.extend { inherit pkgs; basePermissions = c: [ c.base diff --git a/tests/spec/JailSpec.hs b/tests/spec/JailSpec.hs index e46861a..d501d19 100644 --- a/tests/spec/JailSpec.hs +++ b/tests/spec/JailSpec.hs @@ -12,8 +12,8 @@ spec = parallel $ inTestM $ do it "can be imported using callPackage" $ do [i| let - jail-nix-without-flake = import {}; - jail-without-flake = jail-nix-without-flake.lib.init pkgs; + jail-nix-without-flake = pkgs.callPackage {}; + jail-without-flake = jail-nix-without-flake.init pkgs; in jail-without-flake "hello" pkgs.hello [] |] @@ -85,7 +85,7 @@ spec = parallel $ inTestM $ do liftIO $ writeFile secretPath "hunter2" [i| let - jail' = jail-nix.lib.extend { + jail' = jail-nix.extend { inherit pkgs; basePermissions = c: [ (c.readonly #{toNixString secretPath}) @@ -101,7 +101,7 @@ spec = parallel $ inTestM $ do it "allows overriding the bubblewrap package" $ do [i| let - jail' = jail-nix.lib.extend { + jail' = jail-nix.extend { inherit pkgs; bubblewrapPackage = pkgs.writeShellApplication { name = "my-bubblewrap"; diff --git a/tests/spec/OverlaySpec.hs b/tests/spec/OverlaySpec.hs index b344cd6..5c7c045 100644 --- a/tests/spec/OverlaySpec.hs +++ b/tests/spec/OverlaySpec.hs @@ -16,7 +16,7 @@ spec = parallel $ inTestM $ do let pkgs = import { overlays = [ jailOverlay ]; }; jailOverlay = final: prev: - jail-nix.lib.mkOverlay { + jail-nix.mkOverlay { inherit final prev; packages = combinators: with combinators; { nodejs = [ (readonly #{toNixString $ tmpDir "visible"}) ]; @@ -53,7 +53,7 @@ spec = parallel $ inTestM $ do let pkgs = import { overlays = [ jailOverlay ]; }; jailOverlay = final: prev: - jail-nix.lib.mkOverlay { + jail-nix.mkOverlay { inherit final prev; additionalCombinators = combinators: { my-combinator = combinators.readonly #{toNixString $ tmpDir "file"}; @@ -76,7 +76,7 @@ spec = parallel $ inTestM $ do let pkgs = import { overlays = [ jailOverlay ]; }; jailOverlay = final: prev: - jail-nix.lib.mkOverlay { + jail-nix.mkOverlay { inherit final prev; basePermissions = combinators: [ (combinators.readonly #{toNixString $ tmpDir "file"}) @@ -100,7 +100,7 @@ spec = parallel $ inTestM $ do let pkgs = import { overlays = [ jailOverlay ]; }; jailOverlay = final: prev: - jail-nix.lib.mkOverlay { + jail-nix.mkOverlay { inherit final prev; bubblewrapPackage = pkgs.writeShellApplication { name = "my-bubblewrap"; diff --git a/tests/spec/TestPrelude.hs b/tests/spec/TestPrelude.hs index ed5a50a..d96e0e7 100644 --- a/tests/spec/TestPrelude.hs +++ b/tests/spec/TestPrelude.hs @@ -158,7 +158,7 @@ runNixDrvWithinVm vmConfig nixDrvExpr = do }; script = let jail-nix = import {}; - jail = jail-nix.lib.extend { inherit pkgs; suppressExperimentalWarnings = true; }; + jail = jail-nix.extend { inherit pkgs; }; testToRun = #{nixDrvExpr}; in '' ( @@ -204,7 +204,7 @@ evalNixExpr nixExpr = do lib = pkgs.lib; sh = script: (pkgs.writeShellApplication { name = "test-script"; text = script; }); jail-nix = import {}; - jail = jail-nix.lib.extend { inherit pkgs; suppressExperimentalWarnings = true; }; + jail = jail-nix.extend { inherit pkgs; }; in #{nixExpr} |] liftIO $ diff --git a/website/flake.lock b/website/flake.lock index a7355d3..0b1da89 100644 --- a/website/flake.lock +++ b/website/flake.lock @@ -2,16 +2,16 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1783389287, - "narHash": "sha256-0xIy4dVLqq47rA+mRy0hXDfjhQd4E5PoIns/RmB7nR4=", + "lastModified": 1769318308, + "narHash": "sha256-Mjx6p96Pkefks3+aA+72lu1xVehb6mv2yTUUqmSet6Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0ad6f47ea4fe188f4bc8f0380f93ae8523337c6c", + "rev": "1cd347bf3355fce6c64ab37d3967b4a2cb4b878c", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-26.05", + "ref": "nixos-25.11", "repo": "nixpkgs", "type": "github" } diff --git a/website/flake.nix b/website/flake.nix index 4d5969c..c98a4d8 100644 --- a/website/flake.nix +++ b/website/flake.nix @@ -1,7 +1,7 @@ { # This is a separate flake file from the one at the root because we don't # want to depend on nixpkgs - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; outputs = { self, nixpkgs, ... }: @@ -10,7 +10,7 @@ lib = pkgs.lib; repo = rec { - rev = if self ? rev then self.rev else lib.warn "Repo is dirty, links point to main!" "main"; + rev = if self ? rev then self.rev else lib.warn "Repo is dirty, links will not work!" "???"; shortRev = lib.substring 0 8 rev; urls = { base = "https://git.sr.ht/~alexdavid/jail.nix"; @@ -34,16 +34,9 @@ in '' ### ${name} - Source - **${name} :: ${combinatorObj.sig}** - ${ - if combinatorObj ? aliases then - "Aliases: ${lib.concatMapStringsSep ", " (alias: "`${alias}`") combinatorObj.aliases}" - else - "" - } + [Source](${repo.urls.file file attrPos.line}) ${combinatorObj.doc} ''; @@ -51,9 +44,7 @@ combinatorDocs = let allCombinators = - (import (docsFileSet + /lib/combinators.nix) { inherit pkgs; } ( - throw "Docs must not depend on jail arg" - )).docs; + (import (docsFileSet + /lib/combinators.nix) pkgs (throw "Docs must not depend on jail arg")).docs; formatSection = filter: @@ -84,7 +75,7 @@ ${hr} - ${formatSection (v: !(is "includedInBasePermissions" v || is "internal" v || is "experimental" v))} + ${formatSection (v: !(is "deprecated" v || is "includedInBasePermissions" v || is "internal" v))} ${hr} @@ -98,17 +89,12 @@ ${hr} - ## Experimental Combinators + ## Deprecated Combinators - The following combinators are experimental, and may be removed, or - have breaking changes in the future. Please reach out if you have any - feedback on them. + The following combinators have been deprecated, and may be removed in the + future. - Using these combinators will emit an evaluation warning, you can - suppress this warning with - [suppressExperimentalWarnings](advanced-configuration.md#suppressexperimentalwarnings). - - ${formatSection (is "experimental")} + ${formatSection (is "deprecated")} ''; mkdocsSettings = { @@ -118,7 +104,6 @@ name = "readthedocs"; hljs_languages = [ "nix" ]; }; - extra_css = [ "extra.css" ]; # Copyright is placed directly into the page within a

tag. # Concatenating with

here is super janky, but good enough for # now. diff --git a/website/static-docs/advanced-configuration.md b/website/static-docs/advanced-configuration.md index 41d7444..b8a4266 100644 --- a/website/static-docs/advanced-configuration.md +++ b/website/static-docs/advanced-configuration.md @@ -76,9 +76,3 @@ jail = jail-nix.lib.extend { This configuration option allows you to override what bubblewrap package jail.nix uses for its jails. The default value is `pkgs.bubblewrap`. - -## suppressExperimentalWarnings - -By default, jail.nix will emit an evaluation warning if you use an -[experimental combinator](combinators.md#experimental-combinators). Setting -this to true suppresses these warnings. diff --git a/website/static-docs/extra.css b/website/static-docs/extra.css deleted file mode 100644 index 843bfef..0000000 --- a/website/static-docs/extra.css +++ /dev/null @@ -1,9 +0,0 @@ -.document { - position: relative; -} - -a.source { - position: absolute; - margin-top: -48px; - right: 0; -} diff --git a/website/static-docs/index.md b/website/static-docs/index.md index c85b1ad..04bbc2e 100644 --- a/website/static-docs/index.md +++ b/website/static-docs/index.md @@ -17,17 +17,17 @@ To install jail.nix using flakes, add jail.nix to your flake inputs: } ``` -### Non-flakes +### callPackage To install jail.nix using a different dependency manager like -[niv](https://github.com/nmattia/niv), you can use the following snippet: +[niv](https://github.com/nmattia/niv), you can use `pkgs.callPackage`: ```nix let sources = import ./nix/sources.nix; pkgs = import sources.nixpkgs {}; - jail-nix = import sources."jail.nix" {}; - jail = jail-nix.lib.init pkgs; + jail-nix = pkgs.callPackage sources."jail.nix" {}; + jail = jail-nix.init pkgs; in # ... ``` @@ -105,8 +105,6 @@ optionally be passed into `mkOverlay` attribute set as well. Example: ```nix -sources = import ./nix/sources.nix; -jail-nix = import sources."jail.nix" { }; jailOverlay = final: prev: jail-nix.lib.mkOverlay { inherit final prev; packages = combinators: with combinators; { @@ -114,7 +112,7 @@ jailOverlay = final: prev: jail-nix.lib.mkOverlay { firefox = [ network gui gpu ]; }; }; -pkgs = import sources.nixpkgs { +pkgs = import nixpkgs { system = "x86_64-linux"; overlays = [ jailOverlay ]; };