Skip to content

Instantly share code, notes, and snippets.

@mariusvw
Forked from tomster/nixbuild.yml
Created July 5, 2018 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariusvw/1239f4f50b15295457d7b99068d89dda to your computer and use it in GitHub Desktop.
Save mariusvw/1239f4f50b15295457d7b99068d89dda to your computer and use it in GitHub Desktop.
Ansible playbook to build nix on FreeBSD
---
- hosts:
- nixhost
tasks:
- name: Ensure dependency packages are installed
pkgng:
name: "{{item}}"
state: present
with_items:
- sudo
- curl
- perl5
- openssl
- bash
- pkgconf
- sqlite3
- gmake
- autoconf
- automake
- git
- libxslt
- docbook-xsl-ns
- bison
- p5-DBI
- p5-DBD-SQLite
- p5-WWW-Curl
- gtar
- name: fetch nix sources
git:
repo: "https://github.com/manueljacob/nix"
version: "freebsd-build-fixes"
dest: "/home/nixbuild/nix"
accept_hostkey: yes
sudo_user: nixbuild
- name: bootstrap checkout
command: bash bootstrap.sh
args:
chdir: "/home/nixbuild/nix"
creates: "/home/nixbuild/nix/configure"
sudo_user: nixbuild
- name: configure checkout
command: bash configure
args:
chdir: "/home/nixbuild/nix"
creates: "/home/nixbuild/nix/config.status"
sudo_user: nixbuild
- name: build nix
command: gmake
args:
chdir: "/home/nixbuild/nix"
creates: "/home/nixbuild/nix/scripts/nix-build"
sudo_user: nixbuild
- name: install nix
command: gmake install
args:
chdir: "/home/nixbuild/nix"
creates: "/usr/local/bin/nix-build"
- name: create group
group:
name: nixbld
- name: create nixbld users
user:
name: "{{item}}"
groups: nixbld
with_items:
- nxbld1
- nxbld2
tags: foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment