How does "major version upgrades" make it into the "so-so" category? This is one of the best (long term) features of NixOS, since stuff does not really break, you can easily test it with VM tests. What he describes in this seciton is that plasma 6 didn't make it into that "stable" version of NixOS... but it'd be the same on any other distro, more or less?
comments
The comment thread sparked a few new questions for me.
That will likely soon stop working because steam-run is no longer a grab bag for literally every library out there.
What recently changed with steam-run?
Is using pkgs.appimageTools.defaultFhsEnvArgs with pkgs.buildFHSUserEnv a suitable alternative?
#!/usr/bin/env nix-shell
{ pkgs ? import <nixpkgs> { } }:
(
let base = pkgs.appimageTools.defaultFhsEnvArgs; in
pkgs.buildFHSUserEnv (base // {
name = "FHS";
targetPkgs = pkgs: (with pkgs; [
/* add additional packages here e.g */
pcre
tzdata
]);
runScript = "bash";
extraOutputsToInstall = [ "dev" ];
})
).env
Haha nice, tnx for the posts:)
I'm basically deep into my learning phase of nix, and whenever I find something worthwhile, I like cross posting to read what others may think. It's also a handy means of "bookmarking", recalling what authors I've found so far and when I personally discovered them. Glad you appreciate the current deluge of posts.
That's a good one. Definitely seems selecting substituters closer to runtime is more flexible. Especially when the system may be roaming across networks like a laptop that may move outside your home LAN that links to your local desktop cache.
While not a "default setting", a thing I always suggest is to avoid setting multiple substituters in your config. Instead, set trusted-substituters and trusted-public-keys, and then only set the substituters you need in the nixConfig.substituters attribute of the flake.nix of the project they are needed in (if you're not using flakes,, add a .nix.conf file to your project and export NIX_USER_CONF_FILES="${NIX_USER_CONF_FILES+$XDG_CONFIG_HOME/nix}:$PWD/.nix.conf" to your .envrc)
Hey btw I noticed you recently started making many posts here, tnx for adding activity with useful material to this place:)
Check out the nix config repo from Unmoved Centre:
He is the goat, amazing tutorial. Time to add home manager to manage my dots
Hello Patrick! Thanks for the writeup; gradually incorporating it into my config.
BTW, I recall reading a PR you started on fixing the fallback from failing substituters? This may be of interest to you:
Author here! Actually the first time I’ve ever seen anyone (other than myself) share a post of mine.
If there are any suggestions I’m happy to update it, as noted in the post I’ve had a few people reach out with improvements over the years. It seems like this post in particular is liked the search engines.
I had this earlier. It's a kernel bug, not Tailscale itself. There's an issue on the NixPkgs GitHub.
I think we need to wait for a new kernel to get built (unless you want to patch it yourself...)
Edit: added link to issue
Not sure of the exact problem, but I did see tailscale 1.82.5 (I think) was failing to build on Hydra yesterday with a build error mentioning 'portlist'. So I'd assume it's not just you?
x86-64
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
\[ # Include the results of the hardware scan. ./hardware-configuration.nix \];# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "wwt"; # Define your hostname.
services.openssh.enable = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/Chicago";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8"; LC_IDENTIFICATION = "en_US.UTF-8"; LC_MEASUREMENT = "en_US.UTF-8"; LC_MONETARY = "en_US.UTF-8"; LC_NAME = "en_US.UTF-8"; LC_NUMERIC = "en_US.UTF-8"; LC_PAPER = "en_US.UTF-8"; LC_TELEPHONE = "en_US.UTF-8"; LC_TIME = "en_US.UTF-8";};
# Enable the X11 windowing system.
services.xserver.enable = true;
services.tailscale.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us"; variant = "";};
# Enable CUPS to print documents.
#services.printing.enable = true;
services.gvfs.enable = true;
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true; alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; \# If you want to use JACK applications, uncomment this #jack.enable = true; \# use the example session manager (no others are packaged yet so this is enabled by default, \# no need to redefine it in your config for now) #media-session.enable = true;};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
services.flatpak.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
[redacted]
# Enable automatic login for the user.
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = [redacted];
# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false;
# Install firefox.
programs.firefox.enable = true;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
vim wget screen google-chrome openssh blackbox-terminal gnome-tweaks imagemagick git gimp libreoffice-still pipx python312 sound-juicer yt-dlp brasero cdparanoia moonlight-qt ghostscript];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
}
That is a bizarre looking error. What architecture is your host system? Is your config repo publicly viewable? Installing tail scale is your only build issue?
Still seems a little too idealistic, not sure how this would really shake down with more complex build systems or multilingual projects.
Hey do we have a central place with everyone’s configuration file ?
As roundabout as it sounds I've had good luck using GitHub's code search with language:nix and path:flake.nix modifiers.
E.g, I was looking for complete flake examples to overlay nvidia drivers from the unstable branch/channel, I used this regex:
- https://github.com/search?q=language%3Anix+%2Fhardware.nvidia%2F+%2Fpackage+%3D+.*unstable%2F&type=code
Most folks publishing their configs often have more advance setups, but still nice trace git blame to learn how they evolved.
some config file editor where I can just toggle kde + nvidia drivers +
There is SnowflakeOS this kind of stalled, but that could change with recent improvements to structured edits of Nix:
I think installing NixOS is something that could really benefit from more community mentoring or nearby a local linux user group.
Now that I have a working config for my hardware, I feel like I could explain it all to my old self in under half an hour. But to get to that point of familiarity took a few days. Having someone over your shoulder to save a new user most of any trial and error could go a long way in terms of adoption or bounce rate. It's like subject that can be tricky to approach solo, but could be trivial if tutored even slightly formally.
If you also like me prefer spoken/visual instructions over written forms, I'd also recommend these resources:
unless you hear about GNU Guix and get ready to settle
Hey do we have a central place with everyone's configuration file ? configuration.nix or nix.conf or whatever it is ?
I just want to copy and paste, whatever I want on my system without sacrificing multiple of my precious weekends to the linux gods
Or better yet, can I have some config file editor where I can just toggle kde + nvidia drivers + xlibre + sunshine + steam + libreoffice + lutris and just go already ?
Fine, I'll try NixOS already. Even though I was slightly offended to see emacs used as an example where (n)vim surely should have been used. 😂
What I'm really excited about is automatically editing Nixpkgs meta attrs, e.g. to implement https://github.com/NixOS/rfcs/blob/master/rfcs/0180-broken-package-removal.md
Wow, that's awesome. Hopefully that can breathe some new life into SnowflakeOS! My attempts at manipulating nix code went through a nix parser that I can't remember the name of. That's when I found (or came up with? dunno) the importJson function. But this could be cleaner and more reviewable + definitely allows for things like function calls to take advantage of the "JSON on steroids" aspect the author mentioned.
Thanks for sharing 🙏
@onlinepersona@programming.dev , this could be really useful for advancing programmatic mutation of pre-existing nix config files using graphical installers and user administ ration tools, like with SnowflakeOS: