r/NixOS

[Guide]How to reduce boot time using systemd-boot and hide menu/reveal hidden bootloader menu
▲ 0 r/NixOS

[Guide]How to reduce boot time using systemd-boot and hide menu/reveal hidden bootloader menu

Hello,

For those that want to speed up their boot time, specifically for the loader section as shown as output for systemd-analyze command, while using the standard provided bootloader, systemd-boot, there is the simple option to remove the timeout and changing it to zero, this will not only speed up boot time but also hide the systemd-boot menu.

The change will not affect more advanced setups that use encryption, lvm, RAID, etc., the only thing that will change is the slow down caused by the bootloader selection menu for the entry (generally the current generation) and there are 2 main ways to achieve this

1.Changing the timeout manually and applying only to the current generation

sudo -i

Password

cd /boot/loader

ls

entries  entries.srel  keys  loader.conf  random-seed

nano loader.conf

Example loader.conf

timeout 0
default nixos-generation-20.conf
console-mode keep

Generally the timeout will be 5 which means 5 seconds, change it to 0. With nano, Ctrl and x to exit, y to save changes, Enter to confirm.

The advantage of this solution is that it only applies to the current generation, if you ever forget how to reveal the bootloader entries menu, just use "sudo nixos-rebuild switch" and the new entry will be automatically created with a timeout, thus revealing the menu.

2.Changing the timeout in the NixOS configuration

sudo -i

Pass

nano /etc/nixos/configuration.nix

To the bootloader section add the following line, respect text formatting within the config

  boot.loader.timeout = 0;

Ctrl and x, y, Enter

The example was using nano text editor, use the text editor of choice

Lastly

sudo nixos-rebuild switch

Allow the process to take place then reboot

The new systemd-analyze output should confirm after reboot that the loader section is much faster, example from my system

systemd-analyze
Startup finished in 4.790s (firmware) + 366ms (loader) + 1.959s (kernel) + 3.404s (userspace) = 10.520s  
graphical target reached after 3.403s in userspace.

https://ibb.co/Mx5b6cw9

The advantage of using the NixOS config is that it automatically adds 0 to the /boot/loader/loader.conf entry timeout parameter so every time you rebuild, the timeout remains the same.

To revert back, if using the first solution, redo the steps and change 0 to 5 or as needed, for second solution remove the above line and rebuild, then boot with the new generation.

If you simply want to reveal the systemd-boot menu after it becomes hidden, after pressing the power button, press and hold Esc key, if it does not work, likely pressed too late, it has to be done before the bootloader step, during firmware initialization (while motherboard logo is on screen). Restart and try again.

In general systemd-boot as provided by default now is the fastest bootloader available on x86-64 systems, there are faster non bootloader options like EFI boot stub (guide linked bellow), however the gains are marginal, for my system EFIstub reports 179ms while systemd-boot without timeout arround 360ms (there is slight plus or minus delta per boot session), EFIstub is roughly twice as fast but for normal computers it does not matter, however it could be useful for IoT and applications where really fast boot time is important. As a distro, I completely agree with the use of systemd-boot as standard. Generally people do not care as much about boot performance, instead favor aesthetics so hiding the boot menu could also help them with either systemd-boot or the more technically involved EFIstub.

https://www.reddit.com/r/NixOS/comments/1thifji/guidehow_to_create_efi_boot_stub_on_nixos/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

u/activedusk — 17 hours ago
▲ 2 r/NixOS

learning modules to make it esay but now even more confused

So some of you might know I shared a AI written config couple days ago and it turned out to be bad so I decided that I would rewrite on my own .I read about modules and now trying to migrate my config so that it uses modules instead of just splitting code into different files ...

I already have my nixos config that i wrote when i installed nixos for first time, I came across nixos modules
https://wiki.nixos.org/wiki/NixOS_modules
https://youtu.be/vYc6IzKvAJQ?si=zm3yvPqySKOD-_v5

so I moved modules directory which atm only had normal nix function and not really module out of hosts into separate module dir .

however now I am confused on which things should I extract out into a separate module and which not to . kind of like which file to keep where and what things to extract out into separate module .

for example https://github.com/devnchill/dotNix/blob/enhancement/rewrite/modules/os/services/default.nix is file containing almost all of my services, I moved it outside host but now what things should i move out and make modules and what things not to ?

