Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit f80b3b3

Browse files
committed
Nix flakify
Flake URI is github:Zoxcore/qTox_enhanced
1 parent 5644e7e commit f80b3b3

File tree

4 files changed

+100
-62
lines changed

4 files changed

+100
-62
lines changed

buildscripts/nixos_qtox.nix

Lines changed: 2 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,7 @@
1-
let
2-
overlay = final: prev:
3-
# a fixed point overay for overriding a package set
4-
5-
with final; {
6-
# use the final result of the overlay for scope
7-
8-
libtoxcore =
9-
# build a custom libtoxcore
10-
prev.libtoxcore.overrideAttrs ({ ... }: {
11-
src = fetchFromGitHub {
12-
owner = "zoff99";
13-
repo = "c-toxcore";
14-
rev = "4932f9dcf7181d30a0abb4a12b1144ccb1a741fa";
15-
fetchSubmodules = true;
16-
sha256 = "sha256-cNVUZe4xfl88quk8Tm6jeG4ov1L6q/wh81WZIotVbnk=";
17-
};
18-
buildInputs = [
19-
libsodium msgpack ncurses libconfig
20-
libopus libvpx x264 ffmpeg
21-
];
22-
});
23-
24-
toxext =
25-
# use an existing package or package it here
26-
prev.toxext or stdenv.mkDerivation rec {
27-
pname = "toxext";
28-
version = "0.0.3";
29-
src = fetchFromGitHub {
30-
owner = pname;
31-
repo = pname;
32-
rev = "v${version}";
33-
hash = "sha256-I0Ay3XNf0sxDoPFBH8dx1ywzj96Vnkqzlu1xXsxmI1M=";
34-
};
35-
nativeBuildInputs = [ cmake pkg-config ];
36-
buildInputs = [ libtoxcore ];
37-
};
38-
39-
toxextMessages =
40-
# use an existing package or package it here
41-
prev.toxextMessages or stdenv.mkDerivation rec {
42-
pname = "tox_extension_messages";
43-
version = "0.0.3";
44-
src = fetchFromGitHub {
45-
owner = "toxext";
46-
repo = pname;
47-
rev = "v${version}";
48-
hash = "sha256-qtjtEsvNcCArYW/Zyr1c0f4du7r/WJKNR96q7XLxeoA=";
49-
};
50-
nativeBuildInputs = [ cmake pkg-config ];
51-
buildInputs = [ libtoxcore toxext ];
52-
};
53-
54-
qtox = prev.qtox.overrideAttrs ({ buildInputs, ... }: {
55-
version = "push_notification-";
56-
# take sources directly from this repo checkout
57-
buildInputs = buildInputs ++ [ curl libtoxcore toxext toxextMessages ];
58-
});
59-
60-
};
61-
62-
in { pkgs ? import <nixpkgs> { } }:
1+
{ pkgs ? import <nixpkgs> { } }:
632
# take nixpkgs from the environment
643
let
4+
overlay = import ./overlay.nix;
655
pkgs' = pkgs.extend overlay;
666
# apply overlay
677
in pkgs'.qtox

buildscripts/overlay.nix

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
final: prev:
2+
# a fixed point overay for overriding a package set
3+
4+
with final; {
5+
# use the final result of the overlay for scope
6+
7+
libtoxcore =
8+
# build a custom libtoxcore
9+
prev.libtoxcore.overrideAttrs ({ ... }: {
10+
src = fetchFromGitHub {
11+
owner = "zoff99";
12+
repo = "c-toxcore";
13+
rev = "4932f9dcf7181d30a0abb4a12b1144ccb1a741fa";
14+
fetchSubmodules = true;
15+
sha256 = "sha256-cNVUZe4xfl88quk8Tm6jeG4ov1L6q/wh81WZIotVbnk=";
16+
};
17+
buildInputs =
18+
[ libsodium msgpack ncurses libconfig libopus libvpx x264 ffmpeg ];
19+
});
20+
21+
toxext = stdenv.mkDerivation rec {
22+
pname = "toxext";
23+
version = "0.0.3";
24+
src = fetchFromGitHub {
25+
owner = pname;
26+
repo = pname;
27+
rev = "v${version}";
28+
hash = "sha256-I0Ay3XNf0sxDoPFBH8dx1ywzj96Vnkqzlu1xXsxmI1M=";
29+
};
30+
nativeBuildInputs = [ cmake pkg-config ];
31+
buildInputs = [ libtoxcore ];
32+
};
33+
34+
toxextMessages = stdenv.mkDerivation rec {
35+
pname = "tox_extension_messages";
36+
version = "0.0.3";
37+
src = fetchFromGitHub {
38+
owner = "toxext";
39+
repo = pname;
40+
rev = "v${version}";
41+
hash = "sha256-qtjtEsvNcCArYW/Zyr1c0f4du7r/WJKNR96q7XLxeoA=";
42+
};
43+
nativeBuildInputs = [ cmake pkg-config ];
44+
buildInputs = [ libtoxcore toxext ];
45+
};
46+
47+
qtox = prev.qtox.overrideAttrs ({ buildInputs, ... }: {
48+
version = "push_notification-unstable";
49+
src = ./..;
50+
# take sources directly from this repo checkout
51+
buildInputs = buildInputs ++ [ curl libtoxcore toxext toxextMessages ];
52+
});
53+
54+
}

flake.lock

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

flake.nix

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
description = "qTox development flake";
3+
4+
outputs = { self, nixpkgs }:
5+
let inherit (nixpkgs) lib;
6+
in {
7+
overlay = import ./buildscripts/overlay.nix;
8+
9+
legacyPackages =
10+
lib.mapAttrs (system: { extend, ... }: extend self.overlay)
11+
nixpkgs.legacyPackages;
12+
13+
packages = lib.mapAttrs (system: pkgs: {
14+
default = pkgs.qtox;
15+
inherit (pkgs.extend self.overlay)
16+
libtoxcore toxext toxextMessages qtox;
17+
}) self.legacyPackages;
18+
};
19+
}

0 commit comments

Comments
 (0)