tlaternet-webserver/flake.nix
Tristan Daniël Maat 3727f41c1f
flake.lock: Update
Flake lock file updates:

• Updated input 'dream2nix':
    'github:nix-community/dream2nix/34a80ab215f1f24068ea9c76f3a7e5bc19478653' (2023-04-04)
  → 'github:nix-community/dream2nix/0c064fa9dd025069cc215b0a8b4eb5ea734aceb0' (2023-06-06)
• Updated input 'dream2nix/crane':
    'github:ipetkov/crane/59b31b41a589c0a65e4a1f86b0e5eac68081468b' (2022-12-13)
  → 'github:ipetkov/crane/445a3d222947632b5593112bb817850e8a9cf737' (2023-04-11)
• Updated input 'dream2nix/drv-parts':
    'github:davhau/drv-parts/ced8a52f62b0a94244713df2225c05c85b416110' (2023-03-30)
  → 'github:davhau/drv-parts/e8c2ec1157dc1edb002989669a0dbd935f430201' (2023-04-05)
• Updated input 'fenix':
    'github:nix-community/fenix/0d8c0d08db5fe6e5d995f4584f991ad60bbb1673' (2023-04-17)
  → 'github:nix-community/fenix/6fbeedcd2fc1fba77152e13fd7492824d77a4060' (2023-06-13)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/bab80dae445fd576cb4cc22ba208e9fbc39dc18d' (2023-04-16)
  → 'github:rust-lang/rust-analyzer/1f1fe81f0db301124b3026bd2940294526cdd852' (2023-06-12)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/de66115c552acc4e0c0f92c5a5efb32e37dfa216' (2023-04-17)
  → 'github:nixos/nixpkgs/bb8b5735d6f7e06b9ddd27de115b0600c1ffbdb4' (2023-06-11)
2023-06-13 17:45:51 +01:00

87 lines
2.4 KiB
Nix

{
description = "tlater.net web server";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
dream2nix.url = "github:nix-community/dream2nix";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
dream2nix,
fenix,
} @ flake-inputs: let
# At the moment, we only deploy to x86_64-linux. Update when we
# care about another platform.
system = "x86_64-linux";
flakeOutputs = nixpkgs.lib.callPackageWith flake-inputs (import ./nix/packages.nix) {inherit system;};
in {
packages.${system} = {
server = flakeOutputs.packages.${system}.tlaternet-webserver;
templates = flakeOutputs.packages.${system}.tlaternet;
};
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}
'');
};
update = let
update-script = nixpkgs.legacyPackages.${system}.callPackage ./nix/update.nix {
cargo = flakeOutputs.rust-toolchain.cargo;
npm = nixpkgs.legacyPackages.${system}.nodePackages_latest.npm;
npm-check-updates = self.packages.${system}.templates.dependencies.npm-check-updates;
};
in {
type = "app";
program = "${update-script}/bin/update";
};
};
nixosModules.default = import ./nix/module.nix {inherit self system;};
devShells.${system} = {
templates = flakeOutputs.devShells.${system}.tlaternet.overrideAttrs (old: {
buildInputs = with nixpkgs.legacyPackages.${system};
[
yj
]
++ old.buildInputs;
});
server = nixpkgs.legacyPackages.${system}.mkShell {
packages = [
(flakeOutputs.rust-toolchain.withComponents [
"rustc"
"cargo"
"rustfmt"
"rust-std"
"rust-docs"
"clippy"
"rust-src"
"rust-analysis"
])
fenix.packages.${system}.rust-analyzer
];
};
};
checks.${system} = import ./nix/checks {
inherit self system;
pkgs = nixpkgs.legacyPackages.${system};
};
};
}