Continue PR #142: security + Nix docs follow-up (#148)

* feat: add Nix Flake release and update documentation for Nix integration

- Added flake.nix with native library patching for Linux
- Included SHA256 hashes for v0.10.0 DEB releases (x86_64 and arm64)
- Updated README.md with instructions for nix run, NixOS, Home Manager, and devShells
- Generated flake.lock for reproducibility

* refactor: improve Nix Flake patterns for better consumer control

- Extracted derivation logic into a reusable `mkPackage` function
- Exposed `overlays.default` to allow consumers to use their own nixpkgs instance
- Updated `pkgs.system` to `pkgs.stdenv.hostPlatform.system` to follow modern Nix patterns
- Ensured default `packages` definition correctly handles unfree configuration for testing with `nix build` or `nix run`

* docs: update README with advanced Nix integration patterns

- Added Option 1 (Direct Integration) and Option 2 (Overlay) documentation
- Explained how to use the overlay for full nixpkgs control
- Fixed Markdown styling and lint issues in the Nix integration section

* docs: simplify Nix documentation to favor Overlay integration

- Removed "Option 1" (direct integration) as per user feedback
- Promoted the Overlay method as the standard way to consume the package
- Updated devShell examples to rely on the overlayed package set for consistency

* fix(security): prevent master key overwriting on decryption failure and improve account loading resilience

- Modify readSafeStorageKey and generatePrimaryMasterKey to stop if decryption fails for an existing file, preventing permanent data loss when keyring is temporarily locked.
- Update CloudAccountRepo.getAccounts and getAccount to gracefully skip corrupted account records instead of throwing errors.
- Added detailed logging for security failures to aid in diagnostics.

* docs(readme): sync Nix/NixOS integration docs in README.zh-CN

---------

Co-authored-by: Youssef <[email protected]>
This commit is contained in:
vinandYoussef authored and GitHub committed 2026-04-06 21:34:32 +08:00
1 parent 61716bb512
commit fce38ec6f0
6 files changed
+300 -23

No files matched your search

+47
View File
@@ -193,6 +193,53 @@ Download the latest release for your platform from the [Releases](https://github
| Windows (x64/ARM64) | [.exe installer](https://github.com/Draculabo/AntigravityManager/releases/latest) |
| macOS | [.dmg installer](https://github.com/Draculabo/AntigravityManager/releases/latest) |
| Linux | [.deb / .rpm](https://github.com/Draculabo/AntigravityManager/releases/latest) |
| NixOS / Nix | `nix run github:Draculabo/AntigravityManager` |
### ❄️ Nix Integration
You can integrate Antigravity Manager into your Nix configuration using the provided flake.
#### 🛠️ NixOS / Home Manager
Add the flake to your `flake.nix` inputs:
```nix
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
antigravity-manager.url = "github:Draculabo/AntigravityManager";
};
```
To integrate with your system, add `antigravity-manager.overlays.default` to your `nixpkgs.overlays`. This ensures the package is correctly built against your own `nixpkgs` instance and respects your global configuration.
```nix
# Add to your NixOS/Home Manager configuration
{
nixpkgs.overlays = [ inputs.antigravity-manager.overlays.default ];
# Antigravity Manager has an unfree license (cc-by-nc-sa-40)
nixpkgs.config.allowUnfree = true;
environment.systemPackages = [
pkgs.antigravity-manager
];
}
```
#### 💻 Development Shell
If you're using the overlay above, you can simply add it to your `devShell`:
```nix
devShells.default = pkgs.mkShell {
packages = [
pkgs.antigravity-manager
];
};
```
> [!NOTE]
> Since the package is unfree, you **must** have `allowUnfree = true;` enabled in your `nixpkgs` configuration for it to evaluate correctly.
### Build from Source