add nix files

This commit is contained in:
joachimschmidt557 2021-05-24 12:53:59 +08:00
parent c9ac2b6ff1
commit 0073a67ac2
No known key found for this signature in database
GPG key ID: E0B575BE2884ACC5
2 changed files with 61 additions and 0 deletions

39
nix/river.nix Normal file
View file

@ -0,0 +1,39 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.stdenv.mkDerivation rec {
pname = "river";
version = "master";
src = ./.;
# src = builtins.fetchGit {
# url = "https://github.com/ifreund/river";
# ref = "master";
# };
nativeBuildInputs = with pkgs; [
pkg-config
];
buildInputs = with pkgs; [
zig
wayland
wayland-protocols
wlroots
libxkbcommon
pixman
libudev
xorg.libX11
libGL
libevdev
scdoc
];
buildPhase = ''
export HOME=$TMPDIR
zig build -Drelease-safe -Dxwayland -Dman-pages
'';
installPhase = ''
zig build -Drelease-safe -Dxwayland -Dman-pages --prefix $out install
'';
}

22
nix/zig.nix Normal file
View file

@ -0,0 +1,22 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.stdenv.mkDerivation rec {
version = "master";
pname = "zig";
src = ./.;
hardeningDisable = [ "all" ];
nativeBuildInputs = with pkgs; [ cmake ninja ];
buildInputs = with pkgs; [
llvmPackages_12.clang-unwrapped
llvmPackages_12.llvm
llvmPackages_12.lld
libxml2
zlib
];
preBuild = ''
export HOME=$TMPDIR;
'';
}