added stuff
This commit is contained in:
parent
937f28770d
commit
236b8c2a6b
907 changed files with 70990 additions and 0 deletions
5
nyx/hosts/apollon/default.nix
Normal file
5
nyx/hosts/apollon/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
_: {
|
||||
imports = [
|
||||
./system.nix
|
||||
];
|
||||
}
|
85
nyx/hosts/apollon/system.nix
Normal file
85
nyx/hosts/apollon/system.nix
Normal file
|
@ -0,0 +1,85 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/virtualisation/qemu-vm.nix")
|
||||
];
|
||||
|
||||
config = {
|
||||
modules.device.type = "vm";
|
||||
zramSwap.enable = lib.mkForce false;
|
||||
services.thermald.enable = lib.mkForce false;
|
||||
|
||||
boot = {
|
||||
initrd = {
|
||||
supportedFilesystems = ["bcachefs"]; # make bcachefs work
|
||||
availableKernelModules = ["bcache"];
|
||||
};
|
||||
|
||||
kernelPackages = lib.mkOverride 0 pkgs.linuxPackages_testing;
|
||||
};
|
||||
|
||||
environment = {
|
||||
systemPackages = [
|
||||
pkgs.bcachefs-tools
|
||||
];
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
promptInit = ''
|
||||
eval "$(${lib.getExe pkgs.starship} init zsh)"
|
||||
'';
|
||||
};
|
||||
|
||||
users.users."user" = {
|
||||
description = "Testing user with sudo access and no password";
|
||||
isNormalUser = true;
|
||||
password = "";
|
||||
extraGroups = ["wheel" "networkmanager"];
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
|
||||
virtualisation = {
|
||||
memorySize = 2048;
|
||||
diskSize = 4096;
|
||||
cores = 3;
|
||||
useDefaultFilesystems = false;
|
||||
rootDevice = "/dev/vda1";
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "${config.virtualisation.rootDevice}:/dev/vda2";
|
||||
fsType = lib.mkForce "bcachefs";
|
||||
};
|
||||
};
|
||||
|
||||
interfaces = {
|
||||
vm0 = {
|
||||
vlan = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
boot.initrd.postDeviceCommands = with pkgs; ''
|
||||
if ! test -b /dev/vda1; then
|
||||
${parted}/bin/parted --script /dev/vda -- mklabel gpt
|
||||
${parted}/bin/parted --script /dev/vda -- mkpart primary 1MiB 50%
|
||||
${parted}/bin/parted --script /dev/vda -- mkpart primary 50% 100%
|
||||
sync
|
||||
fi
|
||||
|
||||
FSTYPE=$(blkid -o value -s TYPE /dev/vda1 || true)
|
||||
if test -z "$FSTYPE"; then
|
||||
${bcachefs-tools}/bin/bcachefs format /dev/vda1 /dev/vda2 --replicas=2 --label=root
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue