From 61f5e0e0cdf70c209a347a29bc8f577764acc60a Mon Sep 17 00:00:00 2001 From: iFargle Date: Wed, 20 Sep 2023 19:40:48 +0900 Subject: [PATCH] nixos-osaka-vultr-01 start config --- .../default.nix | 29 ++++---------- nixos/hosts/nixos-osaka-vultr-01/disks.nix | 38 +++++++++++++++++++ 2 files changed, 46 insertions(+), 21 deletions(-) rename nixos/hosts/{nixos-amd-osaka-01 => nixos-osaka-vultr-01}/default.nix (51%) create mode 100644 nixos/hosts/nixos-osaka-vultr-01/disks.nix diff --git a/nixos/hosts/nixos-amd-osaka-01/default.nix b/nixos/hosts/nixos-osaka-vultr-01/default.nix similarity index 51% rename from nixos/hosts/nixos-amd-osaka-01/default.nix rename to nixos/hosts/nixos-osaka-vultr-01/default.nix index 030192d1..f80381c6 100644 --- a/nixos/hosts/nixos-amd-osaka-01/default.nix +++ b/nixos/hosts/nixos-osaka-vultr-01/default.nix @@ -1,38 +1,25 @@ { config, lib, pkgs, modulesPath, desktop, username, ... }: { - imports = [ ]; + imports = [ ]; nixpkgs.config.allowUnfree = false; - boot.initrd.availableKernelModules = [ "ata_piix" "ohci_pci" "ehci_pci" "ahci" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = [ "ata_piix" "ohci_pci" "virtio_pci" "virtio_blk" "sr_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - - # For cross-architecture builds - boot.binfmt.emulatedSystems = [ - "aarch64-linux" - "armv7l-linux" - ]; - - fileSystems."/" = { - device = "/dev/mapper/DISK"; - fsType = "btrfs"; - options = [ "subvol=@" ]; - }; - - - boot.initrd.luks.devices."DISK".device = "/dev/vda"; + virtualization.hyprvGuest.enable = true; networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; time.timeZone = "Asia/Tokyo"; - networking.hostName = "nixos-amd-osaka-01"; + networking.hostName = "nixos-osaka-vultr-01"; boot.loader.grub = { - enableCryptodisk = true; + #enableCryptodisk = true; enable = true; - device = "/dev/vda"; - useOSProber = true; + #device = "/dev/vda"; + #useOSProber = true; }; networking.firewall.allowedTCPPorts = [ 22 ]; + time.timezone = "Asia/Tokyo"; } diff --git a/nixos/hosts/nixos-osaka-vultr-01/disks.nix b/nixos/hosts/nixos-osaka-vultr-01/disks.nix new file mode 100644 index 00000000..dbf74a73 --- /dev/null +++ b/nixos/hosts/nixos-osaka-vultr-01/disks.nix @@ -0,0 +1,38 @@ +{ + disko.devices = { + disk = { + vdb = { + type = "disk"; + device = "/dev/vda"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "100M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + extraOpenArgs = [ "--allow-discards" ]; + passwordFile = "/tmp/secret.key"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; + }; +} \ No newline at end of file