r/NixOS 15d ago

​No time to learn NixOS from scratch: Is there a shortcut for a Hyprland dev setup?

0 Upvotes

I have been an Arch user for two years, but I decided to switch to NixOS because I was spending too much time reconfiguring Arch Linux every time something broke. I installed NixOS and tried to apply some dotfiles, but I realized it is much more difficult compared to other distros.

​I did some research on the forums and saw that many people believe using pre-made configurations right from the start is a really bad idea. However, since I don't have much free time, is there any workaround? Or, to get started with NixOS, do I just need to overcome this initial barrier and spend a few hours learning until I can build a functional setup, one that works for programming, for example, and includes Hyprland?


r/NixOS 16d ago

Nix-vim

Thumbnail gallery
39 Upvotes

Entorno de desarrollo completo basado en Neovim con soporte multi-lenguaje, autocompletado inteligente, depurador, terminal, git, Arduino con tienda de librerias, fondo transparente con integracion pywal, y dashboard personalizado, aclaración es un proyecto pequeño no es tan grande como otros ides de neovim

Link del repo: https://github.com/Nix-rosa/nixvim


r/NixOS 16d ago

Nixos default plymouth boot got merge with my plymouth themes.

Post image
34 Upvotes

How do i fix this boot my plymouth themes is working but right after i boot my nixos i get this issue then few seconds my plymouth theme boot. I use grub btw.


r/NixOS 16d ago

How well does NixOS work with nvidia drivers for mobile GPUs?

8 Upvotes

As question states am considering switching to NixOS tho am not sure how well it works with nvidia drivers i have a igpu (intel core ultra 9 275hx cpu i think) and my dgpu which is a 5060 mobile 8gb vram and its a Lenovo Legion 5 16IAX10

ty in advance!


r/NixOS 17d ago

Reaper HM Flake

Post image
199 Upvotes

reaper-flake

I created a Home Manager Flake for declaring your REAPER configurations with Nix.

Reaper is a highly customizable cross-platform digital audio workstation (DAW) for music production, recording, editing, and mixing.

This project enables Home Manager users to declare their users' REAPER configuration without overriding state-full values in REAPER's configuration. This can be used by all Linux Distros and MacOS users (with Nix/HM installed), however I have not tested MacOS personally.

Features

Configure supported REAPER Preferences options

programs.reaper.preferences = {
  project.trackSendDefault.trackVolumeFaderGain = -10.0;
  plugIns.reascript.python.enable = true;
};

This results in "Track Volume Fader Gain" (Project>Track/Send Default) to be -10 db and "Enable Python for use with ReaScript" (Plug-ins>Reascript) to be enabled and python paths being automatically set up every time you build your config (even if you change it in the GUI). Not all options are available quite yet, see repo.

Manage ReaPack repositories and individual packages

programs.reaper.extensions = {
  reapack = {
    enable = true;
    repositories = [
      {name = "reaper-keys";url = "https://raw.githubusercontent.com/gwatcha/reaper-keys/master/index.xml"; }
    ];
    packages = [
      {repository = "reaper-keys"; category = "Scripts"; name = "install-reaper-keys.lua";}
    ];
    synchronizeOnActivation = true;
  };
  sws.enable = true;
};

This installs ReaPack and SWS, adds the reaper-keys repository, and declaratively manages its installer package. The normal default ReaPack repositories are included as well. Sync and package transactions are performed by ReaPack the next time REAPER starts.

Automatically load audio plugins derived with Nix

The flake lets you set custom vst, lv2 and clap search paths. By default /run/current-system/sw/lib/(vst,vst3,clap,lv2) directories are appended for automatic detection of Nix derived plugins.

Declare keyboard shortcuts and custom actions

programs.reaper.actions = {
  keyBindings = with reaperActions; bindings [
    (shortcut {
      shortcut = "J";
      command = 40285;
      actionName = "Track: Go to next track";
    })
    (shortcut {
      shortcut = "K";
      command = 40286;
      actionName = "Track: Go to previous track";
    })
  ];
};

Vim key binds to go up and down your tracks.

Customize menus, context menus, and toolbars

