add vm
This commit is contained in:
parent
a659062930
commit
0f4ae2a2fd
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,5 +8,6 @@
|
||||
__pycache__
|
||||
|
||||
db.sqlite3
|
||||
vm.qcow2
|
||||
|
||||
/.pre-commit-config.yaml
|
||||
|
4
Makefile
4
Makefile
@ -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
|
||||
|
13
flake.nix
13
flake.nix
@ -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
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
config,
|
||||
lib,
|
||||
e11sync-backend,
|
||||
...
|
||||
}: {
|
||||
options.e11sync = with lib.types; {
|
||||
enable = lib.mkEnableOption "Enable e11sync";
|
||||
|
37
vm.nix
Normal file
37
vm.nix
Normal 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";
|
||||
}
|
Loading…
Reference in New Issue
Block a user