summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorยท๐‘‘๐‘ด๐‘•๐‘‘๐‘ฉ๐‘ค2026-02-07 22:45:18 +0000
committerยท๐‘‘๐‘ด๐‘•๐‘‘๐‘ฉ๐‘ค2026-02-07 22:45:18 +0000
commit6e5f3edb01fdfba6debf0814e7debb0d6afa7580 (patch)
tree25b79baa09e532a91e142050a0ead20f7e1d6cfb /flake.nix
parentaed1a5c3a42b58c433db8bbf408404600b59782d (diff)
downloadnixtaml-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.nix76
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