Skip to content

Commit

Permalink
preferences: add servicesSettings
Browse files Browse the repository at this point in the history
move flatpak packages to separate file
add new pulseaudio low latency configuration

remove unneeded packages and disable unused services
  • Loading branch information
JohnRTitor committed Aug 30, 2024
1 parent 7c8b864 commit ae2bf54
Show file tree
Hide file tree
Showing 16 changed files with 152 additions and 125 deletions.
25 changes: 11 additions & 14 deletions dev-environment/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,21 @@
lib,
pkgs,
pkgs-edge,
userSettings,
servicesSettings,
...
}: {
# Configure the build environment

# Containers and adb should be available by default
imports = [
./adb-toolchain.nix
# ./nginx.nix # disable temporarily
imports =
[
# Use devenv instead, it's more flexible
# and contains a lot of prebuilt packages
# configured in home manager

# Use devenv instead, it's more flexible
# and contains a lot of prebuilt packages
# configured in home manager

# ./deprecated/c-toolchain.nix
./deprecated/php.nix
];
environment.systemPackages = with pkgs; [
rustup
];
# ./deprecated/c-toolchain.nix
# ./deprecated/php.nix
]
++ lib.optionals servicesSettings.adb [./adb-toolchain.nix]
++ lib.optionals servicesSettings.nginx [./nginx.nix];
}
4 changes: 2 additions & 2 deletions flake/hosts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
inherit (inputs) nixpkgs nixpkgs-edge nixpkgs-master;
inherit (nixpkgs) lib; # use lib from nixpkgs

inherit (import ../preferences.nix) systemSettings userSettings;
inherit (import ../preferences.nix) systemSettings userSettings servicesSettings;

# bleeding edge packages from nixpkgs unstable branch, for packages that need immediate updates
pkgs-edge = import nixpkgs-edge {
Expand All @@ -27,7 +27,7 @@
};
};

specialArgs = {inherit self inputs pkgs-edge pkgs-master systemSettings userSettings;};
specialArgs = {inherit self inputs pkgs-edge pkgs-master systemSettings userSettings servicesSettings;};
in {
flake = {
nixosConfigurations.${systemSettings.hostname} = lib.nixosSystem {
Expand Down
3 changes: 2 additions & 1 deletion home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
inputs,
systemSettings,
userSettings,
servicesSettings,
...
}: {
imports =
Expand All @@ -27,7 +28,7 @@
./services.nix # services
]
++ lib.optionals osConfig.programs.thunar.enable [./thunar.nix]
++ lib.optionals systemSettings.virtualisation [./virt-manager.nix];
++ lib.optionals servicesSettings.virtualisation [./virt-manager.nix];

# Let home Manager install and manage itself.
programs.home-manager.enable = true;
Expand Down
14 changes: 14 additions & 0 deletions pkgs/flatpak-packages.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
systemPackages = [
# Flatpak packages to be installed systemwide
"com.github.tchx84.Flatseal" # Customising permission of Flatpaks
"io.github.zen_browser.zen" # Zen Browser
];

userPackages = [
# Flatpak packages to be installed on a per user basis
"io.github.tdesktop_x64.TDesktop" # 64Gram
"im.riot.Riot" # Element Matrix Client
"dev.vencord.Vesktop" # Vesktop
];
}
10 changes: 1 addition & 9 deletions pkgs/global-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@
environment.systemPackages =
(with pkgs; [
# System Packages
# firewalld
git # obviously
glib # for gsettings to work
gpgme # gnupg # for encryption and auth keys
libappindicator
libnotify
openssh # for ssh

## URL FETCH TOOLS ##
Expand All @@ -34,8 +29,5 @@
++ [
self.packages.${pkgs.system}.fhs-shell
];
services.flatpak.packages = [
# Flatpak packages to be installed systemwide
"com.github.tchx84.Flatseal" # Customising permission of Flatpaks
];
services.flatpak.packages = (import ./flatpak-packages.nix).systemPackages;
}
33 changes: 14 additions & 19 deletions pkgs/user-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
# feel free to add your own or remove some of them

## ARCHIVING TOOLS ##
zip
unzip
# zip
# unzip
# p7zip
gnutar
# gnutar
# gzip
# xz
# bzip2
# lz4
# lzo
# zlib
zstd
# zstd

# utils
# ripgrep # recursively searches directories for a regex pattern
Expand All @@ -36,7 +36,7 @@
## NETWORKING TOOLS ##
# mtr # A network diagnostic tool
# iperf3
dnsutils # `dig` + `nslookup`
# dnsutils # `dig` + `nslookup`
# ldns # replacement of `dig`, it provide the command `drill`
# aria2 # A lightweight multi-protocol & multi-source command-line download utility
# socat # replacement of openbsd-netcat
Expand All @@ -57,25 +57,25 @@
# lsof # list open files

## SYSTEM TOOLS ##
sysstat
lm_sensors # for `sensors` command
ethtool
pciutils # lspci
usbutils # lsusb
# sysstat
# lm_sensors # for `sensors` command
# ethtool
# pciutils # lspci
# usbutils # lsusb

## MISCELLANEOUS ##
which
gawk
gnused

## PERSONAL ENJOYMENT ##
ani-cli
# ani-cli # watch anime in terminal!

## MONITORING TOOLS ##
btop # for CPU, RAM, and Disk monitoring
nvtopPackages.amd # for AMD GPUs
iotop # for disk I/O monitoring
iftop # for network I/O monitoring
#iotop # for disk I/O monitoring
#iftop # for network I/O monitoring

## GRAPHICAL APPS ##
# Editors #
Expand Down Expand Up @@ -107,10 +107,5 @@
# Some packages may not be cached so.. it may take some time to build
]);

