forked from FG42/FG42
1
0
Fork 0
FG42/flake.nix

112 lines
3.2 KiB
Nix

# Fg42 - Emacs Editor for advance users
#
# Copyright (c) 2010-2024 Sameer Rahmani <lxsameer@gnu.org>
#
# 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 <http://www.gnu.org/licenses/>.
{
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.10";
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"
];
flake = {
# The home-manager integration. The can use FG42 with home-manager by including
# this module.
hm-module = rec {
fg42 = import ./nix/hm;
default = fg42;
};
};
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
'';
};
fg42 = pkgs.callPackage ./nix/fg42 {
inherit nixpkgs;
extraPackages = {
noether = inputs.noether.outputs.packages.${system}.default;
};
};
fg42-wm = pkgs.callPackage ./nix/fg42 {
inherit nixpkgs;
modules = [
./nix/modules/editor
./nix/modules/elisp
./nix/modules/graphics
./nix/modules/noether
./nix/modules/wm
];
extraPackages = {
noether = inputs.noether.outputs.packages.${system}.default;
};
};
run-test-wm = pkgs.writeShellApplication {
name = "run-test-wm";
runtimeInputs = [ fg42-wm ];
text = ''
DISPLAY=:1 ${fg42-wm}/bin/fg42-wm
'';
};
in
{
packages = {
default = fg42;
wm = fg42-wm;
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = [ fg42 fg42-wm pkgs.fish test-x run-test-wm ];
buildInputs = [ fg42 fg42-wm ];
};
apps.wm = {
type = "app";
program = "${run-test-wm}/bin/run-test-wm";
};
apps.x = {
type = "app";
program = "${test-x}/bin/test-x";
};
apps.default = {
type = "app";
program = "${fg42}/bin/fg42";
};
};
};
}