mirror of
https://github.com/zhaofengli/attic.git
synced 2024-12-14 11:57:30 +00:00
flake.nix: Add overlay
This commit is contained in:
parent
b0471c6804
commit
d1e1cf7a61
1 changed files with 23 additions and 13 deletions
36
flake.nix
36
flake.nix
|
@ -20,11 +20,13 @@
|
|||
|
||||
outputs = { self, nixpkgs, flake-utils, crane, ... }: let
|
||||
supportedSystems = flake-utils.lib.defaultSystems;
|
||||
|
||||
makeCranePkgs = pkgs: let
|
||||
craneLib = crane.mkLib pkgs;
|
||||
in pkgs.callPackage ./crane.nix { inherit craneLib; };
|
||||
in flake-utils.lib.eachSystem supportedSystems (system: let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
|
||||
craneLib = crane.lib.${system};
|
||||
cranePkgs = pkgs.callPackage ./crane.nix { inherit craneLib; };
|
||||
cranePkgs = makeCranePkgs pkgs;
|
||||
|
||||
inherit (pkgs) lib;
|
||||
in rec {
|
||||
|
@ -39,6 +41,10 @@
|
|||
inherit self;
|
||||
};
|
||||
|
||||
book = pkgs.callPackage ./book {
|
||||
attic = packages.attic;
|
||||
};
|
||||
} // (lib.optionalAttrs pkgs.stdenv.isLinux {
|
||||
attic-server-image = pkgs.dockerTools.buildImage {
|
||||
name = "attic-server";
|
||||
tag = "main";
|
||||
|
@ -55,15 +61,7 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
|
||||
book = pkgs.callPackage ./book {
|
||||
attic = packages.attic;
|
||||
};
|
||||
};
|
||||
|
||||
internal = {
|
||||
inherit (cranePkgs) attic-tests cargoArtifacts;
|
||||
};
|
||||
});
|
||||
|
||||
devShells = {
|
||||
default = pkgs.mkShell {
|
||||
|
@ -105,5 +103,17 @@
|
|||
};
|
||||
};
|
||||
devShell = devShells.default;
|
||||
});
|
||||
|
||||
internal = {
|
||||
inherit (cranePkgs) attic-tests cargoArtifacts;
|
||||
};
|
||||
}) // {
|
||||
overlays = {
|
||||
default = final: prev: let
|
||||
cranePkgs = makeCranePkgs final;
|
||||
in {
|
||||
inherit (cranePkgs) attic attic-client attic-server;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue