WIP: move nixos modules
This commit is contained in:
parent
d725c3b788
commit
2a5983344d
29 changed files with 65 additions and 115 deletions
6
modules/nixos/server/automatic-garbage-collection.nix
Normal file
6
modules/nixos/server/automatic-garbage-collection.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
options = "--delete-older-than 7d";
|
||||
};
|
||||
}
|
||||
9
modules/nixos/server/automatic-upgrade.nix
Normal file
9
modules/nixos/server/automatic-upgrade.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
system.autoUpgrade = {
|
||||
enable = true;
|
||||
flake = "gitlab:bertof/nix-dotfiles";
|
||||
# dates = "daily"; # default 04:04
|
||||
randomizedDelaySec = "45min";
|
||||
flags = [ "--refresh" ];
|
||||
};
|
||||
}
|
||||
15
modules/nixos/server/btrfs-scrub.nix
Normal file
15
modules/nixos/server/btrfs-scrub.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (builtins) mapAttrs attrValues;
|
||||
inherit (lib) filterAttrs unique;
|
||||
btrfsFileSystems =
|
||||
filterAttrs (_k: v: v.fsType == "btrfs") config.fileSystems;
|
||||
btrfsDevices =
|
||||
unique (attrValues (mapAttrs (_: v: v.device) btrfsFileSystems));
|
||||
in
|
||||
{
|
||||
services.btrfs.autoScrub = {
|
||||
enable = btrfsDevices != [ ];
|
||||
fileSystems = btrfsDevices;
|
||||
};
|
||||
}
|
||||
10
modules/nixos/server/default.nix
Normal file
10
modules/nixos/server/default.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
src = ./.;
|
||||
files = builtins.readDir src;
|
||||
nixFiles = builtins.attrNames (lib.attrsets.filterAttrs (name: type: type != "directory" && lib.hasSuffix ".nix" name && !(lib.hasSuffix "default.nix" name)) files);
|
||||
imports = builtins.map (path: src + ("/" + path)) nixFiles;
|
||||
in
|
||||
{
|
||||
inherit imports;
|
||||
}
|
||||
3
modules/nixos/server/fstrim.nix
Normal file
3
modules/nixos/server/fstrim.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
services.fstrim.enable = true;
|
||||
}
|
||||
3
modules/nixos/server/fwupd.nix
Normal file
3
modules/nixos/server/fwupd.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
services.fwupd.enable = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue