]> git.dujemihanovic.xyz Git - nixos-configuration.git/blob - configuration.nix
systemd network, cleanup, packages
[nixos-configuration.git] / configuration.nix
1 { config, pkgs, ... }:
2
3 {
4 imports =
5 [
6 ./hardware-configuration.nix
7 ];
8
9 boot.loader.systemd-boot.enable = true;
10 boot.loader.efi.canTouchEfiVariables = true;
11
12 boot.extraModprobeConfig =
13 ''
14 options radeon si_support=0 cik_support=0
15 options amdgpu si_support=1 cik_support=1
16 '';
17
18 networking.hostName = "elitedesk"; # Define your hostname.
19 networking.interfaces.eno1.wakeOnLan.enable = true;
20 systemd.network = {
21 enable = true;
22 networks."10-lan" = {
23 matchConfig.Name = "eno1";
24 address = [
25 "192.168.1.30/24"
26 ];
27 routes = [
28 { routeConfig.Gateway = "192.168.1.1"; }
29 ];
30 dns = [ "192.168.1.1" ];
31 linkConfig.RequiredForOnline = "routable";
32 };
33 };
34
35 time.timeZone = "Europe/Zagreb";
36
37 i18n.defaultLocale = "en_US.UTF-8";
38
39 i18n.extraLocaleSettings = {
40 LC_ADDRESS = "hr_HR.UTF-8";
41 LC_IDENTIFICATION = "hr_HR.UTF-8";
42 LC_MEASUREMENT = "hr_HR.UTF-8";
43 LC_MONETARY = "hr_HR.UTF-8";
44 LC_NAME = "hr_HR.UTF-8";
45 LC_NUMERIC = "hr_HR.UTF-8";
46 LC_PAPER = "hr_HR.UTF-8";
47 LC_TELEPHONE = "hr_HR.UTF-8";
48 LC_TIME = "hr_HR.UTF-8";
49 };
50
51 console = {
52 keyMap = "dvorak";
53 packages = with pkgs; [ terminus_font ];
54 font = "ter-124b";
55 };
56
57 sound.enable = false;
58
59 programs.zsh = {
60 enable = true;
61 autosuggestions.enable = true;
62 syntaxHighlighting.enable = true;
63 };
64
65 users.users.duje = {
66 uid = 1000;
67 isNormalUser = true;
68 description = "Duje";
69 extraGroups = [ "networkmanager" "wheel" "libvirtd" ];
70 openssh.authorizedKeys.keys =
71 [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIMI2evf5v4ghSCJWacQJGMINjYW48WZYLvL6KIob1rd"
72 "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKeuxm8MnRjkVnrE+lZjlI+MuqzvD78OmvSgd43UMJ6b" ];
73 shell = pkgs.zsh;
74 };
75 users.users.root.openssh.authorizedKeys.keys =
76 [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIMI2evf5v4ghSCJWacQJGMINjYW48WZYLvL6KIob1rd"
77 "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKeuxm8MnRjkVnrE+lZjlI+MuqzvD78OmvSgd43UMJ6b" ];
78
79 nixpkgs.config.allowUnfree = true;
80
81 environment.systemPackages = with pkgs; [
82 neovim
83 lm_sensors
84 htop
85 nvimpager
86 tree
87 neofetch
88 ];
89
90 hardware.sensor.hddtemp = {
91 enable = true;
92 drives = [ "/dev/disk/by-path/*" ];
93 };
94
95 virtualisation.libvirtd.enable = true;
96
97 services.openssh.enable = true;
98
99 services.smartd.enable = true;
100 programs.msmtp = {
101 enable = true;
102 defaults = {
103 auth = true;
104 tls = true;
105 tls_starttls = true;
106 aliases = "/etc/aliases";
107 };
108 accounts = {
109 default = {
110 from = "duje.mihanovic@skole.hr";
111 host = "smtp.skole.hr";
112 port = 587;
113 user = "duje.mihanovic";
114 passwordeval = "/run/current-system/sw/bin/cat /secrets/email.txt";
115 };
116 };
117 };
118
119 environment.etc."aliases" = {
120 text = ''
121 root: duje.mihanovic@skole.hr
122 duje: duje.mihanovic@skole.hr
123 mailer-daemon: duje.mihanovic@skole.hr
124 '';
125 mode = "0644";
126 };
127
128 # Open ports in the firewall.
129 # networking.firewall.allowedTCPPorts = [ ... ];
130 # networking.firewall.allowedUDPPorts = [ ... ];
131 # Or disable the firewall altogether.
132 # networking.firewall.enable = false;
133
134 system.stateVersion = "23.05";
135
136 }