nixos/modules/common/default.nix

101 lines
3.2 KiB
Nix
Raw Normal View History

2021-12-28 23:05:17 +01:00
{ pkgs, ... }:
let
2022-01-10 20:25:50 +01:00
username = import ../../username.nix;
in
2021-11-23 22:17:41 +01:00
{
imports = [
2022-01-10 20:25:50 +01:00
../../modules/cli
2021-11-23 22:17:41 +01:00
];
# Use the systemd-boot EFI boot loader.
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
2021-11-27 16:53:22 +01:00
# The rough location
location = {
latitude = 46.948;
longitude = 7.447;
};
2021-11-23 22:17:41 +01:00
# Set your time zone.
time.timeZone = "Europe/Zurich";
networking = {
firewall.allowedTCPPorts = [ 22 ];
# firewall.allowedUDPPorts = [ ... ];
};
hardware = {
cpu.intel.updateMicrocode = true;
enableRedistributableFirmware = true;
};
2021-11-24 20:39:18 +01:00
programs.mosh.enable = true;
2021-11-23 22:17:41 +01:00
services = {
openssh.enable = true;
};
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
2022-01-12 22:08:22 +01:00
# Disable the root user
users.users.root.hashedPassword = "!";
2021-11-23 22:17:41 +01:00
# Define a user account. Don't forget to set a password with passwd.
users.users.${username} = {
2021-11-23 22:17:41 +01:00
isNormalUser = true;
initialPassword = "password";
extraGroups = [
"wheel"
"networkmanager"
];
2022-01-10 21:57:50 +01:00
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCR+JXNHSAEQamn2QiaKV0vejCPy6OmzOePXoaQF6CEknXyvBO4j7+qpgZ5RAhe7ups8xZrEpBKdtxRMf7OdQQEXg1PLlfWZSJTC8EGu1TbMltbwwHizgsK/15LkDhJ0Gk/GFz9O9GvGqjizik8Kvvqz8XWY0tEtYs5Riq8bB5D5Ctwl10iultqnIQkdaX0bNa/2X57XKeutWdbqhuSC/C7awC1aVDIdfy1BNT3weHhQhFVAeAlH7Fy4rx3gYPclICfzu27lulLeXKJj9F+NdeY84zEy7E8IkE7eqdo1zfdJJpXSIh3FqekWen5njzWJsXqZCa2Ynk1poK/Rv/ti+ySE+4XicyXp0VJM8fDz6iUI0S/pjumHwzpoN9CeNe5PDK3Y7iQzSlO9REvkj/+v7r2s6XKslk9B7hTKunvH5JgHlIeYymzXb4r2LggNrP/1KUgNk1Ztu+s1c5onXYfBNul1iQOFU3+kgTk8Oh/UFK3FA0dYeWrOLA02TdH2S7U6yE= andreas@gwyn"
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDxBun0BYQaz/WjiP+g5+Hs9/JZnWAuLTpTVYgx/9shJwKS5Zu9K3I115DYOro/lpu0AMeeJca5We2AICcxYcM0lIZvsJqfOnFOHFjgmHxHc6IuzrUPM7msoLneF5lxfJ8ko2/LcFq8EtGlzjkllRpFpp2FtxDviD1lr4mJda4cOuQES4ujH3HP5Shpwa96oqnDENWCL+XPFe+Ur+88tuKTQ2MIX5Iqhs2sMIwsMI1o8HjBi4sMd+kd7qb232XcwWTlP3iIWvq/0D3OxZ6J6uSNyC4UCl781lupLOKrC6ml58RUrYP8nrF0a53+i0hgLuDiCWhj0vkY7W9nJW1no425 andreas@python"
];
2021-11-23 22:17:41 +01:00
};
# allow non-free packages
nixpkgs.config.allowUnfree = true;
2021-11-30 20:25:33 +01:00
nix = {
autoOptimiseStore = true;
package = pkgs.nixFlakes;
extraOptions = ''experimental-features = nix-command flakes'';
# enable garbage collection
gc = {
automatic = true;
2021-12-08 08:31:37 +01:00
dates = "daily";
2021-11-30 20:25:33 +01:00
options = "--delete-older-than 7d";
};
2021-11-23 22:17:41 +01:00
};
2021-11-30 20:25:33 +01:00
2021-11-23 22:17:41 +01:00
environment.shellAliases = {
nix-generations = "sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
2021-11-25 22:45:34 +01:00
rebuild = "sudo nixos-rebuild -j auto switch";
2021-11-23 22:17:41 +01:00
};
environment.variables = {
EDITOR = "vim";
HIGHLIGHT_STYLE = "solarized-light";
};
# 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. Its 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).
2022-01-10 20:25:50 +01:00
system.stateVersion = import ../../version.nix;
2021-11-23 22:17:41 +01:00
}