Compare commits
7 Commits
c8a54817b7
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
c33c04987f
|
|||
|
7e74ff0892
|
|||
|
87f35f3bb3
|
|||
|
76c49857db
|
|||
|
1b2f799d77
|
|||
|
4b105b0517
|
|||
|
79fe0645a0
|
10
README.org
10
README.org
@@ -1,3 +1,13 @@
|
||||
* Aegis
|
||||
|
||||
Declarative configuration for the ZFS backup server, using [[https://nixos.org][NixOS]]
|
||||
|
||||
** Modules
|
||||
|
||||
The configuration is sliced into different files, per category:
|
||||
|
||||
- ZFS pool configuration: hardware-configuration.nix
|
||||
- Network configuration: networking.nix
|
||||
- Systemd services and timers: periodic.nix
|
||||
|
||||
All the modules are imported in *configuration.nix*
|
||||
|
||||
@@ -33,9 +33,6 @@
|
||||
# Cleanup tmp on startup
|
||||
boot.cleanTmpDir = true;
|
||||
|
||||
# Set hostname
|
||||
networking.hostName = "aegis";
|
||||
|
||||
# Create coace user
|
||||
users.users.coace = {
|
||||
isNormalUser = true;
|
||||
@@ -89,16 +86,18 @@
|
||||
shell = "${pkgs.fish}/bin/fish";
|
||||
openssh.authorizedKeys.keys = [''
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINNmNckWBxa2fQkUjWLHgQd32C272yB+f9kTcnooszd5 coolneng@panacea
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICo/y05fFCh8VkDN40cgTR5ZqcbxWvzp0+OzaGIn6vEQ root@unit
|
||||
''];
|
||||
};
|
||||
|
||||
# Rotate logs after 7 days
|
||||
services.journald.extraConfig = "SystemMaxFiles=7";
|
||||
|
||||
# Increase inotify limits
|
||||
boot.kernel.sysctl = { "fs.inotify.max_user_watches" = 204800; };
|
||||
|
||||
# Import other configuration modules
|
||||
imports = [ ./modules/hardware-configuration.nix ./modules/networking.nix ];
|
||||
imports = [
|
||||
./modules/hardware-configuration.nix
|
||||
./modules/networking.nix
|
||||
./modules/periodic.nix
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "usbhid" ];
|
||||
boot.initrd.availableKernelModules = [ "usb_storage" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
@@ -18,6 +18,11 @@
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/shield/unit" =
|
||||
{ device = "shield/unit";
|
||||
fsType = "zfs";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
||||
|
||||
@@ -19,22 +19,4 @@
|
||||
nameservers = [ "1.1.1.1" "8.8.8.8" ];
|
||||
enableIPv6 = false;
|
||||
};
|
||||
|
||||
# Enable zeroconf
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns = true;
|
||||
publish = {
|
||||
enable = true;
|
||||
addresses = true;
|
||||
domain = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Firewall configuration
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ ];
|
||||
allowedUDPPorts = [ ];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
13
modules/periodic.nix
Normal file
13
modules/periodic.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Idle HDDs when not used
|
||||
systemd.services.hd-idle = {
|
||||
description = "Idle HDDs when not in use";
|
||||
wantedBy = [ "default.target" ];
|
||||
path = with pkgs; [ hd-idle ];
|
||||
script = "${pkgs.hd-idle}/bin/hd-idle";
|
||||
serviceConfig.Type = "simple";
|
||||
after = [ "shield-unit.mount" ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user