{"id":22825366,"url":"https://github.com/crabdancing/nixpak-flatpak-wrapper","last_synced_at":"2025-04-23T07:55:26.515Z","repository":{"id":229520188,"uuid":"776944410","full_name":"crabdancing/nixpak-flatpak-wrapper","owner":"crabdancing","description":"Hacks helping with semi-almost-usable declarative NixOS sandboxing","archived":false,"fork":false,"pushed_at":"2024-08-14T21:02:45.000Z","size":63,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-23T07:55:20.871Z","etag":null,"topics":["bwrap","containerization","flatpak","isolation","nix","nix-flake","nixos","nixpak","sandboxing"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/crabdancing.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":"2024-03-24T21:34:14.000Z","updated_at":"2024-12-22T14:48:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"a6bd0526-0757-4aad-995d-e445e581bd20","html_url":"https://github.com/crabdancing/nixpak-flatpak-wrapper","commit_stats":null,"previous_names":["alxpettit/nixpak-flatpak-wrapper","a7287/nixpak-flatpak-wrapper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crabdancing%2Fnixpak-flatpak-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crabdancing%2Fnixpak-flatpak-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crabdancing%2Fnixpak-flatpak-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crabdancing%2Fnixpak-flatpak-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crabdancing","download_url":"https://codeload.github.com/crabdancing/nixpak-flatpak-wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250395201,"owners_count":21423376,"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","containerization","flatpak","isolation","nix","nix-flake","nixos","nixpak","sandboxing"],"created_at":"2024-12-12T17:10:30.020Z","updated_at":"2025-04-23T07:55:26.499Z","avatar_url":"https://github.com/crabdancing.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Glue to wrap `flatpak`, as part of a mischievous scam, tricking `xdg-desktop-portal` into letting us have decent [declaratively managed containerization on NixOS](https://github.com/nixpak/nixpak/).\n\nI mean, it wasn't like [upstream was gonna stop bikeshedding](https://github.com/flatpak/xdg-desktop-portal/pull/741) on stuff like this any time soon.\n\nThis package functions as a drop-in replacement for the original flatpak package. The module exposed in this flake automatically inserts this package as a replacement for the upstream `pkgs.flatpak` in `services.flatpak.package`. It may, in the future, do some kind of other configuration work for better UX.\n\n## Someday Eventually Asked Questions\n\n- Q: Does it control the permissions given by bwrap via `nixpak`?\n- A: No, it doesn't touch that stuff.\n- Q: So I have to specify my permissions in two places?\n- A: Yeah.\n- Q: That sucks.\n- A: True.\n- Q: Do I need to have the nixpkgs flatpak service enabled too for flatpak to work?\n- A: Yup!\n- Q: Do you accept PRs?\n- A: Sure. :3\n- Q: Why did you give it such a bad/awkward name?\n- A: Because I'm a programmer.\n- Q: Why did you code this in Rust instead of using a shell script?\n- A: I like 🦀 uwu\n- Q: What?\n- A: Yes.\n\n## Features \n\n- Theoretically kind of robust (IDK, I haven't seen it misbehave yet.)\n- Most failure modes will simply transparently call flatpak to avoid bricking flatpak\n- Wraps the entirety of the `pkgs.flatpak` file set, transparently updating it with a replacement for the binary, renaming the old binary to `flatpak-raw`\n- Easy-to-use module for drop-in reliable configuration \u0026 setup\n- Logs its experiences in a wondrous diary of adventure so that you can see why, when something goes wrong.\n- Centrally managed with a TOML config file, which is hopefully kind of easy to declaratively manage.\n- A schema-aware Nix configuration module, so that I will forget to update it when I make changes to the TOML config. :sob:\n- Arguably overengineered, with questionable features such as tilda expansion.\n\n## Usage\n\nYou can add it to your system flake `inputs` like so:\n\n```nix\nnixpak-flatpak-wrapper = {\n  url = \"github:crabdancing/nixpak-flatpak-wrapper\";\n  # If you don't follow your own nixpkgs,\n  # you might be accidentally substituting `flatpak` with an older/newer version than in nixpkgs!\n  inputs.nixpkgs.follows = \"nixpkgs\";\n};\n```\n\nOnce you've added the `nixosModules.default` to your system modules, configuration can happen like so:\n```nix\nservices.flatpak.enable = true;\n\nprograms.nixpak-flatpak-wrapper = {\n  enable = true;\n  settings = {\n    enable_logging = true,\n    perms = [\n      {\n        app_id = \"org.chromium.Chromium\";\n        bind.rw = [\n          \"~/Downloads\"\n        ];\n      }\n      {\n        app_id = \"org.mozilla.firefox\";\n        bind.rw = [\n          \"~/Downloads\"\n        ];\n      }\n    ];\n  };\n};\n```\n\n## Internals\n\nConfig is stored at `/etc/nixpak-flatpak-wrapper.toml`\n\nThe schema is as such:\n\n```toml\n[[perms]]\napp_id = \"org.chromium.Chromium\"\nbind.rw = [\n  \"~/Downloads\"\n]\nbind.ro = []\n\n[[perms]]\napp_id = \"org.mozilla.firefox\"\nbind.rw = [\n  \"~/Downloads\"\n]\nbind.ro = []\n```\n\nIt records what happens in `~/.local/share/nixpak-flatpak-wrapper/nixpak-flatpak-wrapper.log` for ease of debugging. This is because a drop-in wrapper/replacement should not print warning/error messages the original app would not have, in case it breaks someone's parsing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrabdancing%2Fnixpak-flatpak-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrabdancing%2Fnixpak-flatpak-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrabdancing%2Fnixpak-flatpak-wrapper/lists"}