nixos-config/hosts/poseidon/default.nix

85 lines
1.9 KiB
Nix
Raw Normal View History

2021-01-27 18:22:02 +01:00
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{
2022-04-10 11:54:58 +02:00
config,
lib,
pkgs,
...
}: let
secrets = config.my.secrets;
in {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
2021-04-22 20:59:54 +02:00
2022-04-10 11:54:58 +02:00
./home.nix
./secrets.nix
];
2021-01-27 18:22:02 +01:00
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
2022-04-10 11:54:58 +02:00
boot.supportedFilesystems = ["btrfs"];
2021-03-24 22:04:33 +01:00
2021-03-25 00:40:22 +01:00
services.btrfs = {
autoScrub = {
enable = true;
2022-04-10 11:54:58 +02:00
fileSystems = ["/"];
2021-03-25 00:40:22 +01:00
};
};
2021-01-27 18:22:02 +01:00
networking.hostName = "poseidon"; # Define your hostname.
networking.domain = "alarsyo.net";
2021-01-27 18:22:02 +01:00
# Set your time zone.
time.timeZone = "Europe/Paris";
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.eno1.ipv4.addresses = [
{
address = "163.172.11.110";
prefixLength = 24;
}
];
networking.defaultGateway = {
address = "163.172.11.1";
interface = "eno1";
};
networking.nameservers = [
"62.210.16.6"
"62.210.16.7"
];
2021-02-22 18:59:37 +01:00
my.networking.externalInterface = "eno1";
2021-01-27 18:22:02 +01:00
my.services = {
2021-08-09 19:34:23 +02:00
restic-backup = {
2021-01-30 18:11:02 +01:00
enable = true;
repo = "b2:poseidon-backup";
passwordFile = config.age.secrets."restic-backup/poseidon-password".path;
environmentFile = config.age.secrets."restic-backup/poseidon-credentials".path;
2021-01-30 18:11:02 +01:00
};
2021-01-30 21:14:27 +01:00
2021-02-22 15:07:29 +01:00
fail2ban = {
enable = true;
};
tailscale = {
enable = true;
exitNode = true;
};
2021-01-27 20:55:16 +01:00
};
2022-11-27 15:42:06 +01:00
services = {
openssh.enable = true;
vnstat.enable = true;
};
# Takes a long while to build
documentation.nixos.enable = false;
2021-01-27 18:22:02 +01:00
}