lisp-scripts/flake.nix

60 lines
1.6 KiB
Nix
Raw Normal View History

2024-10-27 23:44:59 -07:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default-linux";
cl-hyprland-ipc = {
url = "github:eriedaberrie/cl-hyprland-ipc";
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems";
};
2024-10-27 23:44:59 -07:00
};
outputs = {
self,
nixpkgs,
systems,
cl-hyprland-ipc,
2024-10-27 23:44:59 -07:00
}: let
inherit (nixpkgs) lib;
forSystems = f:
lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
in {
overlays = {
default = _: prev: {
sync-music = prev.callPackage ./nix/sync-music.nix {};
time-window = prev.callPackage ./nix/time-window.nix {
inherit (cl-hyprland-ipc.packages.${prev.stdenv.system}) cl-hyprland-ipc;
};
2024-10-27 23:44:59 -07:00
};
};
packages = forSystems (self.overlays.default null);
devShells = forSystems (
pkgs: {
default = pkgs.mkShell rec {
inputsFrom = builtins.attrValues self.packages.${pkgs.stdenv.system};
2024-10-27 23:44:59 -07:00
nativeBuildInputs =
[
(pkgs.sbcl.withPackages (lib.const
(lib.concatMap (p: p.lispLibs) inputsFrom)))
2024-10-27 23:44:59 -07:00
]
++ lib.concatMap (p: p.runtimeInputs or []) inputsFrom;
LD_LIBRARY_PATH = let
getNativeLibs = d:
d.nativeLibs
or []
++ builtins.concatMap getNativeLibs (d.lispLibs or []);
in lib.makeLibraryPath (lib.lists.unique (builtins.concatMap getNativeLibs inputsFrom));
2024-10-27 23:44:59 -07:00
};
}
);
formatter = forSystems (pkgs: pkgs.alejandra);
};
}