niksos/hosts/del/configuration.nix
2024-09-03 15:36:29 +02:00

201 lines
5.7 KiB
Nix

{
config,
inputs,
lib,
pkgs,
...
}: let
inherit (lib.meta) getExe getExe';
inherit (lib.modules) mkForce;
inherit (config.poz.other.system) username;
in {
nix.settings = {
max-jobs = 2;
cores = 3;
};
swapDevices = [
{
device = "/var/lib/swapfile";
size = 48 * 1024;
}
];
programs = {
kdeconnect.enable = true;
};
security.polkit.enable = true;
hardware = {
sensor.iio.enable = true;
# ipu6 = {
# enable = true;
# platform = "ipu6";
# };
};
services = {
pcscd.enable = true;
udisks2.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;
};
# this makes usb devices autosuspend
#powerManagement.powertop.enable = true;
# https://github.com/NixOS/nixpkgs/issues/270809
systemd.services.ModemManager = {
enable = 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";
};
};
};
};
poz = {
other = {
home-manager = {
enable = true;
enableDirenv = true;
};
networking.enable = true;
};
programs = {
agenix.enable = true;
nh = let
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;
enableLsp = true;
};
zathura.enable = true;
hypr = {
land = {
enable = true;
extraSettings = let
hmCfg = config.home-manager.users.${username};
swww = getExe pkgs.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";
}