From 2f54aa81c973d4ba110904a59ebbad0f0a570827 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Mon, 3 Feb 2025 15:32:09 +0100 Subject: [PATCH] docs --- NixOS.md | 57 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/NixOS.md b/NixOS.md index 03f1137..9d0f51c 100644 --- a/NixOS.md +++ b/NixOS.md @@ -33,10 +33,11 @@ This document contains general notes about NixOS that are independent of my NixO * [Evaluate expressions in the context of a NixOS configuration managed with Colmena](#evaluate-expressions-in-the-context-of-a-nixos-configuration-managed-with-colmena) * [Evaluate expressions](#evaluate-expressions) * [Escape strings](#escape-strings) - * [Run AppImages](#run-appimages) * [Audio troubleshooting - Realtek ALC898 Audio Codec on ASRock Z77 Extreme 4](#audio-troubleshooting---realtek-alc898-audio-codec-on-asrock-z77-extreme-4) * [Graphic drivers](#graphic-drivers) * [XDG mimes, desktop files](#xdg-mimes-desktop-files) + * [nix-shell - Development Environments](#nix-shell---development-environments) + * [Run AppImages](#run-appimages) * [Additional resources](#additional-resources) * [Nix Pills](#nix-pills) * [Papers](#papers) @@ -823,21 +824,6 @@ Indented strings (e.g. `''foo bar''`): URIs can be written without quotes (e.g. `http://example.org/foo.bar`). -## Run AppImages - -* https://nixos.wiki/wiki/Appimage - -```shell -# Note how your shell prefix changes. -nix-shell -p appimage-run -``` -```shell -# Inside the shell, you can run an AppImage: -appimage-run ~/Downloads/ubports-installer_0.10.0_linux_x86_64.AppImage -``` - -See the [binfmt option](https://nixos.org/manual/nixos/stable/options#opt-programs.appimage.binfmt) to e.g. run AppImages of other processor architectures. - ## Audio troubleshooting - Realtek ALC898 Audio Codec on ASRock Z77 Extreme 4 TODO: I couldn't get the onboard audio to work. @@ -1011,6 +997,45 @@ xdg-mime query default text/html #=> firefox.desktop ``` +## nix-shell - Development Environments + +Add packages to `PATH` and run `bash` command: + +```shell +nix-shell -p ungoogled-chromium --run 'chromium' +``` + +Add packages from `unstable` channel: + +- https://discourse.nixos.org/t/selecting-a-channel-with-nix-shell/4247/4 +- https://discourse.nixos.org/t/selecting-a-channel-with-nix-shell/4247/8 + +```shell +# This doesn't seem to work! +#nix-shell -p pmbootstrap '' --run 'pmbootstrap -V' + +nix-shell -I nixpkgs=/nix/var/nix/profiles/per-user/root/channels/unstable -p pmbootstrap --run 'pmbootstrap -V' +# or +NIX_PATH=nixpkgs=/nix/var/nix/profiles/per-user/root/channels/unstable nix-shell -p pmbootstrap --run 'pmbootstrap -V' + +nix-shell -p '(import {}).pmbootstrap' --run 'pmbootstrap -V' +``` + +## Run AppImages + +* https://nixos.wiki/wiki/Appimage + +```shell +# Note how your shell prefix changes. +nix-shell -p appimage-run +``` +```shell +# Inside the shell, you can run an AppImage: +appimage-run ~/Downloads/ubports-installer_0.10.0_linux_x86_64.AppImage +``` + +See the [binfmt option](https://nixos.org/manual/nixos/stable/options#opt-programs.appimage.binfmt) to e.g. run AppImages of other processor architectures. + ## Additional resources * Simple NixOS flake template for NixOS with HomeManager. https://github.com/Misterio77/nix-starter-configs#readme