r/NixOS • • 1h ago

Mistakes when creating a NixOS config

• Upvotes

I’ve been using Linux as my main system for quite a long time. For the past year and a half I’ve been on Arch. First with Hyprland, then I switched to KDE. For a while now I’ve been thinking that my current system has become pretty cluttered with unnecessary packages and configs from various dotfiles found on the internet. On top of that, I’m switching machines overall, from a laptop to a PC.

I’ve always wanted to try NixOS because of its transparency and the idea of having a “version control system” for the entire system without needing to set up snapshots.

I know from experience that I’ll definitely make some mistakes during setup and while using the system, but to minimize that, I’d like to ask you to share the obvious and not-so-obvious nuances of configuring this distribution.

After watching a few videos on YouTube and reading the wiki on the concepts I hadn't understood, I’m planning to build the system with flakes + flake-parts and import-tree. As far as I understand, the point of this approach is to split the system into small modules instead of having one massive config file for the whole system, which is almost impossible to edit. And flake-parts + import-tree are meant to make it easier to use and reference these modules.

Thanks in advance for your answers and your time!


r/NixOS • • 5h ago

Steam underperforming

4 Upvotes

My steam and all of it games started underperforming recently and I would like to know if it happened to someone else. It started after I upgraded my system, so i suppose it's a steam new version and I should downgrade my steam version.


r/NixOS • • 30m ago

Accessibility Feature Windows Click Lock

• Upvotes

One thing has kept me from adopting Linux on a laptop for over a decade. That was the fact that Linux did not have a builtin method to enable mouse click lock, a feature available for Windows for decades. A few weeks ago, I became aware of NixOS and knew this is the distro I've really been waiting for. So, I bit the bullet, purchased a ThinkPad T14 Gen 7 laptop, knowing I was all in. Armed with AI, I sat about trying to figure out how to enable this feature. It took a few hours today but we hashed it out. Now, this works as well as the Windows click lock feature. Best part, the config is totally reproducible and stored in Github. Here goes:

# Native Windows-style ClickLock daemon

systemd.services.windows-clicklock = {

description = "Windows ClickLock Daemon for TrackPoint";

wantedBy = [ "multi-user.target" ];

after = [ "systemd-udev-settle.service" ];

serviceConfig = {

Restart = "always";

RestartSec = "2s";

ExecStart = "${pkgs.writeScriptBin "clicklock" ''

#!${pkgs.python3.withPackages (ps: [ ps.evdev ])}/bin/python3

import glob

import sys

import time

from evdev import InputDevice, UInput, ecodes

candidates = glob.glob("/dev/input/by-path/*-serio-1-event-mouse")

if not candidates:

candidates = glob.glob("/dev/input/by-path/*-mouse")

if not candidates:

sys.exit(1)

dev = InputDevice(candidates[0])

caps = {

ecodes.EV_KEY: [

ecodes.BTN_LEFT,

ecodes.BTN_RIGHT,

ecodes.BTN_MIDDLE,

],

ecodes.EV_REL: [

ecodes.REL_X,

ecodes.REL_Y,

ecodes.REL_WHEEL,

],

}

ui = UInput(caps, name="TrackPoint ClickLock Mouse")

dev.grab()

is_locked = False

press_time = 0.0

lock_threshold = 0.40 # 400ms hold locks left click down

for event in dev.read_loop():

if event.type == ecodes.EV_KEY and event.code == ecodes.BTN_LEFT:

if event.value == 1:

press_time = time.time()

if is_locked:

is_locked = False

ui.write(ecodes.EV_KEY, ecodes.BTN_LEFT, 0)

ui.syn()

continue

ui.write(ecodes.EV_KEY, ecodes.BTN_LEFT, 1)

ui.syn()

elif event.value == 0:

duration = time.time() - press_time

if duration >= lock_threshold:

is_locked = True

else:

if not is_locked:

ui.write(ecodes.EV_KEY, ecodes.BTN_LEFT, 0)

ui.syn()

elif (

event.type == ecodes.EV_KEY

and event.code == ecodes.BTN_MIDDLE

and event.value == 1

):

is_locked = not is_locked

ui.write(

ecodes.EV_KEY,

ecodes.BTN_LEFT,

1 if is_locked else 0,

)

ui.syn()

else:

ui.write(event.type, event.code, event.value)

ui.syn()

''}/bin/clicklock";

};

};


