Skip to content

Commit

Permalink
~ try fix azure img
Browse files Browse the repository at this point in the history
  • Loading branch information
oluceps committed Mar 20, 2024
1 parent e162b56 commit a388531
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 60 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions hosts/bootstrap/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"audit=0"
"net.ifnames=0"

# "systemd.gpt_auto=0"
"console=ttyS0"
"earlyprintk=ttyS0"
"rootdelay=300"
Expand All @@ -78,4 +79,26 @@

};
};
services.udev.extraRules = ''
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:0", ATTR{removable}=="0", SYMLINK+="disk/by-lun/0",
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:1", ATTR{removable}=="0", SYMLINK+="disk/by-lun/1",
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:2", ATTR{removable}=="0", SYMLINK+="disk/by-lun/2"
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:3", ATTR{removable}=="0", SYMLINK+="disk/by-lun/3"
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:4", ATTR{removable}=="0", SYMLINK+="disk/by-lun/4"
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:5", ATTR{removable}=="0", SYMLINK+="disk/by-lun/5"
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:6", ATTR{removable}=="0", SYMLINK+="disk/by-lun/6"
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:7", ATTR{removable}=="0", SYMLINK+="disk/by-lun/7"
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:8", ATTR{removable}=="0", SYMLINK+="disk/by-lun/8"
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:9", ATTR{removable}=="0", SYMLINK+="disk/by-lun/9"
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:10", ATTR{removable}=="0", SYMLINK+="disk/by-lun/10"
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:11", ATTR{removable}=="0", SYMLINK+="disk/by-lun/11"
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:12", ATTR{removable}=="0", SYMLINK+="disk/by-lun/12"
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:13", ATTR{removable}=="0", SYMLINK+="disk/by-lun/13"
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:14", ATTR{removable}=="0", SYMLINK+="disk/by-lun/14"
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:15", ATTR{removable}=="0", SYMLINK+="disk/by-lun/15"
'';
}
7 changes: 2 additions & 5 deletions hosts/bootstrap/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@
./configuration.nix
./disk-config.nix
inputs.disko.nixosModules.disko
inputs.impermanence.nixosModules.impermanence

{
nixpkgs = {
hostPlatform = lib.mkDefault system;
overlays = with inputs;[
agenix-rekey.overlays.default
fenix.overlays.default
self.overlays.default
];
};
}
];
Expand Down
83 changes: 31 additions & 52 deletions hosts/bootstrap/disk-config.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{ lib, ... }:
{

{ ...
}: {
disko = {
enableConfig = false;

devices = {
disk.main = {
imageSize = "2G";
Expand All @@ -12,76 +10,57 @@
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
priority = 0;
};

# boot = {
# size = "1M";
# type = "EF02"; # for grub MBR
# priority = 0;
# };
ESP = {
name = "ESP";
size = "512M";
type = "EF00";
priority = 1;
# priority = 0;
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/efi";
mountOptions = [ "fmask=0077" "dmask=0077" ];
};
};

root = {
nix = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" "--csum xxhash64" ];
subvolumes = {
"root" = {
mountpoint = "/";
mountOptions = [ "compress-force=zstd:1" "noatime" "discard=async" "space_cache=v2" "nosuid" "nodev" ];
};
"home" = {
mountOptions = [ "compress-force=zstd:1" "noatime" "discard=async" "space_cache=v2" "nosuid" "nodev" ];
mountpoint = "/home";
};
"nix" = {
mountOptions = [ "compress-force=zstd:1" "noatime" "discard=async" "space_cache=v2" "nosuid" "nodev" ];
mountpoint = "/nix";
};
"var" = {
mountOptions = [ "compress-force=zstd:1" "noatime" "discard=async" "space_cache=v2" "nosuid" "nodev" ];
mountpoint = "/var";
};
};
type = "filesystem";
format = "btrfs";
mountpoint = "/nix";
mountOptions = [ "compress-force=zstd" "nosuid" "nodev" ];
};
};
};
};
};
nodev."/" = {
fsType = "tmpfs";
mountOptions = [ "relatime" "mode=755" "nosuid" "nodev" ];
};
};
};

fileSystems."/" = {
device = "tmpfs";
fsType = "tmpfs";
options = [ "relatime" "mode=755" "nosuid" "nodev" ];
};



fileSystems = {
"/efi" = {
device = "/dev/sda2";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};

"/" = {
device = "/dev/sda3";
fsType = "btrfs";
options = [ "subvol=/root" "compress-force=zstd:1" "noatime" "discard=async" "space_cache=v2" ];
};
} // lib.genAttrs [ "/home" "/nix" "/var" ] (name: {
fileSystems."/nix" = {
device = "/dev/sda3";
fsType = "btrfs";
options = [ "subvol=${name}" "compress-force=zstd:1" "noatime" "discard=async" "space_cache=v2" "nosuid" "nodev" ];
});
options = [ "compress-force=zstd" "nosuid" "nodev" ];
};

fileSystems."/efi" = {
device = "/dev/sda2";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
}

0 comments on commit a388531

Please sign in to comment.