desktop is building I guess, idk, need to start commiting stuff eventually lmao
This commit is contained in:
13
modules/nixos/desktop/cosmic/default.nix
Executable file
13
modules/nixos/desktop/cosmic/default.nix
Executable file
@@ -0,0 +1,13 @@
|
||||
{ config, lib, namespace, ... }:
|
||||
let
|
||||
cfg = config.${namespace}.desktop.cosmic;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
config = lib.mkIf cfg.enable {
|
||||
services = {
|
||||
desktopManager.cosmic.enable = true;
|
||||
displayManager.cosmic-greeter.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
7
modules/nixos/desktop/cosmic/options.nix
Normal file
7
modules/nixos/desktop/cosmic/options.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ lib, namespace, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.${namespace}.desktop.cosmic = {
|
||||
enable = mkEnableOption "enable cosmic settings";
|
||||
};
|
||||
}
|
||||
30
modules/nixos/desktop/gnome/default.nix
Normal file
30
modules/nixos/desktop/gnome/default.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{ config, lib, pkgs, namespace, ... }:
|
||||
let
|
||||
cfg = config.${namespace}.desktop.gnome;
|
||||
in
|
||||
{
|
||||
imports = [ ../../../home/desktop/gnome/options.nix ];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services = {
|
||||
# Enable Desktop Environment.
|
||||
desktopManager.gnome.enable = true;
|
||||
# Enable Desktop Environment.
|
||||
displayManager = {
|
||||
gdm.enable = lib.mkDefault true;
|
||||
gdm.wayland = lib.mkDefault true;
|
||||
};
|
||||
|
||||
gnome.gnome-remote-desktop.enable = true;
|
||||
};
|
||||
|
||||
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
|
||||
programs = {
|
||||
kdeconnect = {
|
||||
enable = true;
|
||||
package = pkgs.gnomeExtensions.gsconnect;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
171
modules/nixos/desktop/hyprland/default.nix
Executable file
171
modules/nixos/desktop/hyprland/default.nix
Executable file
@@ -0,0 +1,171 @@
|
||||
{ config, pkgs, lib, namespace, ... }:
|
||||
let
|
||||
cfg = config.${namespace}.desktop.hyprland;
|
||||
|
||||
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"
|
||||
'';
|
||||
|
||||
sddmThemeName = "sddm-astronaut-theme";
|
||||
sddmThemePkg = pkgs.sddm-astronaut.override {
|
||||
embeddedTheme = "astronaut";
|
||||
themeConfig = {
|
||||
Background = "/run/wallpaper.jpg";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ ../../../home/desktop/hyprland/options.nix ];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [ bing-wallpaper pkgs.jq ];
|
||||
|
||||
services = {
|
||||
displayManager = {
|
||||
sddm = {
|
||||
enable = true;
|
||||
package = pkgs.kdePackages.sddm;
|
||||
extraPackages = [ sddmThemePkg ];
|
||||
theme = sddmThemeName;
|
||||
wayland.enable = true;
|
||||
settings = {
|
||||
Theme = {
|
||||
ThemeDir = "${sddmThemePkg}/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 = false;
|
||||
|
||||
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-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
before = [ "display-manager.service" ];
|
||||
requiredBy = [
|
||||
"plymouth-quit-wait.service"
|
||||
"display-manager.service"
|
||||
];
|
||||
wantedBy = [ "display-manager.service" ];
|
||||
path = [
|
||||
pkgs.bash
|
||||
pkgs.jq
|
||||
pkgs.curl
|
||||
bing-wallpaper
|
||||
];
|
||||
script = ''
|
||||
bing-wallpaper
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
};
|
||||
};
|
||||
};
|
||||
user = {
|
||||
services = {
|
||||
reload-bing-wallpaper = {
|
||||
enable = true;
|
||||
path = [
|
||||
pkgs.bash
|
||||
pkgs.jq
|
||||
pkgs.curl
|
||||
pkgs.hyprland
|
||||
bing-wallpaper
|
||||
];
|
||||
script = ''
|
||||
bing-wallpaper
|
||||
${pkgs.hyprland}/bin/hyprctl hyprpaper reload ,/run/wallpaper
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
};
|
||||
};
|
||||
};
|
||||
# Create a timer to run the service periodically
|
||||
timers = {
|
||||
reload-bing-wallpaper = {
|
||||
description = "Timer for reload-bing-wallpaper";
|
||||
wantedBy = [ "timers.target" ];
|
||||
|
||||
# Timer configuration
|
||||
timerConfig = {
|
||||
OnCalendar = "daily"; # Check every day
|
||||
Persistent = true; # Run immediately if last run was missed
|
||||
Unit = "reload-bing-wallpaper.service";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
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 = true;
|
||||
xdgOpenUsePortal = true;
|
||||
extraPortals = [
|
||||
pkgs.xdg-desktop-portal-hyprland
|
||||
pkgs.xdg-desktop-portal-gnome
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
108
modules/nixos/desktop/hyprland/settings.nix
Normal file
108
modules/nixos/desktop/hyprland/settings.nix
Normal file
@@ -0,0 +1,108 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
nord = import ./theme.nix;
|
||||
themeSize = "compact"; # [ "standard" "compact" ]
|
||||
themeAccent = "all"; # [ "default" "purple" "pink" "red" "orange" "yellow" "green" "teal" "grey" "all" ]
|
||||
themeVariant = "nord"; # [ "nord" "dracula" "gruvbox" "everforest" "catppuccin" "all" "black" "rimless" "normal" "float" ]
|
||||
themeColor = "dark"; # [ "standard" "light" "dark" ]
|
||||
iconThemeVariant = "all"; # [ "default" "purple" "pink" "red" "orange" "yellow" "green" "teal" "grey" "all" ]
|
||||
iconScheme = "nord"; # [ "default" "nord" "dracula" "gruvbox" "everforest" "catppuccin" "all" ]
|
||||
|
||||
sddmThemePkg = pkgs.sddm-astronaut.override {
|
||||
embeddedTheme = "astronaut";
|
||||
themeConfig = {
|
||||
Background = "/run/wallpaper.jpg";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
# Username
|
||||
user = "matt";
|
||||
|
||||
# Displays
|
||||
displayLeft = {
|
||||
input = "eDP-1";
|
||||
resolution = "3456x2234"; # "3356x2160";
|
||||
refreshRate = "60.00000";
|
||||
};
|
||||
displayRight = {
|
||||
input = "DP-2";
|
||||
resolution = "3840x2160";
|
||||
refreshRate = "240.00000";
|
||||
};
|
||||
|
||||
# Cursor
|
||||
cursorTheme = "macOS";
|
||||
cursorThemePkg = pkgs.apple-cursor;
|
||||
cursorSize = 24;
|
||||
|
||||
# GTK
|
||||
gtkThemeSize = themeSize;
|
||||
gtkThemeAccent = themeAccent;
|
||||
gtkThemeVariant = themeVariant;
|
||||
gtkThemeColor = themeColor;
|
||||
gtkTheme = "Colloid-Dark-Compact-Nord";
|
||||
gtkThemePkg = pkgs.colloid-gtk-theme.override {
|
||||
sizeVariants = [ themeSize ];
|
||||
colorVariants = [ themeColor ];
|
||||
themeVariants = [ themeAccent ];
|
||||
tweaks = [ themeVariant ];
|
||||
};
|
||||
|
||||
# Icons
|
||||
iconThemeScheme = iconScheme;
|
||||
iconTheme = "Colloid-Nord-Dark";
|
||||
iconThemePkg = pkgs.colloid-icon-theme.override {
|
||||
schemeVariants = [ iconScheme ];
|
||||
colorVariants = [ iconThemeVariant ];
|
||||
};
|
||||
|
||||
# Fonts
|
||||
fontName = "JetBrainsMono NFM";
|
||||
fontPackage = pkgs.nerd-fonts.jetbrains-mono;
|
||||
fontSize = 12;
|
||||
|
||||
# SDDM/Locking
|
||||
sddm = {
|
||||
themeName = "sddm-astronaut-theme";
|
||||
package = sddmThemePkg;
|
||||
};
|
||||
lockScreenTimer = 900; # 15 min
|
||||
screenOffTimer = 930; # 15.5 min
|
||||
suspendTimer = 3600; # 1hr
|
||||
|
||||
# Packages needed for the theme(s)
|
||||
requiredPkgs = with pkgs; [
|
||||
adwaita-icon-theme
|
||||
adwaita-icon-theme
|
||||
apple-cursor
|
||||
catppuccin
|
||||
catppuccin-gtk
|
||||
catppuccin-qt5ct
|
||||
catppuccin-sddm
|
||||
colloid-gtk-theme
|
||||
colloid-icon-theme
|
||||
nemo
|
||||
nemo-python
|
||||
nemo-emblems
|
||||
nemo-preview
|
||||
nemo-seahorse
|
||||
nemo-fileroller
|
||||
nemo-qml-plugin-dbus
|
||||
papirus-folders
|
||||
sddm-astronaut
|
||||
];
|
||||
|
||||
defaultApps = {
|
||||
browser = pkgs.firefox;
|
||||
editor = pkgs.micro;
|
||||
fileExplorer = pkgs.nemo;
|
||||
visual = pkgs.vscodium;
|
||||
terminal = pkgs.kitty;
|
||||
office = pkgs.onlyoffice-bin_latest;
|
||||
video = pkgs.vlc;
|
||||
imageViewer = pkgs.gnome-photos;
|
||||
};
|
||||
|
||||
theme = nord;
|
||||
}
|
||||
Reference in New Issue
Block a user