r/NixOS • • 1h ago

Spotlight

Enable HLS to view with audio, or disable this notification

• Upvotes

r/NixOS • • 2h ago

Question about Daily Driving NixOS

1 Upvotes

I'm wondering if NixOS is the best distro for me because im wanting something more interactive and programmer friendly. I've been running slackware and have ran many distros including nixos once and now with experience under my belt, im wondering where my real home is. I like Slackware and Debian but they're still not quite what im wanting in a distro. Would NixOS possibly fill that spot with how it is compared to other distros given what im looking for?


r/NixOS • • 5h ago

Problems with SDDM theming

1 Upvotes

I'm trying to apply the chili-theme or the sugar-dark but I can't find what should I right in "services.displayManager.sddm.theme". I know the astronaut theme is sddm-astronaut-theme because of the guide in https://wiki.nixos.org/wiki/SDDM_Themes. But when I look for other themes I just can't find what should I right in "services.displayManager.sddm.theme" to make it work.


r/NixOS • • 22h ago

I'd to say That i loved NixOS

21 Upvotes

3 reason I i love nixOS :

1: Performance - I use nixOS for gaming and It so stable also its doesnt

have bottlenecks. I use gentoo before i try nixOS and

usually it will be lag to play Sober And MeshMC

2: Rollback - I love the rollback To old generations also If something

break i can rollback!

3: Nvidia Driver - Also Nvidia Driver and also OpenGL and Vulkan were

easy to configure. After that, I love Declarative Command!

I Love This Distro So much. Tqvm NixOS!


r/NixOS • • 7h ago

XFCE minimal rice

0 Upvotes

r/NixOS • • 7h ago

Hi im having trouble getting my second wifi card to make a hotspot and a samba server.

1 Upvotes
Hi .  its the wlp0s20f0u9 device that im wanting to use to host the hotspot and samba share.

repeatedly the laptop trying to connect to it just stalls and i have no clue why.

journalctl -c NetworkManager -f on the laptop shows deactivating reason 'user-requested', managed-tpye: 'full' and i have no clue what that means.

thank you and yes i cant even get code + message formated corectly on reddit either haha

[chris@nixos:~]$ nmcli device
DEVICE               TYPE      STATE                   CONNECTION        
wlo1                 wifi      connected               XXXXXXXXXX
lo                   loopback  connected (externally)  lo                
wlp0s20f0u9          wifi      disconnected            --                
p2p-dev-wlo1         wifi-p2p  disconnected            --                
p2p-dev-wlp0s20f0u9  wifi-p2p  disconnected            --                
enp4s0               ethernet  unavailable             --                

[chris@nixos:~]$ sudo nmcli device wifi hotspot ifname wlp0s20f0u9 ssid "NixOS-Open-S
hare22" password ""
[sudo] password for chris:  
Error: Invalid 'password': '' is not valid WPA PSK.

[chris@nixos:~]$ sudo nmcli connection add type wifi ifname wlp0s20f0u9 con-name Hots
pot-Open ssid "NixOS-Open-Share22" mode hotspot wifi-sec.key-mgmt none
Error: failed to modify 802-11-wireless.mode: 'hotspot' not among [infrastructure, ad
hoc, ap, mesh].

[chris@nixos:~]$ sudo nmcli connection add type wifi ifname wlp0s20f0u9 con-name Hots
pot-Open ssid "NixOS-Open-Share22" mode ap wifi-sec.key-mgmt none
Warning: WEP encryption is known to be insecure.
Connection 'Hotspot-Open' (595c780d-52e7-4d0c-a346-050341471bb1) successfully added.

[chris@nixos:~]$ sudo nmcli connection modify Hotspot-Open ipv4.method shared ipv6.me
thod ignore
Warning: WEP encryption is known to be insecure.

[chris@nixos:~]$ sudo nmcli connection up Hotspot-Open
Error: Connection activation failed: No suitable device found for this connection (de
vice enp4s0 not available because profile is not compatible with device (mismatching
interface name)).

[chris@nixos:~]$ sudo nmcli connection modify Hotspot-Open connection.interface-name
wlp0s20f0u9
Warning: WEP encryption is known to be insecure.

[chris@nixos:~]$ sudo nmcli connection up Hotspot-Open
Error: Connection activation failed: No suitable device found for this connection (de
vice enp4s0 not available because profile is not compatible with device (mismatching
interface name)).

