niksos/hosts/del/configuration.nix

205 lines
6 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 = {
nh = let
home = config.home-manager.users.${username}.home.homeDirectory;
in {
enable = true;
flake = "${home}/niksos";
};
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;
};
anyrun.enable = true;
vesktop.enable = true;
foot.enable = true;
mpv.enable = true;
neovim = {
enable = true;
enableLsp = true;
};
zathura = {
enable = true;
themeFile = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/zathura/main/src/catppuccin-mocha";
hash = "sha256-POxMpm77Pd0qywy/jYzZBXF/uAKHSQ0hwtXD4wl8S2Q=";
};
};
hypr = {
land = {
enable = true;
extraSettings = let
hmCfg = config.home-manager.users.${username};
swww = getExe pkgs.swww;
# https://www.reddit.com/r/NixOS/comments/166r8n7/anime_nix_wallpaper_i_created/
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";
}