niksos/hosts/del/configuration.nix

281 lines
8.5 KiB
Nix

{
config,
inputs,
lib,
pkgs,
...
}: {
nixpkgs.config.allowUnfree = true;
boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
nix = {
settings = {
max-jobs = 2;
cores = 3;
substituters = [
"https://nix-community.cachix.org"
"https://nixpkgs-wayland.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
];
};
};
programs = {
dconf.enable = true;
wireshark = {
enable = true;
package = pkgs.wireshark;
};
kdeconnect.enable = true;
noisetorch.enable = true;
};
security.sudo.package = pkgs.sudo.override { withInsults = true; };
security.polkit.enable = true;
users.users.${config.myOptions.other.system.username} = {
extraGroups = [ "video" "wireshark" ];
};
environment.sessionVariables = {
CHROME_EXECUTABLE = "${pkgs.ungoogled-chromium}/bin/chromium";
};
hardware = {
sensor.iio.enable = true;
# ipu6 = {
# enable = true;
# platform = "ipu6";
# };
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
mesa
libdrm
libva
vaapiVdpau
libvdpau-va-gl
];
extraPackages32 = with pkgs; [
driversi686Linux.mesa
driversi686Linux.vaapiVdpau
driversi686Linux.libvdpau-va-gl
];
};
};
services = {
pcscd.enable = true;
udisks2.enable = true;
dbus.enable = true;
fwupd = {
enable = true;
};
ratbagd.enable = true;
fprintd = {
enable = true;
tod = {
enable = true;
driver = pkgs.libfprint-2-tod1-goodix;
};
};
smartd.enable = true;
};
services.journald = {
extraConfig = ''
SystemMaxUse=100M
'';
};
services.udev = {
packages = with pkgs; [
yubikey-personalization
];
};
# this makes usb devices autosuspend
#powerManagement.powertop.enable = true;
# https://github.com/NixOS/nixpkgs/issues/270809
systemd.services.ModemManager = {
enable = lib.mkForce true;
path = [ pkgs.libqmi ];
wantedBy = [ "multi-user.target" "network.target" ];
};
networking.networkmanager = {
enable = true;
ensureProfiles.profiles = {
sim = {
connection = {
id = "sim";
uuid = "91d0e582-a24a-4835-baa9-98709b7793f9";
type = "gsm";
autoconnect = false;
permissions = "user:jacek:;";
};
gsm = {
apn = "internet";
username = "internet";
password = "internet";
};
ipv4.method = "auto";
ipv6 = {
addr-gen-mode = "default";
method = "auto";
};
};
};
};
myOptions = {
other = {
home-manager = {
enable = true;
enableDirenv = true;
};
hardware.monitors = {
eDP-1 = {
resolution = { w = 1920; h = 1280; };
refreshRate = 60;
position = { x = 0; y = 0; };
scale = 1.0;
};
};
};
programs = {
nh = let
inherit (config.myOptions.other.system) username;
home = config.home-manager.users.${username}.home.homeDirectory;
in {
enable = true;
flake = "${home}/niksos";
};
starship.enable = true;
zsh = {
enable = true;
extraAliases = {
u = "nh os switch -H del";
us = "NIX_SSHOPTS='-t' nixos-rebuild switch --flake \"/home/jacek/niksos#chmura\" -L --use-remote-sudo --target-host chmura";
# TODO use this when nh supports it
#us = "NIX_SSHOPTS='-t' nh os switch -H chmura -- --store ssh-ng://chmura";
};
profiling = false;
};
zoxide.enable = true;
anyrun.enable = true;
vesktop.enable = true;
btop.enable = true;
foot.enable = true;
mpv.enable = true;
neovim.enable = true;
zathura.enable = true;
hypr = {
land = {
enable = true;
extraSettings = let
inherit (config.myOptions.other.system) username;
hmCfg = config.home-manager.users.${username};
inherit (inputs.nixpkgs-wayland.packages.${pkgs.system}) swww;
nix_wallpaper = pkgs.fetchurl {
url = "https://i.ibb.co/vZ5JF95/nix-Wallpaper.png";
hash = "sha256-BqOBvRFXFrX/QLI70OLAIcpbbiUH/jUMK97yqCfY+mI=";
};
poz_layer = ./poz.png;
out_dir = "${hmCfg.xdg.dataHome}/hypr";
out_path = "${out_dir}/nix.png";
iio-hyprland = inputs.iio-hyprland.packages.${pkgs.system}.default.overrideAttrs {
patches = [
(pkgs.fetchpatch {
url = "https://patch-diff.githubusercontent.com/raw/JeanSchoeller/iio-hyprland/pull/14.patch";
hash = "sha256-lp5wmvL+F209FAdEdrmvPkYWi2ZzJq+2jrpGdFlolqQ=";
})
];
};
in {
exec-once = [
"${iio-hyprland}/bin/iio-hyprland"
"${pkgs.wvkbd}/bin/wvkbd-mobintl --hidden -L 500"
"${pkgs.coreutils-full}/bin/mkdir -p ${out_dir}"
"${pkgs.imagemagick}/bin/magick ${nix_wallpaper} ${poz_layer} -layers flatten ${out_path}"
];
exec = [
# wait a bit then set the wallpapers
"sleep 0.5 && ${swww}/bin/swww img -o eDP-1 ${out_path}"
];
};
};
lock.enable = true;
};
helix.enable = false;
newsboat.enable = true;
quickshell = {
enable = true;
enabledConfigs = [
"powermenu"
"poz"
];
};
};
themes = {
cursor = {
enable = true;
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
};
gtk = {
enable = true;
package = pkgs.catppuccin-gtk;
name = "Catppuccin-Mocha-Standard-Green-Dark";
variant = "mocha";
accentColour = "green";
iconTheme = {
name = "Papirus-Dark";
package = pkgs.catppuccin-papirus-folders;
};
};
qt = {
enable = true;
package = pkgs.catppuccin-kde;
name = "Catppuccin-Mocha-Dark";
variant = "mocha";
accentColour = "green";
};
};
services = {
dunst.enable = true;
greetd = {
enable = true;
greeter = "gtkgreet";
launchOptions = [
"Hyprland"
"sway"
"zsh"
"reboot"
"shutdown now"
];
};
pipewire.enable = true;
syncthing.enable = true;
};
};
system.stateVersion = "23.11";
}