Merge pull request #173 from HassiyYT/feature/nix-support

Feature/nix support
This commit is contained in:
zhom
2026-01-11 21:41:19 +04:00
committed by GitHub
5 changed files with 171 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
use flake
+12
View File
@@ -31,6 +31,18 @@ When you submit your first pull request, you acknowledge that you agree to the t
## Development Setup
### Using Nix (Recommended for Linux)
If you have [Nix](https://nixos.org/) installed, you can skip the manual setup below and simply run:
```bash
nix develop
```
This will provide Node.js, Rust, and all necessary system libraries.
### Manual Setup
Ensure you have the following dependencies installed:
- Node.js (see `.node-version` for exact version)
+10
View File
@@ -59,6 +59,16 @@ The app can be downloaded from the [releases page](https://github.com/zhom/donut
See [CONTRIBUTING.md](CONTRIBUTING.md).
### Nix Support
For a reproducible development environment (especially on Linux), you can use [Nix](https://nixos.org/):
```bash
nix develop
# or if you use direnv
direnv allow
```
## Issues
If you face any problems while using the application, please [open an issue](https://github.com/zhom/donutbrowser/issues).
Generated
+82
View File
@@ -0,0 +1,82 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1767767207,
"narHash": "sha256-Mj3d3PfwltLmukFal5i3fFt27L6NiKXdBezC1EBuZs4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5912c1772a44e31bf1c63c0390b90501e5026886",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1767926800,
"narHash": "sha256-x0n73J6ufD/EhDlVdcoAmF0OQHZ+b0a2cKDc8RZyt+o=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "499e9eed88ff9494b6604205b42847e847dfeb91",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
+66
View File
@@ -0,0 +1,66 @@
{
description = "Donut Browser Development Environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
# Rust toolchain
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" "rust-analyzer" "clippy" "rustfmt" ];
};
# System dependencies for Tauri on Linux
libraries = with pkgs; [
webkitgtk_4_1
gtk3
cairo
gdk-pixbuf
glib
dbus
librsvg
libsoup_3
];
packages = with pkgs; [
rustToolchain
nodejs_22
pnpm
pkg-config
cargo-tauri
openssl
# App specific tools
biome
] ++ libraries;
in
{
devShells.default = pkgs.mkShell {
buildInputs = packages;
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath libraries}:$LD_LIBRARY_PATH
export XDG_DATA_DIRS=${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS
echo "🍩 Donut Browser Dev Environment Loaded!"
echo "Node: $(node --version)"
echo "Rust: $(rustc --version)"
echo "Tauri CLI: $(cargo-tauri --version)"
'';
};
}
);
}