Skip to content

Commit 7050a6b

Browse files
Kathundnot-a-cowfr
andauthored
feat: nixos dev stuff (#470)
Co-authored-by: not a cow <104355555+not-a-cowfr@users.noreply.github.com>
1 parent a513b62 commit 7050a6b

3 files changed

Lines changed: 176 additions & 8 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ To make changes locally, follow these steps:
3838
1. Clone the repository: `git clone https://github.com/Polyfrost/OneLauncher`
3939
2. Navigate to the project directory: `cd OneLauncher`
4040
3. Configure your system environment for OneLauncher development:
41-
1. For Linux users, run: `./packages/scripts/setup.sh`
42-
> The [Unix script] will check if Rust and pnpm are installed then proceed to install Clang, NASM, LLVM, libvips, [Tauri essentials] and any other required dependencies for OneLauncher to build.
41+
1. Linux:
42+
1. NixOS: Please use `nix develop`
43+
2. For Other Linux users, run: `./packages/scripts/setup.sh`
44+
> The [Unix script] will check if Rust and pnpm are installed then proceed to install Clang, NASM, LLVM, libvips, [Tauri essentials] and any other required dependencies for OneLauncher to build.
4345
2. For macOS users, run: `./packages/scripts/setup.sh`
4446
> The [Unix script] will check if Rust, pnpm and Xcode are installed and proceed to use Homebrew to install NASM, [Tauri essentials] and install any other required dependencies for OneLauncher to build.
4547
3. For Windows users, run in PowerShell: `powershell -ExecutionPolicy Bypass -File .\packages\scripts\setup.ps1`

‎flake.lock‎

Lines changed: 98 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: 74 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,81 @@
11
{
22
description = "Next-generation open source Minecraft launcher";
33

4-
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
5-
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
6-
inputs.crane.url = "github:ipetkov/crane";
4+
inputs = {
5+
nixpkgs = {
6+
url = "github:nixos/nixpkgs/nixos-unstable";
7+
};
8+
9+
flake-parts = {
10+
url = "github:hercules-ci/flake-parts";
11+
};
12+
13+
crane = {
14+
url = "github:ipetkov/crane";
15+
};
16+
17+
rust-overlay = {
18+
url = "github:oxalica/rust-overlay";
19+
inputs = {
20+
nixpkgs = {
21+
follows = "nixpkgs";
22+
};
23+
};
24+
};
25+
};
726

8-
outputs = inputs@{ flake-parts, ... }:
27+
outputs =
28+
inputs@{ flake-parts, rust-overlay, ... }:
929
flake-parts.lib.mkFlake { inherit inputs; } {
10-
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
11-
perSystem = { config, pkgs, ... }: {};
30+
systems = [
31+
"x86_64-linux"
32+
"aarch64-linux"
33+
"x86_64-darwin"
34+
"aarch64-darwin"
35+
];
36+
37+
perSystem =
38+
{ pkgs, system, ... }:
39+
let
40+
pkgs' = import inputs.nixpkgs {
41+
inherit system;
42+
overlays = [ rust-overlay.overlays.default ];
43+
};
44+
in
45+
{
46+
devShells.default = pkgs'.mkShell {
47+
packages = with pkgs'; [
48+
(rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
49+
50+
cargo-tauri
51+
nodejs_24
52+
pnpm
53+
eslint
54+
typescript
55+
56+
pkg-config
57+
openssl
58+
59+
gobject-introspection
60+
at-spi2-atk
61+
atkmm
62+
cairo
63+
gdk-pixbuf
64+
glib
65+
gtk3
66+
harfbuzz
67+
librsvg
68+
libsoup_3
69+
pango
70+
webkitgtk_4_1
71+
];
72+
73+
shellHook = ''
74+
export GIO_MODULE_DIR="${pkgs.glib-networking}/lib/gio/modules/"
75+
pnpm i
76+
pnpm prep
77+
'';
78+
};
79+
};
1280
};
1381
}

0 commit comments

Comments
 (0)