More dsko testing

This commit is contained in:
iFargle 2023-09-21 21:01:13 +09:00
parent e55ffc6b9d
commit 8763628b3b
3 changed files with 85 additions and 2 deletions

View file

@ -35,7 +35,7 @@
nixosConfigurations = { nixosConfigurations = {
# Virtual Machines # Virtual Machines
nixos-vm-01 = libx.mkHost { hostname = "nixos-vm-01"; }; nixos-vm-01 = libx.mkHost { hostname = "nixos-vm-01"; };
nixos-osaka-vultr-01 = libx.mkHost { hostname = "nixos-osaka-vultr-01"; }; nixos-vm-02 = libx.mkHost { hostname = "nixos-vm-02"; };
# Physical Machines # Physical Machines
nixos-laptop = libx.mkHost { hostname = "nixos-laptop"; desktop = "hyprland"; gpu = "intel"; theme = "gruvbox"; }; nixos-laptop = libx.mkHost { hostname = "nixos-laptop"; desktop = "hyprland"; gpu = "intel"; theme = "gruvbox"; };
nixos-framework = libx.mkHost { hostname = "nixos-framework"; desktop = "hyprland"; gpu = "intel"; theme = "gruvbox"; }; nixos-framework = libx.mkHost { hostname = "nixos-framework"; desktop = "hyprland"; gpu = "intel"; theme = "gruvbox"; };
@ -47,7 +47,7 @@
homeConfigurations = { homeConfigurations = {
# Virtual Machines # Virtual Machines
"albert@nixos-vm-01" = libx.mkHome { hostname = "nixos-vm-01"; }; "albert@nixos-vm-01" = libx.mkHome { hostname = "nixos-vm-01"; };
"albert@nixos-osaka-vultr-01" = libx.mkHome { hostname = "nixos-osaka-vultr-01"; }; "albert@nixos-vm-02" = libx.mkHome { hostname = "nixos-vm-02"; };
# Physical Machines # Physical Machines
"albert@nixos-laptop" = libx.mkHome { hostname = "nixos-laptop"; desktop = "hyprland"; theme = "gruvbox"; }; "albert@nixos-laptop" = libx.mkHome { hostname = "nixos-laptop"; desktop = "hyprland"; theme = "gruvbox"; };
"albert@nixos-framework" = libx.mkHome { hostname = "nixos-framework"; desktop = "hyprland"; theme = "gruvbox"; }; "albert@nixos-framework" = libx.mkHome { hostname = "nixos-framework"; desktop = "hyprland"; theme = "gruvbox"; };

View file

@ -0,0 +1,23 @@
{ config, lib, pkgs, modulesPath, desktop, username, ... }: {
imports = [ ./disks.nix ];
nixpkgs.config.allowUnfree = false;
boot.initrd.availableKernelModules = [ "ata_piix" "ohci_pci" "ehci_pci" "ahci" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
virtualisation.virtualbox.guest.enable = true;
time.timeZone = "Asia/Tokyo";
networking.hostName = "nixos-vm-02";
boot.loader.grub = {
enable = true;
device = "/dev/sda";
useOSProber = true;
};
networking.firewall.allowedTCPPorts = [ 22 ];
}

View file

@ -0,0 +1,60 @@
{
disko.devices = {
disk = {
sda = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
ESP = {
label = "EFI";
name = "ESP";
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
extraOpenArgs = [ "--allow-discards" ];
# if you want to use the key for interactive login be sure there is no trailing newline
# for example use `echo -n "password" > /tmp/secret.key`
#passwordFile = "/tmp/secret.key"; # Interactive
settings.keyFile = "/tmp/secret.key";
# additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
};
};
};
};
};
};
};
};
};
}