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 / nix-resolve-dependencies.sh
Created July 5, 2017 22:50
Find attributes of dependencies
#!/usr/bin/env bash
if ! test -e /tmp/nix-nixpkgs-cache; then
nix-env -f '<nixpkgs>' -qaP --no-name --out-path \* > /tmp/nix-nixpkgs-cache
fi
exprs="with import <nixpkgs> {}; (pkgs.runCommandCC or pkgs.runCommand) \"instantiate\" { buildInputs = [ $* ]; } \"\""
exprsDrv=$(nix-instantiate -E "$exprs" 2> /dev/null)
for drv in $(nix-store -qR "$exprsDrv"); do
@LnL7
LnL7 / config.nix
Last active December 28, 2017 12:43
vim configurable
{
packageOverrides = pkgs: {
lnl.vim = pkgs.vim_configurable.customize {
name = "vim";
vimrcConfig = {
customRC = ''
source $HOME/.vimrc
'';
vam.pluginDictionaries = [
{ names = [ "youcompleteme" "fzfWrapper" ]; }
@FRidh
FRidh / overview.md
Last active February 12, 2023 18:00

Python on Nix infrastructure

Introduction

Python is used throughout Nixpkgs. We use it for certain scripts, we provide Python libraries, and we provide applications. There are several methods on how to use Python on Nix, each with their pros and cons. An overview of all issues with the current Python infrastructure on Nix is available in the placeholder issue 1819.

Goal

@mikhailov
mikhailov / gist:9639593
Last active November 10, 2023 22:04
Nginx S3 Proxy with caching
events {
worker_connections 1024;
}
http {
default_type text/html;
access_log /dev/stdout;
sendfile on;
keepalive_timeout 65;
@aktau
aktau / imessage
Last active June 11, 2023 20:30
Send iMessage from the commandline
#!/bin/sh
if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi
exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit
-- another way of waiting until an app is running
on waitUntilRunning(appname, delaytime)
repeat until my appIsRunning(appname)
tell application "Messages" to close window 1
delay delaytime
end repeat
@klange
klange / _.md
Last active December 2, 2023 20:36
It's a résumé, as a readable and compilable C source file. Since Hacker News got here, this has been updated to be most of my actual résumé. This isn't a serious document, just a concept to annoy people who talk about recruiting and the formats they accept résumés in. It's also relatively representative of my coding style.

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at le