1
0
Fork 0
mirror of https://github.com/inexcode/nixos-config.git synced 2024-11-23 15:01:26 +00:00

update laptop

This commit is contained in:
Inex Code 2022-07-01 22:40:13 +03:00
parent 1c4f59a494
commit b5259e38e8
5 changed files with 399 additions and 75 deletions

View file

@ -4,24 +4,55 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec -a "$0" "$@"
'';
in
{ {
imports = imports =
[ # Include the results of the hardware scan. [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./software.nix ./software.nix
./modules/gnome.nix ./modules/gnome.nix
# ./modules/i3.nix
./modules/zsh.nix ./modules/zsh.nix
./pipewire.nix
]; ];
nixpkgs.config = { nixpkgs.config = {
allowUnfree = true; allowUnfree = true;
android_sdk.accept_license = true; # allowBroken = true;
}; android_sdk.accept_license = true;
chromium.enableWideVine = true;
};
nixpkgs.overlays = [
(self: super:
{
vscode-extensions = super.vscode-extensions // {
github.copilot = pkgs.vscode-utils.buildVscodeMarketplaceExtension {
mktplcRef = {
publisher = "github";
name = "copilot";
version = "1.30.6165";
sha256 = "2Y4zQphaPzTjvOJ4EluaVNFksJ2/PL7UE5ceAW7da6Q=";
};
};
};
}
)
];
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
boot.extraModulePackages = [ config.boot.kernelPackages.wireguard ];
# Networking # Networking
@ -38,8 +69,29 @@
}; };
}; };
firewall = { firewall = {
allowedTCPPorts = [ 1716 51820 24642 ]; enable = false;
allowedUDPPorts = [ 1716 51820 24642 ]; allowedTCPPorts = [ 3979 1716 51820 24642 ];
allowedUDPPorts = [ 3979 1716 51820 24642 ];
};
hosts = {
"195.201.86.153" = [ "derpy" "server" ];
"64.227.64.222" = [ "wireguard" ];
"192.168.1.2" = [ "openhab" ];
"188.126.61.194" = [ "home" ];
};
wireguard.interfaces = {
wg0 = {
ips = [ "10.100.0.2/24" ];
privateKeyFile = "/home/inex/wireguard-keys/private";
peers = [
{
publicKey = "8sEAHYhydEGKTVecXcOb28zeGHGLGCsri5evbSQV8mY=";
allowedIPs = [ "10.100.0.0/24" ];
endpoint = "135.181.97.221:51820";
persistentKeepalive = 25;
}
];
};
}; };
}; };
@ -52,11 +104,15 @@
package = pkgs.bluezFull; package = pkgs.bluezFull;
}; };
pulseaudio = { pulseaudio = {
enable = true; enable = false;
package = pkgs.pulseaudioFull; package = pkgs.pulseaudioFull;
support32Bit = true; support32Bit = true;
extraModules = [ pkgs.pulseaudio-modules-bt ]; extraModules = [ pkgs.pulseaudio-modules-bt ];
}; };
sane = {
enable = true;
brscan4.enable = true;
};
}; };
# Select internationalisation properties. # Select internationalisation properties.
@ -72,12 +128,18 @@
# List services that you want to enable: # List services that you want to enable:
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing.enable = true; services.printing = {
enable = true;
drivers = [ pkgs.gutenprint ];
};
services.flatpak.enable = true;
# Enable the X11 windowing system. # Enable the X11 windowing system.
services.xserver = { services.xserver = {
enable = true; enable = true;
layout = "us"; layout = "us";
xkbVariant = "colemak";
videoDrivers = [ "nvidia" ]; videoDrivers = [ "nvidia" ];
libinput.enable = true; libinput.enable = true;
exportConfiguration = true; exportConfiguration = true;
@ -86,12 +148,11 @@
#displayManager.startx.enable = true; #displayManager.startx.enable = true;
}; };
boot.kernelParams = [ "modprobe.blacklist=dvb_usb_rtl28xxu" ];
services.udev.packages = [ pkgs.rtl-sdr ];
# Video driver # Video driver
hardware = {/* hardware = {
bumblebee = {
enable = true;
driver = "nouveau";
};*/
opengl = { opengl = {
enable = true; enable = true;
driSupport32Bit = true; driSupport32Bit = true;
@ -114,23 +175,41 @@
}; };
}; };
virtualisation.docker.enable = true; virtualisation = {
docker = {
enable = true;
enableOnBoot = false;
};
};
hardware.steam-hardware.enable = true; hardware.steam-hardware.enable = true;
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.inex = { users.users = {
isNormalUser = true; inex = {
home = "/home/inex"; isNormalUser = true;
description = "Inex Code"; home = "/home/inex";
extraGroups = [ "wheel" "networkmanager" "jackaudio" "audio" "video" "adbusers" "docker" ]; # Enable sudo for the user. description = "Inex Code";
extraGroups = [ "wheel" "user-with-access-to-virtualbox" "networkmanager" "jackaudio" "audio" "video" "adbusers" "docker" "scanner" "lp" "plugdev" ]; # Enable sudo for the user.
};
}; };
# This value determines the NixOS release with which your system is to be # This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database # compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you # servers. You should change this only after NixOS release notes say you
# should. # should.
system.stateVersion = "19.09"; # Did you read the comment?} system.stateVersion = "22.05"; # Did you read the comment?}
environment.shellInit = ''
export VST_PATH=/nix/var/nix/profiles/default/lib/vst:/var/run/current-system/sw/lib/vst:~/.vst
export LXVST_PATH=/nix/var/nix/profiles/default/lib/lxvst:/var/run/current-system/sw/lib/lxvst:~/.lxvst
export LADSPA_PATH=/nix/var/nix/profiles/default/lib/ladspa:/var/run/current-system/sw/lib/ladspa:~/.ladspa
export LV2_PATH=/nix/var/nix/profiles/default/lib/lv2:/var/run/current-system/sw/lib/lv2:~/.lv2
export DSSI_PATH=/nix/var/nix/profiles/default/lib/dssi:/var/run/current-system/sw/lib/dssi:~/.dssi
export VST3_PATH=/nix/var/nix/profiles/default/lib/vst3:/var/run/current-system/sw/lib/vst3:~/.vst3
'';
} }

