Skip to content

Instantly share code, notes, and snippets.

View rehno-lindeque's full-sized avatar

Rehno Lindeque rehno-lindeque

View GitHub Profile
@bobvanderlinden
bobvanderlinden / builder.sh
Created June 3, 2016 18:12
Nix and npm-shrinkwrap
source $stdenv/setup
# Place npm-shrinkwrap.json alongside package.json
ln -s $NPM_SHRINKWRAP ./npm-shrinkwrap.json
# Create fake package.json. This is not used by npm when npm-shrinkwrap.json is available, but npm does parse this as json
echo "{}" > package.json
# Create fake HOME directory for npm
export HOME=$PWD/home
@joepie91
joepie91 / .md
Last active March 17, 2023 18:42
Nix in multi-user mode on a non-NixOS (eg. Debian) system

This post is deprecated!

Its contents have been moved to the NixOS wiki here, where they are being kept up to date. Please follow the instructions there instead!

The original post is below for posterity.

 

 

@edolstra
edolstra / nix-ui.md
Last active July 14, 2024 21:22
Nix UI

General notes

  • nix-channel and ~/.nix-defexpr are gone. We'll use $NIX_PATH (or user environment specific overrides configured via nix set-path) to look up packages. Since $NIX_PATH supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH to e.g. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz and stay up to date automatically.

  • By default, packages are selected by attribute name, rather than the name attribute. Thus nix install hello is basically equivalent to nix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello won't be upgraded to helloVariant.

    @vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.

TBD: How to deal with search path clashes.

@datakurre
datakurre / .gitignore
Last active December 9, 2023 01:41
Multi-kernel Jupyter notebook environment and Docker container with Nix
*.ipynb
*.png
*.tar.gz
.ipynb_checkpoints
.ipython
.jupyter
.sentinel.*
@marcellodesales
marcellodesales / ec2-host-from-tag-to-env-vars.sh
Last active November 8, 2022 11:49
Create Environment Variables in EC2 Hosts from EC2 Host Tags, just like Beanstalk or Heroku does!
######
# Author: Marcello de Sales ([email protected])
# Description: Create Create Environment Variables in EC2 Hosts from EC2 Host Tags
#
### Requirements:
# * Install jq library (sudo apt-get install -y jq)
# * Install the EC2 Instance Metadata Query Tool (http://aws.amazon.com/code/1825)
#
### Installation:
# * Add the Policy EC2:DescribeTags to a User
@seanhess
seanhess / Form.elm
Created September 14, 2015 01:52
Form.elm
type Action
= Update String
| Enter
type alias Model = { text : String }
update : Action -> Model -> Model
update action model
case action of
Update txt -> { model | text <- txt }
@mgold
mgold / proposal.elm
Last active February 12, 2016 01:34
Elm mailbox revamp
-- a distilation of https://github.com/elm-lang/elm-plans/issues/7
{- Mailbox is renamed Dispatcher, although this name is the part I'm least certain about.
The address field is replaced with a dispatch field.
It's minor, but I've found it helpful to put dispatch second, since the signal is easier to explain.
-}
type alias Dispatcher a =
{ signal : Signal a
, dispatch : a -> Message -- the big change
}
@shashi
shashi / sneaky-dom.js
Last active March 29, 2016 18:29
Sneaky, Shady DOM
(function() {
function Sneaky (node) {
var lightNode = Polymer.dom(node)
this.lightNode = lightNode
this.node = lightNode.node
}
Sneaky.prototype = Polymer.dom()
Object.defineProperties(Sneaky.prototype, {
@rehno-lindeque
rehno-lindeque / NixSetup.md
Last active September 13, 2024 01:22
NixOS Setup (Virtualized + Haskell + Gnome3 + XMonad)

Setup NixOS (Virtualized + Haskell + Gnome3 + XMonad)

Before you get started

This is pretty out of date now... you may want to look elsewhere

Newer guides than mine (mine is a bit dated and has a lot of rough edges):

Have you looked at these?

@vilterp
vilterp / Elmification.md
Created June 23, 2015 02:13
Plan for moving Reactor logic to Elm

Converting the Reactor frontend to Elm

As summarized in the reactor issue "WIP: convert JS to Elm", moving as much of the frontend of elm-reactor from JS to Elm as possible would have significant code quality benefits.

Step 1: Move View Code to Elm

As listed in the issue:

  • Use sliders from elm-html, not a custom native library
  • Move logic for toggling the sidebar and event blocker into Elm