Nix / NixOS

2204 readers
50 users here now

Main links

Videos

founded 2 years ago
MODERATORS
1
2
 
 

I think it's about time I improved a bit on my Nix and NixOS knowledge, and I guess the best way is having someone more experienced critique my monstrosity of a setup.

Maybe it's too modular? Not modular enough? Convoluted? Complete garbage altogether?

Go to the repo and find out! Just be sure to let me know after.

3
 
 

Whenever I run any command line tools without sudo, they take the settings as in ~/.config and work fine. But whenever I run the same CLI tools with same parameters but with sudo, it falls back to default setting. How can I make this behavior consistent?

4
 
 

Ich würd gerne für einen Kollegen und mich zwei TShirts mit dem "Ansible? Nein Danke" Print bestellen. Redbubble ist ja schlecht von der Qualität, ich finde aber auch keine hochauflösende File um es wo anders drucken zu lassen. Wer kann hier vielleicht helfen? @nix

5
 
 

The idea behind the first requirement was that I want to be able to reduce the creation of the logo to a few simple parameters. Additionally, if I can generate the SVG files programmatically, I can programmatically generate the Branding Guide and Media Kit. I’m calling this approach “Branding as Code” (BaC)

That sounds neat, and quite in the spirit of Nix itself! This PR looks to be the work in progress mentioned:

6
2
Re-review of NixOS (typekmatus.blogspot.com)
submitted 2 days ago by [email protected] to c/nix
 
 

https://web.archive.org/save/https%3A%2F%2Ftypekmatus.blogspot.com%2F2025%2F05%2Fre-recenzia-nixos-ako-sa-pouziva.html

Use the translator in the sidebar to translate the page.

Asi pred rokom som napísal kontroverzný článok na kontroverziu v NixOS. Áno, viem, je to paradox. Potom som prešiel na Fedoru od napísania tohoto článku, pričom ju stále používam na mojom Macu, lebo tam mám dôležité veci. Ale teraz po roku som sa rozhodol, že NixOS vyskúšam znova, tentokrát ale ako používateľ, ktorý nesleduje dianie okolo NixOS (na fórum tejto distribúcie som sa prihlásil iba teraz, aby som mohol ľahšie dohľadať príspevok a skopírovať odkaz naň). Poďme sa pozrieť, ako som si ho nastavil.


7
 
 

I just want to know from you how you (or how you would) pass options to packages you develop with flakes.

I am currently writing a widget bar using Astal and then import the flake in my NixOS flake and use the package.default output in home.packages. I'd like to also style this bar according to my Stylix theme, how do you do something like this?

8
9
 
 

I'm trying to write a Nix package for a closed-source, precompiled binary with an unusual twist. The binary is statically-linked, but it contains an embedded binary that is dynamically-linked. Is there some way I can use patchelf or another tool to path the interpreter path in the embedded binary?

The embedded binary does not have any runtime library dependencies, but it does need an interpreter which it expects at the hard-coded path /lib64/ld-linux-x86-64.so.2. It is embedded using the golang "embed" library.

I have a workaround that wraps the binary using buildFHSEnv. That works, but the resulting closure is about 300 MB bigger than it needs to be.

10
11
12
 
 

As the title says. Want that i can have a single config for my systems and just require a single line to install and configure software which i always use in a bundle(office, specific programming applications, server applications,...).

13
2
submitted 1 month ago* (last edited 1 month ago) by [email protected] to c/nix
 
 

https://pastebin.com/30Bh23EV and this:

  DVfio.configuration = {
        systemd.tmpfiles.rules = [
          "f /tmp/enable-vfio-switch 0644 spiderunderurbed users -"
        ];
        environment.variables = {
          KWIN_DRM_DEVICES = lib.mkForce "";
        };
        environment.extraInit = ''
                export KWIN_DRM_DEVICES=$(${vfio}/bin/vfio)
        '';
  };

So there is a issue with my configuration, so, you dont really need to understand nix, just like, look at my qemu hook script, its in plain sh, and the stuff above might be self explanitory, the issue is, my nvidia drivers are still being used, despite, setting KWIN_DRM_DEVICES to card0 so the logs of libvirtd looks something like this: https://pastebin.com/TaKrsY9S if setting kwin_drm_devices to my gpu card does not work, i dont know what does and can use help

14
 
 

The situation: you're trying to build something, but one of your configured substituters (a.k.a binary caches) is either offline, or having a moment of being very slow. Nix doesn't automatically time out, and skip that cache. No, you just can't build. You want to disable the problem cache so you can get on with your life. But since you use NixOS you need to run nixos-rebuild to update your substituter settings. A rebuild means hitting the problem cache...

When I've run into this problem I've thought, "I really need a way to selectively disable a cache in the nix build command." Previously I've had a hard time searching for such an option. Today I found it! Here it is:

$ nix build --option substituters "https://cache.nixos.org/ https://nix-community.cachix.org/"

or

$ nixos-rebuild build --option substituters "https://cache.nixos.org/ https://nix-community.cachix.org/"

