messy code deserves a one-liner doc

This commit is contained in:
Joseph Hanson 2025-02-25 13:03:32 -06:00
parent f5e45209ec
commit d0496de0b3
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
2 changed files with 26 additions and 17 deletions

View file

@ -22,3 +22,10 @@
- [truxnell/dotfiles](https://github.com//truxnell/nix-config/)
- [billimek/dotfiles](https://github.com/billimek/dotfiles/)
## Upgrading the borgmatic template for reference
```sh
borgmatic config generate --source nixos/hosts/shadowfax/config/borgmatic/borgmatic-template.yaml --destination nixos/hosts/shadowfax/config/borgmatic/borgmatic-t
emplate.yaml --overwrite
```

View file

@ -1,7 +1,9 @@
{ lib, ... }:
{lib, ...}:
# Includes all files with .nix suffix in the current directory except default.nix
let
dir = ./.;
files = lib.filterAttrs (name: type:
files = lib.filterAttrs (
name: type:
type == "regular" && name != "default.nix" && lib.hasSuffix ".nix" name
) (builtins.readDir dir);
imports = map (name: "${dir}/${name}") (builtins.attrNames files);