2022-01-14 12:41:06 +01:00
|
|
|
# Settings that most of my hosts can agree on, but
|
|
|
|
# some of these settings are overriden on a per-host basis.
|
|
|
|
{
|
2022-03-23 13:10:18 +01:00
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
2022-04-13 08:50:12 +02:00
|
|
|
}: let
|
|
|
|
cfg = config.settings;
|
|
|
|
mkDefault = lib.mkDefault;
|
|
|
|
in {
|
2022-02-19 16:01:47 +01:00
|
|
|
imports = [
|
|
|
|
./photoprism.nix
|
|
|
|
./7-days-to-die.nix
|
|
|
|
./grafana.nix
|
|
|
|
./radicale.nix
|
|
|
|
./restic.nix
|
2022-03-12 23:23:53 +01:00
|
|
|
./wakeup.nix
|
2022-03-15 15:22:22 +01:00
|
|
|
./hdparm.nix
|
2022-03-23 13:10:18 +01:00
|
|
|
./malte.nix
|
|
|
|
./marie.nix
|
2022-03-29 13:26:19 +02:00
|
|
|
./taskserver.nix
|
2022-02-19 16:01:47 +01:00
|
|
|
];
|
2022-01-18 16:33:18 +01:00
|
|
|
|
2022-03-12 23:23:53 +01:00
|
|
|
options.settings = with lib; {
|
2022-04-13 08:50:12 +02:00
|
|
|
nvidiaUsed = mkEnableOption "NVIDIA graphic card usage";
|
|
|
|
minimalGnome.enable = mkEnableOption "basic gnome stuff";
|
2022-03-12 23:23:53 +01:00
|
|
|
};
|
|
|
|
|
2022-01-18 16:33:18 +01:00
|
|
|
config = {
|
|
|
|
# Allow joypixels' license and unfree licenses in general
|
|
|
|
nixpkgs.config = {
|
|
|
|
allowUnfree = true;
|
|
|
|
joypixels.acceptLicense = true;
|
|
|
|
};
|
|
|
|
# This includes the firmware, oc
|
|
|
|
hardware.enableAllFirmware = true;
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
|
2022-03-23 13:10:18 +01:00
|
|
|
# Use some binary caches
|
|
|
|
nix.settings = {
|
|
|
|
# add binary caches
|
|
|
|
trusted-public-keys = [
|
|
|
|
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
|
|
|
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
|
|
|
|
"2a-emulator.cachix.org-1:ijJDEqNsMqhamxxWvqOiaCQNoYhWNw7A+gGICgAH1mE="
|
|
|
|
"colmena.cachix.org-1:7BzpDnjjH8ki2CT3f6GdOk7QAzPOl+1t3LvTLXqYcSg="
|
2022-03-24 08:55:34 +01:00
|
|
|
"nickel.cachix.org-1:ABoCOGpTJbAum7U6c+04VbjvLxG9f0gJP5kYihRRdQs="
|
2022-03-25 18:46:53 +01:00
|
|
|
# Currently running hydra
|
2022-04-07 22:12:54 +02:00
|
|
|
"elysia-clarki:/ioV+oXpVgxDOZJvXIWmnyL83ERT4W6eW4SDEpnRbxU="
|
2022-03-23 13:10:18 +01:00
|
|
|
];
|
|
|
|
substituters = [
|
|
|
|
"https://cache.nixos.org"
|
|
|
|
"https://nixpkgs-wayland.cachix.org"
|
|
|
|
"https://2a-emulator.cachix.org"
|
|
|
|
"https://colmena.cachix.org"
|
2022-03-24 08:55:34 +01:00
|
|
|
"https://nickel.cachix.org"
|
2022-03-23 13:10:18 +01:00
|
|
|
];
|
2022-04-07 22:19:59 +02:00
|
|
|
trusted-users = [
|
|
|
|
# Hand the wheel group extra nix daemon rights
|
|
|
|
"@wheel"
|
|
|
|
];
|
2022-03-23 13:10:18 +01:00
|
|
|
};
|
|
|
|
|
2022-01-18 16:33:18 +01:00
|
|
|
# Make sure that I can login over the tailscale infrastructure
|
|
|
|
# while increasing security
|
|
|
|
# TODO: Restrict openssh interface, move port
|
|
|
|
services.openssh.enable = pkgs.lib.mkDefault true;
|
|
|
|
users.users.root = {
|
2022-03-23 13:10:18 +01:00
|
|
|
openssh.authorizedKeys.keyFiles = [../users/malte/yubikey.pub];
|
2022-01-18 16:33:18 +01:00
|
|
|
};
|
|
|
|
# Enable mosh for some SSH superpower
|
|
|
|
programs.mosh.enable = pkgs.lib.mkDefault true;
|
|
|
|
|
|
|
|
# Basic packages
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
# I might need git for rebuilding this flake on the remote machine
|
|
|
|
git
|
|
|
|
# Sops is for security
|
|
|
|
sops
|
|
|
|
# top is lacking pizzazz
|
|
|
|
htop
|
|
|
|
# An initial `tailscale up` is necessary to get the network going
|
|
|
|
tailscale
|
2022-02-15 13:24:57 +01:00
|
|
|
# I will need to have access to kakoune
|
|
|
|
kakoune
|
|
|
|
# I much rather use some tools other than the default
|
2022-02-15 14:58:39 +01:00
|
|
|
fd
|
|
|
|
du-dust
|
|
|
|
ripgrep
|
2022-01-18 16:33:18 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
# Language and timezone defaults
|
|
|
|
time.timeZone = "Europe/Berlin";
|
|
|
|
i18n.defaultLocale = pkgs.lib.mkDefault "en_US.UTF-8";
|
|
|
|
|
|
|
|
# Use the latest kernel, this is altered on some hosts with zfs requirements
|
|
|
|
boot.kernelPackages = pkgs.lib.mkDefault pkgs.linuxPackages_latest;
|
|
|
|
boot.loader.timeout = pkgs.lib.mkDefault 1;
|
|
|
|
# This setting is fine, on hosts with x/wayland, I'll want to increase this
|
|
|
|
boot.loader.systemd-boot.configurationLimit = 10;
|
|
|
|
|
|
|
|
# Network configuration with tailscale
|
|
|
|
networking.useDHCP = false;
|
|
|
|
# Enable tailscale!
|
|
|
|
services.tailscale = {
|
|
|
|
enable = true;
|
|
|
|
interfaceName = "looking-glas";
|
|
|
|
};
|
2022-03-23 13:10:18 +01:00
|
|
|
networking.firewall.allowedUDPPorts = [config.services.tailscale.port];
|
2022-03-24 08:56:05 +01:00
|
|
|
|
2022-03-30 12:13:21 +02:00
|
|
|
# Regularly clear the store
|
2022-03-24 08:56:05 +01:00
|
|
|
nix.gc = {
|
|
|
|
automatic = true;
|
2022-03-30 12:13:21 +02:00
|
|
|
dates = lib.mkDefault "weekly";
|
2022-03-24 08:56:05 +01:00
|
|
|
};
|
2022-04-13 08:50:12 +02:00
|
|
|
|
2022-03-24 08:56:05 +01:00
|
|
|
# Enable store optimiser
|
|
|
|
nix.optimise = {
|
|
|
|
automatic = true;
|
|
|
|
dates = ["04:00"];
|
|
|
|
};
|
2022-04-13 08:50:12 +02:00
|
|
|
|
|
|
|
# GNOME
|
|
|
|
# Don't forget to import DISPLAY into dbus variables
|
|
|
|
programs.dconf.enable = mkDefault cfg.minimalGnome.enable;
|
|
|
|
programs.seahorse.enable = mkDefault cfg.minimalGnome.enable;
|
|
|
|
services.gnome.at-spi2-core.enable = mkDefault cfg.minimalGnome.enable;
|
|
|
|
services.gnome.gnome-keyring.enable = mkDefault cfg.minimalGnome.enable;
|
|
|
|
services.dbus.packages = lib.optional cfg.minimalGnome.enable [pkgs.gcr];
|
2022-01-18 16:33:18 +01:00
|
|
|
};
|
2022-01-14 12:41:06 +01:00
|
|
|
}
|