Commit Graph

16 Commits

Author SHA1 Message Date
anntnzrb
70ad5e14ae style(nix): apply nix fmt
Normalize formatting with the treefmt-based nix fmt configuration.
2026-03-16 14:30:34 -05:00
anntnzrb
1e41848ba9 fix: flatten home configs into packages to satisfy flake schema
The previous fix exposed `.activationPackage` but still nested them under
`packages.<system>.homeConfigurations`, which is an attrset, not a derivation.

`nix flake check` requires EVERY attribute under `packages.<system>` to be
a derivation. Now flattening home configurations directly into packages with
the prefix `homeConfigurations-<name>` to ensure each is a top-level derivation.

Changes:
- Merge pipe result directly with `//` instead of nesting under `homeConfigurations`
- Prefix each home config with "homeConfigurations-" to avoid naming conflicts

Result: `packages.x86_64-linux.homeConfigurations-user` instead of
        `packages.x86_64-linux.homeConfigurations.user`
2025-10-09 00:34:37 -05:00
anntnzrb
f92dcdecbb fix: expose activation packages instead of configs in packages output
`nix flake check` requires all `packages.<system>.*` to be derivations.
The previous implementation exposed full home-manager configurations (attrsets)
which caused validation to fail.

Now extracting `.activationPackage` from each home configuration to satisfy
the flake schema requirement.

Fixes CI failure introduced in 012761f.
2025-10-09 00:29:41 -05:00
anntnzrb
7d7ff85b41 style: fmt 2025-10-09 00:06:31 -05:00
anntnzrb
e0be5043e5 refactor: eliminate DRY violations and use pipe in flake
Extract module creation pattern into create-module-set helper to eliminate
triplication. Refactor get-libs to use pipe with filterAttrs and mapAttrs
instead of manual foldl accumulator. Pipeline home configurations transformation.

Changes:
- Added pipe to imports
- Added create-module-set helper for module creation
- Refactored nixos/darwin/home module creation to use helper
- Refactored get-libs using pipe (11 lines → 5 lines, 55% reduction)
- Refactored homeConfigurations using pipe (3 bindings → 1 pipeline)

Impact:
- Lines: +17 -28 (net: -11)
- Eliminated module creation triplication (15 lines → 9 lines)
- Much clearer get-libs logic (filterAttrs → mapAttrs)
- Better data flow in homeConfigurations
- Single source of truth for module creation

Testing: nix flake check ✓
2025-10-09 00:00:19 -05:00
anntnzrb
cedfe30aab refactor: remove rec keyword across codebase
Replace rec keyword with modern Nix patterns:
- Use explicit let...in bindings with inherit statements
- Use fix for recursive package bindings in package/default.nix
- This improves maintainability and follows idiomatic Nix patterns

Files modified:
- snowfall-lib/flake/default.nix
- snowfall-lib/fp/default.nix
- snowfall-lib/home/default.nix
- snowfall-lib/system/default.nix
- snowfall-lib/package/default.nix
2025-10-08 23:11:33 -05:00
anntnzrb
973b06a645 refactor: reduce code duplication with merge-with-aliases helper
Add merge-with-aliases function to attrs module and use it across checks,
modules, packages, shells, and templates to eliminate repeated alias merging
logic. Also optimize get-libs by replacing filter+map with a fold operation.
2025-10-08 22:40:48 -05:00
anntnzrb
9bd2ffc288 style: fmt 2025-10-08 21:56:09 -05:00
anntnzrb
d1eb5eb25b feat: enable per-channel configuration and fix pkgs selection 2025-10-08 21:35:51 -05:00
anntnzrb
012761f5f3 feat: support same username across multiple targets 2025-10-08 21:31:14 -05:00
Jake Hamilton
b2e6364075 feat: namespace arg, inputs for packages and overlays, get lib from root, add checks 2024-05-22 19:03:29 -07:00
Jake Hamilton
c13316eace fix: install shared modules, strip homes from config 2024-05-19 23:20:30 -07:00
Jake Hamilton
1284023e7a refactor: standardize on formatter 2024-05-19 23:20:26 -07:00
Jake Hamilton
9be6d6714e fix: use package namespace for overlays builder 2023-08-17 01:10:55 -07:00
Jake Hamilton
838d233474 feat: convert comments to doc comments 2023-08-17 00:24:05 -07:00
Jake Hamilton
116971f60d wip: initial frost support 2023-08-16 23:46:29 -07:00