Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ build/
*.exe
.dSYM/
*.gz
result/
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ $ make
$ ./sowon
```

### Nixos

- Temporary way

```sh
nix-build
./result/bin/my-app

```

- Install via User profile

```sh
nix-env -i -f default.nix
```

### MacOS

```console
Expand Down Expand Up @@ -55,11 +71,11 @@ $ ./sowon

### Key bindings

| Key | Description |
| --- | --- |
| <kbd>SPACE</kbd> | Toggle pause |
| <kbd>=</kbd> or <kbd>+</kbd> | Zoom in |
| <kbd>-</kbd> | Zoom out |
| <kbd>0</kbd> | Zoom 100% |
| <kbd>F5</kbd> | Restart |
| <kbd>F11</kbd> | Fullscreen |
| Key | Description |
| ---------------------------- | ------------ |
| <kbd>SPACE</kbd> | Toggle pause |
| <kbd>=</kbd> or <kbd>+</kbd> | Zoom in |
| <kbd>-</kbd> | Zoom out |
| <kbd>0</kbd> | Zoom 100% |
| <kbd>F5</kbd> | Restart |
| <kbd>F11</kbd> | Fullscreen |
43 changes: 43 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
pkgs ? import <nixpkgs> { },
}:

pkgs.stdenv.mkDerivation {
pname = "sowon";
version = "1.0.0";

# Point this to the directory containing your binary
src = ./.;

nativeBuildInputs = [
pkgs.autoPatchelfHook
];

buildInputs = with pkgs; [
libX11
libXrandr
libXcursor
libXext
libXi
libXinerama
libXrender
libXfixes
libxcb
libXau
libXdmcp
libGL
stdenv.cc.cc.lib # Provides libstdc++ if needed
glibc
];

installPhase = ''
mkdir -p $out/bin
cp your-executable-name $out/bin/my-app
chmod +x $out/bin/my-app
'';

meta = {
description = "A binary patched for NixOS";
platforms = pkgs.lib.platforms.linux;
};
}
48 changes: 48 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
pkgs ? import <nixpkgs> { },
}:

pkgs.mkShell {
name = "sowon";

# Packages containing the libraries you listed
buildInputs = with pkgs; [
libX11
libXrandr
libXcursor
libXext
libXi
libXinerama
libXrender
libXfixes
libxcb
libXau
libXdmcp
libGL
# Standard C++ and C libraries
stdenv.cc.cc.lib
glibc
];

# This environment variable tells the linker where to find the libs
shellHook = ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${
with pkgs;
lib.makeLibraryPath [
libX11
libXrandr
libXcursor
libXext
libXi
libXinerama
libXrender
libXfixes
libxcb
libXau
libXdmcp
libGL
stdenv.cc.cc.lib
]
}"
'';
}