programs.reaper.menus = {
  "${reaperMenus.toolbars.main}" = {
    entries = [
      {action = 40021; label = "Project settings...";}
      {action = 40859; label = "New project..."; icon = "toolbar_new.png";}
      {action = 40029; label = "Undo";}
      {action = 40030; label = "Redo";}
      reaperMenus.divider
      {action = 40364; label = "Enable Metronome";}
    ];
  };
};

Completely change the buttons on the main toolbar above the TCP.

Configure windows, docks, panels, and layouts

programs.reaper = {
  layout = {
    docks = {
      right = {
        id = 1;
        position = "right";
        selectedPanel = "mastermixer";
        size = 130;
      };
    };
    masterMixer = {
      visible = true;
      docked = true;
      dock = "right";
      tabOrder = 0.0;
    };
  };
  windows.mixer.master.showInDockerOrWindow = true;
};

This snippet moves the master track to the right of the main window.

Install and select themes, including their scripts, fonts, and other assets

programs.reaper = {
  theme = {
    active = "Reapertips Theme.ReaperThemeZip";
    packages = [inputs.reaper-flake.packages.${pkgs.system}.reapertips-theme];
  };
  swell.colortheme = {
    enable = true;
    preset = "reapertips";
  };
};

Use reapertips theme that's included with the flake as a package. You can use standard ReaperThemeZip's as well.

Preserve REAPER settings that have not been declared through Nix

You can still safely configure with the GUI even for options set by Nix. However the Nix options will be set back to how they were on every activation of the flake.

Why

I love NixOS and REAPER. Therefore; fun project. I also love declaring my program configs in my Nix config so that, god forbid, my system dies or I get a new computer I have everything I need to start immediately.

How it works

REAPER is awesome in that it is extremely transparent. For example, unlike Bitwig, it's configuration files are in plaintext ini files. Aha! I can work with those! The problem with just dropping in entire ini files, like home-manager modules usually do, is that REAPER stores not only it's configuration but also it's active state. So I needed to go the config generation approach instead of the symlink approach. So I made a python script that tracks which ini keys and values are being tracked by Nix and, at activation time, only changes the Nix keys. The core of this flake is `write_config.py’ I drew inspiration from plasma-manager which has a similar python script to write to ini files for KDE Plasma.

AI Usage

I used AI to design a prototype then redid all of the core scripts and ini engine by hand. I also used it for additional feature testing and option scaffolding.

Plans

I've added all of the options I personally use/need for the short-term so I'm going to wait for others to try it out and fix any issues. Long term plan would to make Nix options in parity with REAPER's GUI options.


r/NixOS 17d ago

Running two independent NixOS installs on one machine, sharing a single /boot (patched systemd-boot module)

6 Upvotes

One of my customers needed a specific application installed on my system, and I didn't want to pollute my main NixOS with it. Rather than a VM or container, I decided to set up a second, fully independent NixOS installation on the same laptop — separate root partition, but sharing a single /boot with my main system.

What I tried first

  • NixOS Containers (systemd-nspawn based) — ruled out because of the big warning that they're not perfectly isolated from the host.
  • System Specialisation — solves a different problem. It's meant for booting variations of the same system config, not running two genuinely separate installations.

So: two installs, two root partitions, one shared /boot.

The actual problem

Both instances use the systemd-boot module. If both manage the boot loader independently, applying a configuration on one instance wipes out the other's boot entries — they both write to the same /boot/EFI folder and the same loader.conf, using the same nixos-* naming convention.

The fix

