jasongrossman has quit [Ping timeout: 245 seconds]
jasongrossman has joined #nixos-chat
<elvishjerricco>
So why doesn't NixOS use systemd for stage 1?
<samueldr>
not an official answer, but I have seen theorized that the closure size may be an issue
<elvishjerricco>
samueldr: There's a high chance I would not care about that :P I might actually play around with this a bit. How would I go about making my own init system?
<samueldr>
no idea, but please make notes :)
<joepie91>
well, you start by praying to the poettering altar...
<joepie91>
:P
<samueldr>
take notes*
<gchristensen>
your own init system, or make nixos use systemd?
<samueldr>
though you may not care, as far as nixos is concerned, the closure size for the initrd is important as it is often expected to have a smaller /boot partition
<elvishjerricco>
gchristensen: I suppose either.
<elvishjerricco>
samueldr: Yea, I'm not suggesting this would become upstreamed :P
<gchristensen>
for your own init, spawn some stuff and implement waitpid() on SIGCHLD... that is basically it :)
<samueldr>
sure, but I'm actually not sure there is anything *against* it
<elvishjerricco>
samueldr: But for what it's worth, I've recently learned how to avoid having /boot on a different partition, and now I see no actual reason to ever have it on one.
<elvishjerricco>
Unless grub isn't an option, which I guess it often isn't.
<samueldr>
there are users avoiding grub, let's not paint them as being wrong :)
<gchristensen>
for one, efi requires it
<samueldr>
gchristensen: it does not require the ESP to be used for /boot
<elvishjerricco>
gchristensen: But how would I actually make NixOS use my custom init?
<samueldr>
afaiui, systemd-boot does require the kernels and initrd to be in the ESP
<gchristensen>
samueldr: :o
<elvishjerricco>
And yea, you still need a separate partition for the ESP. But /boot should be on the root drive
<samueldr>
but /boot can be on the root drive* :)
<elvishjerricco>
someone should teach systemd-boot to decrypt LUKS :)
<joepie91>
elvishjerricco: iirc having /boot on your main FS is a problem when doing RAID >1
<elvishjerricco>
joepie91: Ah, that would make sense
<joepie91>
(specifically, striping)
<elvishjerricco>
I was able to do ZFS striped over two LUKS drives and Grub booted it no problem
<elvishjerricco>
But that's ZFS doing the raid stuff
<samueldr>
though I don't pretend /boot on a separate partition is the only way, I do say that /boot as its own partition *has* uses
<samueldr>
elvishjerricco: if we simplify, android's bootloader will start a kernel and initrd, the kernel will start the executable /init as the first process it starts
<samueldr>
so my own modules system creates a script
<samueldr>
a bit like how clever's and nixos' does
<samueldr>
but the goals is to start systemd at stage-2
<samueldr>
(for me)
<samueldr>
hmmm, can't figure out a good entry point in mobile-nixos
<samueldr>
but DON'T take this to face value, this was my first initrd
<samueldr>
it is HIGHLY inspired from not-os and nixos' own init script
<samueldr>
(sorry, I'm a bit distracted by the elections night stream)
<elvishjerricco>
samueldr, gchristensen: Does NixOS already have options for supplying a custom init system, or do I have to dive into nixpkgs code to change it?
<gchristensen>
NixOS is not much more than its choice of init system
<gchristensen>
so, in other words, you can't just swap it out, for the large part you're on your own
<elvishjerricco>
gchristensen: Well I'd like to pretty much leave stage 2 untouched. Only looking to mess with stage 1's init script.
<gchristensen>
oh just stage1
<elvishjerricco>
gchristensen: Yea, I figure that comes down to simply supplying a custom initrd, but I dunno if NixOS has existing options for doing that
<samueldr>
elvishjerricco: pretty sure you could dp some funny shenanigans by disabling nixos/modules/system/boot/stage-1.nix
<samueldr>
do some*
<samueldr>
and then putting what's required in system.build
<elvishjerricco>
samueldr: Heh, that could work
<samueldr>
I *may* do this in the future
<samueldr>
but it's FAR away :)
<elvishjerricco>
gchristensen: Thanks, that link is perfect. Didn't realize it was all neatly wrapped up in one file :)
sir_guy_carleton has joined #nixos-chat
lassulus_ has joined #nixos-chat
lassulus has quit [Ping timeout: 252 seconds]
lassulus_ is now known as lassulus
<jackdk>
elvishjerricco if you're interested in the guts of how pid1 does its stuff, I remember poking around the initng sources and thinking it didn't look too bad
<elvishjerricco>
jackdk: Yea it actually looks pretty easy.
<samueldr>
it all depends on what you intend to do :)
<samueldr>
for an initrd, it's really simple; when you want to give PID1 to another init system at stage-2
<elvishjerricco>
jackdk: I'm kinda interested in producing initrd with dracut, and I think just a little lib.mkForce will let me do so without even touching nixpkgs
<samueldr>
IIRC, things under `system.*` isn'T part of the module system, so it may not work, or depend on ordering
<jackdk>
what is mkForce? (and the meta question: is there a good function reference anywhere?)
<samueldr>
or uh, system.build I mean I think
<samueldr>
lib/modules.nix has good comments
<samueldr>
and the nixos manual has the other bits needed to understand at a higher level how the module system works
<elvishjerricco>
samueldr: I would've figured system.build is a `attrsOf unspecified` which I think would still work with mkForce
<samueldr>
elvishjerricco: maybe the issue I had was more specific to bootloaders
<samueldr>
I had both extlinux and grub2 enabled, and it failed to do grub until I disabled extlinux
sevanspowell has joined #nixos-chat
<sevanspowell>
Heya, Nix question. I want to build my project with a specific version of amazonka. Usually I'd do something like this: ``` amazonka = nixpkgs.fetchFromGitHub { owner = "brendanhay"; repo = "amazonka"; rev = "c9d8a62118b2269fb54b1e89c4e92106e8243050"; sha256 = "1nxdgg69fjn6b4nik99mmsa6hrv9737kwls00jyfnwwavqxik49q"; }; ``` But amazonka is a stack project and so doesn't have a nix file. What would be the w
<samueldr>
sevanspowell: you will need to split your messages into lines, and please link the code to a pastebin or a gist
<samueldr>
(and ask in #nixos as this is more off-topic here)
<sevanspowell>
Sure thing, sorry about that.
<samueldr>
your message was also cut off at the end
<ekleog>
,locate intellij
<{^_^}>
Found in packages: kodestudio
<ekleog>
hmm… anyone knows where to find intellij? I can't find the package, though people on the web say they do have it installed :/
<samueldr>
ekleog: unfree I think
<ekleog>
oh
* ekleog
thought intellij was free
<samueldr>
there's the community edition
* samueldr
checks
* ekleog
never actually used that, just ragequit eclipse… why can't java be sane to use with simple text editors like vim? :'(
<samueldr>
license = stdenv.lib.licenses.asl20; <- wondering why it doesn't show in locate
<ekleog>
maybe something due to recurseIntoAttrs?
* ekleog
doesn't have a local nix-locate db, though, so can't really check it's not just a bug of {^_^}
jtojnar has quit [Remote host closed the connection]
jtojnar has joined #nixos-chat
jasongrossman has quit [Ping timeout: 252 seconds]
jasongrossman has joined #nixos-chat
dmc has quit [Quit: WeeChat 2.2]
dmc has joined #nixos-chat
<infinisil>
Hmm I'll check later
<sphalerite>
,locate bin idea
<{^_^}>
Found in packages: jetbrains.idea-community
<sphalerite>
ekleog: it's just that the executable is called idea, not intellij
<sphalerite>
infinisil: samueldr: ^
<ekleog>
oh. stupid me indeed
* ekleog
didn't know what intellij actually was apart from hear-say until a few hours ago, for my defense :°
<sphalerite>
yeah it's annoying that people call it intellij — usually it's IDEA they're talking about, intellij is the branding for the whole suite of IDEs made by jetbrains AFAIUI
<sphalerite>
right, jetbrains used to be called intellij itself
<{^_^}>
#47650 (by Ekleog, 43 seconds ago, open): jetbrains.idea-community: add IntelliJ keyword to the longDescription
<sphalerite>
is the longDescription searched?
<ekleog>
I think so: if I currently search for testng, then idea-community gets out :)
<sphalerite>
perfect
<infinisil>
Ahh
jasongrossman has quit [Ping timeout: 268 seconds]
sir_guy_carleton has quit [Ping timeout: 244 seconds]
jasongrossman has joined #nixos-chat
pie__ has joined #nixos-chat
__monty__ has joined #nixos-chat
pie_ has quit [Ping timeout: 260 seconds]
jackdk has quit [Ping timeout: 252 seconds]
tertl3 has quit [Quit: Connection closed for inactivity]
sevanspowell has quit [Ping timeout: 256 seconds]
jD91mZM2 has joined #nixos-chat
nckx has joined #nixos-chat
lassulus has quit [Ping timeout: 252 seconds]
lassulus_ has joined #nixos-chat
lassulus_ is now known as lassulus
lassulus_ has joined #nixos-chat
lassulus has quit [Ping timeout: 252 seconds]
lassulus_ is now known as lassulus
lassulus has quit [Ping timeout: 252 seconds]
lassulus_ has joined #nixos-chat
lassulus_ is now known as lassulus
pie__ has quit [Ping timeout: 252 seconds]
pie__ has joined #nixos-chat
jD91mZM2 has quit [Quit: WeeChat 2.0]
ericnoan has joined #nixos-chat
Synthetica has joined #nixos-chat
lassulus has quit [Ping timeout: 252 seconds]
<elvishjerricco>
I wonder if Nix should have a `copy` builtin, which would take a store path and return a new store path with that path's entire runtime closure copied in. You'd end up with nested `/nix/store`s, i.e. `/nix/store/...-copy/nix/store/...-foo`. But this would be useful for any tooling that needs to package up an entire Nix closure for some other tool, like Docker or initrd.
lassulus1 has joined #nixos-chat
lassulus1 is now known as lassulus
<elvishjerricco>
I guess symlinks would be better than copies. Or even just a text file containing the paths in the closure. It needs to be computed as a build-time thing though, not an eval time thing, to help maintain our illusion of pure eval.
<gchristensen>
nix can do that
<gchristensen>
look up exportReferencesGraph in the Nix manual
<elvishjerricco>
I thought the existing things used hacks like invoking Nix within Nix to do stuff like that. Didn't realize we had a proper way
<gchristensen>
nope, the layered docker image one (nix2 only) even uses NIx2's structured attribute support to export the ref graph in json
<elvishjerricco>
gchristensen: How does that work?
<elvishjerricco>
Also, I can't find any docs on `--register-validity`, which is how `exportReferencesGraph` describes its format :/
<gchristensen>
sorry, bad internet, you'll have to go look yoursel :) or wait for me to have better internet itomorrow
<elvishjerricco>
gchristensen: No worries. Thanks :)
__monty__ has quit [Quit: leaving]
pie__ has quit [Ping timeout: 246 seconds]
tertl3 has joined #nixos-chat
<Synthetica>
Gotta love maintaining obscure packages, just had to email a FreePorts maintainer on what they were doing with a certain package, because they were the only ones that had it up to date