Skip to content

Instantly share code, notes, and snippets.

@JohnRTitor
Last active July 12, 2024 15:45
Show Gist options
  • Save JohnRTitor/4cfdc99c853f5a82e4f8ac5e3679fd7e to your computer and use it in GitHub Desktop.
Save JohnRTitor/4cfdc99c853f5a82e4f8ac5e3679fd7e to your computer and use it in GitHub Desktop.
Nix Tips and Tricks

Build normal packages - x64

nix build .#hello

Build 32 bit packages - x86

nix build .#pkgsi686Linux.hello

Cross compile aarch64-linux binaries on x64-linux

nom build .#legacyPackages.x86_64-linux.pkgsCross.aarch64-multiplatform.hello

Nix run/build with override

nix run --impure --expr '(builtins.getFlake "github:nixos/nixpkgs/nixpkgs-unstable").legacyPackages."${builtins.currentSystem}".discord.override {withVencord = true;}'
@JohnRTitor
Copy link
Author

Build NixOS manual for NixOS module PRs:

nix build github:nixos/nixpkgs/refs/pull/322591/merge#htmlDocs.nixosManual.x86_64-linux --print-out-paths

@JohnRTitor
Copy link
Author

JohnRTitor commented Jul 2, 2024

Simple nix repl evaluation check

nix repl --expr 'import <nixpkgs>{}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment