Set up waybar and building ISOs.
This commit is contained in:
@@ -1,5 +1,30 @@
|
||||
# Build ISO image
|
||||
# doas nix run github:nix-community/nixos-generators -- --flake .#odo --format iso
|
||||
# nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#iso.odo
|
||||
# output: result/iso/nixos.iso
|
||||
|
||||
# Run the ISO image
|
||||
# "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" \
|
||||
# -accel kvm \
|
||||
# -cpu host \
|
||||
# -smp cores=8 \
|
||||
# -m 32768 \
|
||||
# -drive "file=$(nix-build '<nixpkgs>' --no-out-link -A 'OVMF.fd')/FV/OVMF.fd,if=pflash,format=raw,readonly=on" \
|
||||
# -drive if=pflash,format=raw,file="/tmp/OVMF_VARS.fd" \
|
||||
# -nic user,hostfwd=tcp::60022-:22 \
|
||||
# -boot order=d \
|
||||
# -cdrom "$(readlink -f ./result/iso/nixos.iso)" \
|
||||
# -display vnc=127.0.0.1:0
|
||||
#
|
||||
# doas cp "$(nix-build '<nixpkgs>' --no-out-link -A 'OVMF.fd')/FV/OVMF_VARS.fd" /tmp/OVMF_VARS.fd
|
||||
# doas "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" -accel kvm -cpu host -smp cores=8 -m 32768 -drive "file=$(nix-build '<nixpkgs>' --no-out-link -A 'OVMF.fd')/FV/OVMF.fd,if=pflash,format=raw,readonly=on" -drive if=pflash,format=raw,file="/tmp/OVMF_VARS.fd" -nic user,hostfwd=tcp::60022-:22 -boot order=d -cdrom /persist/machine_setup/nix/configuration/result/iso/nixos.iso -display vnc=127.0.0.1:0
|
||||
|
||||
# Get a repl for this flake
|
||||
# nix repl --expr "builtins.getFlake \"$PWD\""
|
||||
|
||||
# TODO maybe use `nix eval --raw .#iso.odo.outPath`
|
||||
# iso.odo.isoName == "nixos.iso"
|
||||
# full path = <outPath> / iso / <isoName>
|
||||
|
||||
{
|
||||
description = "My system configuration";
|
||||
|
||||
@@ -23,17 +48,14 @@
|
||||
...
|
||||
}@inputs:
|
||||
let
|
||||
base-system = { };
|
||||
odoqemu = nixpkgs.lib.nixosSystem rec {
|
||||
base_x86_64_linux = rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
pkgs-b93b4e9b5 = import nixpkgs-b93b4e9b5 {
|
||||
inherit system;
|
||||
# config.allowUnfree = true;
|
||||
};
|
||||
pkgs-unstable = import nixpkgs-unstable {
|
||||
inherit system;
|
||||
# config.allowUnfree = true;
|
||||
};
|
||||
};
|
||||
modules = [
|
||||
@@ -44,88 +66,30 @@
|
||||
home-manager.useUserPackages = true;
|
||||
}
|
||||
./configuration.nix
|
||||
(
|
||||
{ lib, ... }:
|
||||
{
|
||||
imports = [ <nixpkgs/nixos/modules/virtualisation/qemu-vm.nix> ];
|
||||
virtualisation.qemu.options = [
|
||||
"-device virtio-vga"
|
||||
];
|
||||
virtualisation.vmVariant = {
|
||||
# following configuration is added only when building VM with build-vm
|
||||
virtualisation = {
|
||||
memorySize = 2048; # Use 2048MiB memory.
|
||||
cores = 3;
|
||||
graphics = false;
|
||||
};
|
||||
};
|
||||
networking.dhcpcd.enable = lib.mkForce true;
|
||||
networking.useDHCP = lib.mkForce true;
|
||||
boot.loader.efi.canTouchEfiVariables = lib.mkForce true;
|
||||
# doas nixos-rebuild build-vm --flake .#odoqemu
|
||||
#./result/bin/run-nixos-vm
|
||||
}
|
||||
)
|
||||
];
|
||||
};
|
||||
odo = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
pkgs-b93b4e9b5 = import nixpkgs-b93b4e9b5 {
|
||||
inherit system;
|
||||
# config.allowUnfree = true;
|
||||
};
|
||||
pkgs-unstable = import nixpkgs-unstable {
|
||||
inherit system;
|
||||
# config.allowUnfree = true;
|
||||
};
|
||||
systems = {
|
||||
odo = {
|
||||
main = nixpkgs.lib.nixosSystem (base_x86_64_linux // { });
|
||||
iso = nixpkgs.lib.nixosSystem (
|
||||
base_x86_64_linux
|
||||
// {
|
||||
modules = base_x86_64_linux.modules ++ [
|
||||
(nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix")
|
||||
# TODO: maybe? imports = [ "${modulesPath}/profiles/image-based-appliance.nix" ];
|
||||
{
|
||||
isoImage.makeEfiBootable = true;
|
||||
isoImage.makeUsbBootable = true;
|
||||
me.buildingIso = true;
|
||||
}
|
||||
];
|
||||
}
|
||||
);
|
||||
};
|
||||
modules = [
|
||||
impermanence.nixosModules.impermanence
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
}
|
||||
./configuration.nix
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
# doas nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#vms.odo
|
||||
# ./result/bin/run-nixos-vim
|
||||
vms.odo = odoqemu.config.system.build.vm;
|
||||
odoiso = odo.config.system.build.isoImage;
|
||||
nixosConfigurations.odo = odo;
|
||||
nixosConfigurations.odovm = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
pkgs-b93b4e9b5 = import nixpkgs-b93b4e9b5 {
|
||||
inherit system;
|
||||
# config.allowUnfree = true;
|
||||
};
|
||||
pkgs-unstable = import nixpkgs-unstable {
|
||||
inherit system;
|
||||
# config.allowUnfree = true;
|
||||
};
|
||||
};
|
||||
modules = [
|
||||
impermanence.nixosModules.impermanence
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
}
|
||||
./configuration.nix
|
||||
(
|
||||
{ lib, ... }:
|
||||
{
|
||||
networking.dhcpcd.enable = lib.mkForce true;
|
||||
networking.useDHCP = lib.mkForce true;
|
||||
boot.loader.efi.canTouchEfiVariables = lib.mkForce true;
|
||||
}
|
||||
)
|
||||
];
|
||||
};
|
||||
nixosConfigurations.odo = systems.odo.main;
|
||||
iso.odo = systems.odo.iso.config.system.build.isoImage;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user