Files
natter/flake.nix

84 lines
1.9 KiB
Nix
Raw Normal View History

{
description = "Natter static site generator";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs =
{
self,
nixpkgs,
rust-overlay,
}:
let
forAllSystems =
func:
builtins.listToAttrs (
map (system: {
name = system;
value = func system;
}) nixpkgs.lib.systems.flakeExposed
);
in
{
devShells = forAllSystems (
system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
rustToolchain = (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml);
in
{
default = pkgs.mkShell {
nativeBuildInputs = [
rustToolchain
];
buildInputs = with pkgs; [
];
};
}
);
packages = forAllSystems (
system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
appliedOverlay = self.overlays.default pkgs pkgs;
in
rec {
default = release;
inherit (appliedOverlay.natter)
release
;
docker_env = pkgs.buildEnv {
name = "natter";
paths = with pkgs; [
appliedOverlay.natter.release
];
};
}
);
overlays.default = final: prev: {
natter = final.lib.makeScope final.newScope (natterScope: {
release = (
natterScope.callPackage ./nix/package.nix {
inherit rust-overlay;
buildType = "lto";
}
);
});
};
};
}