diff --git a/Desktop/configuration.nix b/Desktop/configuration.nix new file mode 100644 index 0000000..dbe7b09 --- /dev/null +++ b/Desktop/configuration.nix @@ -0,0 +1,165 @@ +# 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 + unstable = import {}; +in { + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./software.nix + ./modules/gnome.nix + ./modules/zsh.nix + ]; + + nixpkgs.config = { + allowUnfree = true; + android_sdk.accept_license = true; + }; + + # Use the systemd-boot EFI boot loader. + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + networking = { + hostName = "inex-pc"; + networkmanager.enable = true; + useDHCP = false; + interfaces = { + enp7s0 = { + useDHCP = true; + }; + wlp8s0 = { + useDHCP = true; + }; + }; + firewall = { + enable = false; + allowedTCPPorts = [ 1716 51820 24642 27036 27037 ]; + allowedUDPPorts = [ 1716 51820 24642 27031 27036 ]; + }; + wireguard.interfaces = { + wg0 = { + # Determines the IP address and subnet of the client's end of the tunnel interface. + ips = [ "10.100.0.6/24" ]; + + # Path to the private key file. + # + # Note: The private key can also be included inline via the privateKey option, + # but this makes the private key world-readable; thus, using privateKeyFile is + # recommended. + privateKeyFile = "/home/inex/wireguard-keys/private"; + + peers = [ + # For a client configuration, one peer entry for the server will suffice. + { + # Public key of the server (not a file path). + publicKey = "8sEAHYhydEGKTVecXcOb28zeGHGLGCsri5evbSQV8mY="; + + # Forward all the traffic via VPN. + # allowedIPs = [ "0.0.0.0/0" ]; + # Or forward only particular subnets + allowedIPs = [ "10.100.0.0/24" ]; + + # Set this to the server IP and port. + endpoint = "135.181.97.221:51820"; + + # Send keepalives every 25 seconds. Important to keep NAT tables alive. + persistentKeepalive = 25; + } + ]; + }; + }; + }; + + # Select internationalisation properties. + # i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "us"; + }; + + # Set your time zone. + time.timeZone = "Europe/Moscow"; + + services = { + printing.enable = true; + xserver = { + enable = true; + layout = "us"; + xkbVariant = "colemak"; + videoDrivers = [ "amdgpu" ]; + libinput.enable = true; + exportConfiguration = true; + wacom.enable = true; + }; + openssh = { + enable = true; + passwordAuthentication = false; + forwardX11 = true; + }; + pipewire.enable = true; + flatpak.enable = true; + }; + + + sound.enable = true; + + # Video driver + hardware = { + opengl = { + enable = true; + driSupport32Bit = true; + extraPackages = [ pkgs.amdvlk pkgs.rocm-opencl-icd pkgs.rocm-runtime ]; + }; + steam-hardware.enable = true; + bluetooth = { + enable = true; + package = pkgs.bluezFull; + }; + pulseaudio = { + enable = true; + package = pkgs.pulseaudioFull; + support32Bit = true; + extraModules = [ pkgs.pulseaudio-modules-bt ]; + }; + }; + + environment.variables.VK_ICD_FILENAMES = "${pkgs.amdvlk}/share/vulkan/icd.d/amd_icd64.json"; + + programs = { + adb.enable = true; + java = { + enable = true; + }; + }; + + virtualisation.docker.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.inex = { + isNormalUser = true; + home = "/home/inex"; + description = "Inex Code"; + extraGroups = [ "wheel" "networkmanager" "jackaudio" "audio" "video" "adbusers" "docker" ]; # Enable ‘sudo’ for the user. + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzL0gmvpMOZbijqZOlTuNqtVHZGoNrxCiWJXIDcUwr1cx8M2o61qK/wNMZmyYGROpJbpsFERAjXIXBpwg2KQ3ONRL6q44nPrOSbHm3zL8pnFEvzM0BUKV1Mq2T1dM+geMhQnLrwZhOxvp3+9uhFSTPP/dVzWQ19pEiK5hHpXlD3eyO+LIaS/wkTJvBy/wCKz+O/coLyBQ+Mn5hGQaJAyDec/ovu8OhBkJbbvWp03F2zcWUCxwVfZ1VnLQxn7tk9L4iTw1+rDt0kaRQvVISV3KdqLJnPODku6eC38LcMfHIFXAWBdSUslGUl9Qkd1c+6Gorzt3BrfYL/HDW2Xk3UTQF inex-envy" + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCbUS/AblfzZcfr/iMxHJ5pubzCuriVTu12TKt1iRQFDjQDo+/j0/Ga07zqyB9VUhpJg/IOcJ6o2T4PBixNuHQQX5z4sb/tqzbx3buBz0HIp8VHRC3TtLAmsFj24AldxlADlQpGnlt+g3p200m2dwu/Yoe4+GD8Twwg6FCsyiRjstbfo89Kmwi9yVbXx5aBssscEkXBQODTpwOB05nCz3oUuvQ5ex+yH+o02cTlYyBoglgfzM6HzR0GkmCRDlx613nqa1+ICxwWY0cXMbhnUwDoJASk5eJovtmEqC29qJKABxZaKRYsaW3sMJiMOvPHf9BkVKp4uPINhLc5vopwZI10xsNOn75AXRptkHzenn7ymC+qwJr53Z1tAAfMb5ypJ+u+SE8wazd4x2CIFHH+LbaputqxyfUxNoMbFMGNXICDAOCCQ0nkax7Ifr1NlTp07zTYH6VP0kzqqYiAlBu5qo3qIi5dRsLvb6/McerDNhRmYh25Ww7zpEY4Q9uTWDZkCP8= u0_a122@localhost" + ]; + }; + + # 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 = "20.03"; # Did you read the comment? + +} + diff --git a/Desktop/modules/gnome.nix b/Desktop/modules/gnome.nix new file mode 100644 index 0000000..56708a6 --- /dev/null +++ b/Desktop/modules/gnome.nix @@ -0,0 +1,31 @@ +{ config, pkgs, ... }: + +{ + # Enable the GNOME Desktop Environment. + services.xserver = { + displayManager = { + gdm = { + enable = true; + wayland = true; + autoSuspend = false; + }; + }; + desktopManager = { + gnome3.enable = true; + kodi.enable = true; + }; + }; + + + qt5.platformTheme = "gnome"; + + environment.systemPackages = with pkgs; [ + gnome3.pomodoro + gnome3.gnome-tweaks + gnome3.networkmanager-openvpn + gnome3.evolution + gnomeExtensions.gsconnect + paper-icon-theme + ]; +} + diff --git a/Desktop/modules/my_vim.nix b/Desktop/modules/my_vim.nix new file mode 100644 index 0000000..dd1ced4 --- /dev/null +++ b/Desktop/modules/my_vim.nix @@ -0,0 +1,26 @@ +{neovim, vimUtils, vimPlugins, stdenv, fetchgit}: + +let custom_config='' +let g:airline_powerline_fonts = 1 +let g:airline_theme='dark' +''; +in neovim.override { + vimAlias = true; + configure = { + customRC = custom_config; + vam.pluginDictionaries = [ + { names = [ + "vim-sensible" + "vim-airline" + "vim-airline-themes" + "nerdtree" + "vim-nix" + "dart-vim-plugin" + "coc-nvim" + ]; + } + ]; + }; +} + + diff --git a/Desktop/modules/zsh.nix b/Desktop/modules/zsh.nix new file mode 100644 index 0000000..ada9f31 --- /dev/null +++ b/Desktop/modules/zsh.nix @@ -0,0 +1,42 @@ +{ config, pkgs, ... }: + +{ + users.defaultUserShell = pkgs.zsh; + programs.zsh = { + enable = true; + interactiveShellInit = "ponysay -q"; + autosuggestions = { + enable = true; + }; + syntaxHighlighting = { + enable = true; + }; + ohMyZsh = { + enable = true; + plugins = [ + "git" + "python" + "man" + "z" + "catimg" + "copyfile" + "encode64" + "extract" + "npm" + "pip" + ]; + theme = "spaceship"; + customPkgs = with pkgs; [ + pkgs.nix-zsh-completions + pkgs.spaceship-prompt + pkgs.zsh-autosuggestions + pkgs.zsh-syntax-highlighting + ]; + }; + }; + environment.systemPackages = with pkgs; [ + zsh-autosuggestions + zsh-syntax-highlighting + ]; +} + diff --git a/Desktop/software.nix b/Desktop/software.nix new file mode 100644 index 0000000..4477831 --- /dev/null +++ b/Desktop/software.nix @@ -0,0 +1,132 @@ +{ config, pkgs, ... }: + +let + unstable = import {}; +in { + environment.systemPackages = with pkgs; [ + # Utils + cool-retro-term + tmux + ponysay + (pkgs.callPackage ./modules/my_vim.nix {}) + neofetch + pciutils + usbutils + i2c-tools + lm_sensors + bind + libcec + # openvpn + git + unzip + tldr + ffmpeg + wget + nix-bundle + nmap + file + unrar + mosh + syncthing + + # ROCm + rocm-opencl-runtime + rocm-smi + clinfo + + # Voice + speechd + rhvoice + + # Wireguard + #wireguard + #wireguard-tools + + nextcloud-client + + # Encrypted folders + encfs + #gencfsm + + # Browsers + firefox + transmission-gtk + youtube-dl + + # Messangers + tdesktop + #discord + mumble + #riot-desktop + #qtox + dino + zoom-us + teams + teamspeak_client + + # Games + steam + steam-run-native + openttd + minecraft + unstable.lutris-unwrapped + vulkan-tools + wineWowPackages.full + wineWowPackages.fonts + winetricks + xonotic + + # Development + vscode + ansible + octaveFull + texlive.combined.scheme-full + gcc-unwrapped + python3Full + # (import (builtins.fetchTarball "https://github.com/babariviere/nixpkgs/archive/flutter-init.tar.gz") {}).flutter + #android-studio + cmake + nodejs + + ccls + + josm + + # Screen recording + unstable.obs-studio + peek + + # Graphics + krita + gmic_krita_qt + potrace + + # Audio + audacity + # lmms + picard + cmus + spotify + + vlc + + # Plugins + # ladspaPlugins + # lsp-plugins + + # Documents + anki + libreoffice + homebank + trilium-desktop + klavaro + liberation_ttf + keepassxc + + # Themes + paper-icon-theme + plata-theme + + ]; + +}