32 ms·
I feel like nix[1] is better suited than Ansible for this. Just I'm this week, I made an iso for my rpi config, which has everything setup from ssh keys to the
by stardenburden 5y ago
I feel like nix[1] is better suited than Ansible for this.
Just I'm this week, I made an iso for my rpi config, which has everything setup from ssh keys to the services i want to use. All I need to do is flash it and it's good to go. Not to mention that I can easier manage a fleet of this with remote deployment[2].
[1] https://nixos.org https://nixos.org
[2] Nixops, deploy-rs or the --target-host flag in nixos-rebuild
- newman314 5y agoDo you have a repo/gist where you can throw up a sanitized rpi config? I don't know much about Nix but what you are describing sounds like a nice use case as I do have to periodically rebuild different RPIs.
- stardenburden 5y agohttps://github.com/LegendOfMiracles/dotnix/tree/master/hosts/pi/configuration.nix https://github.com/LegendOfMiracles/dotnix/tree/master/hosts... (bottom lines describe the remote build logic) this is the actual config of the pi 3b... One other file also gets sourced: the defaults-nixos file in the root of the repo. And the distributed build host nix file describes creating a build user on my main machine. The setup is mostly mirrored from https://sgt.hootr.club/molten-matter/nix-distributed-builds/ https://sgt.hootr.club/molten-matter/nix-distributed-builds/ Be sure to enable binfmt for whatever architecture your pi uses on your main machine for cross compilation. For generating the iso I used nixos-generators.
- jeppesen-io 5y agoI'm not sure what you mean by sanitized, but here's one example. Very simple configuration on my pi4 server-ish. This is not a remote deploy but gives you an idea of a simple-ish configuration https://github.com/NelsonJeppesen/nix-lifestyle/blob/main/nixos/machines/blue.nix https://github.com/NelsonJeppesen/nix-lifestyle/blob/main/ni... After the first hump of learning the Nix ecosystem, the rewards on time are great EDIT: After looking over the repo, I can see how much code would be unneeded over a Nix[os] configuration
- na85 5y agoIt all seems horribly overengineered. Use apt to install python and pip, then use pip to install Ansible, then use Ansible to install a bunch of stuff that appears to pull in docker as well. Good grief.
- CameronNemo 5y agonot to mention using yaml + jinja2 rather than a structured expression language (e.g. nix or jsonnet). Miss me with that.
- e3bc54b2 5y agoI've been wanting to use Nix(OS) on my Pi for a year now. But from what I understand, there is no binary cache for ARM yet. Building every required package on Pi is out of the question and I don't have another persistent system for cross-compiling (Pi is the only always-on system I own). That being said, I've been using NixOS on my main system and loving it! I've been through format-and-resetup dance far too many times to understand NixOS is worst system management tool, except all the others.
- jeppesen-io 5y ago> Building every required package on Pi is out of the question Are you sure? TBH I don't know if there's a binary cache, but I installed without issue. It was longer than say a Debian install, but can't say it took that long What timeframe do you need to meet your needs?
- jeppesen-io 5y agoJust tested on my pi4, seems to use cache > ssh pi4 (nelson@pi4) Password: Last login: Sun Aug 15 10:44:23 2021 from 192.168.86.235 nelson@pi4:~/ > sudo nix-channel --update [sudo] password for nelson: unpacking channels... created 1 symlinks in user environment nelson@pi4:~/ > sudo nixos-rebuild switch ... > copying path '/nix/store/qpd30425yap9y2mhsa4lg8cfid6703cz-glibc-locales-2.33-49' from 'https://cache.nixos.org https://cache.nixos.org'... copying path '/nix/store/59mpcrm3ndbg32834038v1c6lzjh9yi7-linux-5.10.52-1.20210805' from 'https://cache.nixos.org https://cache.nixos.org'... copying path ect
- CameronNemo 5y agoThey have an aarch64 cache iirc. Not an 32 bit arm cache. There are several variants.
- e3bc54b2 5y agoThanks, I was not aware of this. I will try it out. On another note, do you have any idea why Pi foundation still recommends 32bit images for Raspbian?