2021-03-31 02:12:04 +01:00
|
|
|
{
|
|
|
|
description = "tlater.net web server";
|
|
|
|
|
|
|
|
inputs = {
|
2022-12-10 19:01:07 +00:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
|
2022-09-18 18:52:01 +01:00
|
|
|
dream2nix.url = "github:nix-community/dream2nix";
|
2021-03-31 02:12:04 +01:00
|
|
|
|
2022-09-18 18:52:01 +01:00
|
|
|
fenix = {
|
|
|
|
url = "github:nix-community/fenix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2022-08-13 21:44:31 +01:00
|
|
|
};
|
|
|
|
};
|
2021-03-31 22:25:44 +01:00
|
|
|
|
2022-08-13 21:44:31 +01:00
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
2022-09-18 18:52:01 +01:00
|
|
|
dream2nix,
|
|
|
|
fenix,
|
2023-01-05 02:13:13 +00:00
|
|
|
} @ flake-inputs: let
|
2022-08-13 21:44:31 +01:00
|
|
|
# At the moment, we only deploy to x86_64-linux. Update when we
|
|
|
|
# care about another platform.
|
|
|
|
system = "x86_64-linux";
|
2023-01-05 02:13:13 +00:00
|
|
|
flakeOutputs = nixpkgs.lib.callPackageWith flake-inputs (import ./nix/packages.nix) {inherit system;};
|
2022-08-13 21:44:31 +01:00
|
|
|
in {
|
2022-09-18 18:52:01 +01:00
|
|
|
packages.${system} = {
|
2023-01-05 02:13:13 +00:00
|
|
|
server = flakeOutputs.packages.${system}.tlaternet-webserver;
|
|
|
|
templates = flakeOutputs.packages.${system}.tlaternet;
|
2022-08-13 21:44:31 +01:00
|
|
|
};
|
2021-03-31 22:25:44 +01:00
|
|
|
|
2022-09-29 03:24:41 +01:00
|
|
|
apps.${system}.default = let
|
|
|
|
inherit (self.packages.${system}) server templates;
|
|
|
|
inherit (nixpkgs.legacyPackages.${system}) writeShellScript;
|
|
|
|
in {
|
|
|
|
type = "app";
|
|
|
|
program = builtins.toString (writeShellScript "tlaternet-webserver" ''
|
|
|
|
${server}/bin/tlaternet-webserver --template-directory ${templates}
|
|
|
|
'');
|
|
|
|
};
|
|
|
|
|
2022-09-29 03:24:56 +01:00
|
|
|
nixosModules.default = import ./nix/module.nix {inherit self system;};
|
|
|
|
|
2022-08-13 21:44:31 +01:00
|
|
|
devShells.${system} = {
|
2023-01-05 02:13:13 +00:00
|
|
|
templates = flakeOutputs.devShells.${system}.default.overrideAttrs (old: {
|
2022-09-18 18:52:01 +01:00
|
|
|
buildInputs = with nixpkgs.legacyPackages.${system};
|
2022-08-13 21:44:31 +01:00
|
|
|
[
|
2022-09-18 18:52:01 +01:00
|
|
|
yj
|
2022-08-13 21:44:31 +01:00
|
|
|
]
|
2022-09-18 18:52:01 +01:00
|
|
|
++ old.buildInputs;
|
|
|
|
});
|
|
|
|
|
|
|
|
server = nixpkgs.legacyPackages.${system}.mkShell {
|
|
|
|
packages = [
|
2023-01-05 02:13:13 +00:00
|
|
|
(flakeOutputs.rust-toolchain.withComponents [
|
2022-09-18 18:52:01 +01:00
|
|
|
"rustc"
|
|
|
|
"cargo"
|
|
|
|
"rustfmt"
|
|
|
|
"rust-std"
|
|
|
|
"rust-docs"
|
|
|
|
"clippy"
|
|
|
|
"rust-src"
|
|
|
|
"rust-analysis"
|
|
|
|
])
|
|
|
|
fenix.packages.${system}.rust-analyzer
|
2022-08-13 21:44:31 +01:00
|
|
|
];
|
2021-03-31 22:25:44 +01:00
|
|
|
};
|
2021-03-31 02:12:04 +01:00
|
|
|
};
|
2022-10-03 02:40:19 +01:00
|
|
|
|
|
|
|
checks.${system} = import ./nix/checks {
|
|
|
|
inherit self system;
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
};
|
2022-08-13 21:44:31 +01:00
|
|
|
};
|
2021-03-31 02:12:04 +01:00
|
|
|
}
|