145 lines
3.3 KiB
Nix
Executable File
145 lines
3.3 KiB
Nix
Executable File
{ pkgs, lib, ... }:
|
|
let
|
|
theme = import ./theme.nix { inherit pkgs; };
|
|
|
|
bing-wallpaper = pkgs.writeScriptBin "bing-wallpaper" ''
|
|
# Directory to store wallpapers
|
|
IMG_PATH="/run/wallpaper.jpg"
|
|
|
|
# Download if not already downloaded
|
|
URL=$(curl -s "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1" | \
|
|
jq -r '.images[0].url')
|
|
FULL_URL="https://www.bing.com$URL"
|
|
curl -s -o "$IMG_PATH" "$FULL_URL"
|
|
echo "Downloaded $FULL_URL to $IMG_PATH successfully"
|
|
'';
|
|
in
|
|
{
|
|
imports = [
|
|
./environment.nix
|
|
];
|
|
|
|
home-manager.users.matt = import ./home.nix;
|
|
|
|
services = {
|
|
displayManager = {
|
|
sddm = {
|
|
enable = true;
|
|
package = pkgs.kdePackages.sddm;
|
|
extraPackages = [ theme.sddm.package ];
|
|
theme = theme.sddm.themeName;
|
|
wayland.enable = true;
|
|
settings = {
|
|
Theme = {
|
|
ThemeDir = "${theme.sddm.package}/share/sddm/themes";
|
|
};
|
|
};
|
|
};
|
|
# Disable gdm
|
|
gdm.enable = lib.mkForce false;
|
|
defaultSession = "hyprland";
|
|
};
|
|
|
|
# disable other desktops
|
|
desktopManager = {
|
|
plasma6.enable = lib.mkForce false;
|
|
gnome.enable = lib.mkForce false;
|
|
};
|
|
|
|
dbus.enable = true;
|
|
|
|
ddccontrol.enable = true;
|
|
|
|
blueman.enable = true;
|
|
};
|
|
|
|
programs = {
|
|
hyprland = {
|
|
enable = true;
|
|
xwayland.enable = true;
|
|
portalPackage = pkgs.xdg-desktop-portal-hyprland;
|
|
};
|
|
|
|
nm-applet.enable = true;
|
|
};
|
|
|
|
systemd = {
|
|
services = {
|
|
preload-bing-wallpaper = {
|
|
enable = true;
|
|
wants = [ "network.target" ];
|
|
after = [ "network.target" ];
|
|
wantedBy = [ "graphical-session.target" ];
|
|
path = [
|
|
pkgs.bash
|
|
pkgs.jq
|
|
pkgs.curl
|
|
bing-wallpaper
|
|
];
|
|
script = ''
|
|
bing-wallpaper
|
|
'';
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
};
|
|
};
|
|
};
|
|
user.services.polkit-gnome-authentication-agent-1 = {
|
|
description = "polkit-gnome-authentication-agent-1";
|
|
wantedBy = [ "graphical-session.target" ];
|
|
wants = [ "graphical-session.target" ];
|
|
after = [ "graphical-session.target" ];
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
|
|
Restart = "on-failure";
|
|
RestartSec = 1;
|
|
TimeoutStopSec = 10;
|
|
};
|
|
};
|
|
extraConfig = ''
|
|
DefaultTimeoutStopSec=10s
|
|
'';
|
|
};
|
|
|
|
security = {
|
|
polkit.enable = true;
|
|
|
|
# configure sudo
|
|
sudo.extraRules = [
|
|
{
|
|
commands = [
|
|
{
|
|
command = "/run/current-system/sw/bin/waybar-weather";
|
|
options = [ "NOPASSWD" ];
|
|
}
|
|
{
|
|
command = "/run/current-system/sw/bin/waybar-updates";
|
|
options = [ "NOPASSWD" ];
|
|
}
|
|
];
|
|
groups = [ "wheel" ];
|
|
}
|
|
];
|
|
};
|
|
|
|
xdg.portal = {
|
|
enable = true;
|
|
wlr.enable = false;
|
|
xdgOpenUsePortal = false;
|
|
extraPortals = [
|
|
pkgs.xdg-desktop-portal-hyprland
|
|
pkgs.xdg-desktop-portal-gnome
|
|
pkgs.xdg-desktop-portal-gtk
|
|
];
|
|
};
|
|
|
|
nixpkgs.overlays = [
|
|
(self: super: {
|
|
waybar = super.waybar.overrideAttrs (oldAttrs: {
|
|
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
|
|
});
|
|
})
|
|
];
|
|
}
|