mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-02-04 09:10:01 +01:00
kommode: use disko to configure disks
This commit is contained in:
@@ -147,7 +147,7 @@
|
|||||||
in {
|
in {
|
||||||
bakke = stableNixosConfig "bakke" {
|
bakke = stableNixosConfig "bakke" {
|
||||||
modules = [
|
modules = [
|
||||||
disko.nixosModules.disko
|
inputs.disko.nixosModules.disko
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
bicep = stableNixosConfig "bicep" {
|
bicep = stableNixosConfig "bicep" {
|
||||||
@@ -195,6 +195,7 @@
|
|||||||
];
|
];
|
||||||
modules = [
|
modules = [
|
||||||
inputs.nix-gitea-themes.nixosModules.default
|
inputs.nix-gitea-themes.nixosModules.default
|
||||||
|
inputs.disko.nixosModules.disko
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
(fp /base)
|
(fp /base)
|
||||||
|
./disks.nix
|
||||||
|
|
||||||
./services/gitea
|
./services/gitea
|
||||||
./services/nginx.nix
|
./services/nginx.nix
|
||||||
|
|||||||
80
hosts/kommode/disks.nix
Normal file
80
hosts/kommode/disks.nix
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
sda = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/sda";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
root = {
|
||||||
|
name = "root";
|
||||||
|
label = "root";
|
||||||
|
start = "1MiB";
|
||||||
|
end = "-5G";
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
extraArgs = [ "-f" ]; # Override existing partition
|
||||||
|
# subvolumes = let
|
||||||
|
# makeSnapshottable = subvolPath: mountOptions: let
|
||||||
|
# name = lib.replaceString "/" "-" subvolPath;
|
||||||
|
# in {
|
||||||
|
# "@${name}/active" = {
|
||||||
|
# mountpoint = subvolPath;
|
||||||
|
# inherit mountOptions;
|
||||||
|
# };
|
||||||
|
# "@${name}/snapshots" = {
|
||||||
|
# mountpoint = "${subvolPath}/.snapshots";
|
||||||
|
# inherit mountOptions;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# in {
|
||||||
|
# "@" = { };
|
||||||
|
# "@/swap" = {
|
||||||
|
# mountpoint = "/.swapvol";
|
||||||
|
# swap.swapfile.size = "4G";
|
||||||
|
# };
|
||||||
|
# "@/root" = {
|
||||||
|
# mountpoint = "/";
|
||||||
|
# mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
# };
|
||||||
|
# }
|
||||||
|
# // (makeSnapshottable "/home" [ "compress=zstd" "noatime" ])
|
||||||
|
# // (makeSnapshottable "/nix" [ "compress=zstd" "noatime" ])
|
||||||
|
# // (makeSnapshottable "/var/lib" [ "compress=zstd" "noatime" ])
|
||||||
|
# // (makeSnapshottable "/var/log" [ "compress=zstd" "noatime" ])
|
||||||
|
# // (makeSnapshottable "/var/cache" [ "compress=zstd" "noatime" ]);
|
||||||
|
|
||||||
|
# swap.swapfile.size = "4G";
|
||||||
|
mountpoint = "/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
swap = {
|
||||||
|
name = "swap";
|
||||||
|
label = "swap";
|
||||||
|
start = "-5G";
|
||||||
|
end = "-1G";
|
||||||
|
content.type = "swap";
|
||||||
|
};
|
||||||
|
|
||||||
|
ESP = {
|
||||||
|
name = "ESP";
|
||||||
|
label = "ESP";
|
||||||
|
start = "-1G";
|
||||||
|
end = "100%";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
mountOptions = [ "umask=0077" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -13,21 +13,6 @@
|
|||||||
boot.kernelModules = [ ];
|
boot.kernelModules = [ ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" =
|
|
||||||
{ device = "/dev/disk/by-uuid/d421538f-a260-44ae-8e03-47cac369dcc1";
|
|
||||||
fsType = "btrfs";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" =
|
|
||||||
{ device = "/dev/disk/by-uuid/86CD-4C23";
|
|
||||||
fsType = "vfat";
|
|
||||||
options = [ "fmask=0077" "dmask=0077" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices =
|
|
||||||
[ { device = "/dev/disk/by-uuid/4cfbb41e-801f-40dd-8c58-0a0c1a6025f6"; }
|
|
||||||
];
|
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
|||||||
Reference in New Issue
Block a user