dragnpkgs/flake.nix

65 lines
1.9 KiB
Nix
Raw Normal View History

{
description = "dragnpkgs together with nixpkgs and lix";
inputs = {
2024-10-21 21:31:19 +00:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
lix-module = {
2024-11-13 06:09:12 +00:00
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz";
flake = false;
};
lix = {
2024-11-13 06:09:12 +00:00
url = "https://git.lix.systems/lix-project/lix/archive/2.91.1.tar.gz";
flake = false;
};
};
outputs = { self, nixpkgs, lix, lix-module }:
let
overlays = [
(import ./overlay.nix)
(import "${lix-module}/overlay.nix" { inherit lix; })
];
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
in {
lib = nixpkgs.lib.extend (final: prev: {
2024-10-21 21:37:02 +00:00
nixosSystem = args:
import "${nixpkgs}/nixos/lib/eval-config.nix" (
{
lib = final;
system = null;
modules = args.modules ++ [
({ config, pkgs, lib, ... }: {
config.nixpkgs.flake.source = self.outPath;
2024-10-21 21:44:09 +00:00
config.nixpkgs.overlays = overlays;
2024-10-21 21:37:02 +00:00
})
2024-10-21 21:56:47 +00:00
(import ./module.nix)
2024-10-21 21:37:02 +00:00
];
} // builtins.removeAttrs args [ "modules" ]
);
mkFlake = flakeDef:
let
rewritePerSystem = sectionDef: (forAllSystems (system:
builtins.mapAttrs (name: value:
2024-11-14 18:40:15 +00:00
self.legacyPackages.${system}.callPackage value {}
) sectionDef
));
in
builtins.mapAttrs (name: value:
if name == "packages" || name == "legacyPackages" || name == "devShells" then
rewritePerSystem value
else
value
) flakeDef;
});
legacyPackages = forAllSystems (system:
nixpkgs.legacyPackages.${system}.appendOverlays overlays
);
nixosModules = nixpkgs.nixosModules;
};
}