H5TE46JDBGYT7JWLWDX5IU4SRZVCKZTBMFXEECTJXIDFYHO24EVQC
# SPDX-License-Identifier: BlueOak-1.0.0
# SPDX-FileCopyrightText: 2025 toastal <toastal@posteo.net>
(import ./release.nix).fello-dev-shell
# SPDX-License-Identifier: BlueOak-1.0.0
# SPDX-FileCopyrightText: 2025 toastal <toastal@posteo.net>
let
flake_lock = builtins.fromJSON (builtins.readFile ./flake.lock);
pkgs_src = builtins.fetchTarball {
url =
flake_lock.nodes.nixpkgs.locked.url
or "https://github.com/NixOS/nixpkgs/archive/${flake_lock.nodes.nixpkgs.locked.rev}.tar.gz";
sha256 = flake_lock.nodes.nixpkgs.locked.narHash;
};
pkgs = import pkgs_src {
overlays = [
(import ./nix/overlays/default.nix)
(import ./nix/overlays/development.nix)
];
};
in
{
inherit (pkgs) fello fello-dev-shell;
fello-vocab = pkgs.factorPackages.fello;
}
# SPDX-License-Identifier: BlueOak-1.0.0
# SPDX-FileCopyrightText: 2025 toastal <toastal@posteo.net>
{
lib,
factorPackages,
}:
factorPackages.buildFactorVocab {
pname = "fello";
version = builtins.readFile ../../VERSION.txt;
vocabRoot = "extra";
src =
let
fs = lib.fileset;
factorFilter =
file:
lib.lists.any file.hasExt [
"factor"
"txt"
];
in
fs.toSource {
root = ../../extra;
fileset = fs.fileFilter factorFilter ../../extra;
};
meta = {
license = lib.licenses.blueOak100;
};
}
# SPDX-License-Identifier: BlueOak-1.0.0
# SPDX-FileCopyrightText: 2025 toastal <toastal@posteo.net>
{
lib,
factorPackages,
}:
factorPackages.buildFactorApplication {
pname = "fello";
binName = "fello";
vocabName = "fello.cli";
version = builtins.readFile ../../VERSION.txt;
src =
let
fs = lib.fileset;
factorFilter =
file:
lib.lists.any file.hasExt [
"factor"
"txt"
];
in
fs.toSource {
root = ../../extra;
fileset = fs.fileFilter factorFilter ../../extra;
};
enableDefaults = false;
enableUI = false;
extraVocabs = with factorPackages; [ ];
meta = {
license = lib.licenses.blueOak100;
};
}
# SPDX-License-Identifier: BlueOak-1.0.0
# SPDX-FileCopyrightText: 2025 toastal <toastal@posteo.net>
final: prev: {
fello-dev-shell = final.mkShellNoCC {
name = "fello";
inputsFrom = with final; [
fello
];
packages = with final; [
factorPackages.factor-lang
nixfmt-3-space
rlwrap # for ``rlwrap factor …``
];
shellHook = ''
export FACTOR_ROOTS="$FACTOR_ROOTS:$(pwd)/extra"
export FACTOR_IMAGE="$(pwd)/factor.image"
'';
};
nixfmt-3-space = final.writeTextFile {
name = "nixfmt-wrapped";
executable = true;
destination = "/bin/nixfmt";
text = # sh
''
#!${final.lib.getExe final.dash}
exec ${final.lib.getExe final.nixfmt-rfc-style} --indent=3 "$@"
'';
checkPhase = ''
${final.stdenv.shellDryRun} "$target"
'';
meta.mainProgram = "nixfmt";
};
}
# SPDX-License-Identifier: BlueOak-1.0.0
# SPDX-FileCopyrightText: 2025 toastal <toastal@posteo.net>
final: prev: {
factorPackages = prev.factorPackages.extend (
_: _: {
fello = final.callPackage ../packages/vocab.nix { };
}
);
fello = final.callPackage ../packages/bin.nix { };
}
# SPDX-License-Identifier: BlueOak-1.0.0
# SPDX-FileCopyrightText: 2025 toastal <toastal@posteo.net>
{
description = "factor-nix-demo";
inputs = {
#nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
# contains a fix for factorPackages.buildFactorVocab
nixpkgs.url = "github:nixos/nixpkgs?rev=bdcd50506b69b058890e7361027aee9fd690e627";
};
outputs =
{ self, nixpkgs, ... }@inputs:
let
# covering what what Factor *should* support (this may differ from
# what Nix actually support, but could/should)
supportedSystems = builtins.filter (
system:
builtins.any (archPrefix: nixpkgs.lib.hasPrefix archPrefix system) [
"x86_64-"
"i686-"
]
) nixpkgs.lib.systems.flakeExposed;
nixpkgsFor = nixpkgs.lib.genAttrs supportedSystems (
system:
import nixpkgs {
inherit system;
overlays = [
(import ./nix/overlays/default.nix)
(import ./nix/overlays/development.nix)
];
}
);
forAllSystems =
fn:
nixpkgs.lib.genAttrs supportedSystems (
system:
fn rec {
inherit system;
pkgs = nixpkgsFor.${system};
inherit (pkgs) lib;
}
);
in
{
overlays = {
default = import ./nix/overlays/default.nix;
dev-tools = import ./nix/overlays/development.nix;
};
packages = forAllSystems (
{ pkgs, ... }:
{
default = pkgs.fello;
}
);
devShells = forAllSystems (
{ pkgs, ... }:
{
default = pkgs.fello-dev-shell;
}
);
formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-3-space);
};
}
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1750747400,
"narHash": "sha256-ZarsHYqTyIWLemHIpxqw2i7VLMxvLYqhrUZtK1Ymzf4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "bdcd50506b69b058890e7361027aee9fd690e627",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"rev": "bdcd50506b69b058890e7361027aee9fd690e627",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
! SPDX-License-Identifier: BlueOak-1.0.0
! SPDX-FileCopyrightText: 2025 toastal <toastal@posteo.net>
USING: io ;
IN: fello
: print-hello ( -- ) "Say hello from Nix" print ;
MAIN: print-hello
! SPDX-License-Identifier: BlueOak-1.0.0
! SPDX-FileCopyrightText: 2025 toastal <toastal@posteo.net>
USING: fello ;
IN: fello.cli
MAIN: print-hello
toastal
# SPDX-License-Identifier: BlueOak-1.0.0
# SPDX-FileCopyrightText: 2025 toastal <toastal@posteo.net>
(import ./release.nix).fello
0-dev
===============================================================================
Factor Nix Demo
===============================================================================
-------------------------------------------------------------------------------
A basic starter for building a Factor project
-------------------------------------------------------------------------------
The Factor project is called ``fello`` for Factor + hello (& to not conflict
with :ac:`GNU` ``hello``).
License
===============================================================================
This project is licensed under the :t:`Blue Oak Model License, version 1.0.0`
(``BlueOak-1.0.0``) — for full tet read ``LICENSE.txt``.
Pitching in
===============================================================================
Currently this is best done by sending a patchset to
`toastal+factor-nix-demo@posteo.net
<mailto:toastal+factor-nix-demo@posteo.net>`_ or :ac:`DM` me a remote to clone
@ `toastal@toastal.in.th <xmpp:toastal@toastal.in.th>`_.
Funding / Support
===============================================================================
See choices at the `maker’s website <https://toast.al/funding>`_.
.. vim: set textwidth=79
# Blue Oak Model License
Version 1.0.0
## Purpose
This license gives everyone as much permission to work with
this software as possible, while protecting contributors
from liability.
## Acceptance
In order to receive this license, you must agree to its
rules. The rules of this license are both obligations
under that agreement and conditions to your license.
You must not do anything with this software that triggers
a rule that you cannot or will not follow.
## Copyright
Each contributor licenses you to do everything with this
software that would otherwise infringe that contributor's
copyright in it.
## Notices
You must ensure that everyone who gets a copy of
any part of this software from you, with or without
changes, also gets the text of this license or a link to
<https://blueoakcouncil.org/license/1.0.0>.
## Excuse
If anyone notifies you in writing that you have not
complied with [Notices](#notices), you can keep your
license by taking all practical steps to comply within 30
days after the notice. If you do not do so, your license
ends immediately.
## Patent
Each contributor licenses you to do everything with this
software that would otherwise infringe any patent claims
they can license or become able to license.
## Reliability
No contributor can revoke this license.
## No Liability
***As far as the law allows, this software comes as is,
without any warranty or condition, and no contributor
will be liable to anyone for any damages related to this
software or this license, under any kind of legal claim.***
# Nix stuff
result*
.envrc
.direnv
# Factor stuff
factor.image
# NO to Microsoft
devcontainer.json
*.code-workspace
.devcontainer
.github
.vscode
# NO to Docker
*Dockerfile*
*docker-compose*
# NO to invasive configs
.husky
.pre-commit-config.{yaml,yml}
# http://editorconfig.org/
# Tabs are preferred where possible; this is the only accessible choice
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
trim_trailing_whitespace = true
[VERSION.txt]
insert_final_newline = false
[*.factor]
indent_style = space
indent_size = 4
[*.nix]
indent_style = space
indent_size = 3
[*.rst]
indent_style = unset
indent_size = unset