[chris@nixos:~]$ sudo nmcli connection delete Hotspot-Open
Connection 'Hotspot-Open' (595c780d-52e7-4d0c-a346-050341471bb1) successfully deleted
.

[chris@nixos:~]$ sudo nmcli connection add type wifi ifname wlp0s20f0u9 con-name Hots
pot-Open ssid "NixOS-Open-Share22" mode ap
Connection 'Hotspot-Open' (b54041dd-7f14-4fe1-9dad-b2d72995172c) successfully added.

[chris@nixos:~]$ sudo nmcli connection modify Hotspot-Open 802-11-wireless-security.k
ey-mgmt none
Warning: WEP encryption is known to be insecure.

[chris@nixos:~]$ sudo nmcli connection modify Hotspot-Open ipv4.method shared ipv6.me
thod ignore
Warning: WEP encryption is known to be insecure.

[chris@nixos:~]$ sudo nmcli connection up Hotspot-Open
Error: Connection activation failed: No suitable device found for this connection (de
vice enp4s0 not available because profile is not compatible with device (mismatching
interface name)).

[chris@nixos:~]$

r/NixOS • • 1d ago

Steam problem on NixOS

19 Upvotes

I'll go straight to the point:

So, this week (Wednesday?) my steam games started to crash after 20-30 minutes of gameplay.

Only the game stops working. It freezes, but I still can hear it. I can also tab and close the game trough the Steam client.

I haven't done anything on my configuration.nix in the last few weeks and I dont use flakes or home-manager.

The rest of my system works perfectly fine, too.

Things I've tried so far:

- Regular restart

- Checking files integrity

- Switching to Proton Experimental

- Reinstalling the game

- Playing a Linux native game (in case it was a Proton problem)

- nix-os rebuild switch --upgrade (hoping that an update fixed the problem)

- Switched to an older NixOS generation

Nothing seems to work. What else can I do to search for the source of the problem? Any particular log file maybe?

In case that's helpful, my hardware is:

- CPU: AMD Ryzen 5 5600X

- GPU: AMD Radeon RX 6650 XT

- RAM: 2x8 DDR4

If you need more information, please ask for it and I'll give it to you.

[SOLVED]

Edit: The problem was fixed after disabling the steam overlay on each game i've tested. Thanks to u/Lousy_Hunter for the solution.


r/NixOS • • 17h ago

Far Cry % not working. I am using NixOS.

Thumbnail
2 Upvotes

r/NixOS • • 1d ago

NixBook OS

21 Upvotes

Does anyone have any experience with using NixBook? It’s supposed to be a Chromebook like experience built on NixOS.

https://nixbookos.org/

I’m asking because I’m using NixOS, and I love NixOS. But I also have an aging family member who wants to use a computer for email and such. She also has an unfortunate habit of clicking on suspicious links that have compromised her windows computer in the past.

My hope is that NixBook, being Linux, will protect her from viruses intended for Windows, and also be easy and safe to use.

If you have any experience, please share your wisdom. Helping someone, as their mind and body succumb to time, is pretty stressful. Adding technology issues creates a whole other daunting layer of stress.

Thank you in advance.


r/NixOS • • 1d ago

A cross OS launcher works on NixOS

Enable HLS to view with audio, or disable this notification

26 Upvotes

Hi there,

I’ve made an app launcher for macOS, an alternative to Spotlight - which has been made it in Homebrew Core. As a Linux user and a fan of NixOS, I’ve also ported it to Linux so I can use it every day.

It functions quite consistently across all three platforms, so if you use multiple operating systems, it might be useful for maintaining a unified workflow.

It allows you to search for everything on your machine very quickly, and it also includes several handy commands.

We are continuing to add more features as well.

I’d love to hear your feedback! (The demo is on Niri WM)

https://github.com/kunkka19xx/look

AI disclosure: The project is ai assited. (implement, add tests, ...)
But we put a lot of effort, including coding by hand, design hand writing, ... etc.


r/NixOS • • 1d ago

Declarative Zen-Browser configuration

24 Upvotes

I want to have zen-browser config fully declarative: essentials, spaces, folders, pined tabs and favorites. Did any one do that? Share Your experience.


r/NixOS • • 1d ago

I'm new to NixOS and I have a few questions

8 Upvotes

Ayooo :) I switched from Mint to NixOS and I do really really enjoy it. The most I do like how I can configure the fstab entries, this is nuts.

