introduce flake that exports nixpkgs with overlays

This commit is contained in:
xenia 2024-10-21 16:59:17 -04:00
parent 7b96503597
commit 1ec0ed1bab
5 changed files with 88 additions and 49 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
/result
# we ignore flake.lock because this isn't intended to pin a specific version of nixpkgs
/flake.lock

View File

@ -1,52 +1,5 @@
{ ... }:
{
imports = [
./modules/ghidra-server
];
nixpkgs.overlays = [
(final: prev: {
fetchFromSteam = prev.callPackage ./lib/fetchsteam {};
fetchb4 = prev.callPackage ./lib/fetchb4 {};
gitSource = prev.callPackage ./lib/git-source {};
makeSquashFs = prev.callPackage ./lib/make-squashfs {};
makeHpcDist = final.callPackage ./lib/make-hpc-dist {};
ghidra_headless = prev.ghidra.override {
openjdk17 = prev.openjdk17_headless;
};
# stuff that tracks upstream
ghidra = final.callPackage ./pkgs/ghidra-xenia/build.nix {
protobuf = final.protobuf_21;
};
ghidra-extensions = final.lib.recurseIntoAttrs (final.callPackage ./pkgs/ghidra-xenia/extensions.nix { });
ghidra-bin = final.callPackage ./pkgs/ghidra-xenia { };
kicad = final.callPackage ./pkgs/kicad-xenia { };
kicadAddons = final.lib.recurseIntoAttrs (final.callPackage ./pkgs/kicad-xenia/addons {});
# end stuff that tracks upstream
ocamlPackages = prev.ocamlPackages.overrideScope (ofinal: oprev: {
ppx_unicode = ofinal.callPackage ./pkgs/ocaml/ppx_unicode {};
xlog = ofinal.callPackage ./pkgs/ocaml/xlog {};
});
python312Packages = prev.python312Packages.overrideScope (pfinal: pprev: {
feedvalidator = pfinal.callPackage ./pkgs/python/feedvalidator {};
});
# add to top level because it has a binary
feedvalidator = final.python312Packages.feedvalidator;
outer-wilds-text-adventure = prev.callPackage ./pkgs/games/outer-wilds-text-adventure {};
mkNginxServer = prev.callPackage ./lib/dev-nginx {};
})
];
imports = [ ./module.nix ];
nixpkgs.overlays = import ./overlay.nix;
}

37
flake.nix Normal file
View File

@ -0,0 +1,37 @@
{
description = "dragnpkgs together with nixpkgs and lix";
inputs = {
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";
flake = false;
};
lix = {
url = "https://git.lix.systems/lix-project/lix/archive/2.91.0.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: {
nixosSystem = (args: prev.nixosSystem {
modules = args.modules ++ [
({ ... }: { nixpkgs.overlays = overlays; })
];
} // builtins.removeAttrs args [ "modules" ]);
});
legacyPackages = forAllSystems (system:
nixpkgs.legacyPackages.${system}.appendOverlays overlays
);
nixosModules = nixpkgs.nixosModules;
};
}

5
module.nix Normal file
View File

@ -0,0 +1,5 @@
{ ... }: {
imports = [
./modules/ghidra-server
];
}

42
overlay.nix Normal file
View File

@ -0,0 +1,42 @@
final: prev: {
fetchFromSteam = prev.callPackage ./lib/fetchsteam {};
fetchb4 = prev.callPackage ./lib/fetchb4 {};
gitSource = prev.callPackage ./lib/git-source {};
makeSquashFs = prev.callPackage ./lib/make-squashfs {};
makeHpcDist = final.callPackage ./lib/make-hpc-dist {};
ghidra_headless = prev.ghidra.override {
openjdk17 = prev.openjdk17_headless;
};
# stuff that tracks upstream
ghidra = final.callPackage ./pkgs/ghidra-xenia/build.nix {
protobuf = final.protobuf_21;
};
ghidra-extensions = final.lib.recurseIntoAttrs (final.callPackage ./pkgs/ghidra-xenia/extensions.nix { });
ghidra-bin = final.callPackage ./pkgs/ghidra-xenia { };
kicad = final.callPackage ./pkgs/kicad-xenia { };
kicadAddons = final.lib.recurseIntoAttrs (final.callPackage ./pkgs/kicad-xenia/addons {});
# end stuff that tracks upstream
ocamlPackages = prev.ocamlPackages.overrideScope (ofinal: oprev: {
ppx_unicode = ofinal.callPackage ./pkgs/ocaml/ppx_unicode {};
xlog = ofinal.callPackage ./pkgs/ocaml/xlog {};
});
python312Packages = prev.python312Packages.overrideScope (pfinal: pprev: {
feedvalidator = pfinal.callPackage ./pkgs/python/feedvalidator {};
});
# add to top level because it has a binary
feedvalidator = final.python312Packages.feedvalidator;
outer-wilds-text-adventure = prev.callPackage ./pkgs/games/outer-wilds-text-adventure {};
mkNginxServer = prev.callPackage ./lib/dev-nginx {};
}