Skip to content

Commit a28af2d

Browse files
authored
nix install / run instructions (#78)
1 parent 1cab552 commit a28af2d

File tree

3 files changed

+53
-2
lines changed

3 files changed

+53
-2
lines changed

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,45 @@ cmake --build build --config Debug
218218
.\build\tests\filewatcher\Debug\filewatcher_tests.exe
219219
```
220220

221-
## Nix Develop Shell
221+
## Nix
222+
### Nix Develop Shell
222223
```sh
223224
nix develop
224225
```
225226

227+
### Nix Run / Install (one command)
228+
Run without installing (builds and runs):
229+
```sh
230+
nix run github:jamylak/vsdf
231+
```
232+
233+
Install into your profile (then `vsdf` is on PATH):
234+
```sh
235+
nix profile install github:jamylak/vsdf
236+
```
237+
238+
Open a one-off shell with `vsdf` available:
239+
```sh
240+
nix shell github:jamylak/vsdf
241+
```
242+
243+
### Home Manager (flake) install
244+
```nix
245+
# flake.nix
246+
{
247+
inputs.vsdf.url = "github:jamylak/vsdf";
248+
}
249+
```
250+
```nix
251+
# home.nix
252+
{ inputs, pkgs, ... }:
253+
{
254+
home.packages = [
255+
inputs.vsdf.packages.${pkgs.system}.default
256+
];
257+
}
258+
```
259+
226260
### Manually create your own vulkan compatible shader
227261
If you don't want any template prepended or you want
228262
to use a Vulkan shader directly you can copy `shaders/vulktemplate.frag`

default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ stdenv.mkDerivation {
6363
description = "Vulkan SDF Renderer + Hot Reloader";
6464
homepage = "https://github.com/jamylak/vsdf";
6565
license = licenses.mit;
66+
mainProgram = "vsdf";
6667
platforms = platforms.linux ++ platforms.darwin;
6768
};
6869
}

flake.nix

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#
3030
# config.allowUnfree = true;
3131
};
32+
33+
vsdfPkg = pkgs.callPackage ./default.nix { };
3234
in
3335
{
3436
devShells.default =
@@ -71,6 +73,20 @@
7173
'';
7274
};
7375

74-
packages.default = pkgs.callPackage ./default.nix { };
76+
packages = {
77+
default = vsdfPkg;
78+
vsdf = vsdfPkg;
79+
};
80+
81+
apps = {
82+
default = {
83+
type = "app";
84+
program = "${vsdfPkg}/bin/vsdf";
85+
};
86+
vsdf = {
87+
type = "app";
88+
program = "${vsdfPkg}/bin/vsdf";
89+
};
90+
};
7591
});
7692
}

0 commit comments

Comments
 (0)