infra: format code

This commit is contained in:
Johannes Jöns 2024-07-11 18:38:07 +02:00
parent d4744976e2
commit 8b41ded3a6
4 changed files with 43 additions and 37 deletions

View file

@ -21,28 +21,31 @@
};
};
outputs = inputs@{ self, nixpkgs, ... }: {
outputs =
inputs@{ self, nixpkgs, ... }:
{
# System
nixosConfigurations = {
alisa = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = inputs;
modules = [
./nix/infra
];
modules = [ ./nix/infra ];
};
};
# Formatter
formatter = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system:
nixpkgs.legacyPackages.${system}.nixfmt-rfc-style
formatter = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (
system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style
);
# Packages
legacyPackages = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: import ./nix {
legacyPackages = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (
system:
import ./nix {
inherit system inputs;
pkgs = nixpkgs.legacyPackages.${system};
});
}
);
# Shell
devShells = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: {

View file

@ -12,7 +12,10 @@ in
{
systemd.services.alisa-backend = {
enable = true;
after = [ "network.target" "postgresql.service" ];
after = [
"network.target"
"postgresql.service"
];
wantedBy = [ "multi-user.target" ];
description = "Alisa Backend API Server";
environment = {

View file

@ -1,8 +1,4 @@
{
self,
config,
...
}:
{ self, config, ... }:
{
services.nginx = {
@ -16,7 +12,11 @@
enableACME = true;
forceSSL = true;
locations = {
"/".root = "${self.legacyPackages.${config.nixpkgs.hostPlatform.system}.web.override { withBackendUrl = "https://clan-war.net/api/v1";}}/";
"/".root = "${
self.legacyPackages.${config.nixpkgs.hostPlatform.system}.web.override {
withBackendUrl = "https://clan-war.net/api/v1";
}
}/";
"/api".proxyPass = "http://localhost:8080/api";
};
};

View file

@ -3,7 +3,7 @@
lib,
pnpm,
nodejs,
withBackendUrl ? ""
withBackendUrl ? "",
}:
stdenv.mkDerivation (finalAttrs: {