# 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’). { inputs, outputs, lib, config, pkgs, vars, ... }: { imports = [ ./hardware-configuration.nix inputs.home-manager.nixosModules.home-manager ]; nix = { nixPath = [ "/etc/nix/path" ]; gc = { automatic = true; }; settings = { auto-optimise-store = true; experimental-features = "nix-command flakes"; }; registry = (lib.mapAttrs (_: flake: { inherit flake; })) ((lib.filterAttrs (_: lib.isType "flake")) inputs); }; nixpkgs.config.allowUnfree = true; security.rtkit.enable = true; home-manager = { extraSpecialArgs = { inherit inputs outputs vars; }; users = { ${vars.user} = import ../../home; }; }; powerManagement = { enable = true; powertop.enable = true; }; # Bootloader. boot = { loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; kernelPackages = pkgs.linuxPackages_latest; plymouth.enable = true; kernelParams = [ "quiet" "splash" ]; }; networking = { nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ]; hostName = "saarni"; useNetworkd = true; wireless.iwd.enable = true; }; systemd = { watchdog = { device = "/dev/watchdog"; runtimeTime = "30s"; }; sleep.extraConfig = "HibernateDelaysSec=90m"; network = { enable = true; wait-online.enable = false; networks = { "10-lan" = { matchConfig.Name = "enp0s20f0u9"; networkConfig.DHCP = "yes"; }; "11-lan" = { matchConfig.Name = "wlan0"; networkConfig.DHCP = "yes"; }; }; }; }; system.autoUpgrade = { enable = true; }; sound.enable = true; hardware = { opengl = { enable = true; driSupport = true; extraPackages = with pkgs; [ intel-media-driver libvdpau-va-gl ]; }; bluetooth = { enable = true; powerOnBoot = true; }; }; # Set your time zone. time.timeZone = "Europe/Helsinki"; # Select internationalisation properties. i18n = { defaultLocale = "en_US.UTF-8"; extraLocaleSettings = { LC_ADDRESS = "fi_FI.UTF-8"; LC_IDENTIFICATION = "fi_FI.UTF-8"; LC_MEASUREMENT = "fi_FI.UTF-8"; LC_MONETARY = "fi_FI.UTF-8"; LC_NAME = "fi_FI.UTF-8"; LC_NUMERIC = "fi_FI.UTF-8"; LC_PAPER = "fi_FI.UTF-8"; LC_TELEPHONE = "fi_FI.UTF-8"; LC_TIME = "fi_FI.UTF-8"; }; }; console.keyMap = "fi"; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.${vars.user} = { isNormalUser = true; description = "${vars.name}"; extraGroups = [ "input" "network" "wheel" ]; packages = with pkgs; [ ]; ignoreShellProgramCheck = true; shell = pkgs.${vars.shell}; }; programs = { firefox.enable = true; hyprland.enable = true; gnupg.agent = { enable = true; enableSSHSupport = true; }; mtr.enable = true; }; environment = { sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; }; systemPackages = with pkgs; [ fastfetch vulkan-tools libva-utils wget curl git gzip btop glxinfo sqlite openssh gnupg helix nixfmt ]; etc = lib.mapAttrs' (name: value: { name = "nix/path/${name}"; value.source = value.flake; }) config.nix.registry; }; fonts = { enableDefaultPackages = true; packages = with pkgs; [ noto-fonts fira-code fira-code-symbols ]; fontconfig = { defaultFonts = { serif = [ "Noto Serif" ]; sansSerif = [ "Noto Sans" ]; monospace = [ "Fira Code" ]; }; }; }; # List services that you want to enable: services = { getty.autologinUser = "petri"; resolved = { enable = true; dnsovertls = "true"; }; xserver = { layout = "fi"; xkbVariant = "normal"; }; pipewire = { enable = true; alsa.enable = true; pulse.enable = true; }; openssh.enable = true; printing.enable = true; kmscon = { enable = true; hwRender = true; extraOptions = "--xkb-layout=fi"; }; blueman.enable = true; upower.enable = true; upower.criticalPowerAction = "Hibernate"; fstrim.enable = false; thermald.enable = true; auto-cpufreq.enable = true; greetd = { enable = true; settings = rec { initial_session = { command = "${pkgs.hyprland}/bin/Hyprland"; user = "petri"; }; default_session = initial_session; }; }; }; xdg.portal = { enable = true; xdgOpenUsePortal = true; extraPortals = [ pkgs.xdg-desktop-portal-hyprland pkgs.xdg-desktop-portal-gtk ]; wlr = { enable = true; settings = { screencast = { chooser_type = "simple"; chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -ro"; }; }; }; }; # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ]; # 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.11"; # Did you read the comment? }