Nix / NixOS

2114 readers
2 users here now

Main links

Videos

founded 2 years ago
MODERATORS
1
 
 

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!

2
 
 

[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

3
 
 

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?

4
 
 

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?

5
 
 

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

6
7
8
 
 

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?

9
 
 

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?

10
47
submitted 1 month 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!

11
 
 

cross-posted from: https://infosec.pub/post/24675194

I think I’ll use this for custom setups for non-techies.

12
 
 

Hi all! I'm new to NixOS and so far I'm loving it! I'm in the middle of the process of "nixifying" all my stuff, and I've found a problem that I've not been able to solve yet: When using LibreWolf on my Mac OS laptop, I can easily add exceptions to store cookies from the padlock icon in the search bar, as you can see in the screenshot, so I don't have to re-login to some sites every time I open my browser. The problem is that on my NixOS laptop there is not such an option. I have compared settings in both setups, and they both look the same. I even tried explicitly setting pref.privacy.disable_button.cookie_exceptions to false, but no luck. The option is still not showing in the padlock menu. Here's my LibrefWolf config, in case you are curious.

I know I can manually add exceptions in the settings page, but doing it directly from the search bar is way more convenient.

I searched all around the interwebs before writing this post, but I found nothing. Does anyone know how can I enable this option? Thanks a lot!

13
 
 

Howdy, I'm hoping someone can offer me some insight here because I've been stuck on this problem for an embarrassing amount of time.

I'm using flakes on a NixOS system. The basic outline of my flake.nix I lifted from this repo: https://github.com/notthebee/nix-config. I have one system I don't want to include home-manager, so I'm trying to make the home-manager configuration function (homeManagerCfg) in flakeHelpers.nix only be called if the extraModules list includes home-manager (stable or unstable or other).

I've tried everything I can think of so any help would be really appreciated here, thanks.

14
 
 

I'm rebuilding my home server in nixos.

Rather that configuring the various services natively in nixos, I decided to run containers via virtualisation.oci-containers whenever possible, mostly to be able to independently update the system and the various services.

Everything is going smoothly, but whenever I (for whatever reason) do nixos-rebuild boot and reboot after adding a container instead of nixos-rebuild switch, I run into this issue where podman isn't able to resolve the host (below you see the docker hub host, but it also happened with ghcr.io):

podman-apprise-start[1352]: Trying to pull docker.io/caronc/apprise:1.1.8...
podman-apprise-start[1352]: Pulling image //caronc/apprise:1.1.8 inside systemd: setting pull timeout to 5m0s
podman-apprise-start[1352]: Error: initializing source docker://caronc/apprise:1.1.8: pinging container registry registry-1.docker.io: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io: no such host

I thought that my podman-* services were missing a dependency on network-online and that they were started before the network was available, but it is't the case:

# systemctl list-dependencies podman-apprise.service 
podman-apprise.service
● ├─system.slice
● ├─network-online.target
● │ └─systemd-networkd-wait-online.service
● └─sysinit.target
●   ├─dev-hugepages.mount
[...snip...]

Do you happen to know what the issue is?

PS: Manually running systemctl start podman-whatever once fixes the issue, of course, but I wonder if there's a more robust solution?


update:

After investigating based on balsoft input below, the issue seems to be that systemd-networkd-wait-online doesn't behave as expected (by me).

Basically, systemd-networkd-wait-online waits for network interfaces to have a carrier (working ethernet cable) and an IP address. This is what in systemd-networkd docs is called the "degraded" state (no, it doesn't mean that something got worse than before... don't think too much of what "degraded" implies in English).

In my case, I have an interface that is setup via DHCP and that also has static IPs assigned:

$ cat /etc/systemd/network/00-lan1.network 
[Match]
Name=lan1

[Network]
DHCP=ipv4
IPv6AcceptRA=no
LinkLocalAddressing=no

[Address]
Address=192.168.10.10/24

[Address]
Address=192.168.10.99/24

If you are wondering, the reason I do this is that I want static IPs for my dns server and reverse proxy, but I also want my home server to use DHCP to fetch some network-wide configuration which, critically, includes the default route.

Back to the issue: IIUC, since the interface has a non-link-local address (which systemd-networkd confusingly calls a "routable" address), it is immediately considered "routable" (a state that is moar better than "degraded") and so not only it's basically ignored by the default systemd-networkd-wait-online configuration, but even adding

[Link]
RequiredForOnline=routable

to /etc/systemd/network/00-lan1.network doesn't make a difference whatsoever.

For now, my stopgap solution is to explicitly set the default route for the "lan1" network:

[Network]
Gateway=192.168.10.1

this seems to solve the issue with podman and, while the system still thinks to be "online" before being fully configured, it will suffice until I find a more elegant/robust way (ping me in a while if you are interested).

refs:
systemd-networkd-wait-online man page
systemd-networkd docs on "RequiredForOnline"
networkctl man page

15
15
Any nix RSS feeds? (lm.paradisus.day)
submitted 1 month ago by [email protected] to c/nix
 
 

Does anyone know of any blogs that center around, or frequently discuss nix? My only subscription in freshRSS is NixOS weekly...and thats long since been abondoned.

It'd be really nice if there was some kind of news or ecosystem summary, so I could know about the newest nix projects as well as official sources.

16
9
submitted 2 months ago* (last edited 2 months ago) by [email protected] to c/nix
 
 

After about a month of using Nixos, I realized my apps don't use my discrete gpu. I have an intel cpu with integrated graphics and a discrete amd gpu. On windows I had set all apps to use discrete gpu when the laptop was on power. Before I say more, some info for my system:

Fastfetch outputOS: NixOS 25.05 (Warbler) x86_64

Host: Inspiron 5567

Kernel: Linux 6.12.12

DE: KDE Plasma

WM: KWin (Wayland)

WM Theme: Breeze

Theme: Breeze (Dark) [Qt]

Icons: breeze-dark [Qt], breeze-dark [GTK2/3/4]

Font: Noto Sans (10pt) [Qt], Noto Sans (10pt) [GTK2/3/4]

Cursor: breeze (24px)

Terminal: konsole 24.12.1

CPU: Intel(R) Core(TM) i5-7200U (4) @ 3.10 GHz

GPU 1: AMD Radeon R5 M445 Series [Discrete]

GPU 2: Intel HD Graphics 620 @ 1.00 GHz [Integrated]

Memory: 3.23 GiB / 23.37 GiB (14%)

Swap: Disabled

Disk (/): 88.15 GiB / 195.85 GiB (45%) - ext4

Disk (/home): 514.67 GiB / 716.87 GiB (72%) - ext4

Locale: en_US.UTF-8

My main issue is that my bottles apps (bottles is a wine prefix manager) can't run its wine prefixes with a discrete gpu. I have the nixpkgs version of bottles (not the flatpak one which the developer suggests using). Things I've tried:

  • Enabling/Disabling the "use discrete graphics" option inside the bottle (only the integrated gpu is being used)
  • Launching bottles from command line with DRI_PRIME=1 and bottles opened for a little and then closed, by reporting this:
    terminal output
(process:4413): Gtk-WARNING **: 10:35:38.358: Unknown key gtk-modules in /home/bs/.config/gtk-4.0/settings.ini

(process:4413): Adwaita-WARNING **: 10:35:38.384: Using GtkSettings:gtk-application-prefer-dark-theme with libadwaita is unsupported. Please use AdwStyleManager:color-scheme instead.

(bottles:4413): Gtk-WARNING **: 10:35:39.395: Theme parser warning: style.css:184:3-185:1: Expected ';' at end of block

(bottles:4413): Gtk-WARNING **: 10:35:39.395: Theme parser warning: style-dark.css:23:3-24:1: Expected ';' at end of block
10:35:39 (INFO) Launching with URI: None 
10:35:39 (INFO) [Activate] request received. 
10:35:39 (WARNING) Bottles is only supported within a sandboxed format. Official sources of Bottles are available at: 
10:35:39 (WARNING) https://usebottles.com/download/ 
10:35:39 (WARNING) Please report any issues at: https://github.com/NixOS/nixpkgs/issues 
10:35:39 (INFO) Bottles Started! 

  • Launching the game from command line with DRI_PRIME=1 bottles-cli run -p OuterWilds -b Outer_Wilds after having enabled/disabled the "use discrete graphics" option inside the bottle (kept using the integrated graphics instead)
  • Launching the game from bottles gui, after using the enviroment variable DRI_PRIME=1 and enabling/disabling the "use discrete gpu" option (kept using the integrated graphics instead)
  • Adding the following code to my configuration.nix:
    hardware.graphics = {
    enable = true;
    enable32Bit = true;
    };
    
  • Launching the game from bottles gui, after using the enviroment variable DRI_PRIME=1 DXVK_FILTER_DEVICE_NAME="AMD Radeon R5 M445 Series (RADV ICELAND)" and enabling/disabling the "use discrete gpu" option (it told me that I don't have directX11 installed, but the game should run without it according to steamdb)
  • Setting KDE power profile from "Balanced" to "Performance"

Note that I can launch native apps with discrete gpu by typing in the terminal DRI_PRIME=1 $program_name, where $program_name is the name of the program I want to launch (like SuperTuxKart).

Is there a way to launch bottle apps with my discrete gpu or at least run all of my apps with my discrete gpu? Some extra related links I found, but didn't solve my issue:

links

Cross-posted it at the discourse forum

17
28
submitted 2 months ago* (last edited 2 months ago) by [email protected] to c/nix
 
 

I'm a fan of gaming - my main game is Overwatch. Until this week I've been using xwayland or gamescope to run Wine games which comes with downsides. Xwayland's window management can be buggy - in Gnome I can end up unable to switch back to a game window. Gamescope has some latency and visual artifact issues in my preferred window manager.

But now with the Wine 10 release candidates you can run Wine in native Wayland mode without any special registry settings or anything. And it works very well as far as I can tell! I went through the trouble of figuring out how to get Wine 10 set up on NixOS so I thought I would share.

Wine 10 is currently available in nixos-unstable. The simplest way I've found to get it working for games is to use Lutris, and to install both Lutris and Wine from unstable. To get a complete Wine setup for Lutris use wineWowPackages - for example wineWowPackages.stagingFull. The Full variant includes wine-mono which you'll probably want, and the staging package is the one that worked for me.

I have an overlay that lets me reference unstable packages via pkgs.unstable.${package-name}. With that in place I have this in my NixOS settings:

environment.systemPackages = [
  (pkgs.unstable.lutris.override {
    extraPkgs = pkgs: [
#               ----
#      ↓ same var ↑ 
#     ---- 
      pkgs.wineWowPackages.stagingFull
      pkgs.winetricks
    ];
  })
];

Note that you'll want to use the shadowed pkgs variable introduced in the function given to extraPkgs to reference the wine packages. I think that package set has some extra FHS stuff done to it or something.

If you don't have it already the shortcut for enabling necessary system settings for running games with Vulkan is to enable steam:

programs.steam.enable = true;

You can presumably put the Lutris configuration in Home Manager instead of NixOS by setting home.packages instead of environment.systemPackages. The steam setting needs to be set in NixOS.

When you run Lutris change the Wine runner settings to use the "system default" Wine version, and check the "use system winetricks" toggle.

To make sure that Wine uses Wayland you can unset the DISPLAY environment variable, or set it to an empty string. To do that in Lutris go into the game configuration settings. Under the "System options" tab add an environment variable named DISPLAY, and leave its value empty.

And that's it!

The one issue I've run into is that the Battle.net launcher is a blank black rectangle. The workaround is to run the launcher in gamescope or xwayland, install the game you want, and then re-launch without gamescope in native Wayland. You can start the game you want using the menu from Battle.net's system tray icon so that you don't need to use the launcher UI.

Edit: Thanks @[email protected] for the point about unsetting DISPLAY!

Edit: @[email protected] pointed out that all of the Wine packages on unstable are updated to v10 so I changed the instructions to use stableFull instead of stagingFull.

Edit: stableFull wasn't actually working for me so I switched the instructions back to stagingFull

18
 
 

I've been working on my configuration for a while now using flakes. I can already understand the appeal of flake-parts, and my configuration has always been spread out across multiple files according to specific features. ATM I don't really have any good modules to share, but what's your opinion?

19
 
 

I'm working on small nix flake to standardize the developer environments at my job.

What I'm still missing, however, is a way to clean up after leaving the shell. Some hook to call a shell script, when the shell is closed.

Is there something like this? I thought about wrapping the actual nix develop call inside a bash script and waiting for nix to terminate, but that seems rather hacky.

20
28
Notes on Nix (newsletter.goodtechthings.com)
submitted 2 months ago by [email protected] to c/nix
21
 
 

Auto-updates are enabled on my system, but they're so very unpredictable. Just now had one running, I was thinking "why is my PC lagging" until you hear a symphony of USB connect/disconnect sounds and you realise, "ohh, it was auto-update".

So the question is, is there some kind of way to receive a notification when auto-update is running? Preferably with progressbar. Or maybe a way to get notifications when there are updates available? Thanks!

22
 
 

After around 4 months of reading manuals, forums, watching tutorials and asking online, I've eventually managed to have an almost properly working NixOS installation on my pc and wiped the Win10 partition (I have win10 in a VM as a fallback mechanism)!

I started this journey initially wanting to switch to linux and I started my tests with Debian Stable. But the repo was really old (as expected), so I tried the Testing variant. But this repo had missing packages. I tried Unstable for a few moments too, but I crashed and didn't want to bother. I figured that I could make a script to (declaratively?) fetch and auto update packages from github, bypassing Debian Testing.

Then it was when I looked at NixOS and found out that the whole system kinda does what my script would do, but much much much better. Almost ever since then I tried to learn almost everything I needed and a few extra stuff to get it working. This is the configuration I've come up with so far (it's probably considered simple).

I also made a guide to keep track of what I was doing and what I would have to do once I took the decision to transition to Linux/NixOS, hopefully it might help others too:

https://codeberg.org/BlastboomStrice/LinuxPlan/src/branch/main/LinuxPlan.md

Finally I can be called a Linux user :)