View file

@ -10,7 +10,7 @@
}; };
}; };
desktopManager = { desktopManager = {
gnome3.enable = true; gnome.enable = true;
}; };
}; };
@ -18,10 +18,9 @@
qt5.platformTheme = "gnome"; qt5.platformTheme = "gnome";
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
gnome3.pomodoro gnome.pomodoro
gnome3.gnome-tweaks gnome.gnome-tweaks
gnome3.networkmanager-openvpn evolution
gnome3.evolution
gnomeExtensions.gsconnect gnomeExtensions.gsconnect
paper-icon-theme paper-icon-theme
]; ];

96
Laptop/modules/vscode.nix Normal file
View file

@ -0,0 +1,96 @@
{ config, pkgs, ... }:
let
unstable = import <nixos-unstable> { config.allowUnfree = true; };
extensions = (with pkgs.vscode-extensions; [
unstable.vscode-extensions.ms-vsliveshare.vsliveshare
arcticicestudio.nord-visual-studio-code
bbenoist.nix
davidanson.vscode-markdownlint
dbaeumer.vscode-eslint
jakebecker.elixir-ls
james-yu.latex-workshop
jnoortheen.nix-ide
mhutchie.git-graph
ms-azuretools.vscode-docker
ms-python.vscode-pylance
ms-python.python
ms-toolsai.jupyter
ms-vscode-remote.remote-ssh
ms-vscode.cpptools
github.copilot
]) ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "vscode-standardjs";
publisher = "chenxsan";
version = "1.4.1";
sha256 = "0hiaqflp0d3k2pq3p44wrpyn4v6n0x660f4v47nf9bsdn5lidih3";
}
{
name = "npm-intellisense";
publisher = "christian-kohler";
version = "1.4.1";
sha256 = "0hph57g8fbwrvj1sdzc7vqsiaf7n2qzvkakc9ir0kkkwwdxc6c5a";
}
{
name = "dart-code";
publisher = "Dart-Code";
version = "3.40.0";
sha256 = "1cvibhazgz42zzwlk354sihrimw26qvgsq5nirvwx4v27gcirq81";
}
{
name = "flutter";
publisher = "Dart-Code";
version = "3.40.0";
sha256 = "0yxkqr6ajpdl06rxxad4c1zx5ci4sbaj2lk2xl9bws51imn58wry";
}
{
name = "vscode-html-css";
publisher = "ecmel";
version = "1.12.2";
sha256 = "059s1yg0b875b3ijhwgpg8v408as5z6r876jv5jing1vjb20pgvb";
}
{
name = "vscode-npm-script";
publisher = "eg2";
version = "0.3.25";
sha256 = "0z01i0fhl0phmz5bx5fh80flarldk7sdqgr14vx9kjz5yjzz48ys";
}
{
name = "vsc-material-theme-icons";
publisher = "equinusocio";
version = "2.3.1";
sha256 = "1djm4k3hcn4aq63d4mxs2n4ffq5x1qr82q6gxwi5pmabrb0hrb30";
}
{
name = "vscode-systemd-support";
publisher = "hangxingliu";
version = "1.0.1";
sha256 = "0f7j6y1jngicm475nilx08j55d94nnmymifxcbkszlxg0lnjrqys";
}
{
name = "materialdesignicons-intellisense";
publisher = "lukas-tr";
version = "4.0.0";
sha256 = "1748pj3jcgddpiamcs4ii2bjsmn9m9fx0dn2swfki8c6ibwrhy0w";
}
{
name = "remote-containers";
publisher = "ms-vscode-remote";
version = "0.234.0";
sha256 = "07mx08nwvw7jdlvkbr5iwikrcriib4zc1im1lbrqxjv7paj1an86";
}
];
vscode-with-extensions = pkgs.vscode-with-extensions.override {
vscodeExtensions = extensions;
};
in
{
config = {
environment.systemPackages = [
vscode-with-extensions
];
};
}

