treewide: Migrate to the new dream2nix API
This commit is contained in:
parent
5163ef9d6a
commit
40e0946201
59 changed files with 15003 additions and 24504 deletions
46
flake.nix
46
flake.nix
|
@ -2,7 +2,7 @@
|
|||
description = "tlater.net web server";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
|
||||
dream2nix.url = "github:nix-community/dream2nix";
|
||||
|
||||
fenix = {
|
||||
|
@ -16,21 +16,28 @@
|
|||
nixpkgs,
|
||||
dream2nix,
|
||||
fenix,
|
||||
} @ flake-inputs: let
|
||||
}: 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;};
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
fenixPkgs = fenix.packages.${system};
|
||||
ownPkgs = self.packages.${system};
|
||||
in {
|
||||
packages.${system} = {
|
||||
server = flakeOutputs.packages.${system}.tlaternet-webserver;
|
||||
templates = flakeOutputs.packages.${system}.tlaternet;
|
||||
packages.${system} = dream2nix.lib.importPackages {
|
||||
projectRoot = ./.;
|
||||
projectRootFile = "flake.nix";
|
||||
packagesDir = ./packages;
|
||||
packageSets = {
|
||||
nixpkgs = pkgs;
|
||||
fenix = fenixPkgs;
|
||||
};
|
||||
};
|
||||
|
||||
apps.${system} = {
|
||||
default = let
|
||||
inherit (self.packages.${system}) server templates;
|
||||
inherit (nixpkgs.legacyPackages.${system}) writeShellScript;
|
||||
inherit (ownPkgs) server templates;
|
||||
inherit (pkgs) writeShellScript;
|
||||
in {
|
||||
type = "app";
|
||||
program = builtins.toString (writeShellScript "tlaternet-webserver" ''
|
||||
|
@ -39,11 +46,7 @@
|
|||
};
|
||||
|
||||
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;
|
||||
};
|
||||
update-script = pkgs.callPackage ./nix/update.nix {inherit self;};
|
||||
in {
|
||||
type = "app";
|
||||
program = "${update-script}/bin/update";
|
||||
|
@ -53,17 +56,9 @@
|
|||
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 {
|
||||
server = pkgs.mkShell {
|
||||
packages = [
|
||||
(flakeOutputs.rust-toolchain.withComponents [
|
||||
(fenixPkgs.stable.withComponents [
|
||||
"rustc"
|
||||
"cargo"
|
||||
"rustfmt"
|
||||
|
@ -73,14 +68,13 @@
|
|||
"rust-src"
|
||||
"rust-analysis"
|
||||
])
|
||||
fenix.packages.${system}.rust-analyzer
|
||||
fenixPkgs.rust-analyzer
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
checks.${system} = import ./nix/checks {
|
||||
inherit self system;
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
inherit self system pkgs;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue