Compare commits
2 Commits
d7b203ad6c
...
49fa5d7f63
| Author | SHA1 | Date | |
|---|---|---|---|
| 49fa5d7f63 | |||
| 29c012a492 |
52
Makefile
Normal file
52
Makefile
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
####
|
||||||
|
# Target definitions
|
||||||
|
####
|
||||||
|
|
||||||
|
# Disable echoing of target recipe commands
|
||||||
|
# Comment this for debugging
|
||||||
|
.SILENT:
|
||||||
|
|
||||||
|
# Run target recipes in one shell invocation
|
||||||
|
.ONESHELL:
|
||||||
|
|
||||||
|
# Since all targets are phony, all targets should be listed here
|
||||||
|
# One target per line
|
||||||
|
.PHONY: boot-vm-cli \
|
||||||
|
boot-vm-gui \
|
||||||
|
build-vm \
|
||||||
|
clean \
|
||||||
|
format-nix-files \
|
||||||
|
help
|
||||||
|
|
||||||
|
# Show the help text
|
||||||
|
help:
|
||||||
|
egrep -h '\s##\s' $(MAKEFILE_LIST) \
|
||||||
|
| sort \
|
||||||
|
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
||||||
|
|
||||||
|
format-nix-files: ## Format nix files using the nixpkgs-fmt tool
|
||||||
|
find . -name "*.nix" -exec nixpkgs-fmt {} \;
|
||||||
|
|
||||||
|
clean: ## Clean build artifacts and shutdown running virtual machines
|
||||||
|
rm result > /dev/null 2>&1
|
||||||
|
rm nixos.qcow2 > /dev/null 2>&1
|
||||||
|
pkill qemu
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
build-vm: clean ## Build virtual machine for testing
|
||||||
|
nix build ".#nixosConfigurations.vm.config.system.build.vm"
|
||||||
|
|
||||||
|
boot-vm-cli: ## Run virtual machine in current terminal
|
||||||
|
QEMU_KERNEL_PARAMS=console=ttyS0 \
|
||||||
|
QEMU_NET_OPTS=hostfwd=tcp::8080-:80 \
|
||||||
|
QEMU_OPTS=-nographic \
|
||||||
|
./result/bin/run-nixos-vm
|
||||||
|
reset
|
||||||
|
|
||||||
|
boot-vm-gui: ## Run virtual machine in QEMU window
|
||||||
|
QEMU_KERNEL_PARAMS=console=ttyS0 \
|
||||||
|
QEMU_NET_OPTS=hostfwd=tcp::8080-:80 \
|
||||||
|
./result/bin/run-nixos-vm
|
||||||
|
reset
|
||||||
|
|
||||||
31
vm/default.nix
Normal file
31
vm/default.nix
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{ modulesPath, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
../nixos-module/invoiceninja.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
system.stateVersion = "24.11";
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
users.users.test = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
initialPassword = "test";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
invoiceninja-desktop
|
||||||
|
];
|
||||||
|
|
||||||
|
services.xserver.desktopManager.lxqt.enable = true;
|
||||||
|
|
||||||
|
programs.chromium.enable = true;
|
||||||
|
|
||||||
|
networking.firewall.enable = false;
|
||||||
|
|
||||||
|
services.resolved.enable = true;
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user