niksos/hosts/del/configuration.nix

236 lines
6.7 KiB
Nix

{
config,
inputs,
lib,
pkgs,
...
}: let
inherit (lib) getExe getExe';
in {
nixpkgs.config.allowUnfree = true;
nix.settings = {
max-jobs = 2;
cores = 3;
};
swapDevices = [
{
device = "/var/lib/swapfile";
size = 48 * 1024;
}
];
programs = {
dconf.enable = true;
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" ];
};
environment.sessionVariables = {
CHROME_EXECUTABLE = getExe pkgs.ungoogled-chromium;
};
hardware = {
sensor.iio.enable = true;
# ipu6 = {
# enable = true;
# platform = "ipu6";
# };
graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
mesa
libdrm
libva
vaapiVdpau
libvdpau-va-gl
];
extraPackages32 = with pkgs; [
driversi686Linux.mesa
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;
flatpak.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;
};
programs = {
agenix.enable = true;
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};
swww = getExe 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 = getExe inputs.iio-hyprland.packages.${pkgs.system}.default;
mkdir = getExe' pkgs.coreutils-full "mkdir";
sleep = getExe' pkgs.coreutils-full "sleep";
wvkbd = getExe pkgs.wvkbd;
imagemagick = getExe pkgs.imagemagick;
in {
exec-once = [
"${iio-hyprland}"
"${wvkbd} --hidden -L 500"
"${mkdir} -p ${out_dir}"
"${imagemagick} ${nix_wallpaper} ${poz_layer} -layers flatten ${out_path}"
];
exec = [
# wait a bit then set the wallpapers
"${sleep} 0.5 && ${swww} img -o eDP-1 ${out_path}"
];
};
};
lock.enable = true;
idle.enable = true;
};
newsboat.enable = true;
quickshell = {
enable = true;
enabledConfigs = [
"powermenu"
"poz"
];
};
};
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";
}