# Fg42 - Emacs Editor for advance users # # Copyright (c) 2010-2024 Sameer Rahmani # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . { description = "FG42 - Emacs Editor for advance users"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/442d407992384ed9c0e6d352de75b69079904e4e"; inputs.noether.url = "git+https://devheroes.codes/lxsameer/noether?ref=refs/tags/v0.1.8"; inputs.emacs-overlay.url = "github:nix-community/emacs-overlay/0f7f3b39157419f3035a2dad39fbaf8a4ba0448d"; inputs.flake-parts.url = "github:hercules-ci/flake-parts"; outputs = { self, nixpkgs, flake-parts, ... }@inputs: flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "aarch64-darwin" "riscv64-linux" "x86_64-linux" ]; perSystem = { config, self', inputs', pkgs, system, ... }: let test-x = pkgs.writeShellApplication { name = "test-x"; runtimeInputs = [ pkgs.xorg.xorgserver ]; text = '' ${pkgs.xorg.xorgserver.out}/bin/Xephyr -br -ac -noreset -screen 800x600 :1 ''; }; noether = inputs.noether.outputs.packages.${system}.default; factory = params: pkgs.callPackage ./nix/factory.nix ({ inherit noether; } // params); default = (factory { }); in { packages = { default = default.fg42; } // (pkgs.lib.optionalAttrs (system == "x86_64-linux") { # Gtk causes a flickering issue on WM mode lucid = (factory { emacsParams.toolkit = "lucid"; }).fg42; gtk3 = (factory { emacsParams.withGTK3 = true; }).fg42; pgtk = (factory { emacsParams.withPgtk = true; }).fg42; gtk2 = (factory { emacsParams.withGTK2 = true; }).fg42; none = (factory { emacsParams.toolkit = "no"; }).fg42; }); devShells.default = pkgs.mkShell { nativeBuildInputs = [ default.fg42 pkgs.fish test-x default.run-test-wm ]; buildInputs = [ default.fg42 ]; }; apps.wm = { type = "app"; program = "${default.run-test-wm}/bin/run-test-wm"; }; apps.x = { type = "app"; program = "${test-x}/bin/test-x"; }; apps.default = { type = "app"; program = "${default.fg42}/bin/fg42"; }; }; }; }