Migrate to Snowfall (#1)
Reviewed-on: #1 Co-authored-by: Evan Reichard <evan@reichard.io> Co-committed-by: Evan Reichard <evan@reichard.io>
This commit was merged in pull request #1.
This commit is contained in:
55
modules/nixos/system/disk/default.nix
Normal file
55
modules/nixos/system/disk/default.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
let
|
||||
inherit (lib.${namespace}) mkOpt;
|
||||
inherit (lib) mkIf types;
|
||||
|
||||
cfg = config.${namespace}.system.disk;
|
||||
in
|
||||
{
|
||||
options.${namespace}.system.disk = {
|
||||
enable = lib.mkEnableOption "Disko Configuration";
|
||||
diskPath = mkOpt types.str null "Device path for the main disk";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = cfg.diskPath;
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
swap = {
|
||||
size = "32G";
|
||||
content = {
|
||||
type = "swap";
|
||||
discardPolicy = "both";
|
||||
resumeDevice = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user