bertbobQV2BVK has joined #nixos-chat
bertbobQV2BVK has quit [Remote host closed the connection]
jtojnar_ has joined #nixos-chat
jtojnar has quit [Ping timeout: 260 seconds]
jtojnar_ is now known as jtojnar
jtojnar_ has joined #nixos-chat
jtojnar has quit [Ping timeout: 260 seconds]
jtojnar_ is now known as jtojnar
ma27 has joined #nixos-chat
ma27 has quit [Ping timeout: 265 seconds]
MichaelRaskin has quit [Quit: MichaelRaskin]
<sphalerite> clever: you said you have a sun keyboard? I have a sun type 6 USB keyboard here, and while cleaning it I discovered some DIP switches and am wondering what they're for. Maybe you can enlighten me?
<adisbladis[m]> sphalerite: I used to have such hardware. Iirc they are for setting layout in hardware.
<sphalerite> ah ok. So nothing I can't do in software
<sphalerite> I presume?
jtojnar has quit [Remote host closed the connection]
zybell_ has quit [Ping timeout: 268 seconds]
zybell_ has joined #nixos-chat
ma27 has joined #nixos-chat
<gchristensen> til, some people around here run / as a tmpfs with specific mounts for /nix and a few other directories, and then their /etc and /home have opt-in to persistence for specific files and directories.
<gchristensen> I won't name them unless they want to chime in, but it sounds a lot like what MichaelRaskin does
<gchristensen> I might have to wipe my laptop and try this %)
<LnL> yeah, I also want to do that :)
ma27 has quit [Quit: WeeChat 2.0]
ma27 has joined #nixos-chat
<gchristensen> LnL: have you been thinking about this too?
<LnL> I like the idea to keep yourself honest about what is configuration or state
<gchristensen> me too
ma27 has quit [Ping timeout: 240 seconds]
<clever> sphalerite: i'm guessing it can also be done in software, but its just a nicer UX if the keyboard works without manual config
<sphalerite> something something I think we had a discussion in this direction before
zybell_ has quit [Ping timeout: 264 seconds]
zybell_ has joined #nixos-chat
zybell_ has quit [Quit: Leaving]
zybell has joined #nixos-chat
zybell has left #nixos-chat [#nixos-chat]
zybell_ has joined #nixos-chat
jtojnar has joined #nixos-chat
<gchristensen> time to move to https://github.com/r-raymond/nixos-mailserver?
MichaelRaskin has joined #nixos-chat
* gchristensen waves to MichaelRaskin
<MichaelRaskin> Hello
<gchristensen> MichaelRaskin: how does your layering of /etc work, again?
<MichaelRaskin> Oh, I gave up on layering and switched to the «I decide what's wrong and right»
<gchristensen> what does that mean?
<MichaelRaskin> It means /etc is a symlink to /current-system/global/etc
<MichaelRaskin> End of story, and no mutability
<gchristensen> nice :D
<MichaelRaskin> It is expected to contain symlinks to mutable things elsewhere
<MichaelRaskin> For example, passwd can be used after chrooting to /var/auth
<MichaelRaskin> There lives a mutable passwd, end just enough of symlinks and bind mounts that passwd works in chroot
<MichaelRaskin> Some of the related bugs are actually features
<MichaelRaskin> For example, dhclient creates the new resolv.conf but cannot move it over the old one
<LnL> heh
<MichaelRaskin> Which means that it is easier for me to control whether I use local resolver or the DHCP-provided one
<MichaelRaskin> Much better than messing with immutable-file FS flags, or managing single-file-bind-mounts
<gchristensen> I've been thinking about making / a tmpfs, and using mounts at various places to provide persistence when wanted
<gchristensen> mounts and links, indeed
<LnL> same, but I'm kind of scared about that because I reboot my desktop very infrequently
<gchristensen> hehe, yes... that is a thing -- hard to know how much state you wanted to keep has accreted
<MichaelRaskin> One of the many reasons I don't want to use NixOS bootscripts as-is: I reboot frequent-ish (kernel updates! and some of my unorthodox scripts leak _firefoxes_, which I usually clean up fine, but sometimes it gets out of hand) and I want mkfs on /tmp before mounting
<MichaelRaskin> I have ~/tmp which is for accumulating junk, but I have trained myself that most of thing are actually categorised in a declared-persistent place
<MichaelRaskin> Also, I am quite confident in my automated backups, and I know that whatever is not in the list, can go poof
<MichaelRaskin> By the way, if you run a lot of things as «grab me a random UID > 100000, build a jail for that UID and run stuff there» you also learn to keep track of what is supposed to be persistent
<gchristensen> hehe, I bet so
<LnL> it's probably also easier with a fresh install
<MichaelRaskin> I have escape hatches, but they feel like something wipable
<MichaelRaskin> LnL: that's somewhat true. I probably started the backup-driven approach on a fresh install some years ago; nowadays the notion of a fresh install is just meaningless for me.
<MichaelRaskin> Unlike Zen, my digital life keeps a notion of «digital self» — but it is not really tied to a single substrate, it is a process among multiple copies…
<gchristensen> I agree w.r.t. a fresh install, but mostly b/c ext4 isn't quite so flexible as zfs/btrfs/etc
<MichaelRaskin> Dunno, the only thing where I strongly prefer not to have ext4 is /nix/store
<MichaelRaskin> I like online shrinking and dynamic inode reallocation
<MichaelRaskin> Otherwise I have a slowly growing /home ext4 and I don't care
<LnL> maybe I should just try it, I already have /nix/store, etc. on separate volumes
<MichaelRaskin> I think that it is feasible to migrate to a better layout without a fresh install
<gchristensen> soon: lnl and I have both rendered our systems inoperable
<LnL> if I can figure out what's using disk space on /
<MichaelRaskin> Meh, who cares, you can boot from a usb drive and mount the HDD /nix/store
<MichaelRaskin> ncdu is cool
<MichaelRaskin> gdmap is also cool
<MichaelRaskin> I mean, isn't Nix ideology that there is user data that needs backups, and all the rest that can be deployed on a whim and mixed-and-matched as needed?
<MichaelRaskin> For migrating user data layout you invent a system that takes into account existence of various personal/collective projects with vastly different workflow. One of the projects is «sort out the garbage bin that is my old ~». All the data goes there. The only allowed operation on this data is moving to a better place.
<LnL> heh
<LnL> it's /nix/var/log
<MichaelRaskin> This «better place» might but is not obligated to be afterlife
<MichaelRaskin> Ah, heh
<gchristensen> outside of the /nix/store I bet my biggest usage of disk space is various clones of nixpkgs
<gchristensen> oh ... it is, except for a macos VM.
<MichaelRaskin> Ouch, my ofborg builder ran out of space
<MichaelRaskin> I guess I should both clean up and give it some more space
<MichaelRaskin> Wait, is this person on the mailing list actually asking if there is a version of NixOS that can survive HDD write failure on Nix SQLite database and still complete an update?
<gchristensen> ...wat
<gchristensen> impressive
<gchristensen> I don't think I've seen this one yet
<MichaelRaskin> Weeell
<MichaelRaskin> Actually, I think my dying HDD did behave in a different way.
<gchristensen> it is above 15C outside for the first time in about 6mo... finally I can go outside
<MichaelRaskin> Maybe my email is a little bit trollish, but maybe it will push the user to copy the data while there is still a chance…
<samueldr> hmmm, used by bicycle yesterday, with a high of 6°C
<gchristensen> samueldr: I mean relax outside :)
<samueldr> ah, it was relaxing in its own way!
<samueldr> though, snow storm (again!) by sunday :/
<gchristensen> same
<disasm> yeah, I'm ready for spring, hopefully soon
<disasm> my parents had to cancel their trip this weekend to come visit because of ice storms in MI
<gchristensen> my impression is we're skipping spring and goinng right back in to winter
* LnL did the first scary step
<MichaelRaskin> In what direction?
* zybell_ thinks tmpfs /
<gchristensen> what'd you do? :)
<LnL> yeah
<LnL> move the nix db around, thought I already did that
<MichaelRaskin> Hm
<LnL> do I need to worry about stuff that points to /etc/static?
<MichaelRaskin> find / -xdev -type f | wc -l
<MichaelRaskin> Returns 0 for me!
<LnL> :o
<MichaelRaskin> After wiping some stuff leftover from HOME=/ as root…
<MichaelRaskin> Well, I have separate partitions for /root /var /home /nix /boot (obviously) /tmp
<MichaelRaskin> If I have separate partitions for everything, what exactly should / have, after all?
<zybell_> mkdir -p /sys /proc /dev /run /usr/bin /root /var /home /nix /boot /tmp
<MichaelRaskin> Yep, this doesn't add any entries to find / -xdev -type f though
<zybell_> you need mountpoints (and /usr/bin/env)
<gchristensen> /bin/sh
<MichaelRaskin> Yes, but mountpoints are -type d
<MichaelRaskin> And /usr with /bin are symlinks, -type l
* gchristensen is just brainstorming and isn't a valid implementation of `find`
<MichaelRaskin> Can't you run the entire POSIX Shell and Utilities in your mind?
<zybell_> In your case / *is* infrastructure
<MichaelRaskin> In what sense — infrastructure?
<zybell_> but missing infrastructure...
<zybell_> It holds together your partitions and names them (like DNS)
<MichaelRaskin> Nah, what names them is initramfs
<zybell_> initramfs may *set* the name (DNS doesnt do that either) but when you have a name and need *access* initramfs is long gone.
<MichaelRaskin> Well, that's what gchristensen is arguing for, though: / on tmpfs is roughly the same as never letting go of initramfs completely.
<zybell_> no you would have all the startscripts;-)
<MichaelRaskin> Do you know how switch_root works?
<MichaelRaskin> Basically the bootscripts have to be erased from initramfs file-by-file in any case
<zybell_> pivot-root would let you umount the initramfs which erases all files on it.
<MichaelRaskin> No
<MichaelRaskin> You can umount initrd (which nobody uses nowadays) but not initramfs
<zybell_> pivot-root lets you. Debian uses it all the time.
<MichaelRaskin> Still? during boot?
<MichaelRaskin> I mean, I have tried using pivot_root and it didn't work with initramfs
<zybell_> I have checked It *is* a initramfs although its called initrd. The actual switch is done in a binary 4452 bytes long.
<zybell_> So I couldnt determine where it is done
<zybell_> but mount doesnt have an initramfs anywhere
<MichaelRaskin> That's the point
<zybell_> in the booted sys
<zybell_> in the *booted* sys
<zybell_> so it *was* successfully umounted
<MichaelRaskin> I think the initramfs is not displayed as a mount even before switching
<gchristensen> it isn't?
<MichaelRaskin> It is not a full honest mount
<MichaelRaskin> Otherwise pivot_root would work
<gchristensen> oh I see
<zybell_> AFAIK initramfs is a tmpfs where a cpio was extracted.
<zybell_> honestly mounted
<zybell_> It may depend on kernel ver
<ekleog> MichaelRaskin: so did you switch to / as a tmpfs? :D
<ekleog> (then, /etc as a tmpfs, and let the activation-script rebuild it every time, will likely only cause issues with non-persistend uid/gid? :°)
<ekleog> persistend obviously being a word in-between of persistent and persisted
<ekleog> … oh, looks like I haven't backlogged far enough (only last page here, that started with the “find / -xdev -type f | wc -l returns 0 for me”)
* ekleog pops out
<zybell_> cant the activationscript not contain user id
<zybell_> or get them from ls -l /home?
<ekleog> I know currently it's a perl script that gets the user id from the current /etc/passwd / /etc/group
<gchristensen> immutableUsers++
<ekleog> it can't really contain the user id (unless you can write, in nix, a hashing function that never collides and maps usernames to [1, whatever])
<ekleog> gchristensen: ?
<gchristensen> /var/lib/nixos/uid-map, /var/lib/nixos/gid-map
<ekleog> and getting them from ls -l /home sounds just a bit less good than getting them from the current /etc/passwd / /etc/group, imo, as it's not a better fallback
<ekleog> gchristensen: oh, I was convinced the perl script was reading from the current /etc/passwd, so it looks in /var/lib? great :D
<zybell_> ls -l /home isnt empty when /etc is.
<ekleog> zybell_: and for users who have no home (eg. system daemons?)
<zybell_> cat /nix/store/package/uid
<ekleog> that'd require you to manually set a uid per system daemon, which is a PITA
<zybell_> PIT.nix
<ekleog> gchristensen: what is that? o.O
<ekleog> (so I can say for sure the modules I've written don't have a UID in there, but… what'd it be used for, when we have auto-allocation working and bypassing the need for having less than ~400 total system users across all of nixpkgs?)
<gchristensen> it depends upon what you need
<gchristensen> for some services the uid has no meaning and can be whatever, for others it is very helpful to have it bee consistent across servers no matter what
<ekleog> oh, like when using nfs? indeed, got it
<gchristensen> or restoring a mysql backup at 3am, debugging perms is no fun
<ekleog> ... wait, mysql backups with perms errors? doesn't mysql just dump a sql file that recreates the database? (never investigated how our mysql backup setup worked)
<gchristensen> that is the slow way
<gchristensen> faster to just tar up the datadir
<gchristensen> * with appropriate measures in place to ensure it is consistent
<zybell_> but very reliable
<ekleog> oh. can't that cause issues of breaking ACID?
<ekleog> oh you already answered
<gchristensen> a problem with loading from a sql dump is you're rebuilding indexes as you go
<gchristensen> if you have an appreciable amount of data, it isn't in your favor to use the .sql approach
Sonarpulse has quit [Ping timeout: 240 seconds]
<ekleog> hmm must say we never had to rebuild from a backup, we just periodically (once a… year? 😇) checked the backup files looked good by hand-picking a few rows
<ekleog> anyway I guess we wouldn't qualify as having an “appreciable amount of data”, being a small association :)
<gchristensen> yeah, then its fine
<gchristensen> with mysql, its also very reliable to tar up the data files fwiw
<zybell_> .sql works fast if the index commands are sorted to the end
<gchristensen> it depends on what you're dealing with
<ekleog> good to know, thanks :)
<gchristensen> kudos for verifying your backups :)
<gchristensen> back at my previous job loading from .sql was an all day affair or longer, vs. just the few hours to copy the data to the host and start mysql
<ekleog> oh that's quite a long downtime indeed :/
<gchristensen> ekleog: replicas, hot backups, and automation ;) https://www.youtube.com/watch?v=6VH945-AaRY
<zybell_> mysql can use another mysql database as datastore. Interesting is that you can use that to throw a switch to use another database as backend if you have to backup or restore.
<gchristensen> eh?
<zybell_> mysql has a driver that transfoms disk reads and writes to simple sql ready to shot at a database that speaks mysql network protocoll. one line in hostfile switches ip.
<gchristensen> hah
<gchristensen> hw fails enough I'd rather just point clients away to a different node in the first place :P
<zybell_> acid is done in *primary* mysql
<gchristensen> every node is acid, however speaking to multiple nodes can give you different views
<gchristensen> but the queries are applied in an acid fashion per node