example refactor snowflake module system

This commit is contained in:
do butterflies cry? 2026-03-09 02:46:41 +10:00
parent 0314109bc0
commit 3e29615db9
Signed by: cry
GPG key ID: F68745A836CA0412
26 changed files with 1306 additions and 165 deletions

View file

@ -0,0 +1,23 @@
{ lib, flake-parts-lib, ... }:
let
inherit (lib)
mkOption
types
;
inherit (flake-parts-lib)
mkTransposedPerSystemModule
;
in
mkTransposedPerSystemModule {
name = "packages";
option = mkOption {
type = types.lazyAttrsOf types.package;
default = { };
description = ''
An attribute set of packages to be built by [`nix build`](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-build.html).
`nix build .#<name>` will build `packages.<name>`.
'';
};
file = ./packages.nix;
}