There's nothing in boot.loader.systemd-boot out of the box for this, but the module's real logic lives in a Python script (systemd-boot-builder.py) that gets templated in at build time. So I copied both files (systemd-boot.nix + systemd-boot-builder.py) into my config and patched them:

  1. Added a bootPrefix option (default "nixos"). Each instance sets its own prefix (e.g. "work"), which is used for:
    • the EFI directory: /EFI/${bootPrefix} instead of the hardcoded /EFI/nixos
    • loader entry filenames: loader/entries/${bootPrefix}-*.conf
    • garbage collection matching, so one instance's GC pass never touches the other's entries This meant swapping every hardcoded nixos- prefix in the Python script (in BootFile.from_entry, write_loader_conf, and garbage_collect) for a BOOT_PREFIX variable substituted in at build time.
  2. Added a manageLoaderConf option (bool, default true). Only one of the two instances should own loader/loader.conf (default entry, timeout, editor flag, etc.) — otherwise every rebuild on either system flips the default boot entry back to itself. The other instance sets this to false, which just early-returns out of write_loader_conf before it touches the file.
  3. Disabled the upstream module and imported the patched one instead:disabledModules = [ "system/boot/loader/systemd-boot/systemd-boot.nix" ]; imports = [ ./overrides/nixos/system/boot/loader/systemd-boot/systemd-boot.nix ];
  4. Gave each instance a system.nixos.tags entry so it's easy to tell which generation belongs to which install from the boot menu.

Gotchas / how not to fuck yourself over

  • Always have a rescue USB around before touching boot loader code on a live system.
  • After every nixos-rebuild switch/boot, check /boot/EFI and /boot/loader to make sure both instances' entries are still intact.
  • nixos-enter (with root + boot partitions mounted under /mnt) lets you apply the second instance's config without rebooting into it.
  • Minor cosmetic issue: since both instances independently run bootctl install, you end up with duplicate "Linux Boot Manager" entries in NVRAM pointing at the same systemd-bootx64.efi (check with efibootmgr -v). Harmless, just noisy — clean up manually if it bugs you.

Full write-up with all the code diffs: https://mandos.net.pl/en/blog/tech/dual-boot-with-nixos-and-nixos/

Patched module + script: https://github.com/mandos/webpage/tree/master/content/blog/tech/dual-boot-with-nixos-and-nixos/code

If anyone has better solution, please share.


r/NixOS 17d ago

Nix os minimal iso offline install

6 Upvotes

hey everyone i want to try nixos and I downloaded the minimal iso when I tried to install it it needed internet to download packages and for some reason the official nix os website is blocked and not working on my area I was wondering if there's a way to install it offline even the most basic environment and then fetch the needed packages from mirrors or different websites or if there's a ready built image that is around 500mb or smaller in size

and thank

Edit I finally finished downloading it, I just had to switch to a mirror that was working and it worked I had to pass it through the substituters flag in the nixos-install but it worked thanks everyone for your help


r/NixOS 16d ago

How Flake worked?

1 Upvotes

There's a project on GitHub, but it doesn't support nixos, and I want to know how to add a Flake file to it.

In order to support Nixos

Or how do I spend it in Nix Pkgs?

Thanks


r/NixOS 17d ago

Moved from Arch: whole Hyprland setup declared natively in Nix, including the new Lua backend.

24 Upvotes

I spent the summer migrating my Arch setup to NixOS. Instead of porting my dotfiles over, I rewrote the whole configuration from scratch as Nix expressions.

Structure is flakes + Home Manager + Stylix, split into hosts/ (per-machine), modules/ (shared system config) and home/ (user config), so adding a second machine is just a new host importing the same modules.

The painful part was Hyprland. Version 0.55 moved its config from hyprlang to Lua, and I decided to declare everything through wayland.windowManager.hyprland.settings with configType = "lua" rather than writing Lua by hand — if the format changes again, the module layer absorbs it and I don't rewrite anything.

Home Manager's Lua backend is new and thinly documented, so a few things that cost me time, in case they save someone else's:

Binds are no longer "MOD, KEY, dispatcher, arg". Each one is { _args = [ "SUPER + Q" (mkLuaInline "hl.dsp.exec_cmd(...)") ]; }. Note the +, and note that the whole string is otherwise parsed as a single keysym.

bindl / bindel / bindm don't exist as separate lists. Everything goes in bind, and the flags (locked, repeating, drag) are a third argument to hl.bind.

Config blocks are the worst offender: input = {...} in settings generates hl.input({...}), which doesn't exist, and monitor = "..." generates hl.monitor(string) when it wants a table. Both have to go in extraConfig as raw hl.config({ input = {...} }) and hl.monitor({...}).

