ruby.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
If you are interested in the Ruby programming language, come join us! Tell us about yourself when signing up. If you just want to join Mastodon, another server will be a better place for you.

Administered by:

Server stats:

1.1K
active users

#nix

14 posts14 participants3 posts today
vae :neocat_flag_nb:<p><span>I've been staring at this for too long and can't understand what I'm doing wrong.. Can someone with more brain halp plz? :3<br></span></p><pre><code> environment.systemPackages = with pkgs; [ ... ] ++ lib.mkIf config.someoption.enable [ ... ];</code></pre><span><br>Gives me this:<br></span><pre><code>error: expected a list but found a set: { _type = "if"; condition = «thunk»; content = «thunk»; }</code></pre><span><br>I basically copied this from my old config that I </span><i>know</i><span> used to work (though it had been commented out for a few months, so maybe something's changed?)<br><br>Using latest lix, if that matters.<br><br>(bbl, sleep </span>​:neocat_flop_sleep:​<span>)<br><br></span><a href="https://theshark-smellslike.sparklef.art/tags/nix" rel="nofollow noopener noreferrer" target="_blank">#nix</a> <a href="https://theshark-smellslike.sparklef.art/tags/NixOS" rel="nofollow noopener noreferrer" target="_blank">#NixOS</a><p></p>

🚨WARNING🚨

Apparently some #Nix / #NixOS matrix room(s) have gotten csam spam. I have not verified this claim myself, but honestly, we can all probably just not check matrix for a few days until hopefully things are back to normal.

I do *not* know what utilities #Matrix provides to prevent the proliferation of this information. If you joined the room from a different home server then your server may have synchronized the material to your infrastructure.

I think the safest course of action is not opening a matrix client for a few days...

> Fedora change aims for 99% package reproducibility

Nice, cool. Let's check 🟧.

> I often see initiatives and articles like this but no mention of #Nix. [...] Should it [Fedora] adopt an alternate package manager to achieve this with less headache?

Ah, yes.

Fixing your existing package manager is *clearly* more of a headache than changing the entire package manager.

How does using the #Jolla #JollaC2 (@jolla) with #SailfishOS for about a week as a daily driver now (with my old #iPhone at home as a backup)?

In general, it works much better than I had hoped after my experiences with other alternative #smartphone systems and it indeed is the first (and so far only) system that indeed works quite well. Also at around 285€ (commerce.jolla.com/products/jo) it isn't too expensive, so one can simply try it out.

There are a few limitations though:

* I am really missing biometric unlocking
* There is no predictive text input, so typing could be more comfy
* The UX experience sometimes feels strange (but no no-gos for me)
* It is not a snappy and fast device
* Audio quality is so-so
* GPS really needs a GPS signal, so no WIFI-based location

What is great:

* It is a real #Linux, so it has a #terminal, #sshd, you can e.g. use the #Nix package manager etc.
* Android apps are running in a container
* You can have different users to limit data access

Unfortunately there are nearly no high-quality native apps so far and the built-in ones are very basic (e.g. email).

But: The #Android compatibility layer is very good, the system comes with #Fdroid and #AuroraStore (#Google store front-end) pre-installed, so you can easily install practically all official Android apps.

Most apps work very well, some (especially banking) apps do not though as they complain that the system is rooted, so YMMV regarding the apps you need.

In general I am really happy with this system.

And: All the de-ggoglefied Android phones like the #Volla will always still remain just that: A more limited Android. SailfishOS offers a path towards powerful native (#Qt/#QML/#Cplusplus/#Python/you name it) based apps.

I am hoping that Jolla will provide a significantly more powerful device option and that some of the problems above will be solved.

But already now, even with the limitations above, if you are somewhat technically inclined (but without the need to fiddle with a command line unlike with the open mobile Linux distributions), want to get rid of #Google or #Apple for whatever reason, want a #Linux #smartphone, support a #European company from #Finland, this phone is really usable.

commerce.jolla.comJolla C2 Community Phone

🌗 手動建立 Nix 派生項,無需猜測
➤ 探索 Nix 派生項的底層機制與雜湊生成原理
bernsteinbear.com/blog/nix-by-
本文深入探討了 Nix 派生項的建立過程,作者為了理解如何手動生成用於 Nix 派生項的雜湊值,進行了一系列實驗和研究。文章詳細解釋了 Nix 的運作原理,包括派生項的概念、ATerm 格式、雜湊演算法以及 Nix 特有的 base32 編碼方式。作者在使用 Docker 環境中逐步拆解了 Nix 派生項的建構步驟,並透過 Python 腳本實現了雜湊值的生成,最終揭示了 Nix 如何確保其可重現性和依賴管理。
+ 這篇文章非常詳細地解釋了 Nix 派生項的建立過程,對於想深入瞭解 Nix 的人來說是個很好的學習資源。
+ 雖然文章內容有點技術性,但作者的講解非常清晰易懂,讓我對 Nix 的運作原理有了更深入的理解。
#Nix #軟體建構 #開發工具