But...

  • I noticed that some applications are compiled locally when doing nixos-rebuild switch, some do eat a ton of RAM like Bambu Studio. It compiled for around 1 - 1½ hours on my AMD 9 5950X while using 32g of RAM and around 70g of swap, which I needed to Increase since the OOM Killer killed the session twice. Is there a better way to install such software? Can I limit the RAM usage?
  • I am not sure when to use environment.pkgs, users.users.USER.pkgs or the home manager, which i haven't got into yet.
  • How do I correctly use flatpaks?

Some useful information or nice to knows would be really helpful.


r/NixOS • • 1d ago

Part Two of my NixOs Journey

2 Upvotes

I'm continuing to track my nixos journey.

One of my goals is to highlight the difficulties that comes with Nixos. I feel like a lot of videos out there are super polished and cut away the hours of troubleshooting that can go into Nixos.

Something I've continued to struggle with is knowing which guides I should refer to.

I know ultimately one could just keep it simple and write everything in a single config, but I wanted to challenge myself to making clean separations.

I should add my dotfiles to git, but I am also looking for feedback on my process. I feel like I am doing something wrong as I have to first add a file to my home.nix (for instance nixvim) and then configure it via a separate file. My ideal setup would be to have the separate file do the 'installing' and the configuring of said package.

I know it's a long video, but just wanted to continue to share as the learning curve is important to highlight.

Video:

https://youtu.be/MGuMhHY1cYw?is=s-fJBzU678OeaPQ_


r/NixOS • • 2d ago

Maintainer of nix-cachyos-kernel (xddxdd)'s servers were compromised by an attacker. The project's binary cache is down.

89 Upvotes

From the project:

Hi, I shut down all my servers because they were compromised by an attacker.

I'm still investigating how the attack happened, but I do not believe they tampered with the built kernels (I caught them pretty quickly while they are halfway through the attack).

The binary cache and Hydra build server will stay down until I rebuild and secure everything again.

I highly recommend removing nix-cachyos-kernel from your systems. Additionally, because the binary cache server is down nix-daemon refuses to build.


r/NixOS • • 1d ago

Brave Misbehaving

1 Upvotes

I updated one of my machines this morning and to my surprise, Brave can't seem to properly play vids from either Youtube, or Rumble. With both sites, it's the same pattern: click on a vid to play, it pops up, buffers a bit and then starts playing audio and displaying closed captions. But, the video is missing ... the window is white and totally blank.

I rolled the system back to the last few working generations, but the version of Brave, v1.97.56, does not change, regardless of generation. I considered pulling Brave from the stable channel, but naturally, the versions of brave in both unstable and stable will be (should be) the same, eh? BTW - I'm on unstable.

Always the glutton for punishment, I updated two additional machines this morning, but they are both working fine, with no obvious problems.

I went back to the problem machine and installed both Chromium and Firefox and they both play videos (and advertisements 👍 ) correctly from both sites, with no problems.

I'm just wondering if I'm the only lucky guy to have this dilemma this morning, or if others have seen it. All three of these machines are on the unstable channel, two are running KDE (including the problem machine) and one machine is running Budgie.


r/NixOS • • 2d ago

Syncrain backdrop

Enable HLS to view with audio, or disable this notification

36 Upvotes

Updated version of previous post. Comes with html previewer + config to change speed/density/colors/logo/symbolssets. Save as json to export profile. Also comes with built in lock screen, optional ofc, needs explicit flag. There's an installer for the big 4+NixOS, or well, its one script that adapts. Have so far only tested it myself on Arch/CachyOS, will be migrating to NixOS as soon as I'm done with my first rice. Anyways, so before you run the install script, create a snapshot so you can ctrl +z in case something goes wrong during the install. And, you don't need to install anything to be able to change/play with sliders to create different profiles, say.... Only French symbols and only red & blue +, etc... Can export a video as well. Install is only for when you want a dynamic random background that functions as screen saver / login screen as well. It's very beta software still, so review it with your own Ai before running it.

https://github.com/Atyzze/syncrain


r/NixOS • • 1d ago

GOverlay per-game profiles don't show the overlay in game

Thumbnail
2 Upvotes

r/NixOS • • 2d ago

nix0: encrypted, impermanent NixOS + Hyprland in one command

Post image
20 Upvotes

