2023-08-21 07:07:11 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
inputs,
|
|
|
|
pkgs,
|
|
|
|
...
|
2023-08-31 00:03:07 +02:00
|
|
|
}: let
|
2023-12-29 09:39:36 +01:00
|
|
|
inherit (builtins) attrValues mapAttrs;
|
2023-09-01 14:47:48 +02:00
|
|
|
inherit (lib) filterAttrs;
|
2023-09-03 00:58:47 +02:00
|
|
|
inherit (pkgs.stdenv) isDarwin isLinux;
|
2023-12-29 09:39:36 +01:00
|
|
|
flakeInputs = filterAttrs (name: value: (value ? outputs) && (name != "self")) inputs;
|
2023-08-31 00:03:07 +02:00
|
|
|
in {
|
2023-03-02 07:30:03 +01:00
|
|
|
nixpkgs.config.allowUnfree = true;
|
2023-02-14 00:18:43 +01:00
|
|
|
nix = {
|
|
|
|
gc.automatic = true;
|
2024-03-11 20:18:55 +01:00
|
|
|
package = pkgs.nixVersions.nix_2_18;
|
2023-07-10 04:59:10 +02:00
|
|
|
settings =
|
|
|
|
{
|
2023-12-27 23:56:56 +01:00
|
|
|
auto-optimise-store = true;
|
2023-07-10 04:59:10 +02:00
|
|
|
experimental-features = ["auto-allocate-uids" "flakes" "nix-command" "repl-flake"];
|
2023-11-06 07:28:26 +01:00
|
|
|
trusted-users = ["@sudo" "@wheel" "winston"];
|
2023-07-10 04:59:10 +02:00
|
|
|
use-xdg-base-directories = true;
|
|
|
|
warn-dirty = false;
|
|
|
|
}
|
2023-12-27 23:56:56 +01:00
|
|
|
// (import ../../../flake.nix).nixConfig;
|
2023-12-29 09:39:36 +01:00
|
|
|
registry = mapAttrs (name: v: {flake = v;}) flakeInputs;
|
2023-09-03 00:58:47 +02:00
|
|
|
nixPath =
|
|
|
|
if isDarwin
|
2023-12-29 09:39:36 +01:00
|
|
|
then lib.mkForce (mapAttrs (k: v: v.outPath) flakeInputs)
|
2023-09-03 00:58:47 +02:00
|
|
|
else if isLinux
|
2023-12-29 09:39:36 +01:00
|
|
|
then attrValues (mapAttrs (k: v: "${k}=${v.outPath}") flakeInputs)
|
2023-12-27 23:56:56 +01:00
|
|
|
else throw "Unsupported platform";
|
2023-02-13 23:33:09 +01:00
|
|
|
};
|
|
|
|
}
|