This repository has been archived by the owner on Feb 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Nix Flake for development builds Signed-off-by: Sefa Eyeoglu <[email protected]> * Add Nix formatter Ensure Nix code style is formatted using Alejandra. https://github.com/kamadorueda/alejandra Signed-off-by: Sefa Eyeoglu <[email protected]> * Add garnix CI config https://garnix.io/ Signed-off-by: Sefa Eyeoglu <[email protected]> * Add Nix info to README.md Signed-off-by: Sefa Eyeoglu <[email protected]> * Add GitHub Action for Flake updates Signed-off-by: Sefa Eyeoglu <[email protected]> * Add Nix overlay Signed-off-by: Sefa Eyeoglu <[email protected]> * Add info about Nix outputs to README.md Signed-off-by: Sefa Eyeoglu <[email protected]> --------- Signed-off-by: Sefa Eyeoglu <[email protected]>
- Loading branch information
Showing
9 changed files
with
201 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Update Flake Lockfile | ||
|
||
on: | ||
schedule: | ||
# run weekly at noon on sundays | ||
- cron: "0 12 * * 0" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
update-flake: | ||
if: github.owner == 'galister' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Nix | ||
uses: DeterminateSystems/nix-installer-action@main | ||
- name: Update flake.lock | ||
uses: DeterminateSystems/update-flake-lock@main | ||
with: | ||
pr-title: "Update flake.lock" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/target | ||
.gdb_history | ||
result | ||
reuslt-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
description = "A lightweight OpenXR overlay for Wayland desktops, inspired by XSOverlay"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-parts = { | ||
url = "github:hercules-ci/flake-parts"; | ||
inputs.nixpkgs-lib.follows = "nixpkgs"; | ||
}; | ||
}; | ||
|
||
outputs = inputs @ { | ||
self, | ||
flake-parts, | ||
... | ||
}: | ||
flake-parts.lib.mkFlake {inherit inputs;} { | ||
systems = ["x86_64-linux" "aarch64-linux"]; | ||
imports = [./nix/packages.nix ./nix/dev.nix]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
builds: | ||
exclude: [] | ||
include: | ||
- "checks.*.*" | ||
- "packages.*.*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
lib, | ||
rustPlatform, | ||
alsa-lib, | ||
cmake, | ||
cpm-cmake, | ||
fontconfig, | ||
freetype, | ||
libglvnd, | ||
libxkbcommon, | ||
mesa, | ||
openxr-loader, | ||
pipewire, | ||
pkg-config, | ||
wayland, | ||
xorg, | ||
# flake | ||
self, | ||
version, | ||
}: | ||
rustPlatform.buildRustPackage { | ||
pname = "wlx-overlay-x"; | ||
inherit version; | ||
|
||
src = lib.cleanSource self; | ||
|
||
cargoLock = { | ||
lockFile = ../Cargo.lock; | ||
allowBuiltinFetchGit = true; | ||
}; | ||
|
||
nativeBuildInputs = [ | ||
cmake | ||
pkg-config | ||
rustPlatform.bindgenHook | ||
]; | ||
|
||
buildInputs = [ | ||
alsa-lib | ||
fontconfig | ||
freetype | ||
libglvnd | ||
libxkbcommon | ||
mesa | ||
openxr-loader | ||
pipewire | ||
wayland | ||
xorg.libX11 | ||
]; | ||
|
||
# From https://github.com/StardustXR/server/blob/0dc5b1a92f5707efa16c251602935bdfc47ee7f0/nix/stardust-xr-server.nix | ||
CPM_SOURCE_CACHE = "./build"; | ||
postPatch = '' | ||
sk=$(echo $cargoDepsCopy/stereokit-sys-*/StereoKit) | ||
mkdir -p $sk/build/cpm | ||
# This is not ideal, the original approach was to fetch the exact cmake | ||
# file version that was wanted from GitHub directly, but at least this way it comes from Nixpkgs.. so meh | ||
cp ${cpm-cmake}/share/cpm/CPM.cmake $sk/build/cpm/CPM_0.32.2.cmake | ||
''; | ||
|
||
meta = with lib; { | ||
description = "WlxOverlay for OpenXR, written in Rust"; | ||
homepage = "https://github.com/galister/wlx-overlay-x"; | ||
license = licenses.gpl3Only; | ||
platforms = platforms.linux; | ||
maintainers = with maintainers; [Scrumplex]; | ||
mainProgram = "wlx-overlay-x"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
perSystem = {pkgs, ...}: { | ||
formatter = pkgs.alejandra; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{self, ...}: let | ||
version = builtins.substring 0 8 self.lastModifiedDate or "dirty"; | ||
in { | ||
perSystem = { | ||
config, | ||
pkgs, | ||
... | ||
}: { | ||
packages = { | ||
default = config.packages.wlx-overlay-x; | ||
wlx-overlay-x = pkgs.callPackage ./derivation.nix {inherit self version;}; | ||
}; | ||
}; | ||
|
||
flake.overlays.default = final: _: { | ||
wlx-overlay-x = final.callPackage ./derivation.nix {inherit self version;}; | ||
}; | ||
} |