Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ opennow-stable/package-lock.json
# AI Agent guidelines (local only)
AGENTS.md
release-notes.md

# Nix
result
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<a href="https://github.com/OpenCloudGaming/OpenNOW/releases">
<img src="https://img.shields.io/github/v/tag/OpenCloudGaming/OpenNOW?style=for-the-badge&label=Download&color=brightgreen" alt="Download">
</a>
<a href="https://testflight.apple.com/join/u1XPJKH2">
<img src="https://img.shields.io/badge/TestFlight-Beta-blue.svg?style=for-the-badge&logo=apple" alt="TestFlight">
</a>
<a href="https://opennow.zortos.me">
<img src="https://img.shields.io/badge/Docs-opennow.zortos.me-blue?style=for-the-badge" alt="Documentation">
</a>
Expand Down Expand Up @@ -80,6 +83,55 @@ Current packaging targets:
| macOS | `dmg`, `zip` |
| Linux x64 | `AppImage`, `deb` |
| Linux ARM64 | `AppImage`, `deb` |
| iOS | `ipa` |
Comment thread
Kief5555 marked this conversation as resolved.

## Nix

You'll need to add this repo into your flake.nix:
```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

opennow.url = "github:OpenCloudGaming/OpenNOW";
opennow.inputs.nixpkgs.follows = "nixpkgs";
};

outputs = {
self,
nixpkgs,
opennow,
... }@inputs: {
};
}
```
Then add the package to your configuration:

```nix
# Home-manager
{
pkgs,
inputs,
...
}: {
home.packages = with pkgs; [
inputs.opennow.packages.${pkgs.system}.default
];
}
```

```nix
# Nix configuration
{
pkgs,
inputs,
...
}: {
environment.systemPackages = with pkgs; [
inputs.opennow.packages.${pkgs.system}.default
];
}
```

### Develop Locally

Expand Down
61 changes: 61 additions & 0 deletions flake.lock

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

123 changes: 123 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
description = "Custom GeForce Now Client Named OpenNOW";
Comment thread
Kief5555 marked this conversation as resolved.

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
appPackage = builtins.fromJSON (builtins.readFile ./opennow-stable/package.json);
in
{
packages.default = pkgs.buildNpmPackage {
pname = "opennow";
version = appPackage.version;

src = ./opennow-stable;

npmDepsHash = "sha256-iMoYLIydDGTHgm6eMdoXb65NcPFXfWcVztmvMRHmCJs=";
npmDepsFetcherVersion = 2;
makeCacheWritable = true;
forceGitDeps = true;

npmInstallFlags = [
"--legacy-peer-deps"
"--no-audit"
];
npmFlags = [
"--legacy-peer-deps"
"--no-audit"
];
npmCiFlags = [
"--legacy-peer-deps"
"--no-audit"
];

nativeBuildInputs = [
pkgs.pkg-config
pkgs.python3
pkgs.gcc
pkgs.makeWrapper
pkgs.copyDesktopItems
];

buildInputs = [
pkgs.openssl
pkgs.zlib
pkgs.electron
];

ELECTRON_SKIP_BINARY_DOWNLOAD = "1";

installPhase = ''
runHook preInstall

appdir="$TMPDIR/opennow-install"
mkdir -p "$appdir" "$out/lib/opennow"
if [ -f package.json ]; then
cp package.json "$appdir/"
fi
if [ -f package-lock.json ]; then
cp package-lock.json "$appdir/"
fi
for path in out dist dist-electron; do
if [ -e "$path" ]; then
cp -r "$path" "$appdir/"
fi
done
if [ -d node_modules ]; then
cp -r node_modules "$appdir/"
if [ -f "$appdir/package.json" ]; then
npm --prefix "$appdir" prune --omit=dev --no-audit --legacy-peer-deps
fi
fi
cp -r "$appdir"/. $out/lib/opennow

mkdir -p $out/bin
for path in "out/main/index.js" "dist/main/index.js" "dist-electron/main.js"; do
if [ -f "$out/lib/opennow/$path" ]; then
MAIN_SCRIPT="$out/lib/opennow/$path"
break
fi
done
: ''${MAIN_SCRIPT:="$out/lib/opennow"}

makeWrapper ${pkgs.electron}/bin/electron $out/bin/opennow \
--add-flags "$MAIN_SCRIPT" \
--set NODE_ENV production \
--add-flags "--enable-features=WaylandWindowDecorations --platform-hint=auto"

mkdir -p $out/share/icons/hicolor/512x512/apps
if [ -f "src/renderer/src/assets/opennow-logo.png" ]; then
cp src/renderer/src/assets/opennow-logo.png $out/share/icons/hicolor/512x512/apps/opennow.png
fi
runHook postInstall
'';
desktopItems = [
(pkgs.makeDesktopItem {
name = "opennow";
desktopName = "OpenNOW";
genericName = "Custom GeForce Now Client Named OpenNOW";
comment = "An open-source desktop client for GeForce NOW";
exec = "opennow %U";
icon = "opennow";
keywords = [ "GFN" "GeForceNOW" "cloud" "gaming" ];
startupWMClass = "opennow";
startupNotify = true;
categories = [ "Game" "Network" ];
})
];
};
}
);
}
Loading
Loading