services.flatpak.packages = [
# Flatpak packages to be installed on a per user basis
"io.github.tdesktop_x64.TDesktop" # 64Gram
"im.riot.Riot" # Element Matrix Client
"dev.vencord.Vesktop" # Vesktop
];
services.flatpak.packages = (import ./flatpak-packages.nix).userPackages;
}
11 changes: 9 additions & 2 deletions preferences.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
localeoverride = "en_IN";
stableversion = "24.05";
secureboot = true;
virtualisation = false;
containers = false;
laptop = false;
};

Expand All @@ -22,4 +20,13 @@
gpgkey = "29B0514F4E3C1CC0"; # gpg key
shell = "zsh"; # user default shell # choose either zsh or bash
};

servicesSettings = {
adb = false;
avahi = false;
nginx = false;
containers = false;
tpm = false;
virtualisation = false;
};
}
2 changes: 1 addition & 1 deletion system/boot/boot-options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# circuit connect cuts_alt seal_2 seal_3
theme = "matrix";
themePackages = [
(pkgs.adi1090x-plymouth-themes.override {selected_themes = ["rings_2"];})
#(pkgs.adi1090x-plymouth-themes.override {selected_themes = ["rings_2"];})
pkgs.plymouth-matrix-theme
];
};
Expand Down
96 changes: 44 additions & 52 deletions system/browsers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,57 +17,49 @@
};
*/

environment.systemPackages = with pkgs-edge;
[
(google-chrome.override {
# enable video encoding and hardware acceleration, along with several
# suitable for my configuration
# change it if you have any issues
# note the spaces, they are required
# Vulkan is not stable, likely because of bad drivers
# Flags enabled by command line have no need to be enabled in chrome://flags
commandLineArgs =
""
+ " --enable-accelerated-video-decode"
+ " --enable-accelerated-vpx-decode"
+ " --enable-accelerated-mjpeg-decode"
+ " --enable-gpu-compositing"
+ " --enable-gpu-rasterization"
+ " --enable-native-gpu-memory-buffers"
+ " --enable-raw-draw"
+ " --enable-zero-copy"
+ " --ignore-gpu-blocklist"
# + " --use-vulkan"
+ " --enable-features="
+ "ParallelDownloading" # Faster downloads
+ ",VaapiVideoEncoder" # Video encoding support
+ ",CanvasOopRasterization"
+ ",UseDMSAAForTiles"
+ ",UseGpuSchedulerDfs"
+ ",UIEnableSharedImageCacheForGpu" # Shared image cache
+ ",UseClientGmbInterface" # new ClientGmb interface to create GpuMemoryBuffers
# + ",SkiaGraphite"
# + ",EnableDrDc"
# + ",Vulkan"
# + ",VulkanFromANGLE"
+ ",PostQuantumKyber" # hybrid kyber for enhanced TLS security
+ ",PulseaudioLoopbackForCast" # Audio support for casting and screen sharing
+ ",PulseaudioLoopbackForScreenShare"
+ ",ChromeWideEchoCancellation" # noise cancellation for WebRTC
+ ",DesktopScreenshots"
+ ",FluentOverlayScrollbar" # New scrollbar
+ ",FluentScrollbar"
+ ",EnableTabMuting" # Mute tabs from tab context
+ ",GlobalMediaControlsUpdatedUI"
# New media controls, with PIP
;
})
]
++ [
#inputs.zen-browser.packages.${pkgs.system}.specific
];

