Skip to content

Instantly share code, notes, and snippets.

@therealpxc
therealpxc / homebrew.hm.broken.nix
Last active April 24, 2024 18:39
a Home Manager module for Homebrew, copied from the Nix-Darwin module for Homebrew
# Created by: https://github.com/malob
{ config, lib, options, pkgs, ... }:
with lib;
let
cfg = config.homebrew;
brewfileFile = pkgs.writeText "Brewfile" cfg.brewfile;
@therealpxc
therealpxc / themis-macOS-bootstrap.zsh
Last active November 20, 2021 00:23
pre-Nix setup script for a fresh macOS install
#!/bin/zsh
# in case you need to review these flags, see: https://gist.github.com/mohanpedala/1e2ff5661761d3abd0385e8223e16425
set -euxo pipefail
# in some places (for instance, installing pkgsrc), we just assume x86_64
test "$(/usr/bin/uname -m)" = "x86_64"
pushd "$(mktemp -d)"
@therealpxc
therealpxc / steam-overrides-snippet.nix
Created August 31, 2018 15:03
my steam package overrides for Bumblebee/NVIDIA Optimus
# some Steam/Optimus quirks
nixpkgs.config.packageOverrides = superPkgs: {
steam = superPkgs.steam.override {
withPrimus = true;
extraPkgs = p: with p; [
glxinfo # for diagnostics
nettools # for `hostname`, which some scripts expect
bumblebee # for optirun
virtualgl # for glxspheres
];
~/.d/c/n/p/n/darwin   playground-darwin $+…  n -iA ansible19 578ms  Wed Aug 30 11:10:02 2017
installing ‘ansible-1.9.5’
error: cannot coerce a set to a string, at /Users/pcallahan/.dotfiles/config/nixpkgs/pkgsets/nixpkgs/darwin/pkgs/stdenv/generic/make-derivation.nix:85:11
(use ‘--show-trace’ to show detailed location information)
!  ~/.d/c/n/p/n/darwin   playground-darwin $+…  n -iA ansible19 159ms  Wed Aug 30 11:12:54 2017
error: syntax error, unexpected ')', expecting ';', at /Users/pcallahan/.config/nixpkgs/overlays/pxc.overlay.nix:141:4
!  ~/.d/c/n/p/n/darwin   playground-darwin $+…  n -iA ansible19 101ms  Wed Aug 30 11:14:25 2017
error: undefined variable ‘version’ at /Users/pcallahan/.config/nixpkgs/overlays/pxc.overlay.nix:134:23
!  ~/.d/c/n/p/n/darwin   playground-darwin $+…  n -iA ansible19 102ms  Wed Aug 30 11:14:39 2017
error: anonymous
@therealpxc
therealpxc / dangerous-nix.sh
Created March 9, 2016 23:05
some scripts for installing multiuser Nix on Debian-based distros
#!/bin/sh
groupadd -r nixbld
for i in $(seq 1 10); do sudo useradd -M -N -r -u $(expr 30000 + $i) -g nixbld -G nixbld -c "Nix build user $i" -d /var/empty -s "$(sudo which nologin)" nixbld$i; done
mkdir -p /etc/nix
chown -R root:nixbld /nix/store
chmod 1775 /nix/store
mkdir -p -m 1777 /nix/var/nix/gcroots/per-user
mkdir -p -m 1777 /nix/var/nix/profiles/per-user
@therealpxc
therealpxc / gazebo-nix-error
Last active February 12, 2016 19:13
Gazebo nix failure
~  nix-env -f'<nixpkgs>' -i gazebo Thu 11 Feb 2016 04:36:57 PM MST
installing ‘gazebo-7.0.0’
these derivations will be built:
/nix/store/l5irwha8hhyh2ax6fdd6jb1scvcxdzdk-mirrors-list.drv
/nix/store/q2bg6vcc521n02b0idbh9g83dvh6lns5-ignition-math2-2.3.0.tar.bz2.drv
/nix/store/8792mn1a2775d2j2b6fkxv3dh8cjvj0x-ign-math2-2.3.0.drv
/nix/store/g578gpwgziga0jcb1dvdw44d8m6rrj51-gazebo-7.0.0.tar.bz2.drv
/nix/store/j6pkzr63fjlxz4npbi63fiy2xdv8wf0b-gazebo-7.0.0.drv
these paths will be fetched (2.46 MiB download, 18.28 MiB unpacked):
/nix/store/4ygmk09lzq3j30d55a78iwapjnlsr6ri-boost-1.59.0