Skip to content

Instantly share code, notes, and snippets.

View alexvorobiev's full-sized avatar
👨‍🚀

Alex Vorobiev alexvorobiev

👨‍🚀
View GitHub Profile
@plmercereau
plmercereau / raspberry-pi-zero-2.nix
Last active January 10, 2024 13:46
Nix module to create SD images for Rasperry Pi Zero 2 W
{ config, lib, pkgs, ... }:
{
imports = [
<nixpkgs/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix>
./sd-image.nix
];
system.stateVersion = "23.11";
# Pi Zero 2 struggles to work without swap
sdImage.swap.enable = true;
@gador
gador / migrate_mongodb.sh
Created February 23, 2023 13:06
mongodb migration for NixOS update to 23.05
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash
kill_mongo () {
set +e
sleep 5 # wait for previous processes to come to an end
echo "terminating mongod ..."
pkill mongod
sleep 5
pgrep mongod
@GuillaumeDesforges
GuillaumeDesforges / nixos_python_patch_venv_bins.md
Last active February 11, 2024 00:54
How to: make Python dependencies installed via pip work on NixOS

EDIT: check out fix-python instead, make Python run "as usual" on NixOS!

How to: make Python dependencies installed via pip work on NixOS

The issue

  • You are using NixOS
  • You start working on a Python project
  • You manage the dependencies in a classic Python virtual environment using pip or poetry
@dangom
dangom / org-roam-weeklies.el
Created February 4, 2021 03:43
Weekly notes for org-roam
;;; org-roam-weeklies.el --- Weekly-notes for Org-roam -*- coding: utf-8; lexical-binding: t; -*-
;;;
;; Copyright © 2020 Jethro Kuan <jethrokuan95@gmail.com>
;; Copyright © 2020 Leo Vivier <leo.vivier+dev@gmail.com>
;; Author: Jethro Kuan <jethrokuan95@gmail.com>
;; Leo Vivier <leo.vivier+dev@gmail.com>
;; URL: https://github.com/org-roam/org-roam
;; Keywords: org-mode, roam, convenience
;; Version: 1.2.3
@lg
lg / adding-tailscale-to-edgerouter.md
Last active September 17, 2024 12:12
Add tailscale to an EdgeRouter and surviving system upgrade

Adding tailscale to an EdgeRouter (and surviving system upgrades)

I suggest you run sudo bash on all of these so you're the root user.

Installing

  1. Download tailscale and put the files in /config/. Find the latest stable or unstable version for your EdgeRouter's processor (ex. ER4 is mips and ERX is mipself)
sudo bash    # if you havent already
@reegnz
reegnz / README.md
Last active August 2, 2024 22:18
Implementing a jq REPL with fzf

Implementing a jq REPL with fzf

Update: I created jq-zsh-plugin that does this.

One of my favourite tools of my trade is jq. It essentially enables you to process json streams with the same power that sed, awk and grep provide you with for editing line-based formats (csv, tsv, etc.).

Another one of my favourite tools is fzf.

@AndersonTorres
AndersonTorres / nix-development-template-file.org
Last active July 26, 2024 00:09
A project workflow for Nixpkgs/NixOS

Standard project structure

This is a project structure I’ve found useful. Looking for any thoughts/comments/feedback. Roughly, I found a tension between the style nixpkgs expects and the style conducive to development, so I extracted the common portion into a derivation.nix which is used by the remaining .nix files. This setup allows me to use nix build, nix-shell, overlays, Hydra, alternate packaging schemes, cross-compiling, etc.

@pamolloy
pamolloy / README.md
Last active January 23, 2024 07:28
Ubiquiti USG configuration for Wireguard

Download the latest ugw3 package from https://github.com/Lochnair/vyatta-wireguard/releases and install it on your USG using dpkg -i wireguard-ugw3-<version>.deb.

cd /config/auth
umask 077
mkdir wireguard
cd wireguard
wg genkey > wg_private.key
wg pubkey < wg_private.key > wg_public.key
@lheckemann
lheckemann / 0-readme.md
Last active March 11, 2024 13:11
Expression for a buildEnv-based declarative user environment.

Expression for a buildEnv-based declarative user environment

This is one way of managing your user profile declaratively.

Alternatives include:

  • an attrset-based nix-env-based environment, installed using nix-env -ir rather than nix-env --set. LnL has an overlay which shows a way of doing this.
  • home-manager, which provides NixOS-like config for your $HOME

Note that this is incompatible with regular imperative use of nix-env, e.g. nix-env -iA nixpkgs.hello. It has the advantage of allowing the installation of multiple outputs of the same package much better than nix-env's builtin profile builder does.

@sevanspowell
sevanspowell / EmacsTooling.md
Last active July 6, 2022 01:11
A guide to setting up the Haskell tooling for Emacs in a Nix environment.

Running Emacs Haskell Tooling in a Nix environment

A guide to setting up the Haskell tooling for Emacs in a Nix environment.

Suggestions/Contact

mail@sevanspowell.net

Configuration