Skip to content

Instantly share code, notes, and snippets.

View graham33's full-sized avatar

Graham Bennett graham33

View GitHub Profile
@graham33
graham33 / lnnixug-nixos-module.md
Last active November 7, 2023 20:09
LN Nix User Group: Making a NixOS module

LN Nix User Group - Making a NixOS Module

Background

Home Assistant

I use [Home Assistant] on a NixOS server at home.

Home Assistant is an open-source home automation system, designed to be a central control system for smart home devices with a focus on local control and privacy. It's implemented in Python and has a bewildering array of integrations, so in turn it has a huge number of depdendencies!

There's a great [Home Assistant NixOS module] that allows declarative configuration of Home Assistant.

{ config, lib, pkgs, ... }:
# A temporary hack to `loginctl enable-linger $somebody` (for
# multiplexer sessions to last), until this one is unresolved:
# https://github.com/NixOS/nixpkgs/issues/3702
#
# Usage: `users.extraUsers.somebody.linger = true` or slt.
with lib;