23
13
submitted 3 months ago* (last edited 3 months ago) by [email protected] to c/nix
 
 

Hello everyone, I'm very close to finishing my configuration files for NixOS. I have those working on my nixos installation on my external drive, but before I officially move to nixos I'd like to make sure that I'm not doing something wrong.

Could someone please check my config files? (I only use flakes.nix, configuration.nix, home.nix and hardware.nix and I'd say they aren't much complicated.)

My main concearn is that I probably use the import and modules functions wrong (yet somehow they work?). I've read and watched numerous guides for the last 3 months, but I think I still mess this up😅. I think following a bunch of different guides and videos added to the confusion a bit. (A recent guide I read made me have doubts about my set up.)

This is the link to my nixos configs:

https://codeberg.org/BlastboomStrice/dotfiles/src/branch/main/.config/nixos-conf

Hopefully by the end of the next week I'll be posting here about having transitioned to linux/nixos:)

Sample of probably wrong usage of modules in flakes.nix

    outputs = {self, nixpkgs, ... }@inputs: {
      nixosConfigurations = {
      nixos = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        specialArgs = { inherit inputs; };
        modules = [
          ./hosts/default/configuration.nix

          inputs.home-manager.nixosModules.home-manager
          {
            home-manager.useGlobalPkgs = true;
            home-manager.useUserPackages = true;

            home-manager.users.bs = import ./hosts/default/home.nix;

            home-manager.extraSpecialArgs = { inherit inputs; };
          }

#           inputs.spicetify-nix.nixosModules.default

Sample of probably wrong usage of imports in configuration.nix

imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      #inputs.home-manager.nixosModules.default
    ];

(I think I'm not using home manager in configuration.nix, that's why I've commented it out, and I'm importing it directly in flakes.nix.)

24
 
 

Howdy y'all non-developer trying to understand nix flakes.

25
 
 

Let's make managing infrastructure on your own machine less cumbersome. Simplify it with NixOS and containers.

view more: next ›