Format everything with alejandra

This commit is contained in:
Toast 2024-03-20 12:54:25 +01:00
parent 82bbd7ce87
commit 7888103b1e
100 changed files with 2827 additions and 2756 deletions

View file

@ -1,9 +1,7 @@
{ ... }:
{
imports = [
./plasma.nix
./sddm.nix
./programs
];
{...}: {
imports = [
./plasma.nix
./sddm.nix
./programs
];
}

View file

@ -1,158 +1,172 @@
{ config, pkgs, lib, flakeSelf, ... }:
let
# Set up the default kde options
balooExcludedDirs = lib.strings.intersperse "," [
"$HOME/.cache/"
"$HOME/.config/"
"$HOME/.local/"
];
baloofilerc = lib.generators.toINI {} {
General = {
# The [$e] part allows you to use environment variables
"exclude folders[$e]" = lib.strings.concatStrings balooExcludedDirs;
};
};
# Make custom packages
breezeTint = pkgs.stdenv.mkDerivation {
name = "breeze-tint";
src = "${pkgs.breeze-qt5}";
patches = [ ./patches/BreezeTint.patch ];
installPhase = ''
runHook preInstall
mkdir -p $out/share/color-schemes/
cp -r share/color-schemes/* $out/share/color-schemes/
runHook postInstall
'';
};
# /etc/xdg is not read by plasma, so to change the default settings you need to put them in a package
plasmaDefaults = pkgs.stdenv.mkDerivation {
name = "toast-plasma-defaults";
dontUnpack = true;
installPhase = ''
runHook preInstall
set -x
mkdir -p $out/etc/xdg
echo '${baloofilerc}' > $out/etc/xdg/baloofilerc
runHook postInstall
'';
};
in
{
services.xserver = {
# Enable the Plasma 5 Desktop Environment
desktopManager.plasma5.enable = true;
displayManager.defaultSession = "plasmawayland";
};
config,
pkgs,
lib,
flakeSelf,
...
}: let
# Set up the default kde options
balooExcludedDirs = lib.strings.intersperse "," [
"$HOME/.cache/"
"$HOME/.config/"
"$HOME/.local/"
];
qt.enable = true;
baloofilerc = lib.generators.toINI {} {
General = {
# The [$e] part allows you to use environment variables
"exclude folders[$e]" = lib.strings.concatStrings balooExcludedDirs;
};
};
# GTK apps need dconf to grab the correct theme on Wayland
programs.dconf.enable = true;
# Make custom packages
breezeTint = pkgs.stdenv.mkDerivation {
name = "breeze-tint";
src = "${pkgs.breeze-qt5}";
patches = [./patches/BreezeTint.patch];
installPhase = ''
runHook preInstall
# Install the patched Breeze color schemes as well as the plasma default configs
environment.systemPackages = [ breezeTint plasmaDefaults ];
mkdir -p $out/share/color-schemes/
cp -r share/color-schemes/* $out/share/color-schemes/
# Plasma configs should be on all users
home-manager.sharedModules = [
(
{ config, ... }:
let gtk2rc = "${config.xdg.configHome}/gtk-2.0/gtkrc"; in
{
gtk.gtk2.configLocation = gtk2rc;
# Kde has an annoying habit of overwriting the gtk2 config file
home.file."${gtk2rc}".force = true;
}
)
{
imports = [ flakeSelf.inputs.plasma-manager.homeManagerModules.plasma-manager ];
gtk = {
enable = true;
# Most apps are dark, so a white cursor is easier to spot
cursorTheme = { package = pkgs.breeze-qt5; name = "Breeze_Snow"; };
iconTheme = { package = pkgs.breeze-icons; name = "breeze-dark"; };
theme = { package = pkgs.breeze-gtk; name = "Breeze"; };
# Gtk2 doesn't have a dark mode, so I just tell gtk 3 and 4 to use the dark variant
gtk3.extraConfig.gtk-application-prefer-dark-theme = true;
gtk4.extraConfig.gtk-application-prefer-dark-theme = true;
};
home.packages = [(
pkgs.catppuccin-kde.override {
flavour = [ "mocha" ];
accents = [ "mauve" ];
winDecStyles = [ "classic" ];
}
)];
programs.plasma = {
enable = true;
overrideConfig = true;
# Delete config files that I fully configure here
overrideConfigFiles = [
"plasmashellrc"
"plasma-org.kde.plasma.desktop-appletsrc"
];
workspace = {
clickItemTo = "select";
cursorTheme = "Breeze_Snow";
iconTheme = "breeze-dark";
lookAndFeel = "Catppuccin-Mocha-Mauve";
theme = "default";
colorScheme = "CatppuccinMochaMauve";
};
kwin = {
titlebarButtons = {
left = [ "on-all-desktops" "keep-above-windows" ];
right = [ "minimize" "maximize" "close" ];
};
};
panels = [{
location = "bottom";
height = 44;
widgets = [
{
name = "org.kde.plasma.kickoff";
config.General.icon = "nix-snowflake-white";
}
"org.kde.plasma.pager"
"org.kde.plasma.icontasks"
"org.kde.plasma.marginsseparator"
"org.kde.plasma.systemtray"
{
name = "org.kde.plasma.digitalclock";
config.Appearance.showSeconds = "true";
}
"org.kde.plasma.showdesktop"
];
}];
shortcuts = {
"kwin" = {
"Switch One Desktop to the Left" = [ "Meta+Ctrl+Left" ];
"Switch One Desktop to the Right" = [ "Meta+Ctrl+Right" ];
};
};
configFile = {
"kwinrc" = {
"org\\.kde\\.kdecoration2"."BorderSize" = "None";
"Desktops" = {
"Number" = 2;
"Rows" = 1;
};
"TabBox"."LayoutName" = "thumbnail_grid";
};
"kdeglobals"."General"."AccentColor" = null;
"auroraerc"."CatppuccinMocha-Classic"."ButtonSize" = 0;
"plasmanotifyrc"."Notifications"."NormalAlwaysOnTop" = true;
};
};
}
];
runHook postInstall
'';
};
# /etc/xdg is not read by plasma, so to change the default settings you need to put them in a package
plasmaDefaults = pkgs.stdenv.mkDerivation {
name = "toast-plasma-defaults";
dontUnpack = true;
installPhase = ''
runHook preInstall
set -x
mkdir -p $out/etc/xdg
echo '${baloofilerc}' > $out/etc/xdg/baloofilerc
runHook postInstall
'';
};
in {
services.xserver = {
# Enable the Plasma 5 Desktop Environment
desktopManager.plasma5.enable = true;
displayManager.defaultSession = "plasmawayland";
};
qt.enable = true;
# GTK apps need dconf to grab the correct theme on Wayland
programs.dconf.enable = true;
# Install the patched Breeze color schemes as well as the plasma default configs
environment.systemPackages = [breezeTint plasmaDefaults];
# Plasma configs should be on all users
home-manager.sharedModules = [
(
{config, ...}: let
gtk2rc = "${config.xdg.configHome}/gtk-2.0/gtkrc";
in {
gtk.gtk2.configLocation = gtk2rc;
# Kde has an annoying habit of overwriting the gtk2 config file
home.file."${gtk2rc}".force = true;
}
)
{
imports = [flakeSelf.inputs.plasma-manager.homeManagerModules.plasma-manager];
gtk = {
enable = true;
# Most apps are dark, so a white cursor is easier to spot
cursorTheme = {
package = pkgs.breeze-qt5;
name = "Breeze_Snow";
};
iconTheme = {
package = pkgs.breeze-icons;
name = "breeze-dark";
};
theme = {
package = pkgs.breeze-gtk;
name = "Breeze";
};
# Gtk2 doesn't have a dark mode, so I just tell gtk 3 and 4 to use the dark variant
gtk3.extraConfig.gtk-application-prefer-dark-theme = true;
gtk4.extraConfig.gtk-application-prefer-dark-theme = true;
};
home.packages = [
(
pkgs.catppuccin-kde.override {
flavour = ["mocha"];
accents = ["mauve"];
winDecStyles = ["classic"];
}
)
];
programs.plasma = {
enable = true;
overrideConfig = true;
# Delete config files that I fully configure here
overrideConfigFiles = [
"plasmashellrc"
"plasma-org.kde.plasma.desktop-appletsrc"
];
workspace = {
clickItemTo = "select";
cursorTheme = "Breeze_Snow";
iconTheme = "breeze-dark";
lookAndFeel = "Catppuccin-Mocha-Mauve";
theme = "default";
colorScheme = "CatppuccinMochaMauve";
};
kwin = {
titlebarButtons = {
left = ["on-all-desktops" "keep-above-windows"];
right = ["minimize" "maximize" "close"];
};
};
panels = [
{
location = "bottom";
height = 44;
widgets = [
{
name = "org.kde.plasma.kickoff";
config.General.icon = "nix-snowflake-white";
}
"org.kde.plasma.pager"
"org.kde.plasma.icontasks"
"org.kde.plasma.marginsseparator"
"org.kde.plasma.systemtray"
{
name = "org.kde.plasma.digitalclock";
config.Appearance.showSeconds = "true";
}
"org.kde.plasma.showdesktop"
];
}
];
shortcuts = {
"kwin" = {
"Switch One Desktop to the Left" = ["Meta+Ctrl+Left"];
"Switch One Desktop to the Right" = ["Meta+Ctrl+Right"];
};
};
configFile = {
"kwinrc" = {
"org\\.kde\\.kdecoration2"."BorderSize" = "None";
"Desktops" = {
"Number" = 2;
"Rows" = 1;
};
"TabBox"."LayoutName" = "thumbnail_grid";
};
"kdeglobals"."General"."AccentColor" = null;
"auroraerc"."CatppuccinMocha-Classic"."ButtonSize" = 0;
"plasmanotifyrc"."Notifications"."NormalAlwaysOnTop" = true;
};
};
}
];
}

View file

@ -1,15 +1,13 @@
{ config, ... }:
{config, ...}: {
imports = [
./kate.nix
./firefox.nix
./skanpage.nix
./neochat.nix
./konsole.nix
./git.nix
];
{
imports = [
./kate.nix
./firefox.nix
./skanpage.nix
./neochat.nix
./konsole.nix
./git.nix
];
# Enable the kde partition manager
programs.partition-manager.enable = true;
# Enable the kde partition manager
programs.partition-manager.enable = true;
}

View file

@ -1,32 +1,34 @@
{ config, pkgs, ... }:
{
# KDE specific firefox settings
programs.firefox = {
policies = {
"ExtensionSettings" = {
# TODO: Install extensions the NUR instead of from AMO
"plasma-browser-integration@kde.org" = {
"installation_mode" = "normal_installed";
"install_url" = "https://addons.mozilla.org/firefox/downloads/latest/plasma-integration/latest.xpi";
};
};
"Preferences" = {
# Make firefox use the kde file picker
"widget.use-xdg-desktop-portal.file-picker" = {
"Value" = 1;
"Status" = "default";
};
/*
https://wiki.archlinux.org/title/Firefox#KDE_integration tells me to enable this,
but strangely enough doing so makes firefox ask to be set as the default browser
every time you start it up, so I'll disable it
*/
"widget.use-xdg-desktop-portal.mime-handler" = {
"Value" = 0;
"Status" = "default";
};
};
};
};
config,
pkgs,
...
}: {
# KDE specific firefox settings
programs.firefox = {
policies = {
"ExtensionSettings" = {
# TODO: Install extensions the NUR instead of from AMO
"plasma-browser-integration@kde.org" = {
"installation_mode" = "normal_installed";
"install_url" = "https://addons.mozilla.org/firefox/downloads/latest/plasma-integration/latest.xpi";
};
};
"Preferences" = {
# Make firefox use the kde file picker
"widget.use-xdg-desktop-portal.file-picker" = {
"Value" = 1;
"Status" = "default";
};
/*
https://wiki.archlinux.org/title/Firefox#KDE_integration tells me to enable this,
but strangely enough doing so makes firefox ask to be set as the default browser
every time you start it up, so I'll disable it
*/
"widget.use-xdg-desktop-portal.mime-handler" = {
"Value" = 0;
"Status" = "default";
};
};
};
};
}

