Files
nixcfg/hosts/common/default.nix
2023-02-08 23:02:36 +00:00

102 lines
2.0 KiB
Nix

{
config,
pkgs,
lib,
...
}: let
mkUser = userName: {
isNormalUser = true;
home = "/home/${userName}";
initialPassword = "password";
extraGroups = ["wheel" "networkmanager" "docker" "video" "syncthing"];
shell = pkgs.nushell;
};
defaultUser = "daniel";
in {
# Use the systemd-boot EFI boot loader.
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.loader.systemd-boot.enable = lib.mkDefault true;
boot.loader.efi.canTouchEfiVariables = lib.mkDefault true;
# nix flakes compatibility
nix = {
extraOptions = ''
experimental-features = nix-command flakes
warn-dirty = false
'';
settings = {
substituters = [
"https://hyprland.cachix.org"
];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
};
# Set time zone.
time.timeZone = "Europe/London";
i18n = {
defaultLocale = "en_GB.UTF-8";
};
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
console = {
useXkbConfig = true;
};
virtualisation.docker.enable = true;
hardware.cpu.intel.updateMicrocode = true;
users.users."${defaultUser}" = mkUser defaultUser;
xdg.portal.wlr.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
curl
fd
firefox
fzf
gcc
git
htop
helix
nnn
nushell
ripgrep
wget
zsh
];
environment.homeBinInPath = true;
environment.variables = {
EDITOR = "hx";
};
networking.firewall.trustedInterfaces = ["tailscale0"];
programs.zsh.enable = true;
services = {
openssh.enable = true;
syncthing = {
enable = true;
user = defaultUser;
dataDir = "/home/${defaultUser}";
};
tailscale = {
enable = true;
};
};
}