From: Duje Mihanović Date: Wed, 13 Sep 2023 18:03:53 +0000 (+0200) Subject: systemd network, cleanup, packages X-Git-Url: https://git.dujemihanovic.xyz/%7B%7B%20%24style.Permalink%20%7D%7D?a=commitdiff_plain;h=88699acd4eea8f4aaae2f0698d327e3db755a07d;p=nixos-configuration.git systemd network, cleanup, packages --- diff --git a/configuration.nix b/configuration.nix index b04823e..76fb2d9 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,16 +1,11 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - { config, pkgs, ... }: { imports = - [ # Include the results of the hardware scan. + [ ./hardware-configuration.nix ]; - # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -21,20 +16,24 @@ ''; networking.hostName = "elitedesk"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. networking.interfaces.eno1.wakeOnLan.enable = true; + systemd.network = { + enable = true; + networks."10-lan" = { + matchConfig.Name = "eno1"; + address = [ + "192.168.1.30/24" + ]; + routes = [ + { routeConfig.Gateway = "192.168.1.1"; } + ]; + dns = [ "192.168.1.1" ]; + linkConfig.RequiredForOnline = "routable"; + }; + }; - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - - # Set your time zone. time.timeZone = "Europe/Zagreb"; - # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; i18n.extraLocaleSettings = { @@ -49,13 +48,12 @@ LC_TIME = "hr_HR.UTF-8"; }; - # Configure console keymap - console.keyMap = "croat"; - - # Enable CUPS to print documents. - services.printing.enable = true; + console = { + keyMap = "dvorak"; + packages = with pkgs; [ terminus_font ]; + font = "ter-124b"; + }; - # Enable sound with pipewire. sound.enable = false; programs.zsh = { @@ -64,7 +62,6 @@ syntaxHighlighting.enable = true; }; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.duje = { uid = 1000; isNormalUser = true; @@ -79,31 +76,24 @@ [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIMI2evf5v4ghSCJWacQJGMINjYW48WZYLvL6KIob1rd" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKeuxm8MnRjkVnrE+lZjlI+MuqzvD78OmvSgd43UMJ6b" ]; - # Allow unfree packages nixpkgs.config.allowUnfree = true; - # List packages installed in system profile. To search, run: - # $ nix search wget environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - # wget neovim lm_sensors + htop + nvimpager + tree + neofetch ]; - virtualisation.libvirtd.enable = true; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; + hardware.sensor.hddtemp = { + enable = true; + drives = [ "/dev/disk/by-path/*" ]; + }; - # List services that you want to enable: + virtualisation.libvirtd.enable = true; - # Enable the OpenSSH daemon. services.openssh.enable = true; services.smartd.enable = true; @@ -121,7 +111,7 @@ host = "smtp.skole.hr"; port = 587; user = "duje.mihanovic"; - passwordeval = "cat /secrets/email.txt"; + passwordeval = "/run/current-system/sw/bin/cat /secrets/email.txt"; }; }; }; @@ -141,12 +131,6 @@ # Or disable the firewall altogether. # networking.firewall.enable = false; - # 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. It‘s 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). - system.stateVersion = "23.05"; # Did you read the comment? + system.stateVersion = "23.05"; }