From 62e78dd44e17d26b7b93c6d13ec2894aa507d14a Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Mon, 14 Oct 2024 10:06:54 +1100 Subject: add nix expressions --- default.nix | 20 ++++++++++++++++++++ flake.lock | 26 ++++++++++++++++++++++++++ flake.nix | 10 ++++++++++ 3 files changed, 56 insertions(+) create mode 100644 default.nix create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..50934b6 --- /dev/null +++ b/default.nix @@ -0,0 +1,20 @@ +{stdenv, webkitgtk_4_1, gtk4, pkg-config, wrapGAppsHook4, makeWrapper, glib-networking}: +stdenv.mkDerivation { + name = "rose"; + src = ./.; + nativeBuildInputs = [wrapGAppsHook4 pkg-config makeWrapper]; + buildInputs = [webkitgtk_4_1.dev gtk4.dev]; + buildPhase = '' + $CC -O2 -o rose rosenrot.c \ + `pkg-config --cflags webkit2gtk-4.1` \ + `pkg-config --libs webkit2gtk-4.1` + ''; + installPhase = '' + install -m755 -D ./rose $out/bin/rose + ''; + fixupPhase = '' + wrapProgram $out/bin/rose \ + --set "WEBKIT_DISABLE_DMABUF_RENDERER" "1" \ + --set "GIO_MODULE_DIR" "${glib-networking}/lib/gio/modules/" + ''; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..d094404 --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1728860496, + "narHash": "sha256-HVDtY+3DjEUQKzx+c3OvZAyw1ZlXGt4Ybh/8X2i4vUY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "62b5779a925d22372e0a70f87ba2e9e242954569", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7937fc0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,10 @@ +{ + inputs.nixpkgs.url = "github:nixos/nixpkgs"; + outputs = {self, nixpkgs}: + let + system = "x86_64-linux"; + pkgs = import nixpkgs {inherit system;}; + in { + packages.${system}.default = pkgs.callPackage ./. {}; + }; +} -- cgit v1.2.3