Skip to content

Instantly share code, notes, and snippets.

Setting Up a MacBook with Nix and Home Manager using Flakes

Key Concepts and Components

Here are some key concepts and components of the Nix ecosystem:

  • Nix: a purely functional package manager that provides a declarative approach to managing software dependencies and configurations.
  • Nixpkgs: the default package repository for Nix, which contains thousands of pre-built packages for various programming languages, libraries, and tools.
  • Flakes: a new feature in Nix that allows you to manage Nix configurations as code, with versioned and reproducible dependencies.
  • Home Manager: a tool built on top of Nix that allows you to manage your personal configurations, including shell settings, editor configurations, and other user-specific settings.
@srounce
srounce / readspeed.ts
Last active August 30, 2019 15:21
Read speed from ELM327 over TCP/IP
const { createConnection } = require("net")
const { format } = require("util")
const socket = createConnection({ port: 35000 })
const CURRENT_DATA_MODE = "01"
const CURRENT_DATA_MODE_RESPONSE = "41"
const VEHICLE_SPEED_PID = "0D"
const debounceWait = (time: number) => {
#!/usr/bin/env bash
target_dir=$(dirname $1);
dest_dir=$(dirname $2);
count=1
for file in $(ls $target_dir); do
filename=$(basename $file)
targetname=$(basename $2)
targetname=${targetname%.*}
@srounce
srounce / rx.js
Last active February 24, 2017 11:57 — forked from jamieallen59/rx.js
import { fromPromise } from 'rxjs/observable/fromPromise';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/mergeMap';
import 'rxjs/add/operator/switchMap';
// IGNORE (just filters)
const isValidLinkedAccount = linkedAccount => {
const { is_linked: isLinked, link_failed: linkFailed, status, service_status: serviceStatus } = linkedAccount;
# MIT License
#
# Copyright (c) 2016 Samuel Rounce
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
apiVersion: v1
kind: ReplicationController
metadata:
name: gocd-server-1.0.0
namespace: ciserver
labels:
version: 1.0.0
visualize: "true"
spec:
replicas: 1
@srounce
srounce / .babelrc
Last active February 25, 2016 10:37
SO-GPX-BabelWebpack
{
"sourceMaps": "inline",
"presets": ["es2015"]
}
'use strict'
let AsciiTable = require('ascii-table')
let solve = (hints) => {
function permutate(dictionary) {
const results = []
const permute = (array, position) => {
if (position === array.length - 1) {
results.push(array)
} else {
@srounce
srounce / AnExApp.js
Last active August 29, 2015 08:58 — forked from sahrens/React Native: Animated - Code
Example code from ReactEurope 2015 talk - React Native: Animated
/**
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
#!/bin/bash
sudo apt-get remove phantomjs
sudo unlink /usr/local/bin/phantomjs
sudo unlink /usr/local/share/phantomjs
sudo unlink /usr/bin/phantomjs
cd /usr/local/share