Skip to content

Instantly share code, notes, and snippets.

View tomster's full-sized avatar
💭
no space left on device

Tom Lazar tomster

💭
no space left on device
View GitHub Profile
# 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
sgdisk -Z -n1:0:+512M -t1:EF00 -c1:EFI -n2:0:0 -t2:E800 -c2:LUKS -p /dev/nvme0n1
cryptsetup luksFormat --key-size 512 --hash sha512 --verify-passphrase /dev/nvme0n1p2
cryptsetup open /dev/nvme0n1p2 cdisk
zpool create -o ashift=12 -o altroot=/mnt -m none -O atime=off -O relatime=on -O compression=lz4 tank /dev/mapper/cdisk # take note of hostid
zfs create -o mountpoint=none tank/root
zfs create -o mountpoint=legacy tank/root/nixos
zfs create -o mountpoint=legacy tank/home
zfs create -o compression=off -V 1G tank/swap
mkfs.vfat -F 32 -n EFI /dev/nvme0n1p1
mkswap -L SWAP /dev/zvol/tank/swap
@tomster
tomster / gist:b5b04a4808b0d663b3a5
Created March 18, 2016 14:50
rofi -dump-xresources
# rofi -dump-xresources
! Enabled modi
rofi.modi: window,run,ssh
! Window opacity
rofi.opacity: 100
! Window width
rofi.width: 50
! Number of lines
rofi.lines: 15
! Number of columns
@tomster
tomster / nixbuild.yml
Last active July 5, 2018 09:17
Ansible playbook to build nix on FreeBSD
---
- hosts:
- nixhost
tasks:
- name: Ensure dependency packages are installed
pkgng:
name: "{{item}}"
state: present
with_items:
@tomster
tomster / jailhost-nix.yml
Created July 23, 2014 21:58
install nix inside a freebsd jail
---
- hosts: jailhost-nix
tasks:
- name: install dependencies
pkgng: name={{item}} state=present
with_items:
- curl
- perl5
- openssl
- bash
@tomster
tomster / gist:8544009
Created January 21, 2014 17:12
my current .gitconfig
# ~/.gitconfig
[user]
name = Tom Lazar
email = [email protected]
[branch]
autosetupmerge = true
autosetuprebase = remote
[push]
default = current
@tomster
tomster / gist:7585211
Last active July 5, 2018 09:16
bootstrap a freebsd 9.2 host with ansible. it requires a password for the root user to be set for which it will prompt you (-k). you must use the paramiko transport to allow password based login. based on https://gist.github.com/illenseer/6390361
---
# run this with ansible-playbook -i ansible_hosts bootstrap.yml -k -c paramiko
- hosts: jails_host
gather_facts: false
remote_user: root
tasks:
- name: install pkgng
raw: "pkg_info | grep -v 'pkg-' > /dev/null ; if $? pkg_add -r pkg; rehash ; pkg2ng; echo 'WITH_PKGNG=yes' >> /etc/make.conf; echo 'packagesite: http://pkgbeta.freebsd.org/freebsd%3A9%3Ax86%3A64/latest' >> /usr/local/etc/pkg.conf; pkg update ; pkg upgrade -y"
- name: install python27
raw: "pkg install -y python27"
@tomster
tomster / buildout.cfg
Created February 22, 2012 17:07
sample buildout for working on and developing Kotti & deform
[buildout]
extensions = mr.developer
parts = debug
auto-checkout = *
repo = pyfidelity
[sources]
Kotti = git [email protected]:pyfidelity/Kotti.git
deform = git [email protected]:pyfidelity/deform.git
deform_bootstrap = git [email protected]:pyfidelity/deform_bootstrap.git
@tomster
tomster / .gitconfig
Created September 25, 2011 11:48
An example git configuration including convenience aliases, some saner default behavior, a neat shell prompt and tab completion that can display the name of the tracking remote
# ~/.gitconfig
[branch]
autosetupmerge = true
[push]
default = current
[core]
excludesfile = .gitignore
@tomster
tomster / git-dropbox
Created January 1, 2011 15:40
Create a symlink of the current .git inside your Dropbox, now all your local commits will automatically be backed up to Dropbox (without your dropbox being littered with development cruft, like temporary build files)
#!/usr/bin/env python
# encoding: utf-8
""" Create a symlink of the current .git inside your Dropbox, now all your
local commits will automatically be backed up to Dropbox (without your dropbox
being littered with development cruft, like temporary build files)
"""
from os import getcwd, path, mkdir, symlink, chdir