Skip to content

Commit

Permalink
refactor(flake.nix): simplify overlay configuration
Browse files Browse the repository at this point in the history
simplify NixOS/nixpkgs#358036 and updated the overlay
configuration in flake.nix. This change reduces complexity and improves
maintainability.
  • Loading branch information
tani committed Nov 22, 2024
1 parent d4a393e commit 38d83f9
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,12 @@
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs @ { nixpkgs, flake-parts, ... }:
let
# This is a workaround for https://github.com/NixOS/nixpkgs/pull/358036
patch = flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
flake-parts.flakeModules.easyOverlay
];
systems = nixpkgs.lib.platforms.all;
perSystem = { pkgs, ... }: {
overlayAttrs = {
ccl = pkgs.lib.recursiveUpdate pkgs.ccl { meta.mainProgram = "ccl"; };
mkcl = pkgs.lib.recursiveUpdate pkgs.mkcl { meta.mainProgram = "mkcl"; };
cmucl_binary = pkgs.lib.recursiveUpdate pkgs.cmucl_binary { meta.mainProgram = "lisp"; };
};
};
};
in
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
flake-parts.flakeModules.easyOverlay
];
systems = nixpkgs.lib.platforms.all;
perSystem = { config, pkgs, system, ... }: let
perSystem = { config, pkgs, lib, system, ... }: let
############ Settings ############
## Project name
pname = "fibonacci";
Expand Down Expand Up @@ -211,9 +195,12 @@
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
patch.overlays.default
(_: final: {
ccl = lib.recursiveUpdate final.ccl { meta.mainProgram = "ccl"; };
mkcl = lib.recursiveUpdate final.mkcl { meta.mainProgram = "mkcl"; };
cmucl_binary = lib.recursiveUpdate final.cmucl_binary { meta.mainProgram = "lisp"; };
})
];
config = { };
};
overlayAttrs = builtins.listToAttrs (builtins.map overlays availableLispImpls);
devShells.default = pkgs.mkShell {
Expand Down

0 comments on commit 38d83f9

Please sign in to comment.