infra: format code
This commit is contained in:
parent
d4744976e2
commit
8b41ded3a6
4 changed files with 43 additions and 37 deletions
19
flake.nix
19
flake.nix
|
@ -21,28 +21,31 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ self, nixpkgs, ... }: {
|
outputs =
|
||||||
|
inputs@{ self, nixpkgs, ... }:
|
||||||
|
{
|
||||||
# System
|
# System
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
alisa = nixpkgs.lib.nixosSystem {
|
alisa = nixpkgs.lib.nixosSystem {
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
specialArgs = inputs;
|
specialArgs = inputs;
|
||||||
modules = [
|
modules = [ ./nix/infra ];
|
||||||
./nix/infra
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Formatter
|
# Formatter
|
||||||
formatter = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system:
|
formatter = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (
|
||||||
nixpkgs.legacyPackages.${system}.nixfmt-rfc-style
|
system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style
|
||||||
);
|
);
|
||||||
|
|
||||||
# Packages
|
# 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;
|
inherit system inputs;
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
# Shell
|
# Shell
|
||||||
devShells = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: {
|
devShells = nixpkgs.lib.attrsets.genAttrs nixpkgs.lib.systems.flakeExposed (system: {
|
||||||
|
|
|
@ -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 = {
|
||||||
|
|
|
@ -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";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
pnpm,
|
pnpm,
|
||||||
nodejs,
|
nodejs,
|
||||||
withBackendUrl ? ""
|
withBackendUrl ? "",
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
|
|
Loading…
Reference in a new issue