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,35 +21,38 @@
}; };
}; };
outputs = inputs@{ self, nixpkgs, ... }: { outputs =
# System inputs@{ self, nixpkgs, ... }:
nixosConfigurations = { {
alisa = nixpkgs.lib.nixosSystem { # System
system = "aarch64-linux"; nixosConfigurations = {
specialArgs = inputs; alisa = nixpkgs.lib.nixosSystem {
modules = [ system = "aarch64-linux";
./nix/infra specialArgs = inputs;
]; modules = [ ./nix/infra ];
};
}; };
# Formatter
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 {
inherit system inputs;
pkgs = nixpkgs.legacyPackages.${system};
}
);
# Shell
devShells = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: {
default = import ./shell.nix {
inherit system inputs;
pkgs = nixpkgs.legacyPackages.${system};
};
});
}; };
# Formatter
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 {
inherit system inputs;
pkgs = nixpkgs.legacyPackages.${system};
});
# Shell
devShells = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: {
default = import ./shell.nix {
inherit system inputs;
pkgs = nixpkgs.legacyPackages.${system};
};
});
};
} }

View file

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

View file

@ -1,8 +1,4 @@
{ { self, config, ... }:
self,
config,
...
}:
{ {
services.nginx = { services.nginx = {
@ -16,7 +12,11 @@
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations = { 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"; "/api".proxyPass = "http://localhost:8080/api";
}; };
}; };

View file

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