• home
  • projects
  • misc
  • archives
  • about

Posts

January 9, 2025

nixos VM in lxd

Setting up VM images with nixos is incredibly powerful when coupled with declarative nature of nix language itself.

I am using it for running homelab type services and lab type setups. Here is how I have it working for me:

Create the VM

This is a snippet from a shell script I use

name=nixos1
img=nixos/24.05
cpu=4
mem=8
disk=100
incus launch images:$img $name \
    --vm \
    -c limits.cpu=4 \
    -c limits.memory=${mem}GiB \
    -c security.secureboot=false \
    --device root,size=${disk}GiB

Configure the VM

Assuming you have some nixos configuration, you can upload the config and update the VM.

June 11, 2024

my alternative to google photos

Table of Contents

  • Introduction
  • Walled garden
  • The solution
  • syncthing
  • picman
  • photoprism
  • honorable mention: Photostructure

Introduction

Google photos was amazing in the beginning, the photos application did what I wanted and in general it was a good experience

I was somewhat of an early adopter, so I had a plethora of photos stored in google photos. I didn’t really have to think about photos, it was just handled for me.

February 2, 2024

nix resources

Table of Contents

  • nix
  • flakes
  • nixos
  • home-manager
  • hydra (build system)
  • Fun Stuff

the biggest hurdle in getting into nix is having the revelvant documentation available. This page is just another collection of useful resources to support success.

nix

nix the language

nixhub https://www.nixhub.io/packages/mysql

newer documentation https://nix.dev/

nix-search-cli https://github.com/peterldowns/nix-search-cli

nix-pills: Interesting information if you want to know how nix works. A little dated. https://nixos.org/nixos/nix-pills

nix packge versions - https://lazamar.co.uk/nix-versions/

December 31, 2023

picman: photo sorting tool

github https://github.com/sigmonsays/picman

I wrote a basic tool to replace my krufty bash scripts that imports my photos from various locations into their final resting place.

The tool operates in steps where each step is kind of idempotent. The set of all steps is called a workflow and operates on a single file. see code.

Each step operates on the same workflow object, which primarily has a state object

State Object code

  • holds exif data
  • holds file stat information
  • holds date metadata that is obtained via exif or other logic
  • holds checksum and logs of processing the file

Steps in order

December 27, 2023

nix tip: nvd to see what is going to change

have you ever wanted to see what packages are going to change before updating them on nix?

Well read on to find out how to do this with home-manager and nixos

First, there is a few different ways i came across

Table of Contents

  • A naive approach
  • nix store diff-closure
  • nvd
  • nix-diff

A naive approach

I wondered since everything is in the nix store, why not just diff it?

December 20, 2023

nix tip: shell shabang

A feature I discovered recently is that nix-shell can be used as an interpreter

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash htop

echo hello world
which htop

It even works for python

#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p python3Packages.pillow python3Packages.ansicolor

# scale image by 50%
import sys, PIL.Image, ansicolor
path = sys.argv[1]
image = PIL.Image.open(path)
factor = 0.5
image = image.resize((round(image.width * factor), round(image.height * factor)))
path = path + ".s50.jpg"
image.save(path)
print(ansicolor.green(f"done {path}"))

Discovered on the wiki page at https://nixos.wiki/wiki/Nix-shell_shebang

December 14, 2023

nix-direnv

Table of Contents

  • direnv
  • nix-direnv
  • Nix Shell
  • Rust development environment
  • Go development environment
  • Nix Shell and Flakes
  • Audio / Video Transcoding tools
  • Photos and Videos
  • Static Website
  • Emacs
  • hey gcroots, save some of that garbage!
  • References

direnv

The power of nix with direnv is easy to understate. This post is to explains some ways to use it.

direnv is a nice tool to use which allows you to load the appropriate environment variables when you cd to a specific directory. supported shells are bash, zsh, tcsh, fish, elvish, and powershell.

July 5, 2023

nix and nixos

Table of Contents

  • Summary
  • Why NixOS
  • NixOS
  • Home Manager
  • Build Docker Containers
  • Development Shells
  • Nix Cache
  • Flakes
  • Resources

Summary

Nix is difficult to learn but the promises are appealing with a bit of effort. The effort required may not be worth it to some people.

Nix overall has so many features that it’s worth understanding what’s possible

with nix you can

January 29, 2023

dotbot

Table of Contents

  • why
  • dotbot

why

dotbot is a tool to manage dot files. I wrote this tool after gettting tired of futzing around with the python dotbot from https://github.com/anishathalye/dotbot. Full disclosure I love this tool and it’s the motivation for the development of my own dotbot.

I had two main issues that were annoying to me. First, git submodules were a part of the bootstrap process. Second, I always needed some yaml dependancy installed. These two steps combined and that written in a confusing shell script I managed to find getting setup annoying, and slightly difficult.

November 14, 2022

My Emacs Kit

This document will be a living document that i’ll attempt to update from time to time

Table of Contents

  • Intro
  • Pico and Nano
  • Vim
  • doom emacs
  • emacs28 with native compilation
  • Markdown mode
  • Org mode and babel

Intro

I’ve been using doom-emacs for over a year now (since March 2021) and this is my personal experiences with it.

I do not put a ton of effort into editors, rather I spend a chunk of time intermittently. This has happened with vi/vim and again with emacs. my vim configuration was always flaky and never worked correctly until around neovim. At that point I was so fed up with reproducible editor configuration that I looked for something better.

  • ««
  • «
  • 1
  • 2
  • 3
  • »
  • »»
© sigmonsays 2025