Skip to content

Instantly share code, notes, and snippets.

View fpletz's full-sized avatar
🦺
building

Franz Pletz fpletz

🦺
building
View GitHub Profile
@edolstra
edolstra / nix-lang.md
Last active October 30, 2024 00:36
Nix language changes

This document contains some ideas for additions to the Nix language.

Motivation

The Nix package manager, Nixpkgs and NixOS currently have several problems:

  • Poor discoverability of package options. Package functions have function arguments like enableFoo, but there is no way for the Nix UI to discover them, let alone to provide programmatic ways to
@grahamc
grahamc / tag.sh
Last active March 14, 2017 21:57
msg_list() {
query="tag:nixossec tag:needs-triage and date:2017-02-22.. and not tag:package-identified"
notmuch search "$query" | tr '[:upper:]' '[:lower:]'
}
score_subject() {
# For each word in the subject, search for a package by that name
# sort by the number of hits
# remove 0-hit words
# pick the word with the fewest hits
#!/nix/store/010yd8jls8w4vcnql4zhjbnyp2yay5pl-bash-4.4-p5/bin/bash
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
#
# If pushing without using a named remote those arguments will be equal.
PATH="/nix/store/9lhgvxka8m162d5db0my5cd4qpjii9sv-git-2.12.0/bin"
@edolstra
edolstra / nix-ui.md
Last active July 14, 2024 21:22
Nix UI

General notes

  • nix-channel and ~/.nix-defexpr are gone. We'll use $NIX_PATH (or user environment specific overrides configured via nix set-path) to look up packages. Since $NIX_PATH supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH to e.g. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz and stay up to date automatically.

  • By default, packages are selected by attribute name, rather than the name attribute. Thus nix install hello is basically equivalent to nix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello won't be upgraded to helloVariant.

    @vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.

TBD: How to deal with search path clashes.

@shanselman
shanselman / gist:5422230
Last active November 14, 2024 02:40
Evil Blog Comment Spammer just exposed his template through some error and the whole thing showed up in my comments.
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
@b10m
b10m / hogent_sniper.pl
Created January 31, 2013 16:03
HoGent allowed 20 accounts internet access at a time. I'm to lazy to snipe a free position and use this }:-)
use strict;
use LWP::UserAgent;
my $url = 'https://webauthentication.hogent.be/login.html';
my @passwords = qw( insert passwords here o_O );
my $ua = LWP::UserAgent->new();
for( my $i = 0; $i < @passwords; $i++) {
my $user = sprintf("hgguest%02d", $i+1);