diff options
| author | ยท๐๐ด๐๐๐ฉ๐ค | 2026-02-07 22:45:18 +0000 |
|---|---|---|
| committer | ยท๐๐ด๐๐๐ฉ๐ค | 2026-02-07 22:45:18 +0000 |
| commit | 6e5f3edb01fdfba6debf0814e7debb0d6afa7580 (patch) | |
| tree | 25b79baa09e532a91e142050a0ead20f7e1d6cfb /flake.nix | |
| parent | aed1a5c3a42b58c433db8bbf408404600b59782d (diff) | |
| download | nixtaml-6e5f3edb01fdfba6debf0814e7debb0d6afa7580.tar nixtaml-6e5f3edb01fdfba6debf0814e7debb0d6afa7580.tar.gz nixtaml-6e5f3edb01fdfba6debf0814e7debb0d6afa7580.tar.bz2 nixtaml-6e5f3edb01fdfba6debf0814e7debb0d6afa7580.tar.lz nixtaml-6e5f3edb01fdfba6debf0814e7debb0d6afa7580.tar.xz nixtaml-6e5f3edb01fdfba6debf0814e7debb0d6afa7580.tar.zst nixtaml-6e5f3edb01fdfba6debf0814e7debb0d6afa7580.zip | |
Phase 1: Implement dual flake support with ecosystem bridge
- Added flake.nix using wrapper pattern for modern flake access
- Implemented core outputs: packages, devShells, checks, lib, apps
- Generated flake.lock for reproducible builds
- Updated documentation with dual workflow examples
- Preserved traditional nix-build workflow compatibility
- Maintained philosophical stance as flake alternative/complement
- Enabled hybrid workflows and ecosystem integration
Provides modern flake access while maintaining nixtamal's core values.
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3d8d9a5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,76 @@ +#โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ +# SPDX-FileCopyrightText: 2025 toastal <https://toast.al/contact/> โ +# SPDX-License-Identifier: LGPL-2.1-or-later โ +#โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ +{ + description = "Nixtamal - A Nix version pinning tool with first-class support for Darcs, Pijul, and other VCS systems"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + + # Build nixtamal package using the traditional nix-build approach + # This preserves the existing build infrastructure + nixtamalPkg = pkgs.callPackage ./nix/package/nixtamal.nix { + # Override dependencies as needed + nixtamal = null; # Prevent infinite recursion + }; + + # Development shell using the same approach as shell.nix + devShell = pkgs.mkShell { + buildInputs = nixtamalPkg.buildInputs or []; + nativeBuildInputs = nixtamalPkg.nativeBuildInputs or []; + }; + in + { + # Package outputs + packages = { + nixtamal = nixtamalPkg; + default = nixtamalPkg; + }; + + # Development shell + devShells.default = devShell; + + # Test suite integration + checks = { + # Basic check that the package builds + nixtamal-build = nixtamalPkg; + }; + + # Library outputs for ecosystem integration + lib = { + # Expose the nixtamal package for flake consumption + nixtamal = nixtamalPkg; + + # Helper functions for hybrid workflows + makeHybridInputs = { + extraInputs ? {} + }: { + inherit nixtamalPkg; + } // extraInputs; + + # Utility to create flake-compatible inputs from nixtamal projects + fromNixtamalProject = projectPath: + import (projectPath + "/nix/tamal") { + inherit system; + nixpkgs = pkgs; + }; + }; + + # App output for running nixtamal directly + apps = { + nixtamal = { + type = "app"; + program = "${nixtamalPkg}/bin/nixtamal"; + }; + default = self.apps.${system}.nixtamal; + }; + }); +}
\ No newline at end of file |
