Skip to content

Instantly share code, notes, and snippets.

nix-build
error: cannot auto-call a function that has an argument without a default value (‘mkDerivation’)
output path ‘/nix/store/q7aq9f95rnybb1snsif9271139vgsjvg-git-export’ should have r:sha256 hash ‘1l4r55n1wzr817l225l6pm97li1mxg9icd8s51cpfihh91nkdz68’, instead has ‘0q7cjmz1fsrw3yfsr3h274qjamwnw01xgaqq3h5cjbqlrni4iq7k’
cannot build derivation ‘/nix/store/jax9rqzrp6aq8q5jjxdavagp7mqgcbgn-ruby-2.1.3-p0-bundler-HEAD.drv’: 1 dependencies couldn't be built
@ryantm
ryantm / this_file.rb
Last active August 29, 2015 14:18
Ruby comparison eats stack trace
#$ chruby ruby-2.2.0
#$ ruby this_file.rb
class A
def <=>(other)
nil
end
end
A.new <=> A.new #no error
@ryantm
ryantm / gist:b7ff72a299b0eed3bede
Last active August 29, 2015 14:21
rebuilding after ghc override
ryantm@rtmnix ~ (master)$ sudo nixos-rebuild switch --upgrade
[sudo] password for ryantm:
downloading Nix expressions from ‘https://nixos.org/releases/nixos/unstable/nixos-15.05pre61966.75ebc3c/nixexprs.tar.xz’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
unpacking channels...
building Nix...
building the system configuration...
updating GRUB 2 menu...
spacefm
** (.spacefm-wrapped:6320): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
** (.spacefm-wrapped:6320): WARNING **: No root settings found in /etc/spacefm/ Setting a root editor in Preferences should remove this warning on startup. Otherwise commands run as root may present a security risk.
(.spacefm-wrapped:6320): Gtk-WARNING **: Could not find the icon 'spacefm'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
http://icon-theme.freedesktop.org/releases
ryantm@home1 ~/p/nixpkgs-channels (nixos-unstable)$ nix-env -f . -iA opencc
installing ‘opencc-1.0.3’
these derivations will be built:
/nix/store/r8wz0kfj5k999cy09p0spwh4sqili730-opencc-1.0.3.drv
building path(s) ‘/nix/store/h8iicppcd1i9jcww2iw81gmdk98dxrka-opencc-1.0.3’
unpacking sources
unpacking source archive /nix/store/9066ds73yqsa7lgfllgxmx1aclyk4grl-ver.1.0.3.tar.gz
source root is OpenCC-ver.1.0.3
patching sources
configuring
{-# LANGUAGE FunctionalDepedencies #-}
data Account
= Account {accountId :: !Int,
productCd :: !String,
custId :: !Int,
openDate :: !Day,
closeDate :: !(Maybe Day),
lastActivityDate :: !(Maybe Day),
status :: !String,
~/nixfiles (master)$ NIX_PATH=nixpkgs=https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz nix-build '<nixpkgs>' -A chromium                                                                   
downloading ‘https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz’... ^[[1D [0/0 KiB, 0.0 KiB/s]^[[21D [0/7517 KiB, 0.0 KiB/s]^[[24D [464/7517 KiB, 213.4 KiB/s]^[[28D [4592/7517 KiB, 1446.4 KiB/s]        
unpacking ‘https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz’...      |                                                                                                                                  
these derivations will be built:                                                |                                                                                                                                  
  /nix/store/l9z7lw7a9kfy1535x36cqpg5ki63sijc-chromium-52.0.2743.116.drv        |                                                                                                        
{-# LANGUAGE DataKinds, KindSignatures, MultiParamTypeClasses,
FunctionalDependencies, FlexibleInstances,
OverloadedLabels, ScopedTypeVariables,
TemplateHaskell #-}
import Test2
--instance Has Point "x" Int where from (Point x _) _ = x
deriveI "x"
example = #x (Point 1 2)
@ryantm
ryantm / rename_db
Created February 8, 2017 23:18 — forked from simonrjones/rename_db
Shell script to rename a database, based on https://www.percona.com/blog/2013/12/24/renaming-database-schema-mysql/ - Please note you need to ensure you have access to MySQL via your ~/.my.cnf file
#!/bin/bash
# Copyright 2013 Percona LLC and/or its affiliates
# @see https://www.percona.com/blog/2013/12/24/renaming-database-schema-mysql/
set -e
if [ -z "$3" ]; then
echo "rename_db <server> <database> <new_database>"
exit 1
fi
db_exists=`mysql -h $1 -e "show databases like '$3'" -sss`
if [ -n "$db_exists" ]; then