CCE

My NixOS Desktop/Laptop configuration

Contents

This is nixlib/roles/endpoint/default.nix which is installed on to a minimal NixOS with NixOps. It'll be a full NixOS configuration.nix when it grows up, likely generated in the same way as my home-manager configuration, but for now it's a minimal example. I have no idea how to make this a per-host configuration, eventually I will set up NixOps; for now everything is just gonna be set up by editing this, i guess, and I'll change things as I need to.

nix:tangle ~/nix/roles/endpoint/default.nix:noweb yes:mkdirp yes
{ pkgs, lib, ... }:

let
  endpointCfg = ./default.nix; # this file
in
rec {
  imports = [
    <<arroyo_nixos_imports()>>
  ];

  services.udev.extraRules = ''
    SUBSYSTEM=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0003", MODE="0666"
    SUBSYSTEM=="tty", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0005", SYMLINK+="pico"
  '';
  
  home-manager.users.rrix = import ../../home-manager.nix;
  environment.etc."nixos/configuration.nix".source = endpointCfg;
}

Lua Helper

Here the strings are basically just taken out of the Arroyo System Generator, formatted to point to the relative-root of the CCE nixlib directory, sorted alphabetically, and concatenated. Links to published versions of these modules can be found on the CCE index page.

lua#+name: arroyo_nixos_imports:eval arroyo:results raw
local modules = arroyo.nixos_modules_meta("endpoint")
local lines = {}
for i, m in ipairs(modules) do
    local line = m.module_path
    if m.heading_id ~= nil and m.title ~= nil then
        line = line .. " # [[id:" .. m.heading_id .. "][" .. m.title .. "]]"
    end
    table.insert(lines, line)
end
return table.concat(lines, "\n")

Workboard

NEXT split this in to dynamic CCE-modules like home-manager

some would say this isn't how it should work with org-roam but i think moving towards generating an imports statement instead of inserting a bunch of text in to a buffer, this makes the tooling work a bit better, probably.

NEXT minimise nerdfonts

https://github.com/NixOS/nixpkgs/blob/nixos-21.05/pkgs/data/fonts/nerdfonts/default.nix#L5-L7

https://github.com/NixOS/nixpkgs/blob/nixos-21.05/pkgs/data/fonts/nerdfonts/shas.nix