fix certificates issues and reformat code
This commit is contained in:
1416
common.nix
1416
common.nix
File diff suppressed because it is too large
Load Diff
91
flake.nix
91
flake.nix
@@ -9,7 +9,12 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, nixos-generators }:
|
outputs =
|
||||||
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
nixos-generators,
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
@@ -34,7 +39,10 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
# Common configuration
|
# Common configuration
|
||||||
commonConfig = { isLiveIso ? false }:
|
commonConfig =
|
||||||
|
{
|
||||||
|
isLiveIso ? false,
|
||||||
|
}:
|
||||||
import ./common.nix {
|
import ./common.nix {
|
||||||
inherit pkgs cloudServerNames isLiveIso;
|
inherit pkgs cloudServerNames isLiveIso;
|
||||||
};
|
};
|
||||||
@@ -67,44 +75,55 @@
|
|||||||
|
|
||||||
(commonConfig { isLiveIso = false; })
|
(commonConfig { isLiveIso = false; })
|
||||||
|
|
||||||
({ config, pkgs, lib, ... }: {
|
(
|
||||||
boot.loader.grub.enable = false;
|
{
|
||||||
boot.loader.generic-extlinux-compatible.enable = true;
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
boot.loader.grub.enable = false;
|
||||||
|
boot.loader.generic-extlinux-compatible.enable = true;
|
||||||
|
|
||||||
# Enable networking for VM
|
# Enable networking for VM
|
||||||
networking.hostName = "workshop-vm";
|
networking.hostName = "workshop-vm";
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
networking.firewall.enable = false;
|
networking.firewall.enable = false;
|
||||||
|
|
||||||
# Hybrid console configuration - serial primary, GUI available
|
# Hybrid console configuration - serial primary, GUI available
|
||||||
boot.kernelParams = [ "console=ttyS0,115200" "console=tty1" ];
|
boot.kernelParams = [
|
||||||
|
"console=ttyS0,115200"
|
||||||
|
"console=tty1"
|
||||||
|
];
|
||||||
|
|
||||||
# VM specific settings
|
# VM specific settings
|
||||||
virtualisation.memorySize = 4096;
|
virtualisation.memorySize = 4096;
|
||||||
virtualisation.diskSize = 40000;
|
virtualisation.diskSize = 40000;
|
||||||
|
|
||||||
# Hybrid mode: GUI available but serial console primary
|
# Hybrid mode: GUI available but serial console primary
|
||||||
virtualisation.qemu.options = [
|
virtualisation.qemu.options = [
|
||||||
"-display"
|
"-display"
|
||||||
"gtk"
|
"gtk"
|
||||||
"-monitor"
|
"-monitor"
|
||||||
"stdio"
|
"stdio"
|
||||||
# Add port forwarding for SSH
|
# Add port forwarding for SSH
|
||||||
"-netdev"
|
"-netdev"
|
||||||
"user,id=net0,hostfwd=tcp::2222-:22"
|
"user,id=net0,hostfwd=tcp::2222-:22"
|
||||||
"-device"
|
"-device"
|
||||||
"virtio-net,netdev=net0"
|
"virtio-net,netdev=net0"
|
||||||
];
|
];
|
||||||
# Fix the auto-login conflict with mkForce
|
# Fix the auto-login conflict with mkForce
|
||||||
services.displayManager.autoLogin = lib.mkForce {
|
services.displayManager.autoLogin = lib.mkForce {
|
||||||
enable = true;
|
enable = true;
|
||||||
user = "root";
|
user = "root";
|
||||||
};
|
};
|
||||||
# Keep GUI session commands for when GUI is used
|
# Keep GUI session commands for when GUI is used
|
||||||
services.xserver.displayManager.sessionCommands = ''
|
services.xserver.displayManager.sessionCommands = ''
|
||||||
${pkgs.xfce.xfce4-terminal}/bin/xfce4-terminal --fullscreen --maximize --hide-toolbar --hide-borders --hide-menubar --hide-toolbar --title="Workshop Terminal" &
|
${pkgs.xfce.xfce4-terminal}/bin/xfce4-terminal --fullscreen --maximize --hide-toolbar --hide-borders --hide-menubar --hide-toolbar --title="Workshop Terminal" &
|
||||||
'';
|
'';
|
||||||
})
|
}
|
||||||
|
)
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user