EDIT: check out fix-python instead, make Python run "as usual" on NixOS!
- 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
{ 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; |
#! /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 |
EDIT: check out fix-python instead, make Python run "as usual" on NixOS!
;;; org-roam-weeklies.el --- Weekly-notes for Org-roam -*- coding: utf-8; lexical-binding: t; -*- | |
;;; | |
;; Copyright © 2020 Jethro Kuan <[email protected]> | |
;; Copyright © 2020 Leo Vivier <[email protected]> | |
;; Author: Jethro Kuan <[email protected]> | |
;; Leo Vivier <[email protected]> | |
;; URL: https://github.com/org-roam/org-roam | |
;; Keywords: org-mode, roam, convenience | |
;; Version: 1.2.3 |
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.
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.
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
This is one way of managing your user profile declaratively.
Alternatives include:
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
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.
A guide to setting up the Haskell tooling for Emacs in a Nix environment.