Familliar syntax and all of <nixpkgs/lib>
and builtins
in your hands.
Now going through jq
tutorial:
Identity filter
$ # jq
# 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 |
#!/usr/bin/env bash | |
if ! test -e /tmp/nix-nixpkgs-cache; then | |
nix-env -f '<nixpkgs>' -qaP --no-name --out-path \* > /tmp/nix-nixpkgs-cache | |
fi | |
exprs="with import <nixpkgs> {}; (pkgs.runCommandCC or pkgs.runCommand) \"instantiate\" { buildInputs = [ $* ]; } \"\"" | |
exprsDrv=$(nix-instantiate -E "$exprs" 2> /dev/null) | |
for drv in $(nix-store -qR "$exprsDrv"); do |
{ | |
packageOverrides = pkgs: { | |
lnl.vim = pkgs.vim_configurable.customize { | |
name = "vim"; | |
vimrcConfig = { | |
customRC = '' | |
source $HOME/.vimrc | |
''; | |
vam.pluginDictionaries = [ | |
{ names = [ "youcompleteme" "fzfWrapper" ]; } |
{ config, lib, pkgs, ...}: | |
with lib; | |
{ | |
nix.package = pkgs.nixUnstable; | |
nix.trustedUsers = [ "hydra" ]; | |
nix.binaryCaches = [ "http://cache.example.org" "https://cache.nixos.org" ]; | |
nix.buildMachines = [ |
from __future__ import print_function | |
import sys | |
import tokenize | |
_is_declarative = True | |
with (getattr(tokenize, 'open', open))('setup.py') as setup_py: | |
_lines = [] | |
for line in setup_py: | |
if _is_declarative and line.strip() not in ['import setuptools', 'from setuptools import setup', 'setup()', '']: |
sandbox = true | |
extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env |
#!/usr/bin/env bash | |
sudo mkdir -p /run/nix/current-load | |
sudo launchctl unload /Library/LaunchDaemons/org.nixos.nix-daemon.plist | |
sudo rm /Library/LaunchDaemons/org.nixos.nix-daemon.plist | |
sudo curl -fsSL -o /Library/LaunchDaemons/org.nixos.nix-daemon.plist https://gist.github.com/LnL7/ba2eac19e77cd6b4bb02c8de03bf5f4e/raw/69722c2b13c4eb022a1312cd6891838b413e1f96/org.nixos.nix-daemon.plist | |
sudo launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist | |
# Configure /etc/nix/machines | |
# Make sure root can ssh to the builder (known_hosts etc.) |
Python is used throughout Nixpkgs. We use it for certain scripts, we provide Python libraries, and we provide applications. There are several methods on how to use Python on Nix, each with their pros and cons. An overview of all issues with the current Python infrastructure on Nix is available in the placeholder issue 1819.