This commit is contained in:
NeoTheFox 2021-06-24 23:22:43 +03:00
commit 0e4947b28c
4 changed files with 334 additions and 0 deletions

110
.editorconfig Normal file
View File

@ -0,0 +1,110 @@
# EditorConfig configuration for nixpkgs
# https://EditorConfig.org
# Top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file, utf-8 charset
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
# Ignore diffs/patches
[*.{diff,patch}]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
# see https://nixos.org/nixpkgs/manual/#chap-conventions
# Match json/lockfiles/markdown/nix/perl/python/ruby/shell/docbook files, set indent to spaces
[*.{json,lock,md,nix,pl,pm,py,rb,sh,xml}]
indent_style = space
# Match docbook files, set indent width of one
[*.xml]
indent_size = 1
# Match json/lockfiles/markdown/nix/ruby files, set indent width of two
[*.{json,lock,md,nix,rb}]
indent_size = 2
# Match perl/python/shell scripts, set indent width of four
[*.{pl,pm,py,sh}]
indent_size = 4
# Match gemfiles, set indent to spaces with width of two
[Gemfile]
indent_size = 2
indent_style = space
# Disable file types or individual files
# some of these files may be auto-generated and/or require significant changes
[*.{c,h}]
insert_final_newline = unset
trim_trailing_whitespace = unset
[*.{key,ovpn}]
insert_final_newline = unset
end_of_line = unset
[*.lock]
indent_size = unset
[deps.nix]
insert_final_newline = unset
[pkgs/tools/networking/dd-agent/*-deps.nix]
insert_final_newline = unset
[eggs.nix]
trim_trailing_whitespace = unset
[gemset.nix]
insert_final_newline = unset
[node-{composition,packages,packages-generated}.nix]
insert_final_newline = unset
[nixos/modules/services/networking/ircd-hybrid/*.{conf,in}]
trim_trailing_whitespace = unset
[nixos/tests/systemd-networkd-vrf.nix]
trim_trailing_whitespace = unset
[pkgs/build-support/dotnetenv/Wrapper/**]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
[pkgs/build-support/upstream-updater/**]
trim_trailing_whitespace = unset
[pkgs/development/compilers/elm/registry.dat]
end_of_line = unset
insert_final_newline = unset
[pkgs/development/haskell-modules/hackage-packages.nix]
indent_style = unset
trim_trailing_whitespace = unset
[pkgs/development/mobile/androidenv/generated/{addons,packages}.nix]
trim_trailing_whitespace = unset
[pkgs/development/node-packages/composition.nix]
insert_final_newline = unset
[pkgs/servers/dict/wordnet_structures.py]
trim_trailing_whitespace = unset
[pkgs/tools/misc/timidity/timidity.cfg]
trim_trailing_whitespace = unset
[pkgs/tools/security/enpass/data.json]
insert_final_newline = unset
trim_trailing_whitespace = unset
[pkgs/top-level/emscripten-packages.nix]
trim_trailing_whitespace = unset

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
hardware-configuration.nix

124
configuration.nix Normal file
View File

@ -0,0 +1,124 @@
# ___________ _____ _____
# | _ | ___ \_ _|____ |
# | | | | |_/ / | | / /
# | | | | __/ | | \ \
# \ \_/ / | _| |_.___/ /
# \___/\_| \___/\____/
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
./kernel.nix
];
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
networking.hostName = "opi3n"; # Define your hostname.
# Set your time zone.
time.timeZone = "Europe/Moscow";
# replicates the default behaviour.
networking.useDHCP = false;
networking.networkmanager.enable = true;
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_NUMERIC = "ru_RU.UTF-8"
LC_TIME = "ru_RU.UTF-8"
LC_MONETARY = "ru_RU.UTF-8"
LC_PAPER = "ru_RU.UTF-8"
LC_MEASUREMENT = "ru_RU.UTF-8"
};
# Enable the X11 windowing system.
services.xserver = {
enable = true;
layout = "us,ru";
xkbOptions = "grp:caps_toggle";
xkbVariant = ",phonetic_winkeys";
libinput.enable = true;
displayManager.startx.enable
}
# Sway
programs.sway.enable = true;
programs.sway.extraPackages = with pkgs; [
swaylock swayidle rxvt-unicode kitty dmenu wofi
];
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
sound.enable = true;
#hardware.pulseaudio.enable = true;
services.pipewire = {
enable = true;
pulse.enable = true;
jack.enable = true;
media-session.enable =true;
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
neovim aria2 fd ranger git curl exa bat bottom
neofetch tmux mosh rsync synergy ncdu pciutils
];
# 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;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
programs.vim.defaultEditor = true;
programs.neovim.vimAlias = true;
programs.zsh.enable = true;
# Users
users.users.neothefox = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [ "wheel" "sshusers" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMlvGBRMTZaoCOyNBMHuxhsfuS3GVjETioWfXSd6kOOc neothefox@Master"
"sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBBzBJORk3FEiIsgX9dhJnh7DD/5WhlX61xfkWvxXggB7kTNUgaWCU/2KbxW7kTywllw8ikxVzUYY2CJWI/uMYMMAAAAEc3NoOg== neothefox@pipboy14s"
];
};
programs.zsh.ohMyZsh = {
enable = true;
customPkgs = [ pkgs.nix-zsh-completions ];
plugins = [ "gitfast" "sudo" "man" ];
theme = "eastwood";
};
# 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. Its 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 = "21.05"; # Did you read the comment?
}

99
kernel.nix Normal file
View File

@ -0,0 +1,99 @@
{ config, pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelPatches = [ {
name = "opi3";
patch = builtins.fetchurl "https://xff.cz/kernels/5.12/patches/all.patch";
extraConfig = ''
EXTRA_FIRMWARE_DIR ${builtins.fetchGit "https://megous.com/git/linux-firmware"}
EXTRA_FIRMWARE brcm/brcmfmac43456-sdio.bin brcm/brcmfmac43456-sdio.txt brcm/BCM4345C5.hcd
RT2X00_LIB_FIRMWARE y
AUDIT n
NUMA n
DRM_AMDGPU n
DRM_NOUVEAU n
DRM_RADEON n
DRM_PANFROST y
ARCH_SUNXI y
ARCH_ROCKCHIP n
ARCH_BCM2835 n
ARCH_BCM4908 n
ARCH_MEDIATEK n
ARCH_TEGRA_132_SOC n
ARCH_TEGRA_210_SOC n
ARCH_TEGRA_186_SOC n
ARCH_TEGRA_194_SOC n
ARCH_TEGRA_234_SOC n
ARCH_MXC n
ARCH_MESON n
ARCH_HISI n
ARCH_XGENE n
ARCH_VEXPRESS n
ARCH_QCOM n
SUNXI_RSB y
STMMAC_ETH y
STMMAC_PLATFORM y
DWMAC_SUNXI y
PINCTRL_SUNXI y
SUNXI_WATCHDOG y
IR_SUNXI m
USB_MUSB_SUNXI y
MMC_SUNXI y
VIDEO_SUNXI y
VIDEO_SUNXI_CEDRUS y
CLK_SUNXI y
CLK_SUNXI_CLOCKS y
CLK_SUNXI_PRCM_SUN6I y
CLK_SUNXI_PRCM_SUN8I y
SUNXI_CCU y
SUN8I_H3_CCU y
SUN8I_DE2_CCU y
SUN8I_R_CCU y
SUN8I_THERMAL y
SUNXI_WATCHDOG y
SUN4I_TIMER y
SUN50I_ERRATUM_UNKNOWN1 y
SUNXI_MBUS y
SUNXI_SRAM y
RESET_SUNXI y
NVMEM_SUNXI_SID y
USB_NET_CDCETHER m
USB_RTL8152 y
USB_RTL8153_ECM m
DRM y
DRM_KMS_HELPER y
DRM_SUN4I y
DRM_SUN4I_HDMI y
DRM_SUN4I_HDMI_CEC y
DRM_SUN8I_DW_HDMI y
DRM_DW_HDMI y
DRM_DW_HDMI_AHB_AUDIO y
DRM_DW_HDMI_I2S_AUDIO y
DRM_DW_HDMI_CEC y
HDMI y
SND_SOC_HDMI_CODEC y
SND_SUN4I_CODEC y
SND_SUN8I_CODEC y
SND_SUN8I_CODEC_ANALOG y
SND_SUN50I_CODEC_ANALOG y
SND_SUN4I_I2S y
SND_SUN4I_SPDIF y
SND_SUN8I_ADDA_PR_REGMAP y
ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM y
CRYPTO_DEV_ALLWINNER y
SUN50I_DE2_BUS y
PHY_SUN4I_USB y
PWM_SUN4I y
SUNXI_RSB y
SUNRPC y
SUNRPC_GSS y
SUNRPC_BACKCHANNEL y
FB_SUN5I_EINK n
'';
} ];
}