niksos/hosts/del/configuration.nix

239 lines
6.7 KiB
Nix
Raw Normal View History

2024-02-19 17:06:47 +01:00
{
config,
2024-04-30 11:57:45 +02:00
inputs,
2024-04-01 21:50:57 +02:00
lib,
2024-02-19 17:06:47 +01:00
pkgs,
...
}: let
2024-07-24 18:47:53 +02:00
inherit (lib.meta) getExe getExe';
inherit (lib.modules) mkForce;
2024-07-19 21:04:44 +02:00
inherit (config.myOptions.other.system) username;
in {
2024-02-29 01:28:20 +01:00
nixpkgs.config.allowUnfree = true;
2024-02-19 17:06:47 +01:00
nix.settings = {
max-jobs = 2;
cores = 3;
2024-02-19 17:06:47 +01:00
};
2024-06-05 12:31:28 +02:00
swapDevices = [
{
device = "/var/lib/swapfile";
size = 48 * 1024;
}
];
2024-05-03 18:20:56 +02:00
programs = {
dconf.enable = true;
kdeconnect.enable = true;
noisetorch.enable = true;
};
2024-02-19 17:06:47 +01:00
security.sudo.package = pkgs.sudo.override { withInsults = true; };
security.polkit.enable = true;
2024-07-19 21:04:44 +02:00
users.users.${username} = {
2024-06-04 12:26:27 +02:00
extraGroups = [ "video" ];
2024-02-19 17:06:47 +01:00
};
2024-02-29 00:48:40 +01:00
environment.sessionVariables = {
CHROME_EXECUTABLE = getExe pkgs.ungoogled-chromium;
2024-02-19 17:06:47 +01:00
};
hardware = {
2024-02-21 19:03:55 +01:00
sensor.iio.enable = true;
# ipu6 = {
# enable = true;
# platform = "ipu6";
# };
graphics = {
2024-02-19 17:06:47 +01:00
enable = true;
enable32Bit = true;
2024-02-19 17:06:47 +01:00
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;
2024-07-21 17:02:48 +02:00
# TODO build failure
# fprintd = {
# enable = true;
# tod = {
# enable = true;
# driver = pkgs.libfprint-2-tod1-goodix;
# };
# };
smartd.enable = true;
flatpak.enable = true;
2024-02-19 17:06:47 +01:00
};
services.journald = {
extraConfig = ''
SystemMaxUse=100M
'';
};
services.udev = {
packages = with pkgs; [
yubikey-personalization
];
};
# this makes usb devices autosuspend
#powerManagement.powertop.enable = true;
2024-04-01 21:50:57 +02:00
# https://github.com/NixOS/nixpkgs/issues/270809
systemd.services.ModemManager = {
2024-07-24 18:47:53 +02:00
enable = mkForce true;
2024-04-01 21:50:57 +02:00
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";
};
};
};
};
2024-02-19 17:06:47 +01:00
myOptions = {
2024-07-15 20:14:56 +02:00
other.home-manager = {
enable = true;
enableDirenv = true;
2024-02-19 17:06:47 +01:00
};
programs = {
agenix.enable = true;
2024-05-08 20:49:06 +02:00
nh = let
home = config.home-manager.users.${username}.home.homeDirectory;
in {
enable = true;
flake = "${home}/niksos";
};
2024-02-19 17:06:47 +01:00
starship.enable = true;
zsh = {
enable = true;
extraAliases = {
2024-05-08 21:12:27 +02:00
u = "nh os switch -H del";
2024-02-19 17:06:47 +01:00
us = "NIX_SSHOPTS='-t' nixos-rebuild switch --flake \"/home/jacek/niksos#chmura\" -L --use-remote-sudo --target-host chmura";
2024-05-08 21:12:27 +02:00
# TODO use this when nh supports it
#us = "NIX_SSHOPTS='-t' nh os switch -H chmura -- --store ssh-ng://chmura";
2024-02-19 17:06:47 +01:00
};
profiling = false;
};
2024-04-25 20:20:24 +02:00
zoxide.enable = true;
2024-02-19 17:06:47 +01:00
anyrun.enable = true;
vesktop.enable = true;
btop.enable = true;
foot.enable = true;
mpv.enable = true;
neovim.enable = true;
zathura.enable = true;
2024-03-19 23:45:26 +01:00
hypr = {
land = {
enable = true;
2024-04-30 11:57:45 +02:00
extraSettings = let
hmCfg = config.home-manager.users.${username};
swww = getExe inputs.nixpkgs-wayland.packages.${pkgs.system}.swww;
2024-04-30 11:57:45 +02:00
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";
2024-05-23 21:33:46 +02:00
iio-hyprland = getExe inputs.iio-hyprland.packages.${pkgs.system}.default;
mkdir = getExe' pkgs.coreutils-full "mkdir";
sleep = getExe' pkgs.coreutils-full "sleep";
2024-07-15 20:16:34 +02:00
wvkbd = getExe pkgs.wvkbd;
imagemagick = getExe pkgs.imagemagick;
2024-04-30 11:57:45 +02:00
in {
exec-once = [
"${iio-hyprland}"
2024-07-15 20:16:34 +02:00
"${wvkbd} --hidden -L 500"
2024-04-30 11:57:45 +02:00
"${mkdir} -p ${out_dir}"
2024-07-15 20:16:34 +02:00
"${imagemagick} ${nix_wallpaper} ${poz_layer} -layers flatten ${out_path}"
2024-04-30 11:57:45 +02:00
];
exec = [
# wait a bit then set the wallpapers
"${sleep} 0.5 && ${swww} img -o eDP-1 ${out_path}"
];
};
};
2024-03-19 23:45:26 +01:00
lock.enable = true;
2024-06-09 15:54:49 +02:00
idle.enable = true;
2024-02-19 17:06:47 +01:00
};
newsboat.enable = true;
quickshell = {
enable = true;
enabledConfigs = [
"powermenu"
"poz"
];
};
2024-02-19 17:06:47 +01:00
};
services = {
dunst.enable = true;
greetd = {
enable = true;
greeter = "gtkgreet";
launchOptions = [
"Hyprland"
"sway"
"zsh"
"reboot"
"shutdown now"
];
};
pipewire.enable = true;
syncthing.enable = true;
2024-02-19 17:06:47 +01:00
};
};
system.stateVersion = "23.11";
}