94
Laptop/pipewire.nix Normal file
View file

@ -0,0 +1,94 @@
{
security.rtkit.enable = true;
services = {
pipewire = {
enable = true;
config.pipewire = {
"context.properties" = {
"link.max-buffers" = 16;
"log.level" = 2;
"default.clock.rate" = 48000;
"default.clock.quantum" = 512;
"default.clock.min-quantum" = 512;
"default.clock.max-quantum" = 512;
"core.daemon" = true;
"core.name" = "pipewire-0";
};
"context.modules" = [
{
name = "libpipewire-module-rtkit";
args = {
"nice.level" = -15;
"rt.prio" = 88;
"rt.time.soft" = 200000;
"rt.time.hard" = 200000;
};
flags = [ "ifexists" "nofail" ];
}
{ name = "libpipewire-module-protocol-native"; }
{ name = "libpipewire-module-profiler"; }
{ name = "libpipewire-module-metadata"; }
{ name = "libpipewire-module-spa-device-factory"; }
{ name = "libpipewire-module-spa-node-factory"; }
{ name = "libpipewire-module-client-node"; }
{ name = "libpipewire-module-client-device"; }
{
name = "libpipewire-module-portal";
flags = [ "ifexists" "nofail" ];
}
{
name = "libpipewire-module-access";
args = {};
}
{ name = "libpipewire-module-adapter"; }
{ name = "libpipewire-module-link-factory"; }
{ name = "libpipewire-module-session-manager"; }
];
};
config.pipewire-pulse = {
"context.properties" = {
"log.level" = 2;
};
"context.modules" = [
{
name = "libpipewire-module-rtkit";
args = {
"nice.level" = -15;
"rt.prio" = 88;
"rt.time.soft" = 200000;
"rt.time.hard" = 200000;
};
flags = [ "ifexists" "nofail" ];
}
{ name = "libpipewire-module-protocol-native"; }
{ name = "libpipewire-module-client-node"; }
{ name = "libpipewire-module-adapter"; }
{ name = "libpipewire-module-metadata"; }
{
name = "libpipewire-module-protocol-pulse";
args = {
"pulse.min.req" = "512/48000";
"pulse.default.req" = "512/48000";
"pulse.max.req" = "512/48000";
"pulse.min.quantum" = "512/48000";
"pulse.max.quantum" = "512/48000";
"server.address" = [ "unix:native" ];
};
}
];
"stream.properties" = {
"node.latency" = "512/48000";
"resample.quality" = 1;
};
};
config.jack = {
"jack.properties" = {
"node.latency" = "512/48000";
"node.lock-quantum" = true;
};
};
pulse.enable = true;
jack.enable = true;
};
};
}