View file

@ -1,6 +1,8 @@
{ pkgs, lib, ... }:
{
pkgs,
lib,
...
}: {
home-manager.users.toast = {
programs.git = {
extraConfig = {

View file

@ -1,10 +1,12 @@
{ config, pkgs, ... }:
{
environment.systemPackages = [ pkgs.kate ];
config,
pkgs,
...
}: {
environment.systemPackages = [pkgs.kate];
# Use kwrite to open text files, and kate if I'm developing stuff
xdg.mime.defaultApplications = {
"text/plain" = "org.kde.kwrite.desktop";
};
# Use kwrite to open text files, and kate if I'm developing stuff
xdg.mime.defaultApplications = {
"text/plain" = "org.kde.kwrite.desktop";
};
}

View file

@ -1,17 +1,17 @@
{ pkgs, ... }:
let
catppuccinKonsole = pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "konsole";
# Latest commit is 7d86b8a1e56e58f6b5649cdaac543a573ac194ca
rev = "main";
hash = "sha256-EwSJMTxnaj2UlNJm1t6znnatfzgm1awIQQUF3VPfCTM=";
} + /Catppuccin-Mocha.colorscheme;
in
{
{pkgs, ...}: let
catppuccinKonsole =
pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "konsole";
# Latest commit is 7d86b8a1e56e58f6b5649cdaac543a573ac194ca
rev = "main";
hash = "sha256-EwSJMTxnaj2UlNJm1t6znnatfzgm1awIQQUF3VPfCTM=";
}
+ /Catppuccin-Mocha.colorscheme;
in {
home-manager.users.toast = {
xdg.dataFile = {
"konsole/Catppuccin-Mocha.colorscheme".source = catppuccinKonsole;
};
};
}
}

View file

@ -1,7 +1,5 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
home-manager.users.toast = {
home.packages = [ pkgs.neochat ];
home.packages = [pkgs.neochat];
};
}
}

