Skip to content

Instantly share code, notes, and snippets.

@zopsicle
zopsicle / default.nix
Last active December 8, 2019 16:09
pkg-configWithPackages
{pkgs ? import ./nix/pkgs.nix {}}:
let
pkg-configWithPackages = packages: pkgs.stdenvNoCC.mkDerivation {
name = "pkg-configWithPackages";
buildInputs = [pkgs.makeWrapper];
phases = ["installPhase"];
installPhase = ''
makeWrapperFlags=()
for package in ${pkgs.lib.concatMapStringsSep " " (p: "${p}") packages}; do
makeWrapperFlags+=(--prefix PKG_CONFIG_PATH : $package/lib/pkgconfig)
#!/usr/bin/env perl
use v5.12;
use warnings;
sub cmus
{
my %stati = (
playing => '>>',
paused => '||️',
@zopsicle
zopsicle / README.md
Last active October 16, 2023 17:39
Firefox monospace address bar
@zopsicle
zopsicle / example.bash
Last active June 14, 2022 09:54
Nix shell for PHP development
nix-shell --run 'composer install'
use std::{env, sync::LazyLock};
pub fn LinkCmakeLibrary(currentBinaryDir: &str, name: &str)
{
const cmakeBinaryDir: &str = env!("STELLAR_CMAKE_BINARY_DIR");
static cmakeConfig: LazyLock<&'static str> = LazyLock::new(|| {
let cargoProfile = env::var("PROFILE").unwrap();
match cargoProfile.as_str() {
"debug" => "Debug",
derivation {
name = "shell";
builder = "${nixpkgs.coreutils}/bin/false"; # Only for use with nix-shell.
system = nixpkgs.system;
stdenv = nixpkgs.writeTextDir "setup" ''
export PATH=${
nixpkgs.lib.concatStringsSep ":" [
"${nixpkgs.cmake}/bin"
"${nixpkgs.coreutils}/bin"
"${nixpkgs.gcc}/bin" # Does not get unwanted flags!