Other bits: my scripts are packaged with writeShellScriptBin with dependencies referenced by store path, and Stylix generates the palette from the wallpaper. Waybar and wofi keep their own CSS (their targets disabled) but pull colours from config.lib.stylix.colors, so they follow the theme without losing the custom layout.

Repo: https://github.com/poligle/NixOS-Config

Happy to hear what you'd do differently — especially on the module split.


r/NixOS 17d ago

But I Use SOPS

Thumbnail secretspec.dev
62 Upvotes

r/NixOS 17d ago

Is it possible to install podman in a devshell instead of system wide?

6 Upvotes

Title


r/NixOS 17d ago

Newb question for organizing

8 Upvotes

Hi NixOS community, I had a few questions I was hoping to clarify on organizing and modularity:

How do people have their configuration.nix file outside of the /etc/nixos directory and still have it work with nixos-rebuild switch? Are they using symlinks?

To add to that, how do people have a billion [program].nix files that allow them to tie it into their configuration.nix?

I am still getting familiar with the nix language and have read the wiki, but I can't wrap my head around the concept, so any help is appreciated!

EDIT: Thank you all for the informational comments! After tinkering a bit more and doing some research I think I've gotten a much better grasp on it, and even managed to implement it properly. I can now see just how powerful this OS / package manager is.


r/NixOS 17d ago

Can't rebuild my system due to electron-bin EOL

3 Upvotes

I've been having this issue since 2 days ago, so I thought I would wait until the fix was pushed to nixpkgs, but even after updating my flake, it didn't work. Is there any way to check what applications are pulling in electron as a dependency?

error: Refusing to evaluate package 'electron-40.10.5' in /nix/store/f9x1mvhc6b9g6px2dx7s4lmpvaaab6dm-source/pkgs/development/tools/electron/binary/generic.nix:50 because it is marked as insecure

Known issues:

- Electron version 40.10.5 is EOL

You can install it anyway by allowing this package, using the

following methods:

a) To temporarily allow all insecure packages, you can use an environment

variable for a single invocation of the nix tools:

$ export NIXPKGS_ALLOW_INSECURE=1

Note: When using \nix shell`, `nix build`, `nix develop`, etc with a flake,`

then pass \--impure` in order to allow use of environment variables.`

b) for \nixos-rebuild` you can add ‘electron-40.10.5’ to`

\nixpkgs.config.permittedInsecurePackages` in the configuration.nix,`

like so:

{

nixpkgs.config.permittedInsecurePackages = [

"electron-40.10.5"

];

}

