tlaternet-webserver/flake.nix
Tristan Daniël Maat 9fb195819e
templates: Handle package.json conversion in direnv
By splitting out the check for package.yaml into a separate check, we
can avoid the constant massive shell reloads for the nix shell.
2022-10-05 12:34:43 +01:00

57 lines
1.4 KiB
Nix

{
description = "tlater.net web server";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";
dream2nix.url = "github:nix-community/dream2nix";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
dream2nix,
fenix,
}: let
# At the moment, we only deploy to x86_64-linux. Update when we
# care about another platform.
system = "x86_64-linux";
flakeOutputs = import ./nix/packages.nix {inherit nixpkgs dream2nix fenix system;};
in {
packages.${system} = {
server = flakeOutputs.server.packages.${system}.default;
templates = flakeOutputs.templates.packages.${system}.default;
};
devShells.${system} = {
templates = flakeOutputs.templates.devShells.${system}.default.overrideAttrs (old: {
buildInputs = with nixpkgs.legacyPackages.${system};
[
yj
]
++ old.buildInputs;
});
server = nixpkgs.legacyPackages.${system}.mkShell {
packages = [
(flakeOutputs.server.rust-toolchain.withComponents [
"rustc"
"cargo"
"rustfmt"
"rust-std"
"rust-docs"
"clippy"
"rust-src"
"rust-analysis"
])
fenix.packages.${system}.rust-analyzer
];
};
};
};
}