The flag --option overrides settings that are normally read from /etc/nix/nix.conf. The idea here is instead of specifying a cache to disable, you list all of the caches that you do want to use.

Unless you are running as a "trusted user" you can't use this method to use substituters that aren't already configured because that would be a security problem. That means that substituter URLs need to be exactly the same as they are specified in /etc/nix/nix.conf including query parameters like ?priority.

I run into the misbehaving cache problem in two situations:

  • From time to time I get an error from cachix. I think it might be something like the cache claims to have a store path, but then actually downloading it fails. I'm not sure. Anyway the cache error makes the whole build command fail.
  • Sometimes garnix, as helpful as it is for avoiding expensive rebuilds on my slow laptop, gets very slow serving large packages like slack and google-chrome. These are unfree so they aren't cached on cache.nixos.org which usually takes precedence over garnix for unmodified nixpkgs packages. But since I build my nixos config on garnix the unfree packages do get cached there. I could wait all day for my nixos rebuild, or I could bypass the cache, download binaries from their original URLs, and be done in seconds.
15
16
 
 

Hello!

I'm getting back into NixOS again and i want to refactor my config heavily. Does anyone have any tips, advice or criticism on it? TIA.

https://codeberg.org/fxomt/nixos

17
 
 

cross-posted from: https://lemmy.world/post/27854420

On fediverse at @[email protected]

cross-posted from: https://lemmy.world/post/27825913

Click for comprehensive shownotes with detailed links

  • Linuxfest Northwest
  • Audience Suggestion - Forgejo
  • Television Fuzzy Finder
  • Uptime Kuma- Monitoring
  • Dockje - Docker Compose Manager
  • Homebox - Inventory Management
  • Ameridroid Sponsor
  • Whisper AI - Speech to Text
  • Themio Stereotool
  • scp - SSH based Copy
  • ffmpeg audio extraction
  • Getting a New Laptop
  • Ubuntu adopting uutils
  • Podcasting 2.0 support - State of the Podcast
  • Spread the Word! Help promote the show. Send in feedback.

If you enjoy the show, please help spread the word. Thanks!

18
7
submitted 1 month ago* (last edited 1 month ago) by [email protected] to c/nix
 
 

Edit: It was a portal error. needed to add xdg-portal-hyprland to extraPortals option. [nixos + hyprland user]

Plz help! I am enclosing related files

dotfiles - contain all nixos and firefox configs

firefox file - I don't think this file is the problem

19
 
 

In very short, I have a NixOS install with an /etc/fstab using UUIDs. However, my bulk drive died. I have backups, the data is not the problem.

But I can't boot NixOS without the drive. It throws me into an emergency shell, in which I can't edit /etc/fstab (read-only FS) and since I'm in emergeny mode, nixos rebuild doesn't work either (seems to be mostly a network issue).

So, what's the best, non-reinstalling way to fix that?

20
 
 

I’ve recently discovered nixos containers and was wondering if there where any pros/cons of running them vs. Docker containers. Like if one needs to run a containerised service, would it be better to run it as a nixos container or a docker container in terms of resource consumption? And are there any limitations of each approach?

21
 
 

I am attempting to configure the Tor daemon on nix-darwin. There is unfortunately no services.tor on this platform (yet ! maybe I'll port it from nixOS once I know enough Nix to do that)

I could manage it with homebrew, however, that seems like a sub-par solution, effectively moving tor entirely out of the nix store.

I have installed the package in my flake, and I would like to link a torrc config file to the right directory /etc/tor. However, when done with environment.etc, the file is linked to the general /etc outside of the store, where tor cannot find it.

How can I link this file inside tor's own /etc in the store, so it can use the configuration ?

Link to my config repo fixed at the current commit

22
23
 
 

Really cool Nix idea which could improve incremental builds and replaces IFD (import from derivation) in some instances.

The article poses it as an alt to the lang2nix pattern, but some of functions look rather challenging to understand? Do you think this might allow nixpkgs upstream to support more languages / build systems performantly out of the box, abstracting away the complexity from Nix users?

24
 
 

I'm on unstable and updated my flake.lock and 2 of my Steam games stopped working: Tiny Tina's Wonderlands and Elden Ring. Rolled back to my previous generation and they work again.

Is there a way to roll through nixpkgs commits to find the breaking commit? How do I gather the logs they will need and where should I report it to?

25
47
submitted 2 months ago by [email protected] to c/nix
 
 

Hello, everyone! I'm a long time Linux user who has warily stared at NixOS from the safe distance one might give to wild animals on a safari for quite some time now... And I finally decided, "fuck it, I'm gonna poke it with a stick."

I absolutely adore this system, even as strange a paradigm as it is coming from a decade of "traditional" management systems. I haven't been this excited about a Linux distro since... Well, ever really. Maybe OpenSUSE Tumbleweed? I can't recall.

Anyway, I wanted to introduce myself and preach to the choir for a second, so to speak. As someone totally new to this paradigm of system management, what are your #1 must read/watch resources you would recommend? I've perused through the NixOS Learn website over the last couple of days, and I'm itching for more. I can't wait to see what all this system is capable of!

view more: next ›