add disko (unused)

This commit is contained in:
Anish Lakhwara 2023-05-30 22:21:29 +10:00
parent 7ef8033b53
commit 2b211cc29d
2 changed files with 59 additions and 3 deletions

View file

@ -17,8 +17,10 @@
agenix.inputs.nixpkgs.follows = "nixpkgs"; agenix.inputs.nixpkgs.follows = "nixpkgs";
deploy-rs.url = "github:serokell/deploy-rs"; deploy-rs.url = "github:serokell/deploy-rs";
deploy-rs.inputs.nixpkgs.follows = "nixpkgs"; deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
# Packages # My Packages
poonam.url = "git+ssh://gitea@git.sealight.xyz/aynish/kitaab?ref=main"; poonam.url = "git+ssh://gitea@git.sealight.xyz/aynish/kitaab?ref=main";
poonam.inputs.nixpkgs.follows = "nixpkgs"; poonam.inputs.nixpkgs.follows = "nixpkgs";
basant.url = "git+ssh://gitea@git.sealight.xyz/aynish/basant?ref=main"; basant.url = "git+ssh://gitea@git.sealight.xyz/aynish/basant?ref=main";
@ -26,11 +28,12 @@
basant.inputs.nixpkgs.follows = "nixpkgs"; basant.inputs.nixpkgs.follows = "nixpkgs";
basant.inputs.poonam.follows = "poonam"; basant.inputs.poonam.follows = "poonam";
vimwikicli.inputs.nixpkgs.follows = "nixpkgs"; vimwikicli.inputs.nixpkgs.follows = "nixpkgs";
grasp.url = "git+ssh://gitea@git.sealight.xyz/aynish/grasp.git?ref=main"; grasp.url = "git+ssh://gitea@git.sealight.xyz/aynish/grasp.git?ref=main";
grasp.inputs.nixpkgs.follows = "nixpkgs"; grasp.inputs.nixpkgs.follows = "nixpkgs";
# Matrix # Matrix
nix-matrix-appservices.url = "gitlab:coffeetables/nix-matrix-appservices"; nix-matrix-appservices.url = "gitlab:coffeetables/nix-matrix-appservices";
# Others # Others
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
rust-overlay = { rust-overlay = {
@ -63,6 +66,7 @@
, home-manager , home-manager
, deploy-rs , deploy-rs
, agenix , agenix
, disko
, basant , basant
, grasp , grasp
, nix-matrix-appservices , nix-matrix-appservices
@ -184,6 +188,7 @@
self.nixosModules.backup self.nixosModules.backup
self.nixosModules.wireguard self.nixosModules.wireguard
self.nixosModules.microbin self.nixosModules.microbin
disko.nixosModules.disko
]; ];
}; };
@ -275,7 +280,7 @@
}; };
helix = { helix = {
hostname = "git.sealight.xyz"; hostname = "git.sealight.xyz";
# autoRollback = false; autoRollback = false;
profiles.system = { profiles.system = {
user = "root"; user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.helix; path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.helix;

51
hosts/helix/disko.nix Normal file
View file

@ -0,0 +1,51 @@
{ disks ? [ "/dev/vdb" ], ... }: {
disko.devices = {
disk = {
vdb = {
type = "disk";
device = builtins.elemAt disks 0;
content = {
type = "table";
format = "gpt";
partitions = [
{
name = "ESP";
start = "1MiB";
end = "128MiB";
fs-type = "fat32";
bootable = true;
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
}
{
name = "root";
start = "128MiB";
end = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ]; # Override existing partition
subvolumes = {
# Subvolume name is different from mountpoint
"/rootfs" = {
mountpoint = "/";
};
# Mountpoints inferred from subvolume name
"/home" = {
mountOptions = [ "compress=zstd" ];
};
"/nix" = {
mountOptions = [ "compress=zstd" "noatime" ];
};
};
};
}
];
};
};
};
};
}