Max Bernstein · Nix derivations by hand, without guessing
More from Max B

Hey everyone!
#Nix and #NixOS enable declarative systems and reproducible builds — topics that are especially interesting to the systems community.

Next Tuesday (2025-04-15), Cyberus Technology is hosting a Nix #Meetup, and it's open to everyone!
If you're interested in joining, just react to this message with an emoji. 👋

📍 Cyberus Technology Office, Zwickauer Straße 46
⏰ Tue., April 15, 18-22 o'clock
🍕 Pizza and drinks included

PlanetNix 2025 talks are now live 🎉

Missed the event? You can now watch the sessions here 👉

buff.ly/dLIuYxM

Some highlights:

- Kelsey Hightower and Ron Efroni chat about Nix in a raw, honest fireside chat.
- Aneesh Agrawal shows how Anthropic boosted deploys with nix-sidecar.
- Yannik Sander dives into evaluation performance

And more plus a series of lightning talks!

Big thanks to the Nix community, organizers & volunteers 💜

Hackers' Pub · mkDerivation 인자로 함수를 넘기는 이유NixOS.kr 디스코드에 올렸는데, 다른 분들의 의견을 들어보려고 해커스펍에도 올립니다. 닉스 경험이 많지 않은 사람의 글이니, 정확하지 않을 수 있습니다. 틀린 곳이 있으면 바로 알려주세요. ※ 닉스를 처음 접하는 분들이나, 닉스로 실용적인 업무를 하시는데 문제가 없는 분들한테는 적당한 글은 아닙니다. 서두에 읽으면 도움이 될만한 분들을 추려서 알려 드리려고 하니, 의외로 필요한 분들이 없겠습니다. 실무자들은 이렇게까지 파고들며 알 필요 없고, 닉스 개발자들이야 당연히 아는 내용일테고, 입문자 분들도 역시 이런 내용으로 어렵다는 인식을 갖고 시작할 필요는 없으니까요. 그럼 남은 건 하나네요. mkDerivation 동작을 이미 아는 분들의 킬링 타임용이 되겠습니다.<외국어를 익힐 때, 문법없이 실전과 부딪히며 배우는 방법이 더 좋기는 한데, 가끔은 문법을 따로 보기 전엔 넘기 힘든 것들이 있습니다. 닉스란 외국어를 익히는데도 실제 설정 파일을 많이 보는 것이 우선이지만, 가끔 "문법"을 짚고 넘어가면 도움이 되는 것들이 있습니다. 닉스 알약 (제목이 재밌네요. 알약) 글을 보면 mkDerivation이 속성 집합을 받아, 거기에 stdenv 등 기본적인 것을 추가한 속성 집합을 만들어 derivaition 함수에 넘기는 간단한 래핑 함수임을 직관적으로 잘 설명하고 있습니다. 그런데, 실제 사용 예시들을 만나면, mkDerivation에 속성 집합을 넘기지 않고, attr: {...} 형태의 함수를 넘기는 경우를 더 자주 만납니다. 그래서, 왜 그러는지 실제 구현 코드를 보고 이유를 찾아 봤습니다. mkDerivation = fnOrAttrs: if builtins.isFunction fnOrAttrs then makeDerivationExtensible fnOrAttrs else makeDerivationExtensibleConst fnOrAttrs;<mkDerivation의 정의를 보면 인자로 함수를 받았느냐 아니냐에 따른 동작을 분기합니다. 단순히, stdenv에서 가져온 속성들을 추가한다면, 함수를 인자로 받지 않아도 속성 집합을 병합해주는 //의 동작만 있어도 충분합니다.{ a = 1; } // { b = stdenv.XXX; }<하지만, 함수로 받는 이유를 찾으면, 코드가 단순하지 않습니다. 아래는 함수를 받을 때 동작하는 실제 구현 일부를 가져 왔습니다.makeDerivationExtensible = rattrs: let args = rattrs (args // { inherit finalPackage overrideAttrs; }); ...<전체를 보기 전에 일단 args에서부터 머리가 좀 복잡해집니다. args가 args를 재귀 참조하고 있습니다. 보통 rattrs 매개 변수로는 아래와 같은 함수들이 들어 옵니다.stdenv.mkDerivation (finalAttrs: { pname = "timed"; version = "3.6.23"; ... tag = finalAttrs.version;}<(와, 해커스펍은 코드 블록에 ANSI가 먹습니다! 지원하는 곳들이 드문데요.)코드를 바로 분석하기 전에, 닉스의 재귀 동작을 먼저 보면 좋습니다.<재귀 생각 스트레칭nix-repl> let r = {a = 1; b = a;}; in rerror: undefined variable 'a'<위 동작은 오류지만, 아래처럼 rec를 넣어주면 가능합니다.nix-repl> let r = rec {a = 1; b = a;}; in r { a = 1; b = 1; }<※ rec동작은 Lazy 언어의 fix로 재귀를 구현하는 동작입니다. ※ 참고 Fix 함수 rec를 써서 속성 안에 정의 중인 속성에 접근할 수 있습니다. 그런데, 아래 같이 속성을 r.a 로 접근하면, rec 없이도 가능해집니다.nix-repl> let r = {a = 1; b = r.a;}; in r{ a = 1; b = 1; }<닉스 언어의 Lazy한 특성 때문에 가능합니다.<이제, 원래 문제와 비슷한 모양으로 넘어가 보겠습니다. 아래같은 형태로 바로 자기 자신에 재귀적으로 접근하면 무한 재귀 에러가 나지만,nix-repl> let x = x + 1; in x error: infinite recursion encountered<아래처럼 람다 함수에 인자로 넘기면 얘기가 달라집니다.nix-repl> let args = (attr: {c = 1; b = attr.a + attr.c + 1;}) (args // { a = 1; }); in args{ b = 3; c = 1; }<여기서 속성b의 정의 동작이 중요합니다.attr: { c = 1; b = attr.a + attr.c + 1; }<속성 b는 아직 알 수 없는, 미래의 attr에 있는 a를 받아 써먹고,원래는 rec없이 접근하지 못했던, c에도 attr.c로 접근이 가능합니다. 원래 문제로 다시 설명하면, mkDerivation에 넘기고 있는, 사용자 함수 finalAttrs: { ... }에서,닉스 시스템이 넣어주는 stdenv 값 같은 것들과 사용자 함수내의 속성들을 섞어서 속성 정의를 할 수 있다는 얘기입니다. 아래처럼 말입니다. tag = finalAttrs.version;<뭐하러, 이런 복잡한 개념을 쓰는가 하면, 단순히 속성 추가가 아니라, 기존 속성이 앞으로 추가 될 속성을 기반으로 정의되어야 할 때는 이렇게 해야만 합니다. 함수형 언어에선 자주 보이는, 미래값을 가져다 쓰는 재귀 패턴인데, 저는 아직 그리 익숙하진 않습니다.
Replied in thread

@janl The purpose is to warn bystanders to invest in technological #complexity that seems to be very attractive for its advanced features without acknowledging the risks or efforts associated.

Its learning curve doesn't even allow for an easy start.

As with so many awesome tools, this is something for specific experts and not for new/occasional/advanced users.

BTDT and I've had my fair share of bad experiences.

Current pain in my setup: #NixOS. Instead of providing an abstraction layer to keep away certain OS setup & maintenance problems for good, I got into so many little & bigger troubles that I try to tell people only to use it when they are ready to invest its required learning effort all the way.

From my point of view, this also holds true for "advanced" file systems like #ZFS, #XFS, ... YMMV.

I have to say, my automatic dependency scanner [1] for #nix packages is already working better than expected!

So far i found unused dependencies in git [2], gst-plugins-bad [3], [4], linux-pam [5], networkmanager [6] and vlc [7]. And i don't plan on stopping! All these unused dependencies cause unnecessary strain on our CI and are trivial to clean up. Some of these dependencies are even old enough to drink!

I will give a talk about the tool at @cccda this Monday in the hopes of getting more people excited for this cleanup work, and to get ideas about improving the tool.

[1] github.com/LordGrimmauld/nix-c

[2] github.com/NixOS/nixpkgs/pull/
[3] github.com/NixOS/nixpkgs/pull/
[4] github.com/NixOS/nixpkgs/pull/
[5] github.com/NixOS/nixpkgs/pull/
[6] github.com/NixOS/nixpkgs/pull/
[7] github.com/NixOS/nixpkgs/pull/