build successfully in nix

This commit is contained in:
Bit Borealis 2023-08-16 12:43:10 +00:00
parent ef3164f1af
commit 0dd1df7e1d
Signed by: theotheroracle
GPG Key ID: 2D816A2DCA6E5649
7 changed files with 67 additions and 35 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/target
/result

18
Cargo.lock generated
View File

@ -829,15 +829,6 @@ dependencies = [
"autocfg",
]
[[package]]
name = "neon-gtk"
version = "0.1.0"
dependencies = [
"gtk4",
"libadwaita",
"webrender",
]
[[package]]
name = "num-traits"
version = "0.2.16"
@ -1406,6 +1397,15 @@ dependencies = [
"euclid",
]
[[package]]
name = "xenon-browser"
version = "0.1.0"
dependencies = [
"gtk4",
"libadwaita",
"webrender",
]
[[package]]
name = "xml-rs"
version = "0.8.16"

View File

@ -1,5 +1,5 @@
[package]
name = "neon-gtk"
name = "xenon-browser"
version = "0.1.0"
edition = "2021"

View File

@ -1,11 +1,26 @@
with import <nixpkgs> {};
{ lib, fetchFromGitHub, rustPlatform, cmake, pkg-config, gtk4, gdk-pixbuf, cairo, libadwaita, pango }:
let
rustChannel = rustChannelOf {
channel = "stable";
date = "2023-08-16";
};
in
rustChannel.workspaceMembers.libadwaita.build.override {
rustPlatform.buildRustPackage rec {
pname = "xenon-browser";
version = "0.1.0";
src = ./.;
buildInputs = [ gtk4 gdk-pixbuf cairo libadwaita pango ];
nativeBuildInputs = [cmake pkg-config];
cargoLock.lockFile = ./Cargo.lock;
# src = fetchFromGitHub {
# owner = "BurntSushi";
# repo = pname;
# rev = version;
# hash = "sha256-+s5RBC3XSgb8omTbUNLywZnP6jSxZBKSS1BmXOjRF8M=";
# };
meta = {
description = "an experimental browser written with servo and gtk, inspired by neon.";
# homepage = "https://github.com/BurntSushi/ripgrep";
# license = licenses.unlicense;
# maintainers = [ maintainers.tailhook ];
};
}

25
flake.lock Normal file
View File

@ -0,0 +1,25 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1692128808,
"narHash": "sha256-Di1Zm/P042NuwThMiZNrtmaAjd4Tm2qBOKHX7xUOfMk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4ed9856be002a730234a1a1ed9dcd9dd10cbdb40",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View File

@ -1,19 +1,9 @@
{
description = "A libadwaita application in Rust";
description = "xenon-browser";
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; };
appDerivation = import ./default.nix { inherit pkgs; };
in
{
defaultPackage = appDerivation;
}
);
}
outputs = { self, nixpkgs }:
let pkgs = nixpkgs.legacyPackages.x86_64-linux; in
{
packages.x86_64-linux.default = pkgs.callPackage ./default.nix {};
};
}

View File

@ -21,6 +21,7 @@ mkShell {
# editor deps
lapce
rust-analyzer
nil
];
}