# 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, ... }: let home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz"; dmenu-src = builtins.fetchTarball "https://git.jptrzy.xyz/dmenu/snapshot/master.tar.gz"; dwm-src = builtins.fetchTarball "https://git.jptrzy.xyz/dwm/snapshot/master.tar.gz"; dwmblocks-src = builtins.fetchTarball "https://git.jptrzy.xyz/dwmblocks/snapshot/master.tar.gz"; neo-comic-mono-font = builtins.fetchTarball "https://git.jptrzy.xyz/neo-comic-mono-font/snapshot/master.tar.gz"; sent-src = builtins.fetchTarball "https://git.jptrzy.xyz/sent/snapshot/master.tar.gz"; slock-src = builtins.fetchTarball "https://git.jptrzy.xyz/slock/snapshot/master.tar.gz"; user = "jp3"; in { # NixOS Specific # Copy the NixOS configuration - /run/current-system/configuration.nix system.copySystemConfiguration = true; # Check out https://nixos.org/nixos/options.html). system.stateVersion = "23.05"; # Did you read the comment? nixpkgs.config.allowUnfree = true; nix.extraOptions = '' experimental-features = nix-command flakes ''; nix.gc.automatic = true; imports = [ (import "${home-manager}/nixos") # Include the results of the hardware scan. ./hardware-configuration.nix # Autologin on tty1 ./autologin.nix ]; nixpkgs.config.packageOverrides = pkgs: { nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { inherit pkgs; }; vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; angband = pkgs.angband.override { enableSdl2 = true; }; }; home-manager.users."${user}" = import ./home-manager/home.nix { inherit user config pkgs; inherit (pkgs.nixpkgs) lib; }; security.pam.services."${user}".enableGnomeKeyring = true; security.wrappers = { slock = { owner = "root"; group = "root"; setuid = true; source = "${pkgs.slock}/bin/slock"; }; }; # BootLoader boot = { initrd.luks.devices = { # Decrypt LUKS Partition before accessing LVM(s) partitions root = { device = "/dev/sda2"; preLVM = true; }; }; loader = { # Use the systemd-boot EFI boot loader. systemd-boot = { enable = true; configurationLimit = 3; }; efi.canTouchEfiVariables = true; }; }; # System # Set your time zone. time.timeZone = "Europe/Warsaw"; users.groups."${user}" = {}; # Define a user account. Don't forget to set a password with ‘passwd’. users.users."${user}" = { createHome = true; isNormalUser = true; extraGroups = [ "${user}" "wheel" "video" "audio" "disk" "networkmanager" ]; # Enable ‘sudo’ for the user. group = "users"; home = "/home/${user}"; uid = 1000; }; # Network networking = { hostName = "jp3-x270"; # Define your hostname. networkmanager.enable = true; # Easiest to use and most distros use this by default. }; # Enable sound. sound.enable = true; hardware = { bluetooth = { enable = true; settings = { General = { Enable = "Source,Sink,Media,Socket"; }; }; }; pulseaudio = { enable = true; package = pkgs.pulseaudioFull; extraConfig = " load-module module-switch-on-connect "; }; opengl = { enable = true; extraPackages = with pkgs; [ intel-media-driver # LIBVA_DRIVER_NAME=iHD vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) vaapiVdpau libvdpau-va-gl ]; }; }; services = { logind.extraConfig = '' HandleLidSwitch=suspend ''; xserver = { # Enable the X11 windowing system. enable = true; layout = "pl"; xkbOptions = "caps:escape"; displayManager.sx.enable = true; windowManager.dwm.enable = true; libinput = { enable = true; touchpad = { naturalScrolling = true; clickMethod = "none"; tapping = false; }; }; }; printing = { enable = true; drivers = [ pkgs.hplip pkgs.hplipWithPlugin ]; }; avahi = { enable = true; nssmdns = true; openFirewall = true; }; auto-cpufreq.enable = true; # Helps battery life flatpak.enable = true; gvfs.enable = true; # Gvfs - Trash and MTP (Smartphones) dbus.enable = true; }; # Lock on lid close #systemd.user.services.systemd-lock-handler = { # enable = true; #}; #systemd.services.xautolock-lid-close = { # enable = true; # description = "Enable xautolock on lid close"; # before = [ "sleep.target" ]; # wantedBy = [ "sleep.target" ]; # serviceConfig = { # Type = "forking"; # User = "root"; # Environment = "DISPLAY=:1"; # ExecStartPre = "${pkgs.xorg.xhost}/bin/xhost si:localuser:root"; # ExecStart = "${pkgs.xautolock}/bin/xautolock --locknow"; # }; #}; # Services # PinEntry for GnuPG programs.gnupg.agent = { enable = true; pinentryFlavor = "gnome3"; enableSSHSupport = true; }; # Portals xdg.portal.enable = true; xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; # Programs # Enable Sceen Brightness programs.light.enable = true; programs.system-config-printer.enable = true; # Fonts fonts.fonts = with pkgs; [ noto-fonts noto-fonts-cjk noto-fonts-emoji font-awesome # Custom (import "${neo-comic-mono-font}") ]; # Gaming programs.steam = { enable = true; remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server }; # Suckless Overlays nixpkgs.overlays = [ (final: prev: { dmenu = prev.dmenu.overrideAttrs (old: { src = dmenu-src; }); dwm = prev.dwm.overrideAttrs (old: { src = dwm-src; }); dwmblocks = prev.dwmblocks.overrideAttrs (old: { src = dwmblocks-src; }); sent = prev.dwm.overrideAttrs (old: { src = sent-src; }); slock = prev.slock.overrideAttrs (old: { src = slock-src; buildInputs = with pkgs; [ xorg.libXinerama xorg.libXft imlib2 ] ++ old.buildInputs; }); }) ]; # List packages installed in system profile. To search, run: environment.binsh = "${pkgs.dash}/bin/dash"; # $ nix search wget environment.systemPackages = with pkgs; [ #(import /home/.../.local/src/slock/default.nix { # inherit fetchurl lib stdenv writeText; # inherit libxcrypt; # inherit (xorg) xorgproto libX11 libXext libXrandr; #}) neovim git wget htop gnumake gcc gnupg pass killall shellcheck # Window Manager cmus dconf dmenu dwm dwmblocks slock xclip nsxiv zathura pinentry-gnome gcr pinentry-gtk2 # Heavy alacritty firefox gnome.nautilus pika-backup pavucontrol logseq heroic lxappearance fontpreview ffmpeg mpv thunderbird signal-desktop w3m texlive.combined.scheme-full yt-dlp curl ueberzug libnotify abaddon # Discord inkscape gimp krita cups arandr monero-gui sent xautolock # Gnome Apps without Gnome gnome.adwaita-icon-theme libsecret gnome.seahorse # Lanuguages nil nix-index # Games angband nethack openttd ]; }