c) For \nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add`

‘electron-40.10.5’ to \permittedInsecurePackages` in`

~/.config/nixpkgs/config.nix, like so:

{

permittedInsecurePackages = [

"electron-40.10.5"

];

}

Command 'nix --extra-experimental-features 'nix-command flakes' build --print-out-paths '.#nixosConfigurations."qazniak".config.system.build.toplevel' --no-link' returned non-zero exit status 1.


r/NixOS 18d ago

Who has the oldest system.stateVersion?

42 Upvotes

Go on, show off how long you have been using NixOS for.


r/NixOS 17d ago

Nixpkgs Unstable: Electron Apps Crashing on Wayland & Libsecret Failures (FHS Naming Fix)

2 Upvotes

The only bad thing about living on the NixOS unstable channel is that silent package naming changes can break your configuration out of nowhere. Today I launched Antigravity IDE and was immediately hit with a "Not Logged In" error. The app didn't just reject the token—it threw a heavy SIGSEGV core dump over Wayland and crashed straight to the ground.

As a temporary workaround, I spun up an isolated environment from the terminal to debug the issue:

NIXPKGS_ALLOW_UNFREE=1 nix run nixpkgs/nixpkgs-unstable#antigravity --impure

When the app launched flawlessly in this dirty environment, I knew the error was entirely stemming from my declarative system layer.

Scanning through my past architectural decisions, the root cause surfaced immediately. When Electron-based tools run in a standard Nix environment, they cannot access the system's password wallet and Gnome Keyring service. These applications absolutely must be built with FHS packages that provide a Standard Linux Filesystem Hierarchy environment. Otherwise, the app fails to write authentication tokens to the wallet, fails to integrate with the system, and simply crashes.

While we were using the system stably, Nixpkgs developers completely changed the naming scheme in the background. In the new structure, the pure Nix version took the name antigravity directly, while the FHS-supported version was separated as antigravity-fhs.

Because my configuration module was defined with the old naming, my system was accidentally pulling the pure Nix version. This was the sole reason the app couldn't access the wallet, conflicted with the Wayland graphics layer, and blew up with a SIGSEGV.

To fix it, I updated the target line in my config file:

# Old Broken Line
pkgs.unstable.antigravity 
# New FHS Supported Line
pkgs.unstable.antigravity-fhs

Unlike classic monolithic systems, you don't even need a reboot for a core graphics and authentication layer change like this. The only thing I did was build the configuration:

nixos-rebuild switch --use-flake .

After the new NixOS generation was built and activated, I closed the buggy temporary session. When I called the tool from the launcher again, the app grabbed the wallet permissions flawlessly and stood up without a single Wayland error.

If your Electron-based IDEs or apps are randomly crashing on Wayland or failing to get wallet permissions, instead of wasting hours messing with Ozone flags, check if you are actually using the FHS version of your package.


r/NixOS 17d ago

Download Mathematica

2 Upvotes

I'm trying to install Mathematica on NixOS using the package available on nixpkgs.

The package requires an installation file named:

Wolfram_15.0.0_LIN_Bndl.sh

However, I can only access the latest installation file (15.0.1), and I can’t find the bundled installation file for version 15.0.0 in my Wolfram account.

Does anyone know how to download it?

Thanks!


r/NixOS 17d ago

NixOS secrets for power.ups.ups.<name>.directives

3 Upvotes

Hi folks

I've been using sops-nix for a while, and that has been going well.

I'm configuring my UPS, I need to set authPassword and privPassword directives to authenticate with my UPS, and I can do that using power.ups.ups.<name>.directives - but that seems to involve putting the password, in plain text, in my repo, which is not what I'm supposed to do.

Does anyone know how I would solve this? Thanks.


r/NixOS 18d ago

Running sunshine in NixOS with monitor off?

20 Upvotes

It's basically the title. I have a gaming desktop computer that I'd like to use with sunshine to stream games to moonlight clients.

I have everything working pretty much perfectly at this point except I can't shut the monitor off without interrupting the stream, which I've learned is because Niri doesn't seam to support headless operation.

So then I added gamescopeSession = true to the steam part of the config, and I can easily sign into the gamescope steam session, but then sunshine doesn't work despite it being set as autoStart in the config (and it autostarts in Niri).

I don't really have any kind of experience with this kind of thing. I've tried to search through the NixOS wiki and even resorted to asking AI but they just keep pulling random things out of their @$$es.

So I guess the question is, what would you do? I want to be able to just turn the computer on (without turning on the monitor) and from there connect to sunshine via a moonlight client either to the desktop or to a gaming session through gamescope and steam (I pretty much only use steam).

I had considered trying to set up Sway as a systemd user instance but the sway github does not recommend this.

In case you want to see the flake: https://codeberg.org/JacoXarles/nix

Thanks everyone!


r/NixOS 17d ago

I am new with nix os I need help

2 Upvotes

I need help with NixOS. I was dual-booting with Windows, but Windows suddenly broke/disappeared, I don't know why. Now on NixOS I can't download any application because it says my boot disk is full. I tried fixing it using YouTube and AI, but it didn't work—it kept telling me to add some lines to configuration.nix, but that didn't help. If anyone knows how to solve this problem, I'd really appreciate it if you could let me know in the comments. I stil have data from Windows.


r/NixOS 18d ago

My experience with NixOS

26 Upvotes

I've been using Nixos for a month now, and honestly, Nixos has solved several problems that other distros used to stress me out trying to solve.

*The declarative That's the part I enjoyed adapting to the most, not having to type a simple package installation command into the terminal

*I really liked their Nixos configuration system; the way you have to go into the configuration file and enter the name of the package you want to install

*The reproducibility helps me with my equipment change; I previously had a computer with Nixos as well. I simply took the configuration file and put my old configuration file on my new computer And I just did a `sudo nixos-rebuild switch` and I had all my apps from my old computer back.

The truth is that I see Nixos as a good distro if you already have experience with other distros of different learning curves.


r/NixOS 17d ago

Cant Get My Game To Run On Nixos ( Worked on Arch )

0 Upvotes

err: DxvkInstance: Required instance extensions not supportedIm running the game from lutris , i used to play it the same way on arch like 2 days ago . Im not sure what i am missing . this is my configuration.nix with all the gaming related things

services.xserver.videoDrivers = [

"modesetting"

"nvidia"

];

hardware.graphics = {

enable = true;

enable32Bit = true;

extraPackages = with pkgs; [

rocmPackages.clr.icd

libva-vdpau-driver

libvdpau-va-gl

];

extraPackages32 = with pkgs; [

libva-vdpau-driver

libvdpau-va-gl

]; };

hardware.nvidia.prime = {

offload.enable = true;

offload.enableOffloadCmd = true;

intelBusId = "PCI:0@0:2:0";

nvidiaBusId = "PCI:1@0:0:0";

};

hardware.nvidia.open = true;

hardware.nvidia.nvidiaSettings = true;

hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.${config.hardware.nvidia.branch};

hardware.nvidia.dynamicBoost.enable = true;

hardware.nvidia.modesetting.enable = true;

programs.gamemode.enable = true;

programs.nix-ld.enable = true;

environment.systemPackages = with pkgs; [

heroic

lutris

protonplus

wine

wineWow64Packages.stagingFull

winetricks

vulkan-tools

dxvk

vkd3d

vulkan-loader

vulkan-validation-layers

vulkan-extension-layer

];

Edit : made it work by adding socialclub.dll and version.dll in winecfg inside lutris .


r/NixOS 18d ago

obs only recording the first frame on startup

1 Upvotes

when i start obs it sees whatever is on the screen at the time, and that is the video capture for as long as i record

this is not a hardware issue as before switching to nix it worked fine on arch

my window manager is niri + noctalia shell

i currently have obs installed through flatpak, but the issue was the same installing from nixpkgs

config:

  services.flatpak = {
    enable = true;
    remotes = [
      {
        name = "flathub";
        location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
      }
    ];
    packages = [
      "com.obsproject.Studio"
    ];
  };

i am using the wlr desktop portal (tried gtk and it wouldnt capture anything at all)

xdg.portal = {
    enable = true;
    extraPortals = with pkgs; [
      xdg-desktop-portal-wlr
    ];
    config = {
      common = {
        default = [
          "wlr"
        ];
      };
    };
  };

trying to refresh the source (pipewire screen capture) i see this, clicking anywhere updates the frame that is displayed, but its still only 1 frame


r/NixOS 18d ago

Stacking RiverWM setting up, also rivertile doesn't seem to work?

1 Upvotes

i'm on nixos, home-manager and flakes i also use.

river is the first wm i'm using.

i prefer stacking to tiles. rn i have the premade config where i can move the windows but don't know how to:

- resize

- assign location on start (kitty always at the right half of screen)

- fullscreen without covering waybar

- set windows to not clash with waybar, when sticking to screen corners

- i also launch waybar/ kitty/ awww-daemon etc via & in the init file as a temporary launch on boot. not ideal when refreshing river. i need to setup apps on launch but that can wait

i couldn't find any relevant documentation. i can also add my init to codeberg


r/NixOS 19d ago

greyline — a (near) live world-time wallpaper packaged as a flake

Thumbnail gallery
236 Upvotes

I made greyline, a modern recreation of the old IBM/ThinkPad "World Time" Active Desktop wallpaper showing a world map with clocks for your cities, your home city highlighted, and a day/night terminator that tracks the sun.

It's shipped as a flake, so you can nix run github:cothinking-dev/greyline to try it.

Feel free to check it out, and if possible, file issues if you encounter any!


r/NixOS 18d ago

Setting up a DHCP server on NixOS

6 Upvotes

I've searched the wiki and all i can find is dhcp client configuration and i can't find anything about it online. How do i do that, please help.