services.flatpak.packages = [
"io.github.zen_browser.zen"
environment.systemPackages = with pkgs; [
(google-chrome.override {
# enable video encoding and hardware acceleration, along with several
# suitable for my configuration
# change it if you have any issues
# note the spaces, they are required
# Vulkan is not stable, likely because of bad drivers
# Flags enabled by command line have no need to be enabled in chrome://flags
commandLineArgs =
""
+ " --enable-accelerated-video-decode"
+ " --enable-accelerated-vpx-decode"
+ " --enable-accelerated-mjpeg-decode"
+ " --enable-gpu-compositing"
+ " --enable-gpu-rasterization"
+ " --enable-native-gpu-memory-buffers"
+ " --enable-raw-draw"
+ " --enable-zero-copy"
+ " --ignore-gpu-blocklist"
# + " --use-vulkan"
+ " --enable-features="
+ "ParallelDownloading" # Faster downloads
+ ",VaapiVideoEncoder" # Video encoding support
+ ",CanvasOopRasterization"
+ ",UseDMSAAForTiles"
+ ",UseGpuSchedulerDfs"
+ ",UIEnableSharedImageCacheForGpu" # Shared image cache
+ ",UseClientGmbInterface" # new ClientGmb interface to create GpuMemoryBuffers
# + ",SkiaGraphite"
# + ",EnableDrDc"
# + ",Vulkan"
# + ",VulkanFromANGLE"
+ ",PostQuantumKyber" # hybrid kyber for enhanced TLS security
+ ",PulseaudioLoopbackForCast" # Audio support for casting and screen sharing
+ ",PulseaudioLoopbackForScreenShare"
+ ",ChromeWideEchoCancellation" # noise cancellation for WebRTC
+ ",DesktopScreenshots"
+ ",FluentOverlayScrollbar" # New scrollbar
+ ",FluentScrollbar"
+ ",EnableTabMuting" # Mute tabs from tab context
+ ",GlobalMediaControlsUpdatedUI"
# New media controls, with PIP
;
})
];
}
3 changes: 2 additions & 1 deletion system/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
lib,
systemSettings,
servicesSettings,
...
}: {
imports =
Expand Down Expand Up @@ -36,7 +37,7 @@
lib.optionals (systemSettings.secureboot) [./boot/lanzaboote.nix]
++
# Import if Virtualization is enabled
lib.optionals (systemSettings.virtualisation) [./virtualisation.nix]
lib.optionals (servicesSettings.virtualisation) [./virtualisation.nix]
++
# Import if laptop mode is enabled
lib.optionals (systemSettings.laptop) [./power.nix];
Expand Down
11 changes: 9 additions & 2 deletions system/fonts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@
})
roboto
lohit-fonts.bengali # Bengali fonts
ultimate-oldschool-pc-font-pack
# ultimate-oldschool-pc-font-pack
];

fonts.fontDir.enable = true;
fonts.fontconfig.subpixel.rgba = "rgb"; # Subpixel rendering
fonts.fontconfig = {
subpixel.rgba = "rgb"; # Subpixel rendering
antialias = true;
hinting.enable = true;
useEmbeddedBitmaps = true; # for better rendering of Calibri like fonts
cache32Bit = true;
};

# Console fonts
console = {
Expand Down
35 changes: 27 additions & 8 deletions system/hardware/audio.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,33 @@
security.rtkit.enable = true;

# Enable low latency
services.pipewire.extraConfig.pipewire = {
"92-low-latency" = {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.quantum" = 512;
"default.clock.min-quantum" = 512;
"default.clock.max-quantum" = 512;
};
services.pipewire.extraConfig.pipewire."92-low-latency" = {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.quantum" = 32;
"default.clock.min-quantum" = 32;
"default.clock.max-quantum" = 32;
};
};

# For those apps still using the pulseaudio API
services.pipewire.extraConfig.pipewire-pulse."92-low-latency" = {
"context.properties" = [
{
name = "libpipewire-module-protocol-pulse";
args = {};
}
];
"pulse.properties" = {
"pulse.min.req" = "32/48000";
"pulse.default.req" = "32/48000";
"pulse.max.req" = "32/48000";
"pulse.min.quantum" = "32/48000";
"pulse.max.quantum" = "32/48000";
};
"stream.properties" = {
"node.latency" = "32/48000";
"resample.quality" = 1;
};
};
}
Loading

0 comments on commit ae2bf54

Please sign in to comment.