2021-03-07 22:06:39 -05:00
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
2021-06-02 21:30:09 -04:00
|
|
|
|
let
|
|
|
|
|
dotfiles = builtins.fetchTarball
|
|
|
|
|
"https://github.com/walkah/dotfiles/archive/main.tar.gz";
|
|
|
|
|
in {
|
2021-03-07 22:06:39 -05:00
|
|
|
|
imports = [ # Include the results of the hardware scan.
|
|
|
|
|
./hardware-configuration.nix
|
|
|
|
|
<home-manager/nixos>
|
2021-03-15 22:26:07 -04:00
|
|
|
|
|
|
|
|
|
../../modules/coredns
|
2021-07-27 19:42:11 -04:00
|
|
|
|
../../modules/code-server
|
2021-10-13 21:11:36 -04:00
|
|
|
|
../../modules/gitea
|
2021-07-14 22:49:45 -04:00
|
|
|
|
../../modules/home-assistant
|
2021-06-07 21:15:08 -04:00
|
|
|
|
../../modules/matrix
|
2021-11-14 14:16:56 -05:00
|
|
|
|
../../modules/sops
|
2021-03-07 22:06:39 -05:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Use the systemd-boot EFI boot loader.
|
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
boot.cleanTmpDir = true;
|
2021-03-17 20:30:41 -04:00
|
|
|
|
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
2021-03-07 22:06:39 -05:00
|
|
|
|
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
2021-11-19 22:59:43 -05:00
|
|
|
|
nixpkgs.overlays = [ (import ../../overlays) ];
|
2021-03-07 22:06:39 -05:00
|
|
|
|
|
|
|
|
|
# Set your time zone.
|
|
|
|
|
time.timeZone = "America/Toronto";
|
|
|
|
|
|
|
|
|
|
networking.hostName = "plato"; # Define your hostname.
|
|
|
|
|
networking.useDHCP = false;
|
|
|
|
|
networking.interfaces.enp10s0.useDHCP = true;
|
|
|
|
|
networking.interfaces.enp9s0.useDHCP = true;
|
|
|
|
|
|
|
|
|
|
security.sudo.wheelNeedsPassword = false;
|
|
|
|
|
|
|
|
|
|
users.users.root.openssh.authorizedKeys.keys = [
|
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ0mE4MyMnfd1b2nlBJT7kpZ6Vov+ILuGNfzdp5ZBNQe walkah@walkah.net"
|
2021-03-17 20:30:41 -04:00
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC5spf4diguK+w7iYLFr565++6DjHukWfvpN2ru9dCRk nixbuild"
|
2021-03-07 22:06:39 -05:00
|
|
|
|
];
|
|
|
|
|
users.users.walkah = {
|
|
|
|
|
isNormalUser = true;
|
|
|
|
|
extraGroups = [ "wheel" "docker" ];
|
|
|
|
|
shell = pkgs.zsh;
|
|
|
|
|
openssh.authorizedKeys.keys = [
|
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ0mE4MyMnfd1b2nlBJT7kpZ6Vov+ILuGNfzdp5ZBNQe walkah@walkah.net"
|
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM8YMax7PGIrcPNIHkpuNRFgn3HJK6Wepm+ycZWO6jfR walkah@walkah-ipadpro11"
|
|
|
|
|
];
|
|
|
|
|
};
|
2021-06-02 21:30:09 -04:00
|
|
|
|
home-manager.users.walkah = import "${dotfiles}/home.nix";
|
2021-03-07 22:06:39 -05:00
|
|
|
|
|
2021-09-11 12:35:42 -04:00
|
|
|
|
system.autoUpgrade.enable = false;
|
2021-10-08 21:36:30 -04:00
|
|
|
|
environment.systemPackages = with pkgs; [ docker-compose weechat ];
|
2021-03-07 22:06:39 -05:00
|
|
|
|
|
|
|
|
|
fileSystems."/mnt/downloads" = {
|
|
|
|
|
device = "192.168.6.100:/volume1/Downloads";
|
|
|
|
|
fsType = "nfs";
|
|
|
|
|
};
|
|
|
|
|
fileSystems."/mnt/music" = {
|
|
|
|
|
device = "192.168.6.100:/volume1/Music";
|
|
|
|
|
fsType = "nfs";
|
|
|
|
|
};
|
|
|
|
|
fileSystems."/mnt/video" = {
|
|
|
|
|
device = "192.168.6.100:/volume1/Video";
|
|
|
|
|
fsType = "nfs";
|
|
|
|
|
};
|
|
|
|
|
|
2021-09-24 21:30:15 -04:00
|
|
|
|
power.ups = {
|
|
|
|
|
enable = true;
|
|
|
|
|
mode = "standalone";
|
|
|
|
|
ups."cyberpower" = {
|
|
|
|
|
description = "Cyberpower EC650LCD";
|
|
|
|
|
driver = "usbhid-ups";
|
|
|
|
|
port = "auto";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2021-03-07 22:06:39 -05:00
|
|
|
|
programs.mosh.enable = true;
|
2021-06-07 21:15:08 -04:00
|
|
|
|
programs.zsh = {
|
|
|
|
|
enable = true;
|
|
|
|
|
promptInit = "";
|
|
|
|
|
};
|
2021-10-09 18:15:38 -04:00
|
|
|
|
programs.gnupg.agent = {
|
|
|
|
|
enable = true;
|
|
|
|
|
enableSSHSupport = true;
|
|
|
|
|
};
|
|
|
|
|
|
2021-03-07 22:06:39 -05:00
|
|
|
|
# Enable the OpenSSH daemon.
|
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
|
|
|
|
|
services.tailscale.enable = true;
|
|
|
|
|
services.keybase.enable = true;
|
|
|
|
|
|
2021-09-22 17:37:06 -04:00
|
|
|
|
virtualisation.docker = {
|
|
|
|
|
enable = true;
|
|
|
|
|
# Clean docker images periodically
|
|
|
|
|
autoPrune = {
|
|
|
|
|
enable = true;
|
|
|
|
|
flags = [ "--all" ];
|
|
|
|
|
};
|
|
|
|
|
};
|
2021-03-07 22:06:39 -05:00
|
|
|
|
|
|
|
|
|
# Open ports in the firewall.
|
|
|
|
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
|
|
|
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
|
|
|
# Or disable the firewall altogether.
|
2021-03-15 22:26:07 -04:00
|
|
|
|
networking.firewall.enable = false;
|
2021-03-07 22:06:39 -05:00
|
|
|
|
|
2021-07-09 22:59:33 -04:00
|
|
|
|
walkah.coredns = { enable = true; };
|
|
|
|
|
|
2021-05-10 21:42:30 -04:00
|
|
|
|
services = {
|
|
|
|
|
grafana = {
|
|
|
|
|
enable = true;
|
|
|
|
|
domain = "plato.walkah.lab";
|
|
|
|
|
port = 2342;
|
|
|
|
|
addr = "0.0.0.0";
|
|
|
|
|
};
|
|
|
|
|
prometheus = {
|
|
|
|
|
enable = true;
|
|
|
|
|
port = 9090;
|
|
|
|
|
exporters = {
|
|
|
|
|
node = {
|
|
|
|
|
enable = true;
|
|
|
|
|
enabledCollectors = [ "systemd" ];
|
|
|
|
|
port = 9100;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
scrapeConfigs = [
|
|
|
|
|
{
|
|
|
|
|
job_name = "node";
|
|
|
|
|
static_configs = [{
|
|
|
|
|
targets = [
|
|
|
|
|
"plato:9100"
|
|
|
|
|
"agent:9100"
|
|
|
|
|
"form:9100"
|
|
|
|
|
"matter:9100"
|
|
|
|
|
"purpose:9100"
|
2021-06-30 22:20:56 -04:00
|
|
|
|
"socrates:9100"
|
2021-05-10 21:42:30 -04:00
|
|
|
|
];
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
job_name = "coredns";
|
|
|
|
|
static_configs = [{ targets = [ "plato:9153" ]; }];
|
|
|
|
|
}
|
2021-06-21 22:56:05 -04:00
|
|
|
|
{
|
|
|
|
|
job_name = "ipfs";
|
|
|
|
|
metrics_path = "/debug/metrics/prometheus";
|
|
|
|
|
static_configs = [{
|
|
|
|
|
targets = [ "agent:5001" "form:5001" "matter:5001" "purpose:5001" ];
|
|
|
|
|
}];
|
|
|
|
|
}
|
2021-05-10 21:42:30 -04:00
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2021-03-07 22:06:39 -05:00
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
|
|
|
system.stateVersion = "20.09"; # Did you read the comment?
|
|
|
|
|
}
|