{"id":15171785,"url":"https://github.com/shiryel/nixjail","last_synced_at":"2026-01-27T18:33:42.485Z","repository":{"id":195149881,"uuid":"692353870","full_name":"shiryel/nixjail","owner":"shiryel","description":"Sandbox your nixpkgs easily with bwrap!","archived":false,"fork":false,"pushed_at":"2025-01-29T20:37:49.000Z","size":84,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T21:28:04.346Z","etag":null,"topics":["bwrap","nixos","nixpkgs","sandbox"],"latest_commit_sha":null,"homepage":"https://shiryel.github.io/nixjail/","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shiryel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-16T08:13:00.000Z","updated_at":"2025-01-29T20:37:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"c409d5e2-6d96-46da-93fa-344f3348a8d3","html_url":"https://github.com/shiryel/nixjail","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"c2089a1bc3cf6d27339e6d318368f4354b71b707"},"previous_names":["shiryel/nixjail"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiryel%2Fnixjail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiryel%2Fnixjail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiryel%2Fnixjail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiryel%2Fnixjail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shiryel","download_url":"https://codeload.github.com/shiryel/nixjail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239478639,"owners_count":19645568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bwrap","nixos","nixpkgs","sandbox"],"created_at":"2024-09-27T09:03:58.183Z","updated_at":"2026-01-27T18:33:42.478Z","avatar_url":"https://github.com/shiryel.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NixJail \nSandbox your nixpkgs easily with bwrap!\n\n## Features\n\n- Wraps every binary (inside /bin) of a package with Bwrap automatically  \n  \u003e So you don't need to worry about those packages with 2 binaries that do the same thing\n- Replaces the Desktop item executable with the NixJail version  \n  \u003e So you don't need to worry about Desktop items running the wrong package\n- Keeps symbolic links to the original package  \n  \u003e Because some packages WILL break trying to find these files\n- Makes the result overridable, delegating the override to the original package    \n  \u003e Because some nixpkgs configs WILL try to override the package\n- Add attr `noBwrap` as the original package to the result's `passthru`  \n  \u003e So you can use `PACKAGE.passthru.noBwrap` to use the original package on your config when necessary\n- Does not modify the original package, only wrappes it  \n  \u003e Because nobody wants to wait for the compiler ;)\n- Provides `nixjail.fhs`, an enchanced `buildFHSUserEnvBubblewrap` option\n  \u003e To allow you to create FHS enviroments with many packages in a easier way\n\n[See all available config options here](https://shiryel.github.io/nixjail)\n\n## Usage\n\nOn your flake.nix add nixjail to `inputs` and `outputs`, eg:\n```nix\n{\n  inputs = {\n    # ... other inputs, eg: nixpkgs.url = \"github:NixOS/nixpkgs/nixos-unstable\";\n    nixjail = {\n      url = \"git+file:/home/shiryel/nixos/nixjail\";\n      inputs.nixpkgs.follows = \"nixpkgs\"; # change to your main nixpkgs input name\n    };\n  };\n\n  outputs = { nixpkgs, ... }@inputs:\n    let\n      pkgs = nixpkgs.legacyPackages.x86_64-linux;\n    in\n    {\n      nixosConfigurations.default =\n        nixpkgs.lib.nixosSystem {\n          # avoid using pkgs, args or specialArgs here, they can conflict with nixpkgs.(...) inside modules\n          # see: https://github.com/NixOS/nixpkgs/issues/191910\n          modules = [\n            inputs.nixjail.nixosModules.nixjail\n            # ... other modules\n          ];\n        };\n    };\n}\n```\nNotice that you need to set `nixjail.inputs.nixpkgs.follows` to your main nixpkgs input, because NixJail does not have a default nixpkgs input (like HomeManager) but still expects it\n\nAfter adding NixJail as a module you can use it anywhere on your config, eg:\n```nix\n  nixjail.bwrap.profiles = [\n    {\n      # install many derivations on the same profile\n      packages = f: p: {\n        prismlauncher = prismlauncher;\n        thunderbird = thunderbird;\n        # you can also override the derivations of the profile:\n        discord = p.discord.override { nss = p.nss_latest; };\n      };\n      dri = true;\n      rwBinds = [ \"$HOME/Downloads\" ]; # Make sure to use `$HOME` instead of `~`\n    }\n```\nRebuild your system, the packages will be installed automatically, and use `cat $(which discord)` to see the result ;)\n\n---\n\n## Advanced examples\n\nHere some examples making use of some advanced NixJail options, [read the docs](https://shiryel.github.io/nixjail) before using them\n\n```nix\n{\n  nixjail = {\n    bwrap = {\n      defaultHomeDirRoot = \"$HOME/nixjail\";\n      profiles = [\n        # Firefox\n        {\n          packages = f: p: with p; { firefox = firefox; };\n          dri = true;\n          xdg = true;\n          autoBindHome = false;\n          rwBinds = [\n            { from = \"$HOME/nixjail/mozilla\"; to = \"$HOME/.mozilla\"; }\n            \"$HOME/Downloads\"\n          ];\n        }\n\n        # Lutris\n        {\n          packages = f: p: with p; {\n            lutris = lutris.override {\n              extraPkgs = pkgs: [ pkgs.openssl ];\n              # Fixes: dxvk::DxvkError\n              extraLibraries = pkgs:\n                let\n                  gl = config.hardware.opengl;\n                in\n                [\n                  pkgs.libjson # FIX: samba json errors\n                  gl.package\n                  gl.package32\n                ] ++ gl.extraPackages ++ gl.extraPackages32;\n            };\n          };\n          dri = true; # required for vulkan\n          xdg = true;\n          rwBinds = [ \"$HOME/Downloads\" ];\n          extraConfig = [\n            # Fix games breaking on wayland\n            \"--unsetenv WAYLAND_DISPLAY\"\n            \"--unsetenv XDG_SESSION_TYPE\"\n            \"--unsetenv CLUTTER_BACKEND\"\n            \"--unsetenv QT_QPA_PLATFORM\"\n            \"--unsetenv SDL_VIDEODRIVER\"\n            \"--unsetenv SDL_AUDIODRIVER\"\n            \"--unsetenv NIXOS_OZONE_WL\"\n          ];\n        }\n      ];\n    };\n\n    # run with `code-workspace` on your terminal (this example requires zsh and wayland)\n    fhs = {\n      defaultHomeDirRoot = \"$HOME/nixjail-workspaces\";\n      profiles = [\n        {\n          name = \"code-workspace\";\n          runScript = \"foot\";\n          dev = true;\n          roBinds = [\n            \"$HOME/.config/foot/foot.ini\"\n            \"$HOME/.zshrc\"\n            \"$HOME/.zshenv\"\n            \"$HOME/.zlogin\"\n            \"$HOME/.zprofile\"\n          ];\n          targetPkgs =\n            (pkgs: with pkgs; [\n              foot\n            ]);\n        }\n      ];\n    };\n  };\n}\n```\n\n## Is it any good?\nYes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiryel%2Fnixjail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiryel%2Fnixjail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiryel%2Fnixjail/lists"}