View file

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }:
{
# Only install skanpage if scanning is set up
config = lib.mkIf config.hardware.sane.enable {
environment.systemPackages = [ pkgs.skanpage ];
};
# environment.systemPackages = if config.hardware.sane.enable == true then [ pkgs.skanpage ] else [];
config,
lib,
pkgs,
...
}: {
# Only install skanpage if scanning is set up
config = lib.mkIf config.hardware.sane.enable {
environment.systemPackages = [pkgs.skanpage];
};
# environment.systemPackages = if config.hardware.sane.enable == true then [ pkgs.skanpage ] else [];
}

View file

@ -1,56 +1,56 @@
{ config, pkgs, ... }:
let
currentTheme = config.services.xserver.displayManager.sddm.theme;
sddm-sugar-candy = pkgs.stdenv.mkDerivation {
pname = "sddm-sugar-candy";
version = "master";
src = pkgs.fetchgit {
url = "https://framagit.org/MarianArlt/sddm-sugar-candy.git";
hash = "sha256-XggFVsEXLYklrfy1ElkIp9fkTw4wvXbyVkaVCZq4ZLU=";
};
installPhase = ''
runHook preInstall
mkdir -p $out/share/sddm/themes/sugar-candy
cp -r /build/sddm-sugar-candy/* $out/share/sddm/themes/sugar-candy
runHook postInstall
'';
};
/*
Adds a theme.conf.user file to the current sddm theme's folder,
allowing you to change it's configuration without needing to
repackage it
*/
customcfg = pkgs.stdenv.mkDerivation {
name = "sddm-theme-customizer";
dontUnpack = true;
# TODO: generate theme.conf.user outside of installPhase
installPhase = ''
runHook preInstall
mkdir -p $out/share/sddm/themes/${currentTheme}/
echo "[General]
background = ${pkgs.plasma-workspace-wallpapers}/share/wallpapers/MilkyWay/contents/images/5120x2880.png" >> $out/share/sddm/themes/${currentTheme}/theme.conf.user
runHook postInstall
'';
};
in
{
# Enable SDDM.
services.xserver.displayManager.sddm = {
enable = true;
theme = "sugar-candy";
settings = {
General = { Numlock = "on"; };
Theme = { CursorTheme = "Breeze_Snow"; };
};
};
config,
pkgs,
...
}: let
currentTheme = config.services.xserver.displayManager.sddm.theme;
environment.systemPackages = [ sddm-sugar-candy customcfg ];
sddm-sugar-candy = pkgs.stdenv.mkDerivation {
pname = "sddm-sugar-candy";
version = "master";
src = pkgs.fetchgit {
url = "https://framagit.org/MarianArlt/sddm-sugar-candy.git";
hash = "sha256-XggFVsEXLYklrfy1ElkIp9fkTw4wvXbyVkaVCZq4ZLU=";
};
installPhase = ''
runHook preInstall
mkdir -p $out/share/sddm/themes/sugar-candy
cp -r /build/sddm-sugar-candy/* $out/share/sddm/themes/sugar-candy
runHook postInstall
'';
};
/*
Adds a theme.conf.user file to the current sddm theme's folder,
allowing you to change it's configuration without needing to
repackage it
*/
customcfg = pkgs.stdenv.mkDerivation {
name = "sddm-theme-customizer";
dontUnpack = true;
# TODO: generate theme.conf.user outside of installPhase
installPhase = ''
runHook preInstall
mkdir -p $out/share/sddm/themes/${currentTheme}/
echo "[General]
background = ${pkgs.plasma-workspace-wallpapers}/share/wallpapers/MilkyWay/contents/images/5120x2880.png" >> $out/share/sddm/themes/${currentTheme}/theme.conf.user
runHook postInstall
'';
};
in {
# Enable SDDM.
services.xserver.displayManager.sddm = {
enable = true;
theme = "sugar-candy";
settings = {
General = {Numlock = "on";};
Theme = {CursorTheme = "Breeze_Snow";};
};
};
environment.systemPackages = [sddm-sugar-candy customcfg];
}