2021-03-31 02:12:04 +01:00
|
|
|
{
|
|
|
|
description = "tlater.net web server";
|
|
|
|
|
|
|
|
inputs = {
|
2024-01-01 18:56:16 +00:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.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,
|
2024-01-01 18:56:16 +00:00
|
|
|
}: 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";
|
2024-01-01 18:56:16 +00:00
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
fenixPkgs = fenix.packages.${system};
|
|
|
|
ownPkgs = self.packages.${system};
|
2022-08-13 21:44:31 +01:00
|
|
|
in {
|
2024-01-01 18:56:16 +00:00
|
|
|
packages.${system} = dream2nix.lib.importPackages {
|
|
|
|
projectRoot = ./.;
|
|
|
|
projectRootFile = "flake.nix";
|
|
|
|
packagesDir = ./packages;
|
|
|
|
packageSets = {
|
|
|
|
nixpkgs = pkgs;
|
|
|
|
fenix = fenixPkgs;
|
|
|
|
};
|
2022-08-13 21:44:31 +01:00
|
|
|
};
|
2021-03-31 22:25:44 +01:00
|
|
|
|
2023-01-19 07:59:58 +00:00
|
|
|
apps.${system} = {
|
|
|
|
default = let
|
2024-01-01 18:56:16 +00:00
|
|
|
inherit (ownPkgs) server templates;
|
|
|
|
inherit (pkgs) writeShellScript;
|
2023-01-19 07:59:58 +00:00
|
|
|
in {
|
|
|
|
type = "app";
|
|
|
|
program = builtins.toString (writeShellScript "tlaternet-webserver" ''
|
|
|
|
${server}/bin/tlaternet-webserver --template-directory ${templates}
|
|
|
|
'');
|
|
|
|
};
|
|
|
|
|
|
|
|
update = let
|
2024-01-01 18:56:16 +00:00
|
|
|
update-script = pkgs.callPackage ./nix/update.nix {inherit self;};
|
2023-01-19 07:59:58 +00:00
|
|
|
in {
|
|
|
|
type = "app";
|
|
|
|
program = "${update-script}/bin/update";
|
|
|
|
};
|
2022-09-29 03:24:41 +01:00
|
|
|
};
|
|
|
|
|
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} = {
|
2024-01-01 18:56:16 +00:00
|
|
|
server = pkgs.mkShell {
|
2022-09-18 18:52:01 +01:00
|
|
|
packages = [
|
2024-01-01 18:56:16 +00:00
|
|
|
(fenixPkgs.stable.withComponents [
|
2022-09-18 18:52:01 +01:00
|
|
|
"rustc"
|
|
|
|
"cargo"
|
|
|
|
"rustfmt"
|
|
|
|
"rust-std"
|
|
|
|
"rust-docs"
|
|
|
|
"clippy"
|
|
|
|
"rust-src"
|
|
|
|
"rust-analysis"
|
|
|
|
])
|
2024-01-01 18:56:16 +00:00
|
|
|
fenixPkgs.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 {
|
2024-01-02 14:06:58 +00:00
|
|
|
inherit self pkgs;
|
2022-10-03 02:40:19 +01:00
|
|
|
};
|
2022-08-13 21:44:31 +01:00
|
|
|
};
|
2021-03-31 02:12:04 +01:00
|
|
|
}
|