Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,14 @@ DerivedData
*.eddx
*.xopp
*.DS_Store

# Nix/Devenv
.devenv/
.devenv.flake.nix
.direnv/
devenv.lock
result
result-*

# Build outputs
linuxBuild/build/
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,26 @@ sudo apt install build-essential
./alif filename.alif
```

### البناء باستخدام Nix و Devenv (اختياري):
إذا كان لديك نظام [Nix](https://nixos.org/) مثبت، يمكنك بناء اللغة والحصول على بيئة تطوير جاهزة بسهولة:

- **باستخدام devenv:**
1. قم بتشغيل الأمر للدخول في بيئة التطوير:
```sh
devenv shell
```
2. لبناء اللغة داخل البيئة:
```sh
build-alif
```

- **باستخدام nix build مباشرة:**
```sh
nix build
```

سيتم إنشاء ملف المفسر في `result/bin/alif`.

### نظام ماك (Mac):
- يجب توفر مترجم c++
- يمكنك تثبيته على mac عن طريق تثبيت XCode
Expand Down
103 changes: 103 additions & 0 deletions devenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1773931588,
"owner": "cachix",
"repo": "devenv",
"rev": "037d76fd57112e7b94d12656559075a70226aa63",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1767039857,
"owner": "NixOS",
"repo": "flake-compat",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "flake-compat",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1772893680,
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "8baab586afc9c9b57645a734c820e4ac0a604af9",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1762808025,
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "cb5e3fdca1de58ccbc3ef53de65bd372b48f567c",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1773628058,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f8573b9c935cfaa162dd62cc9e75ae2db86f85df",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"git-hooks": "git-hooks",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": [
"git-hooks"
]
}
}
},
"root": "root",
"version": 7
}
41 changes: 41 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{ pkgs, lib, config, inputs, ... }:

{
# https://devenv.sh/basics/
# env.GREET = "Welcome to Alif development environment!";

# https://devenv.sh/packages/
packages = with pkgs; [
gnumake
gcc
];

# https://devenv.sh/languages/
languages.cplusplus.enable = true;

# https://devenv.sh/processes/
# processes.ping.exec = "ping localhost";

# https://devenv.sh/services/
# services.postgres.enable = true;

# https://devenv.sh/scripts/
scripts.build-alif.exec = "cd linuxBuild && make";

enterShell = ''
echo "مرحباً بك في بيئة تطوير لغة ألف!"
echo "لبناء المشروع، استخدم الأمر: build-alif"
'';

# https://devenv.sh/tests/
# tests = {
# unit-tests = {
# exec = "build-alif";
# };
# };

# https://devenv.sh/pre-commit-hooks/
# pre-commit.hooks.shellcheck.enable = true;

# https://devenv.sh/reference/options/
}
3 changes: 3 additions & 0 deletions devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
Loading