2021-10-16 12:30:41 +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, ... }:
|
|
|
|
|
|
let
|
|
|
|
|
|
unstable = import <nixos-unstable> {};
|
|
|
|
|
|
sshPubkeys = [
|
|
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE+X4vceRi79FLwwyzFzxNvaQlolQFrpYn0N4bgdLLaI root@hardlyworking"
|
|
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFyGaBZIZYjiBhOFD2drvG316B9NUVSbMpTIhOCQur8P arch"
|
|
|
|
|
|
];
|
|
|
|
|
|
mc1 = "192.168.0.167";
|
2021-11-04 12:39:42 +01:00
|
|
|
|
common_mc1_route = {
|
2021-10-16 12:30:41 +02:00
|
|
|
|
via = mc1;
|
|
|
|
|
|
prefixLength = 24;
|
|
|
|
|
|
};
|
2021-11-04 12:39:42 +01:00
|
|
|
|
in
|
|
|
|
|
|
{
|
2021-10-16 12:30:41 +02:00
|
|
|
|
users.users = {
|
|
|
|
|
|
root.openssh.authorizedKeys.keys = sshPubkeys;
|
|
|
|
|
|
mc-fucker = {
|
|
|
|
|
|
isNormalUser = true;
|
|
|
|
|
|
openssh.authorizedKeys.keys = sshPubkeys;
|
2021-11-04 12:39:42 +01:00
|
|
|
|
hashedPassword = "$6$VlNqS5D2uxmzs$AXEEg63iQ5bMQDtU9.Cy4cd/UfQCHk9QNo2RuQmucNz6Y4Z2l0qM5lvr6KFcEdJi6vO7mYd761LrVrQ8J7nPw1";
|
2021-10-16 12:30:41 +02:00
|
|
|
|
extraGroups = [ "wheel" ];
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
nixpkgs.overlays = [
|
|
|
|
|
|
(self: super: {
|
|
|
|
|
|
gitea = unstable.gitea;
|
2021-11-03 18:37:52 +01:00
|
|
|
|
htop = unstable.htop;
|
2021-10-16 12:30:41 +02:00
|
|
|
|
})
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
imports =
|
|
|
|
|
|
[ # Include the results of the hardware scan.
|
|
|
|
|
|
./hardware-configuration.nix
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
boot.loader.grub.enable = true;
|
|
|
|
|
|
boot.loader.grub.version = 2;
|
|
|
|
|
|
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
|
|
|
|
|
|
|
|
|
|
|
|
# networking.hostName = "nixos"; # Define your hostname.
|
|
|
|
|
|
time.timeZone = "Europe/Berlin";
|
|
|
|
|
|
|
|
|
|
|
|
networking.useDHCP = false;
|
|
|
|
|
|
|
|
|
|
|
|
i18n.defaultLocale = "en_GB.UTF-8";
|
|
|
|
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
|
wget
|
|
|
|
|
|
htop
|
|
|
|
|
|
git
|
2021-10-16 16:09:58 +02:00
|
|
|
|
screen
|
|
|
|
|
|
rxvt-unicode
|
2021-11-03 18:37:52 +01:00
|
|
|
|
(import ./vim.nix)
|
2021-10-16 12:30:41 +02:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
# Some programs need SUID wrappers, can be configured further or are
|
|
|
|
|
|
# started in user sessions.
|
|
|
|
|
|
# programs.mtr.enable = true;
|
|
|
|
|
|
# programs.gnupg.agent = {
|
|
|
|
|
|
# enable = true;
|
|
|
|
|
|
# enableSSHSupport = true;
|
|
|
|
|
|
# };
|
|
|
|
|
|
|
|
|
|
|
|
# Open ports in the firewall.
|
|
|
|
|
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
|
|
|
|
|
networking.firewall.allowedTCPPorts = [ 3000 2222 ];
|
|
|
|
|
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
|
|
|
|
# Or disable the firewall altogether.
|
|
|
|
|
|
# networking.firewall.enable = false;
|
|
|
|
|
|
|
2021-11-03 18:37:52 +01:00
|
|
|
|
system.stateVersion = "21.05";
|
2021-10-16 12:30:41 +02:00
|
|
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
|
|
nameservers = [ mc1 ];
|
|
|
|
|
|
defaultGateway = "192.168.0.1";
|
|
|
|
|
|
interfaces.ens192.ipv4 = {
|
|
|
|
|
|
addresses = [ {
|
|
|
|
|
|
address = "192.168.0.165";
|
|
|
|
|
|
prefixLength = 24;
|
|
|
|
|
|
} ];
|
2021-11-04 12:39:42 +01:00
|
|
|
|
routes = [
|
2021-10-16 12:30:41 +02:00
|
|
|
|
(common_mc1_route // { address = "192.168.1.0"; })
|
|
|
|
|
|
(common_mc1_route // { address = "192.168.2.0"; })
|
|
|
|
|
|
(common_mc1_route // { address = "192.168.3.0"; })
|
|
|
|
|
|
];
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
zramSwap = {
|
|
|
|
|
|
enable = true;
|
2021-11-03 18:37:52 +01:00
|
|
|
|
memoryPercent = 250;
|
2021-10-16 12:30:41 +02:00
|
|
|
|
algorithm = "lzo-rle";
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2021-10-16 16:09:58 +02:00
|
|
|
|
programs = {
|
2021-11-04 12:39:42 +01:00
|
|
|
|
zsh = import ./zsh.nix;
|
2021-10-16 16:09:58 +02:00
|
|
|
|
atop = {
|
|
|
|
|
|
enable = true;
|
2021-10-16 12:30:41 +02:00
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
users.defaultUserShell = pkgs.zsh;
|
|
|
|
|
|
|
|
|
|
|
|
security.sudo.wheelNeedsPassword = false;
|
2021-11-03 18:37:52 +01:00
|
|
|
|
|
|
|
|
|
|
system.autoUpgrade = {
|
|
|
|
|
|
enable = true;
|
|
|
|
|
|
allowReboot = true;
|
|
|
|
|
|
};
|
2021-11-04 12:39:42 +01:00
|
|
|
|
|
2021-10-16 12:30:41 +02:00
|
|
|
|
services = {
|
2021-11-04 12:39:42 +01:00
|
|
|
|
openssh = {
|
|
|
|
|
|
enable = true;
|
|
|
|
|
|
passwordAuthentication = false;
|
|
|
|
|
|
};
|
2021-10-16 12:30:41 +02:00
|
|
|
|
|
|
|
|
|
|
zabbixAgent = {
|
|
|
|
|
|
enable = true;
|
|
|
|
|
|
openFirewall = true;
|
|
|
|
|
|
server = mc1;
|
|
|
|
|
|
};
|
2021-11-04 12:39:42 +01:00
|
|
|
|
gitea = import ./gitea.nix;
|
2021-11-03 18:37:52 +01:00
|
|
|
|
};
|
2021-10-16 16:09:58 +02:00
|
|
|
|
|
2021-11-03 18:37:52 +01:00
|
|
|
|
virtualisation = {
|
|
|
|
|
|
docker = {
|
|
|
|
|
|
enable = true;
|
|
|
|
|
|
};
|
2021-10-16 12:30:41 +02:00
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# vim: set et ts=2 sw=2 ai
|