Skip to content

Instantly share code, notes, and snippets.

@haruki7049
haruki7049 / flake.nix
Created May 13, 2025 02:17
Godot v3.x-simula with flake.nix on other repo
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/63dacb46bf939521bdc93981b4cbb7ecb58427a0";
systems.url = "github:nix-systems/x86_64-linux";
godot = {
url = "git+https://github.com/haruki7049/godot?rev=df193d656aad69c0efe33fa9278907c2341d7ce9&submodules=1";
flake = true;
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
[haruki@tuf-chan:~/program-dir/Simula]$ git log --max-count=1
commit b4d6995a48260cd623cb0257ec07f9349e71ff51 (HEAD -> init-flakes, origin/init-flakes)
Author: haruki7049 <[email protected]>
Date: Tue Apr 22 09:55:34 2025 +0900
doc(README): Update to suggest Nix flakes
[haruki@tuf-chan:~/program-dir/Simula]$ git diff --staged
diff --git a/flake.nix b/flake.nix
index 4ea1767..d3872d8 100644

Prerequire

  • There is useless ability for use Git submodules with Nix flakes
    • It let us built Simula with the query, .?submodules=1#simula, from the nix build command.

Choices we can

  • Then we can choose:
    1. Creates the Nix derivations from another repository. For now I chose this way.
    2. Creates the Nix derivations from local source code. The submodules will be replaced to normal source code, if we choose this way.
    3. Creates the Nix derivations from submodules' source code. This way has an problem which will let us built Simula with .?submodules=1#simula.
@haruki7049
haruki7049 / simula_log.txt
Created March 26, 2025 02:31
Simula 2d2cc5af479bbcaf52326d5bb99ea55fb8d13637
$ WAYLAND_DISPLAY=simula-0 SIMULA_DATA_DIR=./ ./result/bin/simula
Godot Engine v3.5.2.stable.custom_build - https://godotengine.org
Requested V-Sync mode: Disabled
Inconsistent value (1) for DRI_PRIME. Should be < 1 (GPU devices count). Using: 0
OpenGL ES 3.0 Renderer: AMD Radeon RX 6700 XT (radeonsi, navi22, LLVM 19.1.6, DRM 3.59, 6.12.12)
Async. shader compilation: OFF
WARNING: All audio drivers failed, falling back to the dummy driver.
at: initialize (servers/audio_server.cpp:222)
libudev.so.1: cannot open shared object file: No such file or directory
$ ldd -r /nix/store/0rnmmwnlrfssbz6s4f96jc9mi1w1ggj5-ghc-9.6.5/lib/ghc-9.6.5/lib/x86_64-linux-ghc-9.6.5/libHSghc-prim-0.10.0-ghc9.6.5.so | grep stg_gc_unpt_r1
undefined symbol: stg_gc_unpt_r1 (/nix/store/0rnmmwnlrfssbz6s4f96jc9mi1w1ggj5-ghc-9.6.5/lib/ghc-9.6.5/lib/x86_64-linux-ghc-9.6.5/libHSghc-prim-0.10.0-ghc9.6.5.so)
simula> Running phase: unpackPhase
simula> unpacking source archive /nix/store/gvnrf03zbwg841a5ii8aiqyp1mm6zjlg-n6nc4kv4n4aq6qrgjk4r0nlkf4sb5g03-source
simula> source root is n6nc4kv4n4aq6qrgjk4r0nlkf4sb5g03-source
simula> Running phase: patchPhase
simula> Running phase: updateAutotoolsGnuConfigScriptsPhase
simula> Running phase: configurePhase
simula> no configure script, doing nothing
simula> Running phase: buildPhase
simula> Godot Engine v3.5.2.stable.custom_build - https://godotengine.org
simula> Requested V-Sync mode: Disabled
# To use cica fonts, run `nix-build -E 'with import <nixpkgs> { }; callPackage ./. { }`
{
stdenvNoCC,
fetchzip,
}:
stdenvNoCC.mkDerivation {
pname = "cica";
version = "5.0.3";
@haruki7049
haruki7049 / perl-curl.pl
Created December 20, 2024 10:58
An hobby implementation of curl, for learning Perl.
#!/usr/bin/env perl
use strict;
use warnings;
use LWP;
use HTTP::Request;
my $url = <STDIN>;
my $user_agent = LWP::UserAgent->new;
--- a/pkgs/by-name/mi/mitra/package.nix
+++ b/pkgs/by-name/mi/mitra/package.nix
@@ -22,10 +22,12 @@ rustPlatform.buildRustPackage rec {
# MEMO: mitra v3.9.0 tests failed with cargo option, "--offline"
doCheck = false;
- RUSTFLAGS = [
- # MEMO: mitra use ammonia crate with unstable rustc flag
- "--cfg=ammonia_unstable"
- ];
@haruki7049
haruki7049 / command.txt
Last active December 1, 2024 10:27
SimulaVR
[haruki@tuf-chan:~/program-dir/Simula-haruki7049]$ nix run .?submodules=1#build-wlroots --show-trace > err.log