Live data from Hacker News

NixOS 22.11 “Raccoon”

nixos.org

131–140 of 201 posts

Re: NixOS 22.11 “Raccoon”

#131
post #58

Earlier quoted context omitted.

> nixpkgs is already one of the largest package collections. There is a good chance your software is already included. Yes, but that still doesn't solve this: > Major problems: installing niche proprietary software that you may have to package yourself If some software _isn't_ packaged, it's a pain in the butt to get it running on NixOS. Either you have to create Nix derivations, which have a pretty steep learning cu…

It's more a story of, you have to do some hackery patchelf business, but creating a Nix derivation helps you do just that. The unfortunate part is that creating a Nix derivation is no more approachable than the patchelf hackery was in the first place.

Most of the time you can just use autoPatchElfHook and add the missing libraries to buildInputs. I can't remember when I last looked at patchelf itself.

Re: NixOS 22.11 “Raccoon”

#132

Earlier quoted context omitted.

NixOS is great for a basic home router (I use it for my home router) but it’s networking config is still pretty rudimentary, and some things I would expect to work just don’t - i.e. port forwarding only works from outside your network, not inside. I haven’t done much with vlans yet so I can’t comment on that.

I would highly recommend to use systemd-networkd based networking which should be able to do almost everything if configured correct.

Is there a nix config wrapper for systemd-networkd?

NixOS still does everything I need it too, but the parent comment sounded like they had a bit more complex of a setup.

Re: NixOS 22.11 “Raccoon”

#133

Earlier quoted context omitted.

That page is missing the opengl drivers which you also most likely want in the 32 bit variant.

Setting programs.steam.enable also enables 32-bit opengl, last I checked.

Yes, that's correct and then you need to tell it which driver you need for your hardware. For example like:

hardware.opengl = { extraPackages = with pkgs; [ intel-compute-runtime # OpenCL library intel-media-driver # video encoding/decoding hardware accerlation ]; extraPackages32 = with pkgs.pkgsi686Linux; [ intel-media-driver # video encoding/decoding hardware accerlation ]; };

Re: NixOS 22.11 “Raccoon”

#134

Earlier quoted context omitted.

> That being said a lot of smart people here and in my peer group swear it's the truth, despite none being able to elevator pitch it. OK, I’ll bite. Nix is a build system . NixOS is a Linux source distro built on top of it (cf Gentoo, gittup, BSDs). Except you won’t need to build anything. Nix builds (should) execute in an isolated environment, thus the build artifacts are (ideally) bit-for-bit identical no matter wh…

Thats quite a lengthy elevator ride : )

Right? :) I intended only the first two paragraphs to be the pitch and the rest to be an extended explanation, but I have to admit they aren’t really a summary of the rest.

Now that I’ve written this, I see I can’t really phrase the benefits such that the result is neither a shallow-sounding platitude nor a laundry list of features, when the reality is a laundry list of features that mostly fall out of a couple of overarching ideas. And it’s not like each of those features haven’t been done before, but this particular implementation comes out remarkably simple and sane given the length of the list.

Re: NixOS 22.11 “Raccoon”

#135
So far no one mentioned that you can: - easily cross compile packages: pkgsCross.aarch64-multiplatform.hello - NixOS has modules to get complete services like Nextcloud, Mastodon or Matrix Synapse up and running within minutes including nginx configs - it is possible to switch Desktops and clean up all packages

Re: NixOS 22.11 “Raccoon”

#136

Earlier quoted context omitted.

I would highly recommend to use systemd-networkd based networking which should be able to do almost everything if configured correct.

Is there a nix config wrapper for systemd-networkd? NixOS still does everything I need it too, but the parent comment sounded like they had a bit more complex of a setup.

Not sure what you mean by config wrapper, but yes, systems-networkd is quite nice. Here's my home router setup with vlan1 for uplink to ISP, a bunch of other vlans for internal networks, and IPv6 prefix delegation to internal networks, and of course fireguard. All configured using systemd-networkd:

{ pkgs, lib, ... }:{

  networking = {
    useNetworkd = true;
    useDHCP = false;
    enableIPv6 = true;
  };

   networking.wireguard.interfaces = {
     wireguard = {
       ips = [ "172.20.60.1/24" ];
       listenPort = 61891;
       privateKeyFile = "/etc/nixos/secrets/wireguard-privateKey";
       peers = [
         {
           publicKey = "897mRPejuv9yVnmTvcUL7ckQkIiM0wnSgHmgR15Evyw=";
           allowedIPs = [ "172.20.60.10/32" ];
           presharedKeyFile = "/etc/nixos/secrets/wireguard-presharedkey";
         }
...

  systemd.network.networks = {
    "10-eno1" = {
      matchConfig.Name = "eno1";
      networkConfig.LinkLocalAddressing = "no";
      networkConfig.DHCP = "no";
      extraConfig = ''
        VLAN=wan
        VLAN=vlan99
        VLAN=vlan30
        VLAN=vlan20
        VLAN=vlan1
        VLAN=podnet
        LLDP=no
        EmitLLDP=no
        IPv6AcceptRA=no
        IPv6SendRA=no
      '';
    };
    "11-vlan1" = {
      matchConfig.Name = "vlan1";
      linkConfig.RequiredForOnline = false;
      networkConfig.DHCP = "no";
      networkConfig.Address = "192.168.1.1/24";
      networkConfig.Domains = "tanso.net";
      networkConfig.ConfigureWithoutCarrier = "yes";
    };
    "11-podnet" = {
      matchConfig.Name = "podnet";
      linkConfig.RequiredForOnline = false;
      networkConfig.DHCP = "no";
      networkConfig.Address = "172.20.2.1/24";
      networkConfig.Domains = "tanso.net";
      networkConfig.ConfigureWithoutCarrier = "yes";
    };
    "11-vlan20" = {
      matchConfig.Name = "vlan20";
      networkConfig.DHCP = "no";
      networkConfig.Address = "172.20.20.1/24";
      networkConfig.Domains = "tanso.net";
      networkConfig.ConfigureWithoutCarrier = "yes";
      extraConfig = ''
      IPv6SendRA=yes
      DHCPv6PrefixDelegation=yes
      '';
    };
....

  systemd.network.netdevs = {
    "11-vlan1" = {
      netdevConfig = { Name = "vlan1"; Kind = "vlan"; };
      vlanConfig.Id = 1;
    };
    "11-podnet" = {
      netdevConfig = { Name = "podnet"; Kind = "vlan"; };
      vlanConfig.Id = 2;
    };
    "11-vlan20" = {
      netdevConfig = { Name = "vlan20"; Kind = "vlan"; };
      vlanConfig.Id = 20;
    };
    "11-vlan30" = {
      netdevConfig = { Name = "vlan30"; Kind = "vlan"; };
      vlanConfig.Id = 30;
    };

Re: NixOS 22.11 “Raccoon”

#137
post #2

> Graphical installer I've recently installed NixOS on an old Thinkpad I got from work, and I was pleasantly surprised by the graphical installer. Even though NixOS is far from a beginner distro, removing friction in the initial installation process is a good thing.

I was also pleasantly surprised, especially by how easy it was to setup disk encryption. I probably wouldn't have done so otherwise.

Re: NixOS 22.11 “Raccoon”

#138
post #13

Earlier quoted context omitted.

- You will have to learn both the nix language and working with nixpkgs. Learning nix is pretty trivial IMO (great resources are nix-1p[0] and Nix Pills[1]) but the documentation, while vast, is pretty shallow at the moment. You will likely have to resort to reading random blog posts, nix configs published by others and the source code of nixpkgs itself. - As mentioned by another commenter you will not be able to run…

> learn both the nix language That seems weird to me. I don't have to learn package configuration language in other distributions. I thought that one could just install packages with a package manager. > You can use nix-alien[2] which will automatically fetch the required libraries and build an FHS shell for the binary. That's actually fine. I want to put closed source software into a chroot anyway.

> I thought that one could just install packages with a package manager.

You could use the command

    nix-env -iA mypackage
To install packages, which is like pacman -S mypackage or apt install mypackage.

But... the interesting part of Nix is that it lets you install packages declaratively, by editing a config (like vim and emacs packages). Besides installing packages, all configuration is done through this config file (or bunch of config files): nix generates all files in /etc for you, again, like vim or emacs, but for the whole OS

That way, you easily transfer your setup to another computer or even keep two machines in sync. And you can add it to version control. And you get a grub menu with all your previous setups (until you uninstall them)

If this doesn't appeal you, you probably won't like to use NixOS

Re: NixOS 22.11 “Raccoon”

#139

Earlier quoted context omitted.

I'm just going to link to the best HN comment I've seen on this topic https://news.ycombinator.com/item?id=33679621

No mention of the fucky /nix/store paths for everything? I haven't used a lot of other distros, especially recent ones (my list: Slackware, Redhat, Ubuntu, Debian), but Nix is a drastic departure from the standard FHS and Linux conventions. Don't get me wrong - I love NixOS! I'm gradually switching my infrastructure to NixOS. There are very necessary reasons for Nix's departures. But it is jarring , and if we want co…

That's true! Whenever I demo Nix for someone in person, the first trick I do is

> Look ma, no /usr/lib

and right after that it's a chat about the Nix store, and then a tour of what all those ugly hashes let you achieve.

I guess when I wrote that comment I was mostly thinking about what it's like to administer NixOS on a personal system over the moderate term, not the initial shock and wonder of hiking through the glorious Nix symlink forest under /nix/var/nix/profiles for the first time. :)

Re: NixOS 22.11 “Raccoon”

#140

Earlier quoted context omitted.

Yeah I used to use pfSense but hated having a load of config and firewall rules created manually, it all felt quite brittle. Moved to NixOS almost 5 years ago now and haven’t looked back, my router config is in Git and I’m able to make changes with confidence. Best part is making a change/installing an update and being able to rollback if I mess something up. I also use Nixus to push new configs which has a nifty fea…

How are you managing the VM’s on NixOS? A couple years ago I was searching for a good way to declaratively manage them, and the best I came up with was libvirt + terraform + nixos-generators for images. It feels like you should just be able to set them up as systemd units, but I couldn’t figure it out. microvm has caught my eye recently but I haven’t played with it yet: https://github.com/astro/microvm.nix

Not OP (and I suspect they don’t have what you’re looking for since they have stated they treat the VMs as pets, not cattle). I currently use libvirt, but I eschew persistent VMs and instead build the libvirt domain XML with Nix, and then start VMs with `virsh create /path/to/myvm.xml`. Using an absolute path means that libvirt will not persist the domain, and makes it easier to declaratively manage the config with Nix.

However, none of my VMs are always-on, so I don’t have to deal with restarts on config change. That said, when libvirt isn’t managing the lifecycle of the VMs as much, writing a systemd unit should be quite a bit easier.

Post reply on HN