Changes
5 changed files (+195/-58)
-
core/nix/deps.nix (new)
-
@@ -0,0 +1,34 @@# generated by zon2nix (https://github.com/nix-community/zon2nix) { linkFarm, fetchzip, fetchgit }: linkFarm "zig-packages" [ { name = "clap-0.10.0-oBajB434AQBDh-Ei3YtoKIRxZacVPF1iSwp3IX_ZB8f0"; path = fetchzip { url = "https://github.com/Hejsil/zig-clap/archive/refs/tags/0.10.0.tar.gz"; hash = "sha256-leXnA97ITdvmBhD2YESLBZAKjBg+G4R/+PPPRslz/ec="; }; } { name = "libmoo-0.0.0-HVqw0kUaAQBEDpkiC5_DX2Hh1ZTZvQ62nFL9IfuVxqdS"; path = fetchzip { url = "https://git.pocka.jp/libmoo.git/archive/2f073dbe0e73f46e0832e1a2f0501969a929c1f3.tar.gz"; hash = "sha256-kdbdC99TgSFDJcOePplpby0X0q2/Wm9wgHWSVDbpBNI="; }; } { name = "sood-0.0.0-A_jj-7ITAQAPlaaR2AHFXwPvBWzNBCCPTT--OCHnRQ_i"; path = fetchzip { url = "https://git.pocka.jp/libsood.git/archive/8080245c2696cc6404b0628e5c3eb363cb80014f.tar.gz"; hash = "sha256-ikHN1tvw/zNsSYgSNWVembjJogK1aSjmeCnN8tRh/dc="; }; } { name = "websocket-0.1.0-ZPISdYBIAwB1yO6AFDHRHLaZSmpdh4Bz4dCmaQUqNNWh"; path = fetchzip { url = "https://github.com/karlseguin/websocket.zig/archive/c1c53b062eab871b95b70409daadfd6ac3d6df61.tar.gz"; hash = "sha256-/2RBC2/LxDMzrM+57WU8Oshf7P15qI8ykT7MFmT3O4M="; }; } ]
-
-
-
@@ -0,0 +1,20 @@Copyright 2025 Shota FUJI Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache-2.0 --- "deps.nix" is autogenerated file. Applying same copyright and license for simplicity and consistency.
-
-
core/nix/package.nix (new)
-
@@ -0,0 +1,30 @@# Copyright 2025 Shota FUJI # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # SPDX-License-Identifier: Apache-2.0 { stdenvNoCC }: stdenvNoCC.mkDerivation { pname = "plac"; version = "0.0.0"; src = ../.; phases = [ "unpackPhase" "installPhase" ]; installPhase = '' mkdir -p $out cp $src/build.zig $out cp $src/build.zig.zon $out cp -r $src/src $out ''; }
-
-
-
@@ -14,9 +14,6 @@ # limitations under the License.# # SPDX-License-Identifier: Apache-2.0 # This file is sorely for development environment setup purpose. # No packaging code should be included, Nix is optional (good to have). { description = "Plac monorepo";
-
@@ -38,75 +35,41 @@ }:flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; lib = pkgs.lib; in { in rec { packages = { gtk-adwaita = pkgs.callPackage ./gtk-adwaita/nix/package.nix {}; update-deps = pkgs.writeShellApplication { name = "update-deps"; text = '' cd core ${pkgs.zon2nix}/bin/zon2nix > nix/deps.nix ''; }; }; devShell = pkgs.mkShell { buildInputs = [ (lib.lists.remove pkgs.zig.hook packages.gtk-adwaita.nativeBuildInputs) packages.gtk-adwaita.buildInputs ]; packages = with pkgs; [ # --- Common # > Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA # https://uncrustify.sourceforge.net/ uncrustify # > Zig is a general-purpose programming language and toolchain for maintaining # > robust, optimal and reusable software. # https://ziglang.org/ zig # For text editors, optional. # > ZLS is a non-official implementation of the Language Server Protocol for Zig # https://github.com/zigtools/zls zls # --- GTK-Adwaita # Runtime dependency. # > The GTK toolkit # https://docs.gtk.org/gtk4/ gtk4 # Runtime dependency. # Faster (using SIMD) libjpeg implementation # https://libjpeg-turbo.org/ libjpeg # Provides styles and widgets following GNOME Human Interface Guideline. # Runtime dependency. # (https://developer.gnome.org/hig/index.html) # > Building blocks for modern GNOME applications # https://gnome.pages.gitlab.gnome.org/libadwaita/ # https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/ # https://valadoc.org/libadwaita-1/index.htm libadwaita # Required library for GTK4/Adwaita, albeit undocumented. # Runtime dependency. # > A library to render SVG images to Cairo surfaces. # https://gitlab.gnome.org/GNOME/librsvg librsvg # Necessary library to use collection types such as HashMap and ArrayList in Vala. # Runtime dependency. # https://wiki.gnome.org/Projects/Libgee # https://valadoc.org/gee-0.8/index.htm libgee # > pkg-config is a helper tool used when compiling applications and libraries. # https://www.freedesktop.org/wiki/Software/pkg-config/ pkg-config # > Vala is a programming language using modern high level abstractions without # > imposing additional runtime requirements and without using a different ABI # > compared to applications and libraries written in C. # https://vala.dev/ vala # For text editors, optional. # > Code Intelligence for Vala & Genie # https://github.com/vala-lang/vala-language-server vala-language-server # --- Misc # Code formatter # https://dprint.dev/ dprint
-
@@ -117,8 +80,6 @@ reuse] # Non macOS packages (not supported, broken, etc.) ++ (lib.optionals (!stdenv.isDarwin) [ # --- CLI # For debugging, optional. # > Valgrind is an instrumentation framework for building dynamic analysis tools # https://valgrind.org/
-
-
-
@@ -0,0 +1,92 @@# Copyright 2025 Shota FUJI # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # SPDX-License-Identifier: Apache-2.0 { stdenvNoCC, callPackage, zig, gtk4, pkg-config, libjpeg, libadwaita, librsvg, libgee, vala, coreutils, wrapGAppsHook4 }: stdenvNoCC.mkDerivation { pname = "plac-gtk-adwaita"; version = "0.0.0"; src = ../.; meta = { mainProgram = "jp.pocka.plac.gtk-adwaita"; }; nativeBuildInputs = [ zig.hook # > Zig is a general-purpose programming language and toolchain for maintaining # > robust, optimal and reusable software. # https://ziglang.org/ zig # > pkg-config is a helper tool used when compiling applications and libraries. # https://www.freedesktop.org/wiki/Software/pkg-config/ pkg-config # > Vala is a programming language using modern high level abstractions without # > imposing additional runtime requirements and without using a different ABI # > compared to applications and libraries written in C. # https://vala.dev/ vala # Installed for "realpath" command. coreutils ]; buildInputs = [ # > The GTK toolkit # https://docs.gtk.org/gtk4/ gtk4 # > Faster (using SIMD) libjpeg implementation # https://libjpeg-turbo.org/ libjpeg # Provides styles and widgets following GNOME Human Interface Guideline. # (https://developer.gnome.org/hig/index.html) # > Building blocks for modern GNOME applications # https://gnome.pages.gitlab.gnome.org/libadwaita/ # https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/ # https://valadoc.org/libadwaita-1/index.htm libadwaita # Required library for GTK4/Adwaita, albeit undocumented. # > A library to render SVG images to Cairo surfaces. # https://gitlab.gnome.org/GNOME/librsvg librsvg # Necessary library to use collection types such as HashMap and ArrayList in Vala. # https://wiki.gnome.org/Projects/Libgee # https://valadoc.org/gee-0.8/index.htm libgee # This helper takes care of GLib/GTK's messy runtime things. # https://nixos.org/manual/nixpkgs/stable/#sec-language-gnome wrapGAppsHook4 ]; zigBuildFlags = [ "--system" (callPackage ../../core/nix/deps.nix {}) "-Dcompile-gschema" ]; # zon2nix does not support path dependency, and Zig seems not to have a way to set multiple # dependencies directory nor specify directory name via flags. postPatch = '' substituteInPlace build.zig.zon \ --replace "../core" $(realpath --relative-to=. ${callPackage ../../core/nix/package.nix {}}) ''; }
-