Skip to content

Commit ceff220

Browse files
authored
Merge pull request #970 from onekey-sec/unblob-nixpkgs
Use nixpkgs as a base to build Unblob from
2 parents e4a70bb + 71df562 commit ceff220

File tree

13 files changed

+106
-644
lines changed

13 files changed

+106
-644
lines changed

docs/installation.md

Lines changed: 76 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,84 @@ docker run \
8787
ghcr.io/onekey-sec/unblob:latest /data/input/path/to/file
8888
```
8989

90-
## nix package
90+
## Nix package
9191

92-
unblob can be built and run using the [Nix](https://nixos.org) package manager.
93-
The Nix derivation installs all 3rd party dependencies.
92+
You can install stable releases of unblob directly from nixpkgs using your preferred package installation method, e.g:
9493

95-
1. [Install and configure Nix](https://nixos.org/download.html).
94+
For a system-wide installation on [NixOS](https://nixos.org):
95+
96+
```nix
97+
# configuration.nix
98+
99+
{ pkgs, ...}:
100+
101+
{
102+
environment.systemPackages = [ pkgs.unblob ];
103+
}
104+
```
105+
106+
For [home-manager](https://nix-community.github.io/home-manager/):
107+
108+
```nix
109+
# home.nix
110+
111+
{ pkgs, ...}:
112+
113+
{
114+
home.packages = [ pkgs.unblob ];
115+
}
116+
```
117+
118+
Using `nix-env`:
119+
120+
```console
121+
$ nix-env -iA nixpkgs.unblob
122+
```
123+
124+
Or `nix profile`:
125+
```console
126+
$ nix profile install nixpkgs#unblob
127+
```
128+
129+
Alternatively you can also install the latest version from git:
130+
131+
Using the provided overlay:
132+
133+
```nix
134+
{
135+
nixpkgs.overlays = [
136+
(let
137+
unblob = import (builtins.fetchTarball {
138+
url = "https://github.com/onekey-sec/unblob/archive/main.tar.gz";
139+
});
140+
in
141+
"{unblob}/overlay.nix")
142+
];
143+
144+
environment.systemPackages = [ pkgs.unblob ]; # or `home.packages` for home-manager
145+
}
146+
```
147+
148+
You can use the provided flake as well:
149+
150+
```nix
151+
{
152+
inputs.nixpkgs.url = "...";
153+
inputs.unblob.url = "github:onekey-sec/unblob";
154+
155+
outputs = { nixpkgs, unblob, ...}: {
156+
nixosConfiguration.<my-host> = nixpkgs.lib.nixosSystem {
157+
modules = [
158+
({ pkgs, ... }: {
159+
environment.systemPackages = [ unblob.packages.${pkgs.system}.default ];
160+
})
161+
];
162+
};
163+
};
164+
}
165+
```
166+
167+
For imperative package installation, follow these steps:
96168

97169
1. _Optional_: enable the experimental features so that you don't need to pass
98170
`--extra-experimental-features "nix-command flakes"` to `nix` command invocations:

flake.lock

Lines changed: 3 additions & 225 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)