Skip to content

Instantly share code, notes, and snippets.

View haruki7049's full-sized avatar

haruki7049 haruki7049

View GitHub Profile
@haruki7049
haruki7049 / log
Created November 17, 2025 05:19
The kakei's log on macOS
haruki@enmac:~/program-dir/kakei/ > cargo test --workspace
Compiling kakei v0.1.0 (/Users/haruki/program-dir/kakei)
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.25s
Running unittests src/lib.rs (target/debug/deps/kakei-95be839b4ae9ae84)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests src/main.rs (target/debug/deps/kakei-2ee18922db26a0c1)
[haruki@tuf-chan:~/program-dir/kakei]$ nix-build
these 4 derivations will be built:
/nix/store/f8n4rxpvijl6xlcmkf2rfw4maz4v5347-vendor-registry.drv
/nix/store/p0kpa4g13vx1y2y3bhd6lfjp70n70ryq-vendor-cargo-deps.drv
/nix/store/v9nvmp8fgygrakm5jpcxvhfplfcyl1s7-kakei-deps-0.1.0.drv
/nix/store/w1jwsv6pc9m5p5gcklh8sklz3706yk52-kakei-0.1.0.drv
building '/nix/store/f8n4rxpvijl6xlcmkf2rfw4maz4v5347-vendor-registry.drv'...
building '/nix/store/p0kpa4g13vx1y2y3bhd6lfjp70n70ryq-vendor-cargo-deps.drv'...
building '/nix/store/v9nvmp8fgygrakm5jpcxvhfplfcyl1s7-kakei-deps-0.1.0.drv'...
cargoArtifacts not set, will not reuse any cargo artifacts
[haruki@tuf-chan:~]$ nix repl
Nix 2.31.2
Type :? for help.
nix-repl> pkgs = import (builtins.fetchTarball "https://github.com/nixos/nixpkgs/archive/c80356bb1b1e65675470364434e58fcea8566dd7.tar.gz") { }
nix-repl> pkgs.linuxPackages_latest
{
__unfix__ = «lambda @ /nix/store/fzp7zdnhp95wkj3khbx2lwjbdryzsl4l-source/lib/fixed-points.nix:447:7»;
acer-wmi-battery = «derivation /nix/store/9006154my7yn373i0m8l2254kpgxdcns-acer-wmi-battery-6.17.7-0.1.0-unstable-2025-04-24.drv»;
acpi_call = «derivation /nix/store/i1nb8gb543psql4izcyxgapd3yvqn1md-acpi-call-1.2.2-6.17.7.drv»;
@haruki7049
haruki7049 / default.nix
Created August 3, 2025 23:51
Beatoraja's Nix expression
{
stdenv,
fetchFromGitHub,
jdk,
jre,
ant,
makeWrapper,
}:
-- Original data
data = {2, 3, 55, 22, 1, 4, 5, 33, 44, 11}
-- Debugging function
function dump(o)
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
@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 <tontonkirikiri@gmail.com>
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)