Skip to content

Instantly share code, notes, and snippets.

View default.nix
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "emojicode-0.6";
src = fetchFromGitHub {
owner = "emojicode";
repo = "emojicode";
sha256 = "0v5r481xhjc3kdk9a49yi9lqnd6gxq5iws4d65dcx43mw3wz38sj";
rev = "5d655df6b7f7ffa13c4addfc140ef83d695381ca";
};
View gist:86135143bc068297327f14f930620304
[clever@amd-nixos:~]$ nix-shell -p 'map (x: pkgs."ruby_${x}") [ "2_0" "2_1" "2_2" "2_3" "2_4" ]' --run 'which -a ruby'
/nix/store/fzig0rrfwv2vim8dwdlqpz9p0jd6yfcx-ruby-2.0.0-p648/bin/ruby
/nix/store/frhi4b281vifmwxqcz0cj812f6fgw7j8-ruby-2.1.10/bin/ruby
/nix/store/fsycgl16fapyxnvvjw8gl39pjbvidbc8-ruby-2.2.8/bin/ruby
/nix/store/jav1bpg9z6h5iwk66m8vpaacqg5vgkzw-ruby-2.3.5/bin/ruby
/nix/store/r9dy9bck3y57vaglv1yp0yn71jycw082-ruby-2.4.2/bin/ruby
View 1-cmd
[clever@amd-nixos:~]$ nix-build math.nix --argstr a 4294967296 --argstr b 4294967296
these derivations will be built:
/nix/store/dbjigm9n6nia5cmfbv9cnlnm240z78sy-do-da-math.hs.drv
/nix/store/1yq4lh0wwy563jp8d7awii030makjxy8-do-da-math.drv
building path(s) ‘/nix/store/ph39dp1ffckjidhjyhgj4p1685vw8d4a-do-da-math.hs’
building path(s) ‘/nix/store/ab8m9ar1bg5p3h8bs2v8x5lk35mwjnmg-do-da-math’
/nix/store/ab8m9ar1bg5p3h8bs2v8x5lk35mwjnmg-do-da-math
[clever@amd-nixos:~]$ cat result
18446744073709551616
View default.nix
{ mkDerivation, base, stdenv, ... }@args:
mkDerivation {
pname = "nix-assert-bug";
version = "0.1.0.0";
src = ./.;
libraryHaskellDepends = [ args."assert" base ];
license = stdenv.lib.licenses.bsd3;
}
View gist:ed7cfc6696ffa74c4d1d012b2a4bdacf
[root@amd-nixos:~]# zfs list -t snapshot amd/home -r -o name,used,refer,written
NAME USED REFER WRITTEN
amd/home@zfs-auto-snap_weekly-2017-10-16-00h00 1.60G 101G 101G
amd/home@zfs-auto-snap_weekly-2017-10-23-00h00 913M 104G 4.10G
amd/home@zfs-auto-snap_weekly-2017-10-30-00h00 285M 107G 3.97G
amd/home@zfs-auto-snap_monthly-2017-11-01-00h00 4.13M 107G 287M
amd/home@zfs-auto-snap_daily-2017-11-03-00h00 3.89M 107G 4.44M
amd/home@zfs-auto-snap_daily-2017-11-04-00h00 3.23M 107G 283M
amd/home@zfs-auto-snap_daily-2017-11-05-00h00 3.16M 107G 3.23M
amd/home@zfs-auto-snap_weekly-2017-11-06-00h00 216K 107G 491M
View gist:6671e4ae5bd56b63473feca6db2e6fba
[root@system76:~]# zfs list tank tank/home tank/nix tank/root -o name,compressratio,used,logicalused
NAME RATIO USED LUSED
tank 1.91x 14.6G 25.8G
tank/home 1.37x 2.14G 2.85G
tank/nix 2.04x 10.8G 20.2G
tank/root 1.65x 599M 947M
View default.nix
{ stdenv, fetchurl, unzip, interface, writeText, jre, zopfli }:
stdenv.mkDerivation {
name = "static-assets";
phases = [ "unpackPhase" "installPhase" ];
buildInputs = [ jre unzip ];
installPhase = ''
mkdir -p $out/share
cp ${./Allsight.svg} $out/Allsight.svg
cp ${./swoosh.svg} $out/swoosh.svg
View default.nix
{ stdenv, fetchurl, unzip, interface, writeText, jre }:
let allSight = writeText "Allsight.svg" (builtins.readFile ./Allsight.svg);
swoosh = writeText "swoosh.svg" (builtins.readFile ./swoosh.svg);
in stdenv.mkDerivation {
name = "static-assets";
phases = [ "unpackPhase" "installPhase" ];
buildInputs = [ jre unzip ];
installPhase = ''
mkdir -p $out
cp ${allSight} $out/Allsight.svg
View gist:bf6519210b5c562641d02daa68167084
normal nixos machine:
system: "x86_64-linux", multi-user?: yes, version: nix-env (Nix) 1.11.14, channels(root): "nixos-18.03pre114421.799435b7ca", nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
- system: `"x86_64-linux"`
- host os: `Linux 4.9.46, NixOS, 18.03pre114421.799435b7ca (Impala)`
- multi-user?: `yes`
- sandbox: `relaxed`
- version: `nix-env (Nix) 1.11.14`
- channels(root): `"nixos-18.03pre114421.799435b7ca"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`
View gopanda.nix
{ pkgs ? import <nixpkgs> {}
, cairo ? pkgs.cairo
, fetchurl ? pkgs.fetchurl
, glib ? pkgs.glib
, patchelf ? pkgs.patchelf
, stdenv ? pkgs.stdenv
, xorg ? pkgs.xorg
, nss
, nspr
, gnome3
You can’t perform that action at this time.