Refactored zfs
This commit is contained in:
parent
ffc2762249
commit
ab33edcb6b
|
@ -5,11 +5,12 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../modules/zfs.nix
|
|
||||||
../modules/profiles/laptop.nix
|
../modules/profiles/laptop.nix
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
|
this.systems.zfs.enable = true;
|
||||||
|
|
||||||
# This is required for the zfs module as well. Must be unique. Run the following head -c4 /dev/urandom | od -A none -t x4
|
# This is required for the zfs module as well. Must be unique. Run the following head -c4 /dev/urandom | od -A none -t x4
|
||||||
networking.hostId = "a7a1c3f5";
|
networking.hostId = "a7a1c3f5";
|
||||||
networking.hostName = "nil"; # Define your hostname.
|
networking.hostName = "nil"; # Define your hostname.
|
||||||
|
|
|
@ -15,6 +15,5 @@
|
||||||
# TODO Refactor everything after this.
|
# TODO Refactor everything after this.
|
||||||
./cli.nix
|
./cli.nix
|
||||||
./fonts.nix
|
./fonts.nix
|
||||||
./zfs.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, ... }: {
|
||||||
imports = [ ./gtk.nix ./boot.nix ./xdg.nix ./flatpak.nix ];
|
imports = [ ./gtk.nix ./boot.nix ./xdg.nix ./flatpak.nix ./zfs.nix ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,15 @@
|
||||||
{ config, pkgs, ... }: {
|
{ config, lib, pkgs, ... }:
|
||||||
|
let cfg = config.this.systems.zfs;
|
||||||
|
in with lib; {
|
||||||
|
options.this.systems.zfs = {
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
type = with types; bool;
|
||||||
|
description = "enable zfs";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
boot = {
|
boot = {
|
||||||
supportedFilesystems = [ "zfs" ];
|
supportedFilesystems = [ "zfs" ];
|
||||||
zfs = {
|
zfs = {
|
||||||
|
@ -18,5 +29,5 @@
|
||||||
flags = "-k -p --utc";
|
flags = "-k -p --utc";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
{ config, pkgs, ... }: {
|
|
||||||
boot = {
|
|
||||||
supportedFilesystems = [ "zfs" ];
|
|
||||||
zfs = {
|
|
||||||
forceImportRoot = false;
|
|
||||||
forceImportAll = false;
|
|
||||||
};
|
|
||||||
# this was required for the initial setup of the zpool.
|
|
||||||
# see https://nixos.org/nixos/options.html#boot.zfs.forceimportroot
|
|
||||||
# kernelParams = ["zfs_force=1"];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.zfs = {
|
|
||||||
autoScrub.enable = true;
|
|
||||||
# enable default auto-snapshots
|
|
||||||
autoSnapshot = {
|
|
||||||
enable = true;
|
|
||||||
flags = "-k -p --utc";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
Reference in New Issue
Block a user