Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Nix flake #124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@ $ ln -s /path/to/boomer/overlay/ boomer
$ nix-env -iA nixos.boomer
```

## NixOS Flake

### Run

```
$ nix run github:tsoding/boomer
```

### Installation

```
$ nix profile install github:tsoding/boomer
```

## References

- https://github.com/nim-lang/x11/blob/bf9dc74dd196a98b7c2a2beea4d92640734f7c60/examples/x11ex.nim
Expand Down
58 changes: 58 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
description = "Zoomer application for Linux";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
};

outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
formatter = pkgs.alejandra;
packages = rec {
boomer = let
opengl = pkgs.nimPackages.buildNimPackage rec {
pname = "opengl";
version = "1.2.8";
src = pkgs.fetchFromGitHub {
owner = "nim-lang";
repo = "opengl";
rev = version;
hash = "sha256-OHdoPJsmCFdyKV7FGd/r+6nh6NRF7TPhuAx7o/VpiDg=";
};
};
in
pkgs.nimPackages.buildNimPackage {
pname = "boomer";
version = "0.0.1";
nimBinOnly = true;

src = ./.;

buildInputs = with pkgs.nimPackages; [
x11
opengl
];
propagatedBuildInputs = with pkgs; [
xorg.libX11
xorg.libXrandr
xorg.libXext
libGL
libGLU
];
meta = with nixpkgs.lib; {
mainProgram = "boomer";
description = "Zoomer application for Linux";
homepage = "https://github.com/tsoding/boomer";
license = licenses.mit;
};
};
nilp0inter marked this conversation as resolved.
Show resolved Hide resolved
default = boomer;
};
apps = rec {
boomer = flake-utils.lib.mkApp {drv = self.packages.${system}.boomer;};
default = boomer;
};
}
);
}