]> git.dujemihanovic.xyz Git - nixos-configuration.git/blob - configuration.nix
Convert to server config
[nixos-configuration.git] / configuration.nix
1 # Edit this configuration file to define what should be installed on
2 # your system. Help is available in the configuration.nix(5) man page
3 # and in the NixOS manual (accessible by running ‘nixos-help’).
4
5 { config, pkgs, ... }:
6
7 {
8 imports =
9 [ # Include the results of the hardware scan.
10 ./hardware-configuration.nix
11 ];
12
13 # Bootloader.
14 boot.loader.systemd-boot.enable = true;
15 boot.loader.efi.canTouchEfiVariables = true;
16
17 boot.extraModprobeConfig =
18 ''
19 options radeon si_support=0 cik_support=0
20 options amdgpu si_support=1 cik_support=1
21 '';
22
23 networking.hostName = "elitedesk"; # Define your hostname.
24 # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
25 networking.interfaces.eno1.wakeOnLan.enable = true;
26
27 # Configure network proxy if necessary
28 # networking.proxy.default = "http://user:password@proxy:port/";
29 # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
30
31 # Enable networking
32 networking.networkmanager.enable = true;
33
34 # Set your time zone.
35 time.timeZone = "Europe/Zagreb";
36
37 # Select internationalisation properties.
38 i18n.defaultLocale = "en_US.UTF-8";
39
40 i18n.extraLocaleSettings = {
41 LC_ADDRESS = "hr_HR.UTF-8";
42 LC_IDENTIFICATION = "hr_HR.UTF-8";
43 LC_MEASUREMENT = "hr_HR.UTF-8";
44 LC_MONETARY = "hr_HR.UTF-8";
45 LC_NAME = "hr_HR.UTF-8";
46 LC_NUMERIC = "hr_HR.UTF-8";
47 LC_PAPER = "hr_HR.UTF-8";
48 LC_TELEPHONE = "hr_HR.UTF-8";
49 LC_TIME = "hr_HR.UTF-8";
50 };
51
52 # Configure console keymap
53 console.keyMap = "croat";
54
55 # Enable CUPS to print documents.
56 services.printing.enable = true;
57
58 # Enable sound with pipewire.
59 sound.enable = false;
60
61 programs.zsh = {
62 enable = true;
63 autosuggestions.enable = true;
64 syntaxHighlighting.enable = true;
65 };
66
67 # Define a user account. Don't forget to set a password with ‘passwd’.
68 users.users.duje = {
69 uid = 1000;
70 isNormalUser = true;
71 description = "Duje";
72 extraGroups = [ "networkmanager" "wheel" "libvirtd" ];
73 openssh.authorizedKeys.keys =
74 [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIMI2evf5v4ghSCJWacQJGMINjYW48WZYLvL6KIob1rd"
75 "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKeuxm8MnRjkVnrE+lZjlI+MuqzvD78OmvSgd43UMJ6b" ];
76 shell = pkgs.zsh;
77 };
78
79 # Allow unfree packages
80 nixpkgs.config.allowUnfree = true;
81
82 # List packages installed in system profile. To search, run:
83 # $ nix search wget
84 environment.systemPackages = with pkgs; [
85 # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
86 # wget
87 neovim
88 lm_sensors
89 ];
90
91 virtualisation.libvirtd.enable = true;
92
93 # Some programs need SUID wrappers, can be configured further or are
94 # started in user sessions.
95 # programs.mtr.enable = true;
96 # programs.gnupg.agent = {
97 # enable = true;
98 # enableSSHSupport = true;
99 # };
100
101 # List services that you want to enable:
102
103 # Enable the OpenSSH daemon.
104 services.openssh.enable = true;
105
106 services.smartd.enable = true;
107 programs.msmtp = {
108 enable = true;
109 defaults = {
110 auth = true;
111 tls = true;
112 tls_starttls = true;
113 aliases = "/etc/aliases";
114 };
115 accounts = {
116 default = {
117 from = "duje.mihanovic@skole.hr";
118 host = "smtp.skole.hr";
119 port = 587;
120 user = "duje.mihanovic";
121 passwordeval = "cat /secrets/email.txt";
122 };
123 };
124 };
125
126 environment.etc."aliases" = {
127 text = ''
128 root: duje.mihanovic@skole.hr
129 duje: duje.mihanovic@skole.hr
130 mailer-daemon: duje.mihanovic@skole.hr
131 '';
132 mode = "0644";
133 };
134
135 # Open ports in the firewall.
136 # networking.firewall.allowedTCPPorts = [ ... ];
137 # networking.firewall.allowedUDPPorts = [ ... ];
138 # Or disable the firewall altogether.
139 # networking.firewall.enable = false;
140
141 # This value determines the NixOS release from which the default
142 # settings for stateful data, like file locations and database versions
143 # on your system were taken. It‘s perfectly fine and recommended to leave
144 # this value at the release version of the first install of this system.
145 # Before changing this value read the documentation for this option
146 # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
147 system.stateVersion = "23.05"; # Did you read the comment?
148
149 }