nixos-conf/desktop.nix

152 lines
3.5 KiB
Nix
Raw Normal View History

2024-05-23 13:39:48 +03:00
{ config, pkgs, ... }:
2024-06-02 16:18:19 +03:00
let
Xresources = "${pkgs.writeText "Xresources" ''
Xft.dpi: 96
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.autohint: false
Xft.hintstyle: hintslight
Xft.lcdfilter: lcddefault
Xcursor.theme: xcursor-breeze
Xcursor.size: 0
2024-06-02 16:18:19 +03:00
''}";
2024-05-23 13:39:48 +03:00
in
2024-06-02 16:18:19 +03:00
{
2024-06-06 22:16:29 +03:00
assertions = [
{
assertion = config.users.users ? "vili";
message = "User 'vili' needed for desktop!";
}
];
imports = [ ./program-config-files/firefox.nix ];
2024-06-02 16:18:19 +03:00
environment.systemPackages = with pkgs; [
2024-12-10 20:20:45 +02:00
alacritty
2024-06-02 16:18:19 +03:00
i3status
rofi
arandr
telegram-desktop
signal-desktop
discord
tidal-hifi
vlc
pavucontrol
viewnior
xfce.mousepad
pcmanfm
libreoffice
evince
brightnessctl
networkmanagerapplet
flameshot
speedcrunch
2024-09-06 11:33:26 +03:00
zotero
kile
texliveFull
imagemagick
ghostscript
kdePackages.okular
2024-06-02 16:18:19 +03:00
];
services = {
displayManager = {
defaultSession = "none+i3";
autoLogin.enable = true;
autoLogin.user = "vili";
};
xserver = {
enable = true;
2024-06-02 05:53:39 +03:00
displayManager = {
2024-06-02 16:18:19 +03:00
lightdm.enable = true;
sessionCommands = ''${pkgs.xorg.xrdb}/bin/xrdb -merge < ${Xresources}'';
2024-06-02 05:53:39 +03:00
};
2024-06-02 16:18:19 +03:00
windowManager.i3 = {
2024-06-02 05:53:39 +03:00
enable = true;
2024-07-12 01:46:57 +03:00
configFile = "${
2024-07-18 15:50:06 +03:00
(import ./program-config-files/i3.nix {
inherit config;
inherit pkgs;
2024-07-12 01:46:57 +03:00
})
}";
2024-06-02 05:53:39 +03:00
};
};
2024-06-02 16:18:19 +03:00
printing.enable = true;
};
2024-06-02 05:53:39 +03:00
2024-12-01 18:42:45 +02:00
services.pipewire.enable = false;
2024-06-02 16:18:19 +03:00
nixpkgs.config.pulseaudio = true;
hardware.pulseaudio.enable = true;
2024-06-02 05:53:39 +03:00
2024-07-20 14:12:05 +03:00
security.polkit.enable = true;
2024-06-02 16:18:19 +03:00
xdg.mime.defaultApplications = {
"application/pdf" = "org.gnome.Evince.desktop";
"text/plain" = "org.xfce.mousepad.desktop";
2024-09-07 11:11:46 +03:00
"text/x-tex" = "org.kde.kile.desktop";
2024-06-02 16:18:19 +03:00
"inode/directory" = "pcmanfm.description";
};
2024-06-02 05:53:39 +03:00
2024-07-20 14:12:05 +03:00
qt = {
enable = true;
2024-07-20 14:17:42 +03:00
style = "adwaita-dark";
platformTheme = "gnome";
};
system.userActivationScripts.mkDesktopSettingsSymlinks.text =
let
home = "/home/vili/";
paths = [
rec {
dir = "${home}.config/pcmanfm/default/";
file = "pcmanfm.conf";
full = "${dir}${file}";
source = "${./program-config-files/pcmanfm.conf}";
}
rec {
dir = "${home}.config/libfm/";
file = "libfm.conf";
full = "${dir}${file}";
source = "${./program-config-files/libfm.conf}";
}
rec {
dir = "${home}.config/gtk-3.0/";
file = "bookmarks";
full = "${dir}${file}";
source = "${./program-config-files/gtk-bookmarks}";
}
rec {
dir = "${home}";
file = ".gtkrc-2.0";
full = "${dir}${file}";
source = "${./program-config-files/gtkrc-2.0}";
}
rec {
dir = "${home}.config/gtk-3.0/";
file = "settings.ini";
full = "${dir}${file}";
source = "${./program-config-files/gtk-3-4-settings.ini}";
}
rec {
dir = "${home}.config/gtk-4.0/";
file = "settings.ini";
full = "${dir}${file}";
source = "${./program-config-files/gtk-3-4-settings.ini}";
}
];
in
toString (
map (path: ''
mkdir -p ${path.dir}
if test -e ${path.full} -a ! -L ${path.full}; then
mv -f ${path.full} ${path.full}.old
fi
ln -sf ${path.source} ${path.full}
'') paths
);
2024-06-02 16:18:19 +03:00
}