Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7638128
bug(https://github.com/objectionary/eoc/issues/741): Add initial flak…
morphqdd Oct 19, 2025
5f15f72
bug(https://github.com/objectionary/eoc/issues/741): Improve flake.ni…
morphqdd Oct 20, 2025
cdddbdd
bug(https://github.com/objectionary/eoc/issues/741): Remove empty lin…
morphqdd Oct 20, 2025
ff4acf3
bug(https://github.com/objectionary/eoc/issues/741): Remove npm from …
morphqdd Oct 20, 2025
6145179
bug(https://github.com/objectionary/eoc/issues/741): Remove redundant…
morphqdd Oct 20, 2025
345d6d4
bug(https://github.com/objectionary/eoc/issues/741): Use node2nix to …
morphqdd Oct 20, 2025
59bf9bb
bug(https://github.com/objectionary/eoc/issues/741): Pass source to n…
morphqdd Oct 20, 2025
b83667f
bug(https://github.com/objectionary/eoc/issues/741): Use import inste…
morphqdd Oct 20, 2025
f6e6c82
bug(https://github.com/objectionary/eoc/issues/741): Use correct sour…
morphqdd Oct 20, 2025
b07da0b
bug(https://github.com/objectionary/eoc/issues/741): Use callPackage …
morphqdd Oct 20, 2025
2c5e1ab
bug(https://github.com/objectionary/eoc/issues/741): Import node2nix …
morphqdd Oct 20, 2025
db12afa
bug(https://github.com/objectionary/eoc/issues/741): Upgrade nodejs v…
morphqdd Oct 20, 2025
4680256
bug(https://github.com/objectionary/eoc/issues/741): Upgrade nodejs v…
morphqdd Oct 20, 2025
be22d02
bug(https://github.com/objectionary/eoc/issues/741): Package eolang a…
morphqdd Oct 20, 2025
9399106
bug(https://github.com/objectionary/eoc/issues/741): Prevent npm inst…
morphqdd Oct 20, 2025
d8959cc
bug(https://github.com/objectionary/eoc/issues/741): Use buildNpmPack…
morphqdd Oct 20, 2025
475e5d0
bug(https://github.com/objectionary/eoc/issues/741): Remove symlink t…
morphqdd Oct 20, 2025
78dbab1
bug(https://github.com/objectionary/eoc/issues/741): Use importNpmLoc…
morphqdd Oct 21, 2025
892e23c
bug(https://github.com/objectionary/eoc/issues/741): Remove broken sy…
morphqdd Oct 21, 2025
6fe526b
bug(https://github.com/objectionary/eoc/issues/741): Normalize packag…
morphqdd Oct 22, 2025
cb3694f
bug(https://github.com/objectionary/eoc/issues/741): Add Nix Flakes i…
morphqdd Oct 22, 2025
41ac365
bug(https://github.com/objectionary/eoc/issues/741): Fix typo in READ…
morphqdd Oct 22, 2025
98b8004
bug(https://github.com/objectionary/eoc/issues/741): Add SPDX headers…
morphqdd Oct 22, 2025
5490f57
bug(https://github.com/objectionary/eoc/issues/741): Add flake.lock t…
morphqdd Oct 22, 2025
c2dfacd
bug(https://github.com/objectionary/eoc/issues/741): Formatting issue…
morphqdd Oct 22, 2025
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
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,64 @@ brew tap objectionary/eoc https://github.com/objectionary/eoc
brew install objectionary/eoc/[email protected]
```

Or install it via [Nix flakes](https://nixos.wiki/wiki/Flakes):

```bash
nix run github:objectionary/eoc
```

You can also include EOLANG in your own flake:

```nix
{
inputs = {
eoc.url = "github:objectionary/eolang";
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
};

outputs = { self, nixpkgs, eoc, ... }: {
nixConfigurations.<hostname> = nixpkgs.lib.nixosSystem {
modules = [
{
nixpkgs.config.packageOverrides = pkgs: {
eoc = eoc.packages.${system}.default;
};
}
];
}
};
}
```

After that, select one of the methods for installing the package:

```nix
#configuration.nix (Global)
{
environment.systemPackages = with pkgs; [
eoc
];
}
```

```nix
#configuration.nix (For user)
{
users.users.<your-user-name>.packages = with pkgs; [
eoc
];
}
```

```nix
#home.nix (For home-manager)
{
home.packages = with pkgs; [
eoc
];
}
```

Then, you write a simple [EO](https://www.eolang.org) program in `hello.eo` file
in the current directory:

Expand Down
1 change: 1 addition & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ path = [
"MANIFEST.MF",
"README.md",
"renovate.json",
"flake.lock"
]
precedence = "override"
SPDX-FileCopyrightText = "Copyright (c) 2025 Yegor Bugayenko"
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

81 changes: 81 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Objectionary.com
# SPDX-License-Identifier: MIT
{
description = "Command-line toolkit for parsing, compiling, transpiling, optimizing, linking, dataizing, and running EOLANG programs";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
srcPatched = pkgs.runCommand "patched-src" {} ''
cp -r ${./.} $out
substituteInPlace $out/package.json \
--replace-quiet "\"node\": \"^25.0.0\"," ""
'';
lockHash = builtins.hashFile "sha512" ./package-lock.json;
packageJson = builtins.fromJSON (builtins.readFile ./package.json);
eolangBase = pkgs.buildNpmPackage {
pname = packageJson.name;
version = packageJson.version;
src = srcPatched;

buildInputs = [ pkgs.nodejs ];
dontNpmBuild = true;

installPhase = ''
mkdir -p $out/lib
cp -r . $out/lib
mkdir -p $out/bin
ln -s $out/lib/src/eoc.js $out/bin/eoc
chmod +x $out/bin/eoc
'';

npmDeps = pkgs.importNpmLock {
npmRoot = srcPatched;
};

npmConfigHook = pkgs.importNpmLock.npmConfigHook;

meta = with pkgs.lib; {
description = packageJson.description;
homepage = packageJson.homepage;
license = licenses.mit;
author = packageJson.author;
};
};

eolangWrapped = pkgs.writeShellScriptBin "eoc" ''
set -euo pipefail

EOC_STORE="${eolangBase}/lib"
EOC_STATE="$HOME/.eoc/lib"
EOC_HASH="${lockHash}"

mkdir -p "$EOC_STATE"

if [ ! -f "$EOC_STATE/.hash" ] || [ "$(cat $EOC_STATE/.hash)" != "$EOC_HASH" ]; then
rm -rf "$EOC_STATE/"
cp -r "$EOC_STORE/" "$EOC_STATE/"
chmod -R 755 "$EOC_STATE/"
echo "$EOC_HASH" > "$EOC_STATE/.hash"
fi

exec "${pkgs.nodejs}/bin/node" "$EOC_STATE/src/eoc.js" "$@"
'';

in {
packages.default = eolangWrapped;
meta = with pkgs.lib; {
description = packageJson.description;
homepage = packageJson.homepage;
license = licenses.mit;
author = packageJson.author;
};
}
);
}