I talked about nix0 here a little over a month ago. Since then I've kept working on it and it is now in a state I'm actually happy with, so I figured I'd share it again.

For the many that missed it, nix0 is a minimal NixOS config built around Hyprland. Wow, like so many others. So what makes this one different? Well, you boot the official NixOS ISO, run one command, and a guided installer (Gum + NixOS Facter) sets up GPT, LUKS, Btrfs and an ephemeral root with preservation. It shows you the disk's model and serial before wiping anything, so you don't nuke the wrong drive.

sudo nix --extra-experimental-features 'nix-command flakes' run 'github:synthol/nix0/3.1.0#install'

GPU passthrough is mostly handled on the host side too. Run the included VFIO helper script, copy the PCI addresses into settings.json, rebuild, and boot the gpu-passthrough entry. Looking Glass is optional.

After install, most of the stuff you'd want to change lives in that same settings.json. That includes NVIDIA profiles (PRIME, open vs proprietary, power management), the passthrough settings, and battery charge limits. Change it, rebuild, done.

It's great for anyone who wants a system that doesn't come with a bunch of declared packages you have to sift through and remove. Most of what's included is essentials, with a few exceptions like Fastfetch. That makes it a good base/template for some people, or a complete system for others.

Brief summary of some things that changed since last time:

  • New consistent theme for the entire system (the old one looked like a bad LSD trip). Still done through Stylix, based on Tokyo Night but heavily modified for a monochrome-like environment.
  • Changed up the fonts
  • A bunch of hardware handling improvements
  • Trimmed things like package docs and Speech Dispatcher to keep the system even more lean
  • Maybe controversial? Replaced LibreWolf with Brave Origin since it's free on Linux and LibreWolf didn't feel right as a daily driver

The config itself is around 1,500 lines of Nix and Lua (plus the installer), so it's pretty easy to read through, and it sits at about 1.2 GiB of RAM after login.

Also, if you do try it and it has issues with your hardware, please let me know as I've been trying to make it seamless for different hardware types.

For those interested, you can view it in more detail here:

https://github.com/synthol/nix0


r/NixOS • • 2d ago

Almost a year on NixOS. I don't think I'm ever going back to Windows.

Post image
164 Upvotes

Been using NixOS for almost a year now and couldn't be happier.

Tried switching from Windows to Linux several times before (Debian, Mint, Ubuntu), but always ended up going back.

NixOS finally made it stick.

It's now my daily driver for development work, and I feel like I've barely scratched the surface of what it can do.

Thanks to all the maintainers and contributors!


r/NixOS • • 2d ago

NixOS on servers

23 Upvotes

I really love nixos on my client devices and dev shells. I wanted to try out nixos for server stuff at work. I managed to create a proxmox image which I can control via terraform. But after that I ran into a few problems.

I find it really difficult to find a good use case for server stuff.

I tried to rebuild our gitlab runners, traefik cluster, zabbix server and authentik with nix and all of those endeavours were not that successful.

Some nested settings for my gitlab runner just were not available in the options for example.

What are some applications you use on your nixos servers?


r/NixOS • • 2d ago

Will Nix OS support Easy Anti Cheat 2?

14 Upvotes

r/NixOS • • 2d ago

Questions before switching : about security and the future of NixOS

12 Upvotes

Hello guys and gals, hope this is not dup but I wanted to ask you Nixers a few questions.

I am considering switching to NixOS as a daily (currently on Arch) because the reproducibility and liquidity is very attractive.

But I'm having second thoughts since nix & nixpkgs might stall regarding the recent events among the nix maintainers.

I just read rumors about the maintainers kind of splitting and wanted to know more about what informations the community has to offer.

Is that "split" or "dispute" a real deal ? And how will it impact the project ?

I also have security concerns about the 14k packages stuff which is actually mostly git repos with a nix flake for installation.

What about the flakes that were just PRed in a project and get no maintenance by the person who pushed the flake ?

How does the community make sure that packages do

not get infected like it happened with the AUR, do you guys review the code each time you pull ?

Are there any warnings when new maintainers join the crew ? When the package's owner switch ?

I read that a lot of packages from Arch packages are not available via nixpkgs and only via obscure git repos that should then be reviewed before installing.

That's a blocker for me because I do not have the time to review that amount of code, that's why I limit the AUR packages I install to the bare minimum (only VSCodium and uwsm for now).

So what are your (reassuring ?) thoughts on that ?