Initial commit
This commit is contained in:
commit
9661927410
27 changed files with 1091 additions and 0 deletions
30
hosts/hijiri-vm/default.nix
Normal file
30
hosts/hijiri-vm/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
self,
|
||||
inputs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
configurations.nixos.hijiri-vm = {
|
||||
modulesPath,
|
||||
lib,
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
"${modulesPath}/profiles/qemu-guest.nix"
|
||||
(import ./disks.nix {})
|
||||
];
|
||||
boot = {
|
||||
supportedFilesystems = ["btrfs"];
|
||||
loader.systemd-boot.enable = true;
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
};
|
||||
|
||||
nixpkgs.system = "aarch64-linux";
|
||||
|
||||
users.users.${username}.openssh.authorizedKeys.keys = lib.attrValues config.assets.sshKeys.user;
|
||||
|
||||
networking.domain = "hijiri";
|
||||
networking.hostName = "vm";
|
||||
};
|
||||
}
|
42
hosts/hijiri-vm/disks.nix
Normal file
42
hosts/hijiri-vm/disks.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{bootDevice ? "/dev/vda", ...}: {
|
||||
disko.devices.disk.bootDisk = {
|
||||
type = "disk";
|
||||
device = bootDevice;
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
name = "EFI";
|
||||
start = "1MiB";
|
||||
end = "128MiB";
|
||||
fs-type = "fat32";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "LINUX";
|
||||
start = "128MiB";
|
||||
end = "100%";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = ["-f"];
|
||||
subvolumes = let
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
in {
|
||||
"/root" = {
|
||||
inherit mountOptions;
|
||||
mountpoint = "/";
|
||||
};
|
||||
"/nix" = {inherit mountOptions;};
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue