diff --git a/nixos/overlays.nix b/nixos/overlays.nix index c244fd0..d5e32c6 100644 --- a/nixos/overlays.nix +++ b/nixos/overlays.nix @@ -1,6 +1,7 @@ { nur, fenix, nixpkgs-unstable, ... }: [ nur.overlays.default fenix.overlays.default + (import ./pkgs/overlay.nix {}) (final: prev: { unstable = import nixpkgs-unstable { system = prev.system; diff --git a/nixos/packages.nix b/nixos/packages.nix index d7b49a2..36ea4ed 100644 --- a/nixos/packages.nix +++ b/nixos/packages.nix @@ -7,12 +7,14 @@ environment.systemPackages = with pkgs; [ # development cc65 # C compiler for processors of 6502 family + chibicc-uxn (fenix.default.withComponents [ "cargo" "rustc" ]) gcc # GNU Compiler Collection, version 13.3.0 (wrapper script) git # Distributed version control system godot_4 # Free and Open Source 2D and 3D game engine gtk4 # Multi-platform toolkit for creating graphical user interfaces just # Handy way to save and run project-specific commands + gnumake # Tool to control the generation of non-source files from sources meson # Open source, fast and friendly build system made in Python nodejs_23 # Event-driven I/O framework for the V8 JavaScript engine pnpm # Fast, disk space efficient package manager for JavaScript diff --git a/nixos/pkgs/chibicc-uxn/default.nix b/nixos/pkgs/chibicc-uxn/default.nix new file mode 100644 index 0000000..06a85e6 --- /dev/null +++ b/nixos/pkgs/chibicc-uxn/default.nix @@ -0,0 +1,23 @@ +{ lib, stdenv, fetchFromGitHub }: stdenv.mkDerivation { + pname = "chibicc-uxn"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "lynn"; + repo = "chibicc"; + rev = "0a590db363fb8d69b80fc70d9dfb7e655aafe656"; + sha256 = "1jf18dh9ns0q79q8ql5yiw7l3zswyy0qjlz089xr3kw4zpqaqfmn"; + }; + + installPhase = '' + mkdir -p $out/bin + cp chibicc $out/bin + ''; + + meta = { + description = "A small C compiler... for uxn"; + homepage = "https://github.com/lynn/chibicc"; + license = lib.licenses.mit; + platforms = lib.platforms.unix; + }; +} diff --git a/nixos/pkgs/overlay.nix b/nixos/pkgs/overlay.nix new file mode 100644 index 0000000..eb26376 --- /dev/null +++ b/nixos/pkgs/overlay.nix @@ -0,0 +1,3 @@ +{ ... }: final: prev: with final; { + chibicc-uxn = callPackage ./chibicc-uxn {}; +}