gchristensen changed the topic of #nixos-chat to: NixOS but much less topical || https://logs.nix.samueldr.com/nixos-chat
lopsided98 has quit [Quit: Disconnected]
taktoa has quit [Remote host closed the connection]
jtojnar has quit [Quit: jtojnar]
jtojnar has joined #nixos-chat
lopsided98 has joined #nixos-chat
lopsided98_ has joined #nixos-chat
lopsided98 has quit [Ping timeout: 255 seconds]
jtojnar has quit [Read error: Connection reset by peer]
jtojnar has joined #nixos-chat
infinisil has quit [Quit: Configuring ZNC, sorry for the join/quits!]
infinisil has joined #nixos-chat
jtojnar has quit [Read error: Connection reset by peer]
jtojnar has joined #nixos-chat
jD91mZM2 has joined #nixos-chat
<jD91mZM2> sphalerite: Woah, scaleway is nice! Just bought a server to try it out :)
<sphalerite> jD91mZM2: :)
<jD91mZM2> What's the difference between bare metal and arm?
<sphalerite> I've got nixos running on the C1s in case you're interested
<sphalerite> they're orthogonal. Bare metal means you get exclusive access to physical hardware, rather than a virtual machine
<jD91mZM2> Ooooo! I just got ubuntu + nix on a startup plan for now, but I'm always interested in new things
<jD91mZM2> Wait, you get one physical machine for €3 a month ll
<sphalerite> the C1 (32-bit arm) machines are bare metal, they have various x86 options (both physical and virtualised) as well and I think they have bigger ARM64 servers which are virtualised
<sphalerite> yep
<jD91mZM2> By the way nix is so awesome! I've almost already compiled one of my things on the server thanks to shell.nix
<sphalerite> A physical machine that's a bit more powerful than an rpi, but on the same order of magnitude of performance AFAIK
<jD91mZM2> Nice! How'd you get NixOS working?
* jD91mZM2 notices theres a wiki page for it
<sphalerite> basically, boot debian, install nix, install nixos-generate-config and nixos-rebuild, touch /etc/NIXOS, and nixos-rebuild boot
<sphalerite> there's a couple of options like boot.initScript.enable = true; which are needed
<sphalerite> it doesn't run a nixos kernel, I was hoping to do that using kexec, but no luck so far
<jD91mZM2> Do you keep your server-side nix things in dotfiles somewhere? I'm kind of wondering how I'd cleanly structure that
<sphalerite> oh yeah, and the installing nix bit is a bit more of a fuss than on x86
<jD91mZM2> Maybe ~/.dotfiles/main and ~/.dotfiles/server would make sense?
<sphalerite> I have a git repo that I share between my chromebook and a server and some other machines, but I haven't published it
* tilpner doesn't feel like server config qualifies as dotfiles
<jD91mZM2> tilpner: I mean I get that, but it'd be useful to not have to re-install everything everytime you get a new server
<jD91mZM2> If you could just copy over your config and get automatic zsh and stuff
<tilpner> Sure, I put dotfiles in my server config, but not the server config into my dotfiles
<jD91mZM2> So you have separate repos?
<tilpner> No
<tilpner> Well, kinda
<jD91mZM2> sphalerite: How do you get nixos-rebuild btw? Using the kexec thing the wiki describes?
<tilpner> I have a zsh config repo that I can clone on non-NixOS servers
<tilpner> Which is a submodule for my NixOS config
<sphalerite> jD91mZM2: no, nix-env -f '<nixpkgs/nixos>' --arg configuration {} -iA config.system.build.nixos-rebuild config.system.build.nixos-generate-config
<jD91mZM2> So we're basically installing nixos rebuild stuff on a non-nixos system? :P
<sphalerite> not a non-nixos system for long ;)
<sphalerite> but yeah, that's the approach usually taken when not using some bootable installer
<sphalerite> although usually with nixos-install rather than nixos-rebuild
<sphalerite> there are some gotchas with installing in place over an existing debian installation
<sphalerite> oh yeah and there are some things you need to remember because the nixos system isn't integrated with scaleway — like adding your SSH keys yourself
<tilpner> Did you try the kexec way?
<jD91mZM2> I'm totally gonna lock myself out of the system, but I'll try it from a barely modified config without enabling initScript stuff
<sphalerite> tilpner: no, I see no reason to
<tilpner> My reason was that it's cleaner, you start from an empty disk and bring all kernel modules you need
<jD91mZM2> "the build users group nixbld has no members"
<jD91mZM2> Yeah I might either go Ubuntu+Nix or kexec NixOS, but I don't think I'll try Ubuntu+NixOS that sounds weird
MichaelRaskin has quit [Quit: MichaelRaskin]
<sphalerite> it's not ubuntu+nixos, you just remove the ubuntu stuff
<jD91mZM2> Still using the ubuntu kernels and things
<sphalerite> I did at one point during that process do `rm -r /bin /sbin /usr /etc` :p
<sphalerite> It doesn't use ubuntu kernels, it uses scaleway kernels for all the OS options AFAIK
<sphalerite> Anyway, if you hopelessly bork the system you can still just throw the server out and start a new one
<sphalerite> :D
<jD91mZM2> I just did :P
<jD91mZM2> I really easily feel uncomfortable with systems
<jD91mZM2> Which is why nixos is nice - you can be sure you have no leftover old configs
<sphalerite> yeah
<adisbladis[m]> jD91mZM2: My company still has one ansible deployment
<adisbladis[m]> Everyone is _super_ paranoid to touch that one
adisbladis has joined #nixos-chat
<jD91mZM2> Wait woah @clever did the kexec thing?
<jD91mZM2> That's really epic work
<sphalerite> yeah
<jD91mZM2> By the way, is there a reason the default channel is called nixos on nixos and nixpkgs on pure nix?
<adisbladis> jD91mZM2: Clever deserves his nickname :)
<adisbladis> jD91mZM2: Because they are two distinct things.
<adisbladis> jD91mZM2: https://howoldis.herokuapp.com/
<jD91mZM2> oh
<jD91mZM2> Is nixpkgs just nixos without the nixos modules?
<sphalerite> no, it has all the nixos stuff as well, it just isn't tested for the nixpkgs channels
<sphalerite> s/s$//
<adisbladis> We are testing different things
<jD91mZM2> Oh okay
<jD91mZM2> What's a nice and clean way to autostart programs on servers?
<jD91mZM2> Normal tmux startup scripts? systemd services?
<adisbladis> jD91mZM2: systemd services :)
<lassulus> systemd services
<lassulus> you can also start tmux scripts from systemd services
<lassulus> if you want to attach to them later
<jD91mZM2> To clarify: I want to host a discord bot (for example). If something goes wrong I want to access the logs easily and restart it without issues
<jD91mZM2> How do I access logs using systemd? journalctl?
<lassulus> yes
<lassulus> journalctl -u my-unit.service
<lassulus> or just journalctl, but then you also get all the other logs
<jD91mZM2> Nice, okay. And I can restart it by just normal --user systemd commands right?
<jD91mZM2> That's really nice! Thanks!
<adisbladis> jD91mZM2: It depends
<adisbladis> jD91mZM2: A user unit can be restarted with "systemd --user"
<jD91mZM2> systemctl*?
* jD91mZM2 has to go, sorry
<adisbladis> jD91mZM2: Yes.
<adisbladis> Sorry for the typo :)
<adisbladis> I blame a long workday
adisbladis has quit [Ping timeout: 260 seconds]
<jD91mZM2> adisbladis[m]: lassulus: Ah crap the server is on Ubuntu and can't use systemd
<lassulus> huh, I thought ubuntu is using systemd?
<jD91mZM2> I don't think so? At least `systemctl --user` complains about some dbus thing
<lassulus> maybe user sessions are not working
<jD91mZM2> Isn't Ubuntu using their `sudo service` thing?
<lassulus> but I thought you are on nixos, If you want to run something as your user on the server, just tmux could be enough
<jD91mZM2> Oh yeah I don't want to run my discord bot as root :thinking:
<adisbladis[m]> The Ubuntu systemd setup is strange
<lassulus> well systemd-units can be run as unprivileged user
<adisbladis[m]> Worst case if it's an ancient Ubuntu you can write an upstart thingie
<jD91mZM2> The process with PID 1 is /sbin/init
<jD91mZM2> Meanwhile on my NixOS setup this is systemd
<jD91mZM2> Oh except it's a symlink to systemd never mind
<jD91mZM2> Okay so I guess something is just wrong with my setup
<jD91mZM2> "You are using Ubuntu 16.04. It does not run per-user instances of systemd." according to stack overflow
<samueldr> jD91mZM2: looked into jpeg + grub yesterday, 2 issues: 1) nixos doesn't load the jpeg module for grub, 2) grub can't use progressive jpeg
<jD91mZM2> samueldr: Ah
<jD91mZM2> I wonder if Nix provides a way to convert a jpeg to png on the fly
<samueldr> for this reason, even when my PR that adds jpeg support in nixos+grub, I would recommend against using jpeg
<samueldr> jD91mZM2: almost!
<samueldr> all the tooling is there
<jD91mZM2> Could I like point the background to a mkDerivation that depends on ffmpeg and on buildPhase uses it to convert the image to a png?
<samueldr> you could use pkgs.runCommand, here I'm using imagemagick to roatate the picture https://gitlab.com/samueldr/nixos-configuration/blob/master/options/zr/boot.nix#L72-80
<jD91mZM2> That is some extreme dedication
<samueldr> I'm using my configuration on multiple machines, with one having an inverted panel
<jD91mZM2> Do you also happen to know if there's a way to avoid restarting each time I wanna try my grub config?
<samueldr> not yet :/
<samueldr> I mean, I don't know yet
<samueldr> nixos-rebuild build-vm-with-bootloader should work, but I can't confirm
<jD91mZM2> That keeps giving me weird errors sadly :(
<jD91mZM2> Welp I might just have murdered my server by trying to upgrade to Ubuntu 17.10
<sphalerite> I guess you'll have to install nixos. What a shame.
<jD91mZM2> But I can't do that. I can just use the kexec hacks which feel hacky
Sonarpulse has joined #nixos-chat
<sphalerite> there's nothing wrong with the kexec thing, it's just a way of booting into the installer
<jD91mZM2> I mean except we're booting into a kernel in order to use kexec to boot into another kernel
<samueldr> this happens only for the installation
obadz- has joined #nixos-chat
<sphalerite> Yep. And normal boots look somewhat like that too. It's just using linux as a bootloader really.
<jD91mZM2> oh
obadz has quit [Ping timeout: 256 seconds]
obadz- is now known as obadz
<sphalerite> A typical desktop machine nowadays probably has like 5 different boot stages. My laptop probably has at least 3 stages in the firmware to get EFI fully set up, then that loads GRUB, then that loads linux with an initramfs, then the initramfs mounts the real filesystem
<jD91mZM2> So after running this kexec thing once it completely replaces my system with NixOS? Nice!
<jD91mZM2> I no longer have any excuses left
<sphalerite> the kexec thing is like booting an installation CD, just without the CD
<jD91mZM2> That's pretty darn awesome
<jD91mZM2> Could I do this on my main system as well?
<jD91mZM2> for no reason of course
<sphalerite> yes
<sphalerite> Of course you can make kexec setups from arbitrary nixos configurations (as long as you have enough RAM to fit the resulting image, otherwise you won't be able to boot it), not just the standard nixos installer
<sphalerite> or you can make netboot images in much the same way. In fact netboot images and kexec images are basically the same
<jD91mZM2> "Nothing has been loaded!"
<jD91mZM2> Just that, after kexec -e
<jD91mZM2> Oh, also this: "Cannot malloc 394491208 bytes: Cannot allocate memory"
<jD91mZM2> I only have 1GB RAM on the thing, I'm not using C1 but rather the Start plan
<tilpner> I know it works with 2G, and the test VMs use 2G as well
<jD91mZM2> I created a swapfile and it worked, except all it did was reboot back into fedora
<tilpner> Did you reboot manually?
<jD91mZM2> Nope, just called ./kexec_nixos
<jD91mZM2> The console seems to be crashing after the kexec -e call
<tilpner> Huh, it's not supposed to reboot by default
<tilpner> At least not yet
<tilpner> (clever put some auto-reboot logic in there)
<sphalerite> jD91mZM2: yeah not sure you'll get the kexec thing to work on only 1G
<sphalerite> I'd suggest trying to just install nixos in place on there
<tilpner> Do they allow booting a rescue system?
jtojnar has quit [Quit: jtojnar]
<jD91mZM2> sphalerite: How do you install it in-place? You mean using your nixos-rebuild installation commands?
<sphalerite> yep
<jD91mZM2> How do you then uninstall ubuntu?
<sphalerite> by removing all the files :p
<jD91mZM2> oh, nix regenerates necessary ones?
<sphalerite> nixos does
<jD91mZM2> sounds like a lot of work though
<jD91mZM2> Will you hate me if I just stick with Ubuntu+Nix+Home-manager for this?
<sphalerite> no.
<jD91mZM2> Awesome, thanks :)
jcrben has left #nixos-chat ["The Lounge - https://thelounge.github.io"]
jcrben has joined #nixos-chat
<sphalerite> Any suggestions on coping strategies for dealing with horrendous code?
<simpson> Relax. Take a deep breath. Stretch. Go for a walk. Remember that all code is terrible. Remember that the purpose of code is to exist, to do, and then to be obsoleted and deleted.
<sphalerite> Complain about it on IRC
<sphalerite> :D
<jD91mZM2> sphalerite: Ah, I see you've found my GitHub /s
jD91mZM2 has quit [Quit: WeeChat 2.0]
balsoft has joined #nixos-chat
taktoa has joined #nixos-chat
<sphalerite> sound is really weird
<sphalerite> if I have the door to the server room open, depending on the position of my head, it sounds like my laptop's making lots of noise. But it's actually just its monitor reflecting the noise from the server room
Synthetica has joined #nixos-chat
MichaelRaskin has joined #nixos-chat
jtojnar has joined #nixos-chat
balsoft has quit [Quit: balsoft]
jtojnar has quit [Quit: jtojnar]
Lisanna has joined #nixos-chat