summaryrefslogtreecommitdiff
path: root/modules/xnet/disk.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/xnet/disk.nix')
-rw-r--r--modules/xnet/disk.nix34
1 files changed, 26 insertions, 8 deletions
diff --git a/modules/xnet/disk.nix b/modules/xnet/disk.nix
index 82e9c87..e6835f4 100644
--- a/modules/xnet/disk.nix
+++ b/modules/xnet/disk.nix
@@ -1,4 +1,9 @@
-{ config, lib, modulesPath, inputs, ... }:
+{
+ config,
+ lib,
+ modulesPath,
+ ...
+}:
let
cfg = config.xnet.disk;
commonOpts = {
@@ -11,12 +16,16 @@ let
"com.sun:auto-snapshot" = "false";
};
- inherit (lib) mkOption mkDefault mkIf types;
+ inherit (lib)
+ mkOption
+ mkDefault
+ mkIf
+ types
+ ;
in
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
- inputs.disko.nixosModules.default
];
options.xnet.disk = {
@@ -33,8 +42,7 @@ in
};
config = mkIf cfg.enable {
- networking.hostId = builtins.substring 0 8
- (builtins.hashString "md5" config.networking.hostName);
+ networking.hostId = builtins.substring 0 8 (builtins.hashString "md5" config.networking.hostName);
services.zfs = {
autoScrub.enable = true;
@@ -46,8 +54,14 @@ in
zramSwap.enable = mkDefault true;
boot = {
- kernelParams = [ "nohibernate" "elevator=none" ];
- supportedFilesystems = [ "vfat" "zfs" ];
+ kernelParams = [
+ "nohibernate"
+ "elevator=none"
+ ];
+ supportedFilesystems = [
+ "vfat"
+ "zfs"
+ ];
zfs.devNodes = mkDefault "/dev/disk/by-partuuid";
loader = {
systemd-boot.enable = true;
@@ -94,7 +108,11 @@ in
disko.devices = {
nodev."/" = {
fsType = "tmpfs";
- mountOptions = [ "defaults" "size=2G" "mode=755" ];
+ mountOptions = [
+ "defaults"
+ "size=2G"
+ "mode=755"
+ ];
};
zpool.zroot = {