mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
fix(lint): nixfmt the whole tree
This commit is contained in:
parent
643b136863
commit
bf219a30c2
69 changed files with 2605 additions and 1726 deletions
|
|
@ -1,12 +1,19 @@
|
|||
{ config, pkgs, lib, myLib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
myLib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.aviallon.filesystems.btrfs;
|
||||
#fsCfg = config.fileSystems;
|
||||
btrfsPaths = [ "/" ];
|
||||
# btrfsPaths = filterAttrs (n: v: v.fsType == "btrfs") fsCfg;
|
||||
# btrfsPaths = filterAttrs (n: v: v.fsType == "btrfs") fsCfg;
|
||||
generalCfg = config.aviallon.general;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.aviallon.filesystems.btrfs = {
|
||||
enable = mkEnableOption "BTRFS support";
|
||||
autoScrub = {
|
||||
|
|
@ -57,11 +64,11 @@ in {
|
|||
};
|
||||
systemd.services.duperemove = {
|
||||
script = ''
|
||||
mkdir -p $DATA_DIR
|
||||
exec ${pkgs.duperemove}/bin/duperemove \
|
||||
--io-threads=${toString cfg.autoDedup.ioThreads} --cpu-threads=${toString cfg.autoDedup.cpuThreads} \
|
||||
--dedupe-options=same \
|
||||
--hashfile=$DATA_DIR/hashes.db -h -v -rd "$@"
|
||||
mkdir -p $DATA_DIR
|
||||
exec ${pkgs.duperemove}/bin/duperemove \
|
||||
--io-threads=${toString cfg.autoDedup.ioThreads} --cpu-threads=${toString cfg.autoDedup.cpuThreads} \
|
||||
--dedupe-options=same \
|
||||
--hashfile=$DATA_DIR/hashes.db -h -v -rd "$@"
|
||||
'';
|
||||
scriptArgs = concatStringsSep " " cfg.autoDedup.paths;
|
||||
# %S : state
|
||||
|
|
|
|||
|
|
@ -1,21 +1,27 @@
|
|||
{config, lib, pkgs, ...}:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.aviallon.filesystems.zfs;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.aviallon.filesystems.zfs = {
|
||||
enable = mkEnableOption "ZFS support";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot.initrd.supportedFilesystems = ["zfs"]; # boot from zfs
|
||||
boot.initrd.supportedFilesystems = [ "zfs" ]; # boot from zfs
|
||||
boot.supportedFilesystems = [ "zfs" ];
|
||||
|
||||
aviallon.filesystems.udevRules = mkAfter [
|
||||
# ZFS doesn't like additional schedulers
|
||||
''SUBSYSTEM=="block", ACTION!="remove", KERNEL=="sd[a-z]*[0-9]*|mmcblk[0-9]*p[0-9]*|nvme[0-9]*n[0-9]*p[0-9]*", ENV{ID_FS_TYPE}=="zfs_member", ATTR{../queue/scheduler}="none"''
|
||||
];
|
||||
|
||||
|
||||
services.zfs.autoScrub.enable = true;
|
||||
services.zfs.autoSnapshot.enable = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue