Commit Graph

128 Commits

Author SHA1 Message Date
mjallen18
e426f2244f docs 2026-03-16 14:16:55 -05:00
mjallen18
e4bb3f2fd3 update nixpkgs to 25.11 2025-12-05 16:36:11 -06:00
mjallen18
ddfab125d3 fold -> foldr 2025-12-01 09:39:46 -06:00
mjallen18
07d7456158 fold -> foldr 2025-12-01 09:38:41 -06: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
3c01e24645 refactor: use pipe for clearer data transformations in overlay and home
Replace multiple intermediate let bindings with pipe for clearer data flow
in default-overlay creation and split-user-and-host function.

Changes:
- overlay/default.nix: Added pipe and flatten to imports
- overlay/default.nix: Refactored default-overlay using pipe (5 bindings → 1 pipeline)
- home/default.nix: Added pipe to imports
- home/default.nix: Refactored split-user-and-host using pipe

Impact:
- Lines: +8 -14 (net: -6)
- Eliminated 6 intermediate bindings total
- Clearer data transformation flow
- More maintainable code

Testing: nix flake check ✓
2025-10-09 00:00:09 -05:00
anntnzrb
8bfe3616e5 refactor: improve attrs helpers and extract merge logic
Add apply-aliases-and-overrides for pre-merged attribute sets (e.g., from fix).
Extract nested merge logic in merge-shallow-packages into named merge-item
helper for better testability. Inline single-use aliased-items binding.

Changes:
- attrs/default.nix: Added apply-aliases-and-overrides helper
- attrs/default.nix: Extracted merge-item and merge-value helpers
- attrs/default.nix: Inlined single-use binding in merge-with-aliases
- package/default.nix: Use new apply-aliases-and-overrides helper

Impact:
- Lines: +17 -5 (net: +12, but adds reusable helper)
- Better separation of concerns
- Improved testability
- Consistent alias handling across codebase

Testing: nix flake check ✓
2025-10-09 00:00:00 -05:00
anntnzrb
4df1f04931 refactor: unify filesystem operations with pipe and higher-order functions
Introduce get-entries-by-kind to eliminate duplication between get-directories
and get-files. Add filter-files helpers to reduce 6 similar filtering functions
into 2 reusable higher-order functions.

Changes:
- Added pipe to imports
- Added get-entries-by-kind using pipe for clearer data flow
- Refactored get-directories and get-files to use get-entries-by-kind
- Added filter-files and filter-files-recursive helpers
- Refactored all 6 file filtering functions to one-liners using helpers

Impact:
- Lines: +30 -49 (net: -19)
- Eliminated duplication in filesystem operations
- Introduced modern pipe pattern for data transformations
- Better composability with higher-order functions

Testing: nix flake check ✓
2025-10-08 23:59:51 -05:00
anntnzrb
e629ecd57d refactor: use point-free style for path utilities
Use fp.compose for get-output-name and get-directory-name to leverage
existing composition utilities and adopt more idiomatic functional style.

Changes:
- path/default.nix: Convert to point-free using snowfall-lib.fp.compose

Impact: Improved code style, more functional approach
Testing: nix flake check ✓
2025-10-08 23:59:40 -05:00
anntnzrb
06620a8e41 feat: add fs.get-directories-with-default helper to eliminate duplicate directory filtering 2025-10-08 23:42:04 -05:00
anntnzrb
9969d5d8e3 feat: add path.get-relative-module-path helper to extract module paths consistently 2025-10-08 23:42:00 -05:00
anntnzrb
903e38d999 feat: add path.get-directory-name helper for consistent directory name extraction 2025-10-08 23:41:57 -05:00
anntnzrb
a8025edb45 refactor(shell): use create-simple-derivations helper 2025-10-08 23:28:36 -05:00
anntnzrb
db72aa1e33 refactor(checks): use create-simple-derivations helper 2025-10-08 23:28:21 -05:00
anntnzrb
adbd6680dc refactor(internal): add create-simple-derivations helper 2025-10-08 23:28:02 -05:00
anntnzrb
e4771be1c1 refactor(path): add get-output-name helper to eliminate duplication 2025-10-08 23:27:36 -05:00
anntnzrb
1f7af06347 fix: correct fold argument order in get-libs function
Fix argument order for fold/foldr - the list element comes before the
accumulator in foldr, not after. This was causing evaluation errors
when using the library.
2025-10-08 23:11:50 -05:00
anntnzrb
47c33cfae1 docs: add comments explaining unsafeDiscardStringContext usage
Add clear documentation for all uses of unsafeDiscardStringContext,
explaining that it's necessary when building flake outputs based on
file paths, as Nix doesn't allow using paths as attribute names directly.
2025-10-08 23:11:44 -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
a905b259d5 chore: remove .github directory 2025-10-08 22:07:58 -05:00
anntnzrb
313e1fab46 chore: remove flake-compat (legacy support) 2025-10-08 22:06:28 -05:00
anntnzrb
9bd2ffc288 style: fmt 2025-10-08 21:56:09 -05:00
anntnzrb
592bb5148d chore: switch formatter from alejandra to nixfmt 2025-10-08 21:55:34 -05:00
anntnzrb
22f45f9cf3 chore: bump nixpkgs to release-25.05 2025-10-08 21:47:13 -05:00
anntnzrb
ff10f4dfbf chore: update flake-utils-plus to master branch 2025-10-08 21:44:48 -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
anntnzrb
3d03566997 fix: pass namespace argument to home-manager modules 2025-10-08 21:27:22 -05:00
anntnzrb
b85b94de04 fix: pass namespace argument to overlays 2025-10-08 21:24:21 -05:00
anntnzrb
f00967f8a9 feat: auto-extract template descriptions from flake.nix 2025-10-08 21:21:52 -05:00
anntnzrb
3f738f00e0 perf: replace ./ with self to improve evaluation speed 2025-10-08 21:14:24 -05:00
Jake Hamilton
02d941739f Merge pull request #153 from michaelBelsanti/main
fix: replace cfg.useUserPackages with home-manager.useUserPackages
2025-01-05 18:28:15 -08:00
michaelBelsanti
6231ee4443 fix: replace cfg.useUserPackages with home-manager.useUserPackages 2025-01-05 15:35:37 -05:00
Jake Hamilton
cfeacd0555 Merge pull request #141 from msfjarvis/main
fix: replace `pkgs.system` with `pkgs.stdenv.hostPlatform.system`
2024-11-25 06:17:54 -08:00
Harsh Shandilya
fe5c2acd4b fix: replace pkgs.system with pkgs.stdenv.hostPlatform.system 2024-11-24 23:58:15 +05:30
Jake Hamilton
dd348182c1 Merge pull request #122 from cscutcher/patch-1
fix: Correct simple typo in definition`os-user-home` in home module
2024-10-28 10:22:01 -07:00
Jake Hamilton
d9ce57bd9e Merge pull request #133 from MrIngelborn/patch-1
feat: Add proxmox-lxc to virtual systems
2024-10-28 04:52:57 -07:00
Jake Hamilton
6707fe8c45 Merge pull request #134 from dtgagnon/patch-1
"Fix": in virtual-systems.nix, swapped position "raw-efi" <-> "raw"
2024-10-28 04:51:42 -07:00
dtgagnon
b99bc8db44 Update virtual-systems.nix
Re-ordered to align w/ most -> least specific.
2024-10-28 07:40:51 -04:00
Marcus Ingelborn
81aaf22d46 Add proxmox-lxc to virtual systems 2024-10-25 20:43:56 +00:00
Chris Scutcher
b5d4366dfd fix: Correct simple typo in home module 2024-07-26 12:10:06 +01:00
Jake Hamilton
c6238c83de Merge pull request #113 from ClicksCodes/fix-transitive-sytem-lib
fix: make system-lib imports use namespaces
2024-06-21 14:39:44 -07:00
Skyler Grey
312ad5d16c fix: make system-lib imports use namespaces
Previously when you accessed stuff on your lib via snowfall-lib's
internal system-lib (e.g. with lib.snowfall.internal.system-lib.my-namespace.my-lib-function)
the lib which is passed to *your* lib used hardcoded the "internal" name

This makes lib functions in your flake's lib break if they use other lib
functions in your flake's lib
2024-06-21 21:37:25 +00:00
Jake Hamilton
aa19b02b63 Merge pull request #105 from snowfallorg/dev
fix: revert fs path type usage
2024-06-11 02:15:23 -07:00
Jake Hamilton
c7edfb1b93 Merge pull request #102 from thelioncape/main
Add proxmox-lxc to virtual-systems to support generating proxmox lxc tarballs
2024-06-11 02:15:04 -07:00
Jake Hamilton
5a10d2e37b fix: revert fs path type usage 2024-06-05 15:13:19 -07:00