forked from extern/nixos-wiki-infra
add disko configuration
This commit is contained in:
parent
36e05c009a
commit
3d8ddfad86
21
flake.lock
21
flake.lock
@ -1,5 +1,25 @@
|
||||
{
|
||||
"nodes": {
|
||||
"disko": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1684003056,
|
||||
"narHash": "sha256-zl11zyRNKzAW7YLvTkxmFjSBqxZbEvfwZqNCT91ELfU=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "8f95856432e091e5ac56fea2df81e905ddd02d27",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
@ -38,6 +58,7 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"disko": "disko",
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"srvos": "srvos",
|
||||
|
@ -8,6 +8,9 @@
|
||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
disko.url = "github:nix-community/disko";
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
srvos.url = "github:numtide/srvos";
|
||||
# Use the version of nixpkgs that has been tested to work with SrvOS
|
||||
srvos.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
@ -3,6 +3,7 @@
|
||||
hcloud.imports = [
|
||||
inputs.srvos.nixosModules.server
|
||||
inputs.srvos.nixosModules.hardware-hetzner-cloud
|
||||
./single-disk.nix
|
||||
];
|
||||
|
||||
nixos-wiki.imports = [
|
||||
|
51
modules/single-disk.nix
Normal file
51
modules/single-disk.nix
Normal file
@ -0,0 +1,51 @@
|
||||
{ self, ... }:
|
||||
let
|
||||
partitions = [
|
||||
{
|
||||
name = "grub";
|
||||
end = "1M";
|
||||
part-type = "primary";
|
||||
flags = [ "bios_grub" ];
|
||||
}
|
||||
{
|
||||
name = "ESP";
|
||||
start = "1MiB";
|
||||
end = "500MiB";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "root";
|
||||
start = "100MiB";
|
||||
end = "100%";
|
||||
part-type = "primary";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
# We use xfs because it has support for compression and has a quite good performance for databases
|
||||
format = "xfs";
|
||||
mountpoint = "/";
|
||||
};
|
||||
}
|
||||
];
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
self.inputs.disko.nixosModules.disko
|
||||
];
|
||||
disko.devices = {
|
||||
disk.sda = {
|
||||
type = "disk";
|
||||
device = "/dev/sda";
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
inherit partitions;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user