2018-03-31 22:16:38 +02: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’).
|
|
|
|
|
|
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
2018-11-10 15:24:58 +01:00
|
|
|
|
let
|
2019-03-26 11:22:08 +01:00
|
|
|
|
gitRev = "83dbfc9fc8fab023f21743c13bb0f42287a5eb50";
|
2018-11-10 15:24:58 +01:00
|
|
|
|
nixpkgs = fetchTarball "https://github.com/nyanloutre/nixpkgs/archive/${gitRev}.tar.gz";
|
|
|
|
|
in
|
2018-03-31 22:16:38 +02:00
|
|
|
|
{
|
2018-09-04 14:05:06 +02:00
|
|
|
|
imports = [
|
2018-09-20 12:22:05 +02:00
|
|
|
|
../common.nix
|
2018-09-04 14:05:06 +02:00
|
|
|
|
./hardware-configuration.nix
|
|
|
|
|
./users.nix
|
|
|
|
|
./services.nix
|
|
|
|
|
];
|
2018-03-31 22:16:38 +02:00
|
|
|
|
|
2018-09-04 14:05:06 +02:00
|
|
|
|
boot = {
|
|
|
|
|
loader = {
|
|
|
|
|
systemd-boot.enable = true;
|
|
|
|
|
efi.canTouchEfiVariables = true;
|
|
|
|
|
};
|
2018-03-31 22:16:38 +02:00
|
|
|
|
|
2018-09-04 14:05:06 +02:00
|
|
|
|
supportedFilesystems = [ "zfs" ];
|
2018-03-31 22:16:38 +02:00
|
|
|
|
|
2018-09-04 14:05:06 +02:00
|
|
|
|
tmpOnTmpfs = true;
|
|
|
|
|
};
|
2018-04-05 19:22:09 +02:00
|
|
|
|
|
2018-11-10 15:24:58 +01:00
|
|
|
|
nix.nixPath = [
|
|
|
|
|
"nixpkgs=${nixpkgs}"
|
|
|
|
|
"nixos-config=/etc/nixos/configuration.nix"
|
|
|
|
|
];
|
|
|
|
|
|
2019-02-12 11:15:39 +01:00
|
|
|
|
nixpkgs.config.allowUnfree = false;
|
|
|
|
|
nixpkgs.config.allowUnfreePredicate = (pkg: builtins.elem (builtins.parseDrvName pkg.name).name [ "factorio-headless" "perl5.28.1-slimserver" ]);
|
|
|
|
|
|
2018-09-04 14:05:06 +02:00
|
|
|
|
services.zfs = {
|
|
|
|
|
autoSnapshot.enable = true;
|
|
|
|
|
autoScrub.enable = true;
|
|
|
|
|
};
|
2018-03-31 22:16:38 +02:00
|
|
|
|
|
2019-04-04 23:47:24 +02:00
|
|
|
|
# eno1 -> VLAN100 -> Internet
|
|
|
|
|
# eno2 -> LAN
|
2019-04-21 11:05:45 +02:00
|
|
|
|
# eno3 -> Legacy client DHCP
|
|
|
|
|
# eno4 -> Pas utilisé
|
2019-04-04 23:47:24 +02:00
|
|
|
|
|
2018-09-04 14:05:06 +02:00
|
|
|
|
networking = {
|
|
|
|
|
hostName = "loutreos"; # Define your hostname.
|
|
|
|
|
hostId = "7e66e347";
|
2019-04-04 23:47:24 +02:00
|
|
|
|
|
|
|
|
|
vlans.bouyges = {
|
|
|
|
|
id = 100;
|
|
|
|
|
interface = "eno1";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
interfaces = {
|
|
|
|
|
bouyges = {
|
|
|
|
|
# Adresse MAC BBox ? https://lafibre.info/remplacer-bbox/informations-de-connexion-ftth/msg598303/#msg598303
|
|
|
|
|
macAddress = "00:11:22:33:44:55";
|
|
|
|
|
};
|
|
|
|
|
eno2 = {
|
|
|
|
|
ipv4.addresses = [
|
|
|
|
|
{ address = "10.30.0.1"; prefixLength = 16; }
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# NAT bouyges <-> eno2
|
|
|
|
|
nat = {
|
|
|
|
|
enable = true;
|
2019-04-21 11:05:45 +02:00
|
|
|
|
# À remplacer par bouyges
|
|
|
|
|
externalInterface = "eno3";
|
2019-04-04 23:47:24 +02:00
|
|
|
|
# Permet d'utiliser le SNAT plus rapide au lieu de MASQUERADE
|
|
|
|
|
# externalIP = "0.0.0.0";
|
|
|
|
|
internalIPs = [ "10.30.0.0/16" ];
|
|
|
|
|
internalInterfaces = [ "eno2" ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services.dhcpd4 = {
|
|
|
|
|
enable = true;
|
|
|
|
|
interfaces = [ "eno2" ];
|
|
|
|
|
extraConfig = ''
|
|
|
|
|
option domain-name-servers 89.234.141.66, 80.67.169.12, 80.67.169.40;
|
|
|
|
|
option subnet-mask 255.255.0.0;
|
|
|
|
|
option routers 10.30.0.1;
|
|
|
|
|
subnet 10.30.0.0 netmask 255.255.0.0 {
|
|
|
|
|
range 10.30.50.0 10.30.250.0;
|
|
|
|
|
}
|
|
|
|
|
'';
|
2018-09-04 14:05:06 +02:00
|
|
|
|
};
|
2018-03-31 22:16:38 +02:00
|
|
|
|
|
2018-05-04 15:25:24 +02:00
|
|
|
|
nixpkgs.overlays = [
|
2018-06-09 13:23:26 +02:00
|
|
|
|
(import ../../overlays/riot-web.nix)
|
2018-05-04 15:25:24 +02:00
|
|
|
|
];
|
2018-05-07 11:35:57 +02:00
|
|
|
|
|
2018-09-04 14:05:06 +02:00
|
|
|
|
services.openssh = {
|
|
|
|
|
enable = true;
|
|
|
|
|
permitRootLogin = "no";
|
|
|
|
|
passwordAuthentication = false;
|
|
|
|
|
};
|
2018-03-31 22:16:38 +02:00
|
|
|
|
|
2018-09-04 14:05:06 +02:00
|
|
|
|
networking.firewall = {
|
2018-11-26 17:25:26 +01:00
|
|
|
|
allowedTCPPorts = [ ];
|
|
|
|
|
allowedUDPPorts = [ ];
|
2018-09-04 14:05:06 +02:00
|
|
|
|
enable = true;
|
|
|
|
|
};
|
2018-03-31 22:16:38 +02:00
|
|
|
|
|
|
|
|
|
security.sudo.wheelNeedsPassword = false;
|
|
|
|
|
|
2018-05-03 00:02:19 +02:00
|
|
|
|
system.stateVersion = "18.03";
|
2018-03-31 22:16:38 +02:00
|
|
|
|
}
|