Skip to content

Instantly share code, notes, and snippets.

View LnL7's full-sized avatar
❄️
1970 /nix/store

Daiderd Jordan LnL7

❄️
1970 /nix/store
View GitHub Profile
@LnL7
LnL7 / configuration.nix
Last active April 7, 2024 01:08
NixOS configuration overlays
{ config, pkgs, ... }:
let
# Import unstable channel.
# sudo nix-channel --add http://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
# sudo nix-channel --update nixpkgs-unstable
unstable = import <nixpkgs-unstable> {};
in
{
self: super:
{
# Install overlay:
# $ mkdir -p ~/.config/nixpkgs/overlays
# $ curl https://gist.githubusercontent.com/LnL7/570349866bb69467d0caf5cb175faa74/raw/3f3d53fe8e8713ee321ee894ecf76edbcb0b3711/lnl-overlay.nix -o ~/.config/nixpkgs/overlays/lnl.nix
userPackages = super.userPackages or {} // {
# Example:
hello = self.hello;
self: super:
let
# Import unstable channel.
# $ sudo nix-channel --add http://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
# $ sudo nix-channel --update nixpkgs-unstable
unstable = import <nixpkgs-unstable> {};
in
{
@LnL7
LnL7 / configuration.nix
Created March 2, 2017 18:29
NixOS keyboard repeat
{ config, pkgs, ... }:
{
services.xserver.displayManager.sessionCommands = ''
${pkgs.xlibs.xset}/bin/xset r rate 200 40
${pkgs.xlibs.setxkbmap}/bin/setxkbmap -layout us -option ctrl:nocaps
'';
}
self: super:
{
linuxPackagesFor = kernel: (super.linuxPackagesFor kernel).extend (self: super: {
foo = self.callPackage ./foo.nix {};
});
}
#!/bin/sh
printf "checking for nixbld group... "
/usr/bin/dscl . -read /Groups/nixbld &> /dev/null
case $? in
0) echo "yes" ;;
56)
echo "no, created"
sudo /usr/sbin/dseditgroup -o create -r "Nix build group for nix-daemon" -i 30000 nixbld >&2 || exit
;;
let
builder = "${builtins.storePath <bash>}/bin/bash";
in
{
# nix-build basic.nix -A foo -I bash=$(nix-build '<nixpkgs>' -A bash --no-out-link)
foo = derivation {
name = "foo-0.0.0";
inherit builder;
args = ["-c" "echo 42 > $out"];
@LnL7
LnL7 / u.sh
Created November 20, 2020 20:05
:u() {
local exports
exports=$(direnv apply_dump <(nix-shell -E "with import <nixpkgs> {}; mkShell { buildInputs = [ $* ]; }" --run 'direnv dump'))
eval "$exports"
name+="''${name:+ }$*"
typeset -U PATH
}
diff --git a/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix b/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix
index 761ff3ea925..a8f667dcbe7 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix
@@ -20,4 +20,8 @@ appleDerivation {
mv $out/usr/local/include $out/include
rm -rf $out/usr
'';
+
+ failureHook = ''
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index aa694577d..504ae6ebd 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -207,6 +207,16 @@ std::string listLogFormats()
return res;
}
+LogFormatSetting::LogFormatSetting(Config * options,
+ LogFormat def,