View file

@ -1,29 +1,52 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
unstable = import <nixos-unstable> {}; unstable = import <nixos-unstable> { config.allowUnfree = true; };
in { in
{
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# Utils # Utils
cool-retro-term (pkgs.callPackage ./modules/my_vim.nix { })
tmux
ponysay
(pkgs.callPackage ./modules/my_vim.nix {})
neofetch
pciutils pciutils
usbutils usbutils
i2c-tools
bind bind
# openvpn
git
unzip
tldr
ffmpeg
wget
nix-bundle nix-bundle
file
glxinfo
nmap nmap
gparted
# Archives
unzip
unrar
appimage-run
# Manuals
unstable.manix
tldr
# Terminal
cool-retro-term
mosh
tmux
neofetch
ponysay
bpytop
httpie
htop
# Voice
speechd
rhvoice
unstable.noisetorch
xsane
# Wireguard # Wireguard
wireguard
wireguard-tools wireguard-tools
nextcloud-client nextcloud-client
@ -34,41 +57,56 @@ in {
# Browsers # Browsers
firefox firefox
ungoogled-chromium
# Downloaders
transmission-gtk transmission-gtk
youtube-dl yt-dlp
syncthing
wget
# Messangers # Messangers
tdesktop tdesktop
#discord
mumble mumble
#riot-desktop
qtox qtox
dino dino
zoom-us gomuks
# Games # Games
steam steam
steam-run-native steam-run
unstable.openttd unstable.openttd
minecraft
lutris lutris
vulkan-tools vulkan-tools
wineWowPackages.full wineWowPackages.full
wineWowPackages.fonts wineWowPackages.fonts
xonotic
cataclysm-dda
# Development # VCS
vscode git
ansible gitAndTools.git-bug
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
# IDE
lens
postman
unstable.androidStudioPackages.canary
# Compilers and interpretators
ccls ccls
cmake
gcc-unwrapped
octaveFull
python3Full
nodejs
nixpkgs-fmt
# Docker and orchestration
ansible
docker-compose
# Maps
josm josm
# Screen recording # Screen recording
@ -76,27 +114,45 @@ in {
peek peek
# Graphics # Graphics
blender
krita krita
gmic_krita_qt gmic_krita_qt
potrace potrace
ffmpeg
inkscape
imagemagick
# Audio # Audio
audacity audacity
pulseeffects-pw
# lmms # lmms
picard picard
cmus cmus
spotify
rhythmbox
unstable.helvum
# Plugins vlc
# ladspaPlugins syncplay
# lsp-plugins
# DAW
zrythm
distrho
helvum
zam-plugins
x42-plugins
helm
zyn-fusion
lsp-plugins
ardour
# Documents # Documents
anki anki
libreoffice libreoffice
homebank
trilium
klavaro
liberation_ttf liberation_ttf
obsidian
keepassxc
glow
]; ];
}
}