for reference this is how my old/current config looks : https://github.com/devnchill/dotNix
this is how it's lookin now WIP : https://github.com/devnchill/dotNix/tree/enhancement/rewrite

Reminder: SECRETS ARE GIT ENCRYPTED USING GIT CRYPT AND YES I WILL SOON SWITCH TO SOPS.NIX , THAT IS GOAL OF THIS REWRITE TOO ...

reddit.com
u/Leading-Toe3279 — 12 hours ago
▲ 17 r/NixOS

Using Nix for CI - Builds as Pure Functions by Moritz Jørg at Func Prog Sweden

The quintessential CI pipeline is a shell script wrapped in YAML, running inside a Docker image that silently changes underneath you. But, as all practitioners of Docker-based CI secretly know, a disturbing number of failures come down to environment variance, not actual bugs. In this talk, we will trace the migration of a real F# and Rust application from GitLab CI through self-hosted Forgejo to Garnix, replacing mutable Docker images with content-addressed derivations, as well as replacing 200 lines of workflow YAML with `nix flake check`. The talk assumes no Nix background, only a passing familiarity with pure functions.

youtu.be
u/MagnusSedlacek — 15 hours ago
▲ 21 r/NixOS

Absolutely Loving NixOS

Most recently I finally polished setting up disko and preservation onto my system, and honestly i love NixOS so much. I've been using it for about 4 months straight now give or take and I literally cannot imagine using another distro ever again. My config is at a really nice state for me right now and I'm honestly still constantly looking for new things to add to my flake. My flake manages my systems `athena-nixos` (Desktop), `circe-nixos` (Laptop), and `nyx-nixos` (Server/HomeLab) and it's been a dream. The next major thing I may try again is moving to a dendritic layout since it has always looked and sounded super neat, but feels like so much work and refactoring 😭 but maybe one day....

Also obligatory here is my repo config repo :3

https://dawn.wine/foxtrottt/olympus-nixos.git

EDIT: I forgot to include pictures of my desktop! niri + noctalia-shell my beloved.

https://preview.redd.it/2in33hk72e2h1.png?width=3440&format=png&auto=webp&s=576cd1f4748b668dd8cd85eceb0a4fe9dde968cb

https://preview.redd.it/okmyp27a2e2h1.png?width=1318&format=png&auto=webp&s=f96d7653b7101208d02f438b21b18eda24f6204a

reddit.com
u/duckysocks22 — 22 hours ago
▲ 80 r/NixOS

New to NixOS

Hi! I'm quite new to NixOS after trying Arch and Mint as my first distros. I started using it around 4 weeks ago, and I'm still figuring things out.

Really liked this OS, is the Linux distro that just worked for me, also really liked the community, a lot of things I had difficulty with I could get on forums or here in reddit.

Just sharing my desktop looks, it is not that impressive, just basic Niri + Noctalia, but I like how it feels for me.

Can someone help me understand home-manager? I tried and gave up a while back then and just sticked with flakes, but I'm now trying to style my dolphin but it isn't working, I heard it is very easy with home-manager + stylix, but I'm still learning and home-manager seems a lot more difficult do get.

u/Any_Requirement4592 — 1 day ago
▲ 6 r/NixOS

Partydeck on NixOS

Hello, I'm trying to open 2 instances of a game on my NixOS machine and this program seems to be the only way to do that on Linux, but it's not on nixpkgs, is there any way I can get this to run?

u/_kasiel — 1 day ago
▲ 34 r/NixOS

Why isolation ≠ reproducibility and what that means for dev environments

The post started as a simple explainer on standardized dev environments and turned into something more interesting: a direct comparison between how containers and Nix-style environments actually achieve (or don't achieve) reproducibility.

The short version: containers correlate isolation with reproducibility, but they're not the same thing. A Dockerfile is a procedural recipe that calls out to mutable external systems. Package indexes, install scripts, base image tags. node:22 is a mutable reference. The practical unit of reproducibility ends up being the digest-pinned image, not the Dockerfile that produces it.

Nix, Guix, and Flox approach it differently. Reproducibility is a function of the declared input graph, the lockfile, and the realized store closure. Running flox activate or nix develop against the same definition realizes the same cryptographically-hashed store paths, on any machine, at any time.

To make this concrete, we built the same Python 3.14 + Node.js 25 dev environment four ways: Dockerfile, Guix manifest, Nix flake, and Flox manifest, then walked through how each one resolves (or doesn't) to a reproducible output. The Nix flake and Flox sections include the actual flake.nix and manifest.toml, along with the lockfile behavior.

(Disclosure: this is the Flox account)

flox.dev
u/floxdev — 1 day ago
▲ 40 r/NixOS

NixOS might be the best thing for sandboxed testing stuff!

I wanted to try something timely instead of configuring Neovim or other typical nix activities, so I ended up vibe nixing.

I have to say I'm not taken by it, but also impressed.
NixOS can just spin up fully configured services, point to an LLM locally, setup bridges etc etc. 1 prompt, 1 rebuild command.

If you have some old laptop or mini PC lying around, I highly recommend trying it out.

youtu.be
u/Yametsu — 2 days ago
▲ 11 r/NixOS

If this is wrong, I don't want to be right

I added this module to my nixos configuration:

{ nixpkgs, pkgs, lib, ...}:
let upstreamRegistry = pkgs.fetchurl {
  url = "https://raw.githubusercontent.com/NixOS/flake-registry/refs/heads/master/flake-registry.json";
  hash = "sha256-e56aGI09taupUuZbn3ocfEe4EyOWjWwr/sl8oByiBIw=";
};
upstreamRegistryNix = builtins.fromJSON (builtins.readFile upstreamRegistry); in
{
  nix.settings.flake-registry = pkgs.writeText "registry.json" ( builtins.toJSON {
    version = upstreamRegistryNix.version;
    flakes = upstreamRegistryNix.flakes ++ [ 
      { exact = true;
      from.id = "local-nixpkgs";
        from.type = "indirect";
        to = {
          type = "path";
          path = nixpkgs.outPath;
        } // lib.filterAttrs (n: _: n == "lastModified" || n == "rev" || n == "narHash") nixpkgs;
      }
    ]; });
}

Now I can use:

inputs.nixpkgs.url = "flake:nixpkgs-local"

for building my profile and have my profile use the same version of nixpkgs as my system. Someday someone will make a convincing argument to me why having flakes stop accepting the system registry entries was a Good Thing (surely lockfiles are sufficient?), but until then, I will work around it.

reddit.com
u/Aidenn0 — 2 days ago
▲ 13 r/NixOS

2GB/8GB - Can NixOS work?

I have a Dell Wyse 5010 with 2GB RAM and 8GB storage, and I intend to run it as a PiHole.

However, I would also prefer to have my entire homelab in a Nix flake.

Is this possible, or is 2GB/8GB just too little? I'm happy to actually build everything on my main PC.

reddit.com
u/jerdle_reddit — 2 days ago
▲ 0 r/NixOS+1 crossposts

Ai rewrote my nixos config....

Hello everyone, I started using nixos couple month ago. At that time i wrote the config what felt right to me at that time. however i recieved some suggestions such as move modules out of host to avoid duplication , I came across this repo which I really liked and took inspiration from it. his dotfiles ...

Since I am newbie to nix,I decided to vibecode a rewrite. would help me test how good AI can do it and if it is good,would save me some time.

this is dotfiles written by me
this is dotfiles written by AI

I would be really thankful if you could take a look and see how well/terrible it's done.

Thanks

EDIT -> I really appreciate people dm out of concern for private keys. Those are encrypted throught git crypt and no they are not added by AI, if you look at git history, it's been there since I installed nixos and wrote config on my own ... So yeah those keys are safe to publish . Again thanks for the all the folks who notified me out of concern

u/Leading-Toe3279 — 2 days ago
▲ 193 r/NixOS

Steam Controller (2026) Public Service Announcement

When using the new Steam Controller, Steam will try to check whether a firmware update is available every time the controller is turned on, plugged in, or Steam is started, and on NixOS (and other distros), it'll fail every time.

The issue is that the Steam client uses hidapi for this communication, which isn't installed by default. Here's the fix, if you don't already have hidapi installed in systemPackages:

programs.steam = {
  enable = true;
  extraPackages = [
    pkgs.hidapi
  ];
};

UPDATE: This is no-longer an issue with the beta version of the Steam client. For now, the stable version still needs it.

EDIT: Removed redundant steam-hardware option - as vaibhavsagar pointed out, it's already set by programs.steam.

reddit.com
u/Cyb0lic — 3 days ago
▲ 14 r/NixOS

Overlays with the Dendritic pattern

hey there, i am currently setting up my new dwm config with picom, and I wanted to use the FT-Labs fork, so i looked online, and realized that its not in official repos, so I checked its repo, and found out that it only provides a flake.nix, but I do not understand how I could turn that flake into a package for me to use, please help!

reddit.com
u/bszartur — 2 days ago
▲ 457 r/NixOS

We hit 1 Million Commits on the 'Master' branch 🎉🎉🎉

Not a particularly meaningful milestone, but cool nonetheless! Unstable will also probably reach this milestone in the next week or so, it is currently at 998,543

Thanks everyone, keep up the good work!

u/gayez — 3 days ago
▲ 138 r/NixOS

NixOS Changed How I Think About Operating Systems

Started with Ubuntu, then got bored with the slow update cycle (don’t get me wrong — Ubuntu is still a great distro for its purpose).

Moved to Arch Linux and got excited by the bleeding-edge capabilities, but also spent a lot of time troubleshooting instability issues. I even had a dedicated USB just for Timeshift recovery.

Finally landed on NixOS.

After using it daily for more than a year, my biggest question is:

Why aren’t more people talking about it?

The declarative approach makes systems much easier to audit and maintain, even for a single machine. Rollbacks completely changed how comfortable I feel experimenting with my setup.

Another underrated advantage is that NixOS is extremely LLM-friendly, especially when using one long centralized config file. Explaining your setup, debugging issues, or generating configs becomes surprisingly efficient.

I’m a programmer with fair knowledge of the Nix language now, and I’m planning to start contributing to Nixpkgs next year.

Honestly, NixOS changed the way I think about operating systems entirely.

reddit.com
u/abusen333 — 3 days ago
▲ 8 r/NixOS

How can I create minimal containers from nixpkgs - without extra dependencies?

One of my reasons for taking an interest in NixOS, was the idea of assembling containers more easily from prebuilt packages, rather than running "apt-get install". The advantages are numerous.

But are the nixpkgs usable for containerization? What extra steps should you take? For example:

  • do you create a wrapper package, that only copies over necessary files - or removes unneeded ones?
  • do you compile statically linked for reduced binary size and simpler filesystem layout?
  • ...

I'm currently facing an issue with the 'squid' package, in that it pulls in a bunch of other packages.

image = pkgs.dockerTools.buildLayeredImage {
  name = "squid";
  tag = "latest";
  contents = with pkgs; [
    coreutils
    squid
  ];

  extraCommands = ''
    mkdir -p var/lib/squid
  '';

  fakeRootCommands = ''
    chown -R 1000:1000 var/*
    chmod 700 var/*
  '';

  config = {
    User = "1000";
    Cmd = [
      "/sbin/sh"
    ];
  };
};

This pulls in systemd (/nix/store/11yzh5vk22ybx1abvs42184ydf2hpdj3-systemd-258.7/), which is obviously not needed.

Reviewing the package source code, I therefore tried override,

(squid.override { systemd = null; libcap = null; pam = null; })

and this builds an image without this package.

But it also requires a full rebuild. A major advantage was in being able to use prebuilt packages. I suppose I can use a binary cache, so the hit wont happen so frequently, but it's significant if this has to be done for every package, especially since systemd service definitions are common.

What are my alternatives?

Is there a way to use prebuilt packages, but remove the dependencies after?

u/BeachOtherwise5165 — 3 days ago
▲ 18 r/NixOS

Help: update fatigue

I love NixOS. Biggest gripe / speed bump is managing updates. I commonly find myself running into “oh, I need to update program X, let me do nix flake update and then NixOS-rebuild switch.” However, lots of the time this step has broken packages, takes a really long time, and it makes me reluctant to even use those apps that need to be updated.

How do people handle this pain point? Do people allow rebuild to continue with partial failures? Any auto-update / cachix things I should know about?

I currently have 1 flake.nix with all my sources and everything is nix modules across multiple hosts.

reddit.com
u/Beautiful-Alarm8222 — 3 days ago