These are my notes on instaling NixOS 16.03 on a Lenovo ThinkPad X1 Carbon (4th generation) with an encrypted root file system using UEFI.
Most of this is scrambled from the following pages:
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs). | |
# So here's a minimal Gist which worked for me as an install on a new M1 Pro. | |
# Inspired by https://github.com/malob/nixpkgs I highly recommend looking at malob's repo for a more thorough configuration | |
# | |
# Let's get started | |
# | |
# Let's install nix (at the time of writing this is version 2.5.1 | |
curl -L https://nixos.org/nix/install | sh | |
# I might not have needed to, but I rebooted |
# Layout Poetry originally from | |
# https://github.com/direnv/direnv/issues/592 | |
layout_poetry() { | |
if [[ ! -f pyproject.toml ]]; then | |
log_error 'No pyproject.toml found. Use `poetry new` or `poetry init` to cr | |
exit 2 | |
fi | |
local VENV=$(poetry env list --full-path | cut -d' ' -f1) |
#!/usr/bin/env bash | |
# Author: Ned Letcher | |
# | |
# This bash script is designed to configure a clean Ubuntu installation (eg new | |
# EC2 instance) with a somewhat opionated set of packages and tools for working | |
# on Python projects. In addition to installing a range of packages for dev | |
# work, it installs pyenv for the current user, overwriting the current .profile | |
# and modifying the existing .bashrc to make sure pyenv is configured correctly. |
[kandinski@desire:~/data/work/hack/mal/impls/zigzug]$ pcre2-config --cflags | |
-I/nix/store/zl4d7qfqn5w0y06vnxcm9617yzfpbmmg-pcre2-10.36-dev/include | |
[kandinski@desire:~/data/work/hack/mal/impls/zigzug]$ pcre2-config --libs8 | |
-L/nix/store/wz02m7d46hznxzv3wlgppz1syzs9wsmc-pcre2-10.36/lib -lpcre2-8 | |
[kandinski@desire:~/data/work/hack/mal/impls/zigzug]$ zig test -lc -L/nix/store/wz02m7d46hznxzv3wlgppz1syzs9wsmc-pcre2-10.36/lib -lpcre2-8 -I/nix/store/zl4d7qfqn5w0y06vnxcm9617yzfpbmmg-pcre2-10.36-dev/include re.zig | |
warning: Unrecognized C flag from NIX_CFLAGS_COMPILE: -frandom-seed=ck69i4nqmv | |
(...) | |
All 11 tests passed. |
These are my notes on instaling NixOS 16.03 on a Lenovo ThinkPad X1 Carbon (4th generation) with an encrypted root file system using UEFI.
Most of this is scrambled from the following pages:
with import <nixpkgs> {}; | |
stdenv.mkDerivation { | |
name = "sc3-plugins-3.7.0-beta"; | |
src = fetchgit { | |
url = "https://github.com/supercollider/sc3-plugins"; | |
rev = "a963ecb"; | |
sha256="0840jwh7ljmhg34zblahqx3abk42a3y3gvgb740r558rphbp1p19"; | |
fetchSubmodules = true; |
Let's say you have an iOS project, and you want to use some external library, like AFNetworking. How do you integrate it?
Add the project to your repo:
git submodule add [email protected]:AFNetworking/AFNetworking.git Vendor/AFNetworking
or something to that effect.
// macro-ize gallir's spinlock code from: | |
// http://stackoverflow.com/questions/6704252/atomic-memcpy-suggestion/28286503#28286503 | |
// third version, thanks to kragen for explains of expression/statement and do/while protective coding | |
#define SPINLOCK(lock) do { while ((lock) || ! __sync_bool_compare_and_swap(&(lock) , 0 , 1));} while (0) | |
#define SPINUNLOCK(lock) (lock) = 0; | |
// and the wrap-a-block version |
#!/usr/bin/env bash | |
git checkout develop || (echo "Aborting..." && exit 1) | |
git pull || (echo "Aborting..." && exit 1) | |
BRANCHES=$(git branch --merged | grep -v develop | grep -v master | tr -d "\n") | |
for BRANCH in $BRANCHES | |
do |