6 ms·
Sorry for being dense, but I thought one of the main reason for nixos's existence is reproducibilty. I thought they have these kinds of things solved already.
by mihalycsaba 3y ago
Sorry for being dense, but I thought one of the main reason for nixos's existence is reproducibilty. I thought they have these kinds of things solved already.
I have only ~2 hours experience with Nixos, wanted to try hyprland, I thought it would be easier on Nixos since hyprland needs a bit of setup and maybe it's easier to use someone else's config on nixos, than on some other distro. Finding a config was hard too, found like 3 on some random github gists, thought there would be more... and none of them worked, at that point I gave up.
- rgoulter 3y agoYeah, Nix is a tough tool to learn. It's probably never the right tool to pick for "I just want something that works right now" if you're unfamiliar with it. > I thought one of the main reason for nixos's existence is reproducibilty NixOS uses "reproducible" to mean "with the same Nix code, you get the same program behaviour". This is more/less what people hope Dockerfiles provide. This is the level of reproducibility you want when you say "it works on my machine" or "it worked last time I tried it". Whereas "reproducible build" aims for bit-for-bit equality for artifacts build on different machines. -- With this, there's a layer of security in that you can verify that code has been built from a particular set of sources. > Finding a config was hard too What search query were you using? Searching "nixos configuration" on https://github.com/search?q=nixos%20configuration&type=repositories https://github.com/search?q=nixos%20configuration&type=repos... Or searching for hyprland specifically, there seem to be many using that https://github.com/search?q=wayland.windowManager.hyprland&type=code https://github.com/search?q=wayland.windowManager.hyprland&t...
- amarshall 3y ago> NixOS uses "reproducible" to mean "with the same Nix code, you get the same program behaviour". Note that ”Nix code” also includes the hashes of all non-Nix sources. One way to think of it is that Nix has reliable build cache invalidation. > This is more/less what people hope Dockerfiles provide. Indeed, but importantly they do not provide input-reproducibility (while Nix does) because, at least, there are no hashes for remote data.
- __MatrixMan__ 3y agoPSA: you can build OCI images with nix, then they'll be a pure function of their input like we've all wished was the case with Dockerfiles.
- Smaug123 3y ago(And Nix derivations compose, whereas Dockerfiles entirely do not.)
- mihalycsaba 3y agoI don't remember, some of them needed some other tools installed(like flakes whatever it is), I looked for configs, that looked like they don't need a few more hours to learn and to setup some other tools for them to work. I just wanted to take a quick look at hyprland, I imagined I just use an existing config, I never thought it would need hours of research. Later I installed an arch vm and managed to install hyprland with some basic components in less than an hour from the first guide I found. Looks like I misunderstood, what nix was made for. I just want a system I can more or less set up with a simple config file. I saw this os, didn't have time to try it yet, but I thought this is how nix works. https://blendos.co/ https://blendos.co/ For example you just define gnome like this, the nix configs I found looked similar, they just didn't work. >gnome: > enabled: true > style: light > gtk-theme: 'adw-gtk3' > icon-theme: 'Adwaita' > titlebar: > button-placement: 'right' > double-click-action: 'toggle-maximize' > middle-click-action: 'minimize' > right-click-action: 'menu'
- ParetoOptimal 3y ago> I just wanted to take a quick look at hyprland, I imagined I just use an existing config, I never thought it would need hours of research. It shouldn't. You'd want a simple flake to start with that has home-manager (for higher chance of finding declarative vest practice configs and modules) and to add small things to that. I imagine you tried grabbing someone's complex config, modifying it, and ran into issues?
- t0astbread 3y agoFlakes will hopefully be that soon but I wouldn't recommend starting with flakes when learning Nix in 2023. They're experimental and you still need to learn most of flake-less Nix (except channels and NIX_PATH) anyways. When I started learning/using NixOS about two years ago I found it useful to start out with just Nixpkgs (i.e. what you get out of the box) and only add libraries when I felt they would help me. My first configs where ugly as hell and full of bad practice but the cool thing about Nix is that it gives you a lot of safety nets to enable experimentation and refactoring.
- quietbritishjim 3y agoThere are two senses of reproducible. The sense you're thinking of is that you can easily rebuild a binary package and it will use the same dependency versions, build options, etc. There should be no chance of a compiler error that didn't happen the first time (the old "but it worked on my laptop" syndrome). The sense used here is that every build output is byte-for-byte binary identical. It doesn't depend on the machine name, the time it was compiled or anything like that (or, in a parallel build, the order in which files finish compiling). That is much harder.
- jowea 3y ago> The sense you're thinking of is that you can easily rebuild a binary package and it will use the same dependency versions, build options, etc. There should be no chance of a compiler error that didn't happen the first time (the old "but it worked on my laptop" syndrome). And that's just for Nixpkgs, the packages themselves that also work outside NixOS. NixOS has reproducibility of the entire system complete with configuration.
- ParetoOptimal 3y ago> Finding a config was hard too, found like 3 on some random github gists, thought there would be more.. That sounds odd, did you use github code search? Find relevant home manager options: https://mipmip.github.io/home-manager-option-search/?query=hyprland https://mipmip.github.io/home-manager-option-search/?query=h... Then search those on github: https://github.com/search?utf8=%E2%9C%93&q=lang%3Anix+hyprland+plugins&type=code https://github.com/search?utf8=%E2%9C%93&q=lang%3Anix+hyprla... Note some option searches imply more casual or advanced users.
- chpatrick 3y ago> Sorry for being dense, but I thought one of the main reason for nixos's existence is reproducibilty. I thought they have these kinds of things solved already. Nixos has the advantage that everything is built in its own sandbox with only its explicitly declared (and hashed) dependencies available, unlike in mainstream distros where it's the full system environment, so in many cases you already get the same binary every time. But this doesn't immediately lead to reproducibility because the build process might be nondeterministic for various packages.
- benreesman 3y agoThis is a really good comment, I have no idea why it’s going grey. Upvote from me FWIW.
- WhyNotHugo 3y ago> unlike in mainstream distros where it's the full system environment Usually packages are built in an environment which has only a minimal base system plus the package's explicitly dependencies. They don't have random unnecessary packages installed.
- goodpoint 3y ago> unlike in mainstream distros Debian has been building in a clean sandbox with only required, tracked dependencies since decades. It's also building the large majority of packages reproducibly including the binary and whole installation packages (not just the sources like nixos)
- chpatrick 3y ago> not just the sources like nixos Not sure what you mean by that, the Nix packages that are reproducible have reproducible binaries. In the Nixos world there isn't really a concept of a "binary/installation package" like in Debian or elsewhere. Everything can be rebuilt from source on any machine, but because everything is hashed, if the official binary caches have already built something with the same inputs, they can just give you the outputs directly. So it's more like memoization than a .deb or something that you install. Nix is a functional language that builds recipes (derivations) to build stuff, with all the inputs and outputs hashed. If the derivation you want to build has already been built by a cache you trust, the system will just fetch it instead of building locally. What the Nix reproducability project checks is that the same derivation produces the same output regardless of what machine it's built on.
- Aerbil313 3y agoCheck out https://github.com/donovanglover/nix-config https://github.com/donovanglover/nix-config . Flake based config with hyprland and cool stuff. > at that point I gave up. NixOS is not for the weak or time constrained, currently. Hopefully it will be one day. Still if you push through, you reap the benefits.
- flkiwi 3y agoAnother good option: https://github.com/Misterio77/nix-starter-configs https://github.com/Misterio77/nix-starter-configs I started with this one, the minimal version, then moved on to something more like the standard version, and now I'm moving on to something based on his much more complicated and flexible build in a different repo. I had been flailing, then this repo made it click.
- __MatrixMan__ 3y agoSame here, that repo is fantastic.
- flkiwi 3y agoHis documentation has gotten better too! I actually just rebuilt my entire config based on his updated "standard" version. I want to use his "non-starter" config too, bc it seems remarkably powerful, but ... I need more time and brain to do that. And, just to be clear, I rebuilt my entire config in less than an hour, copying and pasting where necessary, then it took about 20 minutes (!!) to download and setup all my software. Only one error, so I consider that a significant My NixOS Journey accomplishment! Granted, because it's NixOS, I have NO IDEA AT ALL what the error was, lol.
- colordrops 3y agoNix is reproducteable in tbe environment sense, meaning you can get the exact same setup every time, but not in the bit-for-bit sense, meaning that the compiled binaries will be identical.