This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>PayloadContent</key> | |
<array> | |
<dict> | |
<key>PayloadDescription</key> | |
<string>Configures Energy Saver settings</string> | |
<key>PayloadDisplayName</key> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eux | |
format() { | |
parted -s "$1" -- mklabel msdos | |
parted -s "$1" -- mkpart primary 1MiB 512MiB | |
parted -s "$1" -- set 1 boot on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ordering Services | |
# | |
# Given a set of services, make them run one at a time in a specific | |
# order, on a timer. | |
let | |
lib = import <nixpkgs/lib>; | |
servicePrefix = "ordering-test-"; | |
mkService = name: { | |
name = "${servicePrefix}${name}"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This allows overriding nixpkgs by passing `--arg pkgs ...` | |
{ pkgs ? import ./devtools/lib/nix/nixpkgs.nix {} | |
, lib ? pkgs.lib | |
}: | |
with pkgs; | |
with lib; | |
let |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grahamc@Morbo> docker run --user 1000:1000 -it --rm layered-on-top:latest ~/projects/nixpkgs | |
total 36 | |
drwxr-xr-x 1 0 0 4096 Dec 4 17:39 . | |
drwxr-xr-x 1 0 0 4096 Dec 4 17:39 .. | |
-rwxr-xr-x 1 0 0 0 Dec 4 17:39 .dockerenv | |
dr-xr-xr-x 2 0 0 4096 Jan 1 1970 bin | |
drwxr-xr-x 5 0 0 360 Dec 4 17:39 dev | |
drwxr-xr-x 2 0 0 4096 Dec 4 17:39 etc | |
drwxrwxrwx 1 0 0 4096 Dec 4 17:39 example-output | |
dr-xr-xr-x 3 0 0 4096 Jan 1 1970 lib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let pkgs = import <nixpkgs> {}; in | |
# 11. Create an image on top of a layered image | |
pkgs.dockerTools.buildImage { | |
name = "mutable-directory"; | |
tag = "latest"; | |
extraCommands = '' | |
mkdir ./example-output | |
chmod 777 ./example-output | |
''; | |
config.Cmd = [ "${pkgs.bash}/bin/bash" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------- Doc test execution failure -------- | |
ID: function-library-lib.attrsets.getOutput-example | |
Evaluating the Nix expression: | |
{ | |
actual = let | |
lib = import /home/grahamc/projects/nixpkgs/lib; | |
context = ( | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.nixos.bootup</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>bash</string> | |
<string>/var/root/apply.sh</string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shellcheckHook = makeSetupHook { | |
name = "shellcheck-hook"; | |
substitutions = {}; | |
} | |
(pkgs.writeText "foo" '' | |
( | |
# lol | |
filename=$(cat "$0" | tail -n1 | ${pkgs.utillinux}/bin/rev | cut -d' ' -f2 | ${pkgs.utillinux}/bin/rev) | |
${pkgs.shellcheck}/bin/shellcheck -s bash "$filename" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1] grahamc@Morbo> cat /nix/store/r6fx7f861dba25mks70lcidwjc9hxqdi-autorandr-1.1/lib/systemd/system/autorandr.service | |
[Unit] | |
Description=autorandr execution hook | |
After=sleep.target | |
# Note: StartLimitInterval was renamed to StartLimitIntervalSec in systemd-230. | |
# See autorandr bug #69. Do not rename for now, as the old name is kept for | |
# compatibility. | |
StartLimitInterval=5 | |
StartLimitBurst=1 |
NewerOlder