1
This commit is contained in:
Motiejus Jakštys 2024-01-15 23:11:46 +02:00
parent a659062930
commit 0f4ae2a2fd
5 changed files with 54 additions and 2 deletions

1
.gitignore vendored
View File

@ -8,5 +8,6 @@
__pycache__
db.sqlite3
vm.qcow2
/.pre-commit-config.yaml

View File

@ -18,3 +18,7 @@ run-backend:
.PHONY: run-frontend
run-frontend:
nix run .#e11sync-frontend
.PHONY: vm
vm:
nix run .#nixosConfigurations.x86_64-linux.vm.config.system.build.vm

View File

@ -42,6 +42,8 @@
inherit geoip2-tarball;
};
e11sync-module = import ./modules/e11sync;
e11sync-static = pkgs.callPackage ./pkgs/e11sync-static.nix {};
e11sync-frontend = pkgs.callPackage ./pkgs/e11sync-frontend.nix {
@ -77,8 +79,7 @@
'';
};
nixosModules.e11sync = import ./modules/e11sync;
nixosModules.default = self.nixosModules.e11sync;
nixosModules.e11sync = e11sync-module;
apps = {
e11sync-frontend = {
@ -129,5 +130,13 @@
};
formatter = pkgs.alejandra;
nixosConfigurations.vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./vm.nix
e11sync-module
];
};
});
}

View File

@ -2,6 +2,7 @@
config,
lib,
e11sync-backend,
...
}: {
options.e11sync = with lib.types; {
enable = lib.mkEnableOption "Enable e11sync";

37
vm.nix Normal file
View File

@ -0,0 +1,37 @@
{
pkgs,
modulesPath,
...
}: {
#e11sync.enable = true;
imports = [(modulesPath + "/virtualisation/qemu-vm.nix")];
virtualisation.graphics = false;
environment.systemPackages = with pkgs; [
tmux
htop
];
nix.extraOptions = ''
experimental-features = nix-command flakes
trusted-users = vm
'';
users = {
mutableUsers = false;
users.nixos = {
extraGroups = ["wheel"];
isNormalUser = true;
hashedPassword = "";
};
};
security.sudo.wheelNeedsPassword = false;
services.getty.autologinUser = "nixos";
networking = {
hostName = "vm";
firewall = {
allowedTCPPorts = [8001];
};
};
system.stateVersion = "23.11";
}