test-vm: Add WHIB backend
This commit is contained in:
20
flake.lock
generated
20
flake.lock
generated
@@ -260,7 +260,8 @@
|
|||||||
"nix-gc-env": "nix-gc-env",
|
"nix-gc-env": "nix-gc-env",
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"pppdotpm-site": "pppdotpm-site"
|
"pppdotpm-site": "pppdotpm-site",
|
||||||
|
"whib-backend": "whib-backend"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
@@ -292,6 +293,23 @@
|
|||||||
"repo": "default",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"whib-backend": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731143140,
|
||||||
|
"narHash": "sha256-pLxBnIgcAJxvbMglXbeSI5/yxSR0RfFgNW7eQ7oNFR8=",
|
||||||
|
"path": "/home/alex/code/own/whib",
|
||||||
|
"type": "path"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"path": "/home/alex/code/own/whib",
|
||||||
|
"type": "path"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|||||||
25
flake.nix
25
flake.nix
@@ -37,6 +37,12 @@
|
|||||||
url = "git+ssh://gitea@git.ppp.pm:1122/alex/ppp.pm-site.git?ref=main";
|
url = "git+ssh://gitea@git.ppp.pm:1122/alex/ppp.pm-site.git?ref=main";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
whib-backend = {
|
||||||
|
# url = "git+ssh://gitea@git.ppp.pm:1122/alex/whib.git?ref=nix-flake";
|
||||||
|
url = "path:/home/alex/code/own/whib";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
@@ -77,13 +83,20 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
test-vm = inputs.nixpkgs.lib.nixosSystem {
|
test-vm =
|
||||||
system = "x86_64-linux";
|
let
|
||||||
specialArgs = {
|
system = "x86_64-linux";
|
||||||
inherit inputs;
|
in
|
||||||
|
inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs;
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
./hosts/test-vm/configuration.nix
|
||||||
|
inputs.whib-backend.nixosModules.${system}.default
|
||||||
|
];
|
||||||
};
|
};
|
||||||
modules = [ ./hosts/test-vm/configuration.nix ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells =
|
devShells =
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
home.homeDirectory = "/home/alex";
|
home.homeDirectory = "/home/alex";
|
||||||
|
|
||||||
home.packages = [
|
home.packages = [
|
||||||
|
inputs.whib-backend.packages.${pkgs.system}.whib-import
|
||||||
|
pkgs.beekeeper-studio
|
||||||
pkgs.bitwarden-desktop
|
pkgs.bitwarden-desktop
|
||||||
pkgs.gimp
|
pkgs.gimp
|
||||||
pkgs.zip
|
pkgs.zip
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./ppp.pm-site.nix
|
./ppp.pm-site.nix
|
||||||
|
./whib-backend.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
@@ -10,7 +11,8 @@
|
|||||||
networking.hostName = "test-vm";
|
networking.hostName = "test-vm";
|
||||||
|
|
||||||
mod = {
|
mod = {
|
||||||
pppdotpm-site.enable = true;
|
pppdotpm-site.enable = false;
|
||||||
|
whib-backend.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.a = {
|
users.users.a = {
|
||||||
|
|||||||
54
hosts/test-vm/whib-backend.nix
Normal file
54
hosts/test-vm/whib-backend.nix
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
enabled = config.mod.whib-backend.enable;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
mod.whib-backend = {
|
||||||
|
enable = lib.mkEnableOption "enable WHIB backend";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf enabled {
|
||||||
|
services.whib-backend = {
|
||||||
|
enable = true;
|
||||||
|
domain = "whib-backend.local";
|
||||||
|
|
||||||
|
backend = {
|
||||||
|
signingKey = "super-secret-key";
|
||||||
|
};
|
||||||
|
|
||||||
|
postgres = {
|
||||||
|
password = "postgrespassword";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
virtualisation.vmVariant = {
|
||||||
|
virtualisation = {
|
||||||
|
sharedDirectories = {
|
||||||
|
my-shared = {
|
||||||
|
source = "/home/alex/whib-backup";
|
||||||
|
target = "/mnt/shared";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
forwardPorts = [
|
||||||
|
{
|
||||||
|
from = "host";
|
||||||
|
host.port = 8080;
|
||||||
|
guest.port = 8080;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
from = "host";
|
||||||
|
host.port = 5432;
|
||||||
|
guest.port = 5432;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user