# Things every machine will have...

{ inputs, outputs, lib, pkgs, ... }: {
  imports = [
    inputs.home-manager.nixosModules.home-manager
    ./users/noe.nix
    ./features/sops.nix
  ];

  boot.tmp.cleanOnBoot = true;
  boot.loader.systemd-boot.configurationLimit = 5;

  # Set UTC
  time.timeZone = lib.mkDefault "Etc/UTC";
  
  i18n.defaultLocale = "en_US.UTF-8";

  i18n.extraLocaleSettings = {
    LC_ADDRESS = "en_US.UTF-8";
    LC_IDENTIFICATION = "en_US.UTF-8";
    LC_MEASUREMENT = "en_US.UTF-8";
    LC_MONETARY = "en_US.UTF-8";
    LC_NAME = "en_US.UTF-8";
    LC_NUMERIC = "en_US.UTF-8";
    LC_PAPER = "en_US.UTF-8";
    LC_TELEPHONE = "en_US.UTF-8";
    LC_TIME = "en_US.UTF-8";
  };

  home-manager.extraSpecialArgs = { inherit inputs outputs; };
  home-manager.useGlobalPkgs = true;
  home-manager.useUserPackages = true;
  home-manager.sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager ];

  # A very fishy fish.
  programs.fish = {
    enable = true;
  };
  
  programs.git.enable = true;

  users.defaultUserShell = pkgs.fish;

  users.users.root.openssh.authorizedKeys.keys = import ./users/noe-keys.nix;

  services.openssh.enable = lib.mkDefault true;

  documentation.man.generateCaches = lib.mkForce false;

  nixpkgs = {
    overlays = [
      outputs.overlays.additions
      outputs.overlays.modifications
      outputs.overlays.unstable-packages
    ];
    config = {
      allowUnfree = true;
    };
  };

  nix = {
    package = pkgs.lix;
    gc.automatic = true;
    settings = {
      experimental-features = "nix-command flakes";
      auto-optimise-store = true;
      trusted-users = [ "root" "@wheel" ];
    };
  };
}
