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,19 +1,21 @@
{ config, pkgs, ... }:
{
# Enable scanning
hardware.sane = {
enable = true;
extraBackends = [ pkgs.sane-airscan ];
};
users.users.toast.extraGroups = [ "scanner" ];
config,
pkgs,
...
}: {
# Enable scanning
hardware.sane = {
enable = true;
extraBackends = [pkgs.sane-airscan];
};
users.users.toast.extraGroups = ["scanner"];
services.xserver.enable = true;
services.xserver.enable = true;
# Set up fonts
fonts.packages = [
( pkgs.nerdfonts.override { fonts = [ "Hack" "JetBrainsMono" ]; } )
];
# Set up fonts
fonts.packages = [
(pkgs.nerdfonts.override {fonts = ["Hack" "JetBrainsMono"];})
];
boot.plymouth.enable = true;
boot.plymouth.enable = true;
}

View file

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

View file

@ -1,14 +1,12 @@
{ ... }:
{
imports = [
./discord.nix
./firefox.nix
./micro.nix
./keepassxc.nix
./jamesdsp.nix
./vscode.nix
./git.nix
./ssh.nix
];
{...}: {
imports = [
./discord.nix
./firefox.nix
./micro.nix
./keepassxc.nix
./jamesdsp.nix
./vscode.nix
./git.nix
./ssh.nix
];
}

View file

@ -1,41 +1,45 @@
{ config, pkgs, lib, ... }:
let
discordOverlay = self: super: {
discord = super.discord.override {
withOpenASAR = true;
withVencord = true;
};
# Update some stuff while I wait for nixpkgs
/*vencord = super.vencord.overrideAttrs rec {
version = "522fdcd";
src = pkgs.fetchFromGitHub {
owner = "Vendicated";
repo = "Vencord";
rev = "522fdcd";
#rev = "v${version}";
hash = "sha256-9G7FNL4pHaaLachzJmeAol0WpNUj533K2FNa7DH0eBM=";
};
};*/
};
stock-discord = self: super: {
discord = super.discord.override {
withOpenASAR = false;
withVencord = false;
};
};
in
{
# Sometimes discord breaks after updates, and launching it stock once fixes it
specialisation.stockDiscord.configuration = {
nixpkgs.overlays = lib.mkAfter [ stock-discord ];
};
config,
pkgs,
lib,
...
}: let
discordOverlay = self: super: {
discord = super.discord.override {
withOpenASAR = true;
withVencord = true;
};
# Update some stuff while I wait for nixpkgs
/*
vencord = super.vencord.overrideAttrs rec {
version = "522fdcd";
src = pkgs.fetchFromGitHub {
owner = "Vendicated";
repo = "Vencord";
rev = "522fdcd";
#rev = "v${version}";
hash = "sha256-9G7FNL4pHaaLachzJmeAol0WpNUj533K2FNa7DH0eBM=";
};
};
*/
};
stock-discord = self: super: {
discord = super.discord.override {
withOpenASAR = false;
withVencord = false;
};
};
in {
# Sometimes discord breaks after updates, and launching it stock once fixes it
specialisation.stockDiscord.configuration = {
nixpkgs.overlays = lib.mkAfter [stock-discord];
};
nixpkgs.overlays = [ discordOverlay ];
home-manager.users.toast = {
home.packages = with pkgs; [
discord
vesktop
];
};
nixpkgs.overlays = [discordOverlay];
home-manager.users.toast = {
home.packages = with pkgs; [
discord
vesktop
];
};
}

View file

@ -1,57 +1,59 @@
{ config, lib, ... }:
{
# System wide firefox settings
programs.firefox = {
enable = true;
policies = {
"DisablePocket" = true;
"DisableTelemetry" = true;
# You need these for Spotify
"EncryptedMediaExtensions" = { "Enabled" = true; };
"ExtensionSettings" = {
# TODO: Install extensions the NUR instead of from AMO
"uBlock0@raymondhill.net" = {
"installation_mode" = "force_installed";
"install_url" = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
};
# Decentraleyes
"jid1-BoFifL9Vbdl2zQ@jetpack" = {
"installation_mode" = "normal_installed";
"install_url" = "https://addons.mozilla.org/firefox/downloads/latest/decentraleyes/latest.xpi";
};
"jid1-MnnxcxisBPnSXQ@jetpack" = {
"installation_mode" = "normal_installed";
"install_url" = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi";
};
# Uninstall the kde plasma integration extension if KDE is not installed
"plasma-browser-integration@kde.org"."installation_mode" = lib.mkDefault "blocked";
};
"Preferences" = {
# Enable video hardware acceleration
"media.ffmpeg.vaapi.enabled" = {
"Value" = true;
"Status" = "default";
};
"dom.security.https_only_mode" = {
"Value" = true;
"Status" = "locked";
};
"general.smoothScroll.msdPhysics.enabled" = {
"Value" = true;
"Status" = "default";
};
};
"PromptForDownloadLocation" = true;
# I use an external password manager, so the built in one just bothers me
"PasswordManagerEnabled" = false;
"Permissions" = {
"Autoplay" = {
"Allow" = [ "https://www.youtube.com" ];
"Default" = "block-audio-video";
};
};
"FirefoxHome" = { "SponsoredTopSites" = false; };
};
};
config,
lib,
...
}: {
# System wide firefox settings
programs.firefox = {
enable = true;
policies = {
"DisablePocket" = true;
"DisableTelemetry" = true;
# You need these for Spotify
"EncryptedMediaExtensions" = {"Enabled" = true;};
"ExtensionSettings" = {
# TODO: Install extensions the NUR instead of from AMO
"uBlock0@raymondhill.net" = {
"installation_mode" = "force_installed";
"install_url" = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
};
# Decentraleyes
"jid1-BoFifL9Vbdl2zQ@jetpack" = {
"installation_mode" = "normal_installed";
"install_url" = "https://addons.mozilla.org/firefox/downloads/latest/decentraleyes/latest.xpi";
};
"jid1-MnnxcxisBPnSXQ@jetpack" = {
"installation_mode" = "normal_installed";
"install_url" = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi";
};
# Uninstall the kde plasma integration extension if KDE is not installed
"plasma-browser-integration@kde.org"."installation_mode" = lib.mkDefault "blocked";
};
"Preferences" = {
# Enable video hardware acceleration
"media.ffmpeg.vaapi.enabled" = {
"Value" = true;
"Status" = "default";
};
"dom.security.https_only_mode" = {
"Value" = true;
"Status" = "locked";
};
"general.smoothScroll.msdPhysics.enabled" = {
"Value" = true;
"Status" = "default";
};
};
"PromptForDownloadLocation" = true;
# I use an external password manager, so the built in one just bothers me
"PasswordManagerEnabled" = false;
"Permissions" = {
"Autoplay" = {
"Allow" = ["https://www.youtube.com"];
"Default" = "block-audio-video";
};
};
"FirefoxHome" = {"SponsoredTopSites" = false;};
};
};
}

View file

@ -1,6 +1,8 @@
{ pkgs, lib, ... }:
{
pkgs,
lib,
...
}: {
home-manager.users.toast = {
programs.git = {
package = pkgs.gitFull;
@ -11,6 +13,6 @@
};
};
home.packages = [ pkgs.git-cola ];
home.packages = [pkgs.git-cola];
};
}

View file

@ -1,5 +1,7 @@
{ config, pkgs, ... }:
{
users.users.toast.packages = [ pkgs.jamesdsp ];
config,
pkgs,
...
}: {
users.users.toast.packages = [pkgs.jamesdsp];
}

View file

@ -1,63 +1,69 @@
{ config, pkgs, lib, ... }:
let
kpxcSettings = lib.generators.toINI {} {
General = {
# Not sure what changing this does, I'll leave it alone
ConfigVersion = 2;
MinimizeAfterUnlock = true;
AutoSaveAfterEveryChange = false;
};
GUI = {
ApplicationTheme = "classic";
MinimizeOnStartup = false;
MinimizeOnClose = true;
MinimizeToTray = true;
ShowTrayIcon = true;
# 0 is icons, 1 is text, 2 is text next to icons, 3 is text under icons, and 4 is follow style
ToolButtonStyle = 0; # Would choose 4 but it's too big for a small window
# monochrome-light, monochrome-dark or colorful
TrayIconAppearance = "monochrome-light";
};
Security = {
HideNotes = true;
IconDownloadFallback = true;
};
SSHAgent.Enabled = true;
};
in
{
home-manager = {
extraSpecialArgs = { kpxcSettings = kpxcSettings; };
users.toast = { config, pkgs, kpxcSettings, ... }: {
# No module for KeePassXC config :(
home = {
packages = [ pkgs.keepassxc ];
file = {
".config/keepassxc/keepassxc.ini".text = kpxcSettings;
# For some reason the autostart .desktop is not the same as the regular one
".config/autostart/org.keepassxc.KeePassXC.desktop".text = ''
[Desktop Entry]
Name=KeePassXC
GenericName=Password Manager
Exec=keepassxc
TryExec=keepassxc
Icon=keepassxc
StartupWMClass=keepassxc
StartupNotify=true
Terminal=false
Type=Application
Version=1.0
Categories=Utility;Security;Qt;
MimeType=application/x-keepass2;
X-GNOME-Autostart-enabled=true
X-GNOME-Autostart-Delay=2
X-KDE-autostart-after=panel
X-LXQt-Need-Tray=true
'';
};
};
};
};
config,
pkgs,
lib,
...
}: let
kpxcSettings = lib.generators.toINI {} {
General = {
# Not sure what changing this does, I'll leave it alone
ConfigVersion = 2;
MinimizeAfterUnlock = true;
AutoSaveAfterEveryChange = false;
};
GUI = {
ApplicationTheme = "classic";
MinimizeOnStartup = false;
MinimizeOnClose = true;
MinimizeToTray = true;
ShowTrayIcon = true;
# 0 is icons, 1 is text, 2 is text next to icons, 3 is text under icons, and 4 is follow style
ToolButtonStyle = 0; # Would choose 4 but it's too big for a small window
# monochrome-light, monochrome-dark or colorful
TrayIconAppearance = "monochrome-light";
};
Security = {
HideNotes = true;
IconDownloadFallback = true;
};
SSHAgent.Enabled = true;
};
in {
home-manager = {
extraSpecialArgs = {kpxcSettings = kpxcSettings;};
users.toast = {
config,
pkgs,
kpxcSettings,
...
}: {
# No module for KeePassXC config :(
home = {
packages = [pkgs.keepassxc];
file = {
".config/keepassxc/keepassxc.ini".text = kpxcSettings;
# For some reason the autostart .desktop is not the same as the regular one
".config/autostart/org.keepassxc.KeePassXC.desktop".text = ''
[Desktop Entry]
Name=KeePassXC
GenericName=Password Manager
Exec=keepassxc
TryExec=keepassxc
Icon=keepassxc
StartupWMClass=keepassxc
StartupNotify=true
Terminal=false
Type=Application
Version=1.0
Categories=Utility;Security;Qt;
MimeType=application/x-keepass2;
X-GNOME-Autostart-enabled=true
X-GNOME-Autostart-Delay=2
X-KDE-autostart-after=panel
X-LXQt-Need-Tray=true
'';
};
};
};
};
}

View file

@ -1,21 +1,27 @@
{ config, pkgs, lib, ... }:
{
home-manager = {
users.toast = { config, pkgs, ... }:
{
programs.micro = {
enable = true;
settings = {
# Use xclip/wl-clipboard for copying and pasting
clipboard = lib.mkForce "external";
};
};
/*
On a kde wayland session micro uses xsel or xclip instead of wl-clipboard
which doesn't work, so I only install wl-clipboard here to make micro use it
*/
home.packages = with pkgs; [ wl-clipboard ];
};
};
config,
pkgs,
lib,
...
}: {
home-manager = {
users.toast = {
config,
pkgs,
...
}: {
programs.micro = {
enable = true;
settings = {
# Use xclip/wl-clipboard for copying and pasting
clipboard = lib.mkForce "external";
};
};
/*
On a kde wayland session micro uses xsel or xclip instead of wl-clipboard
which doesn't work, so I only install wl-clipboard here to make micro use it
*/
home.packages = with pkgs; [wl-clipboard];
};
};
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
home-manager.users.toast = {
programs.ssh = {
enable = true;

View file

@ -1,40 +1,45 @@
{ config, pkgs, flakeSelf, ... }:
let inputs = flakeSelf.inputs; in
{
nixpkgs.overlays = [ inputs.catppuccin-vsc.overlays.default ];
home-manager.users.toast = {
home.packages = with pkgs; [
nixpkgs-fmt
];
programs.vscode = {
enable = true;
package = pkgs.vscodium;
mutableExtensionsDir = false;
extensions = with inputs.vscode-extensions.extensions.x86_64-linux.open-vsx; [
jnoortheen.nix-ide
(pkgs.catppuccin-vsc.override {
workbenchMode = "flat";
extraBordersEnabled = true;
})
catppuccin.catppuccin-vsc-icons
waderyan.gitblame
];
userSettings = {
# VSCode doesn't like nested settings
# https://stackoverflow.com/questions/74134436/is-it-possible-to-express-settings-in-vs-codes-settings-json-where-each-dot-sep
# TODO: write a function that unnests settings
"workbench.colorTheme" = "Catppuccin Mocha";
"workbench.iconTheme" = "catppuccin-mocha";
"editor.fontFamily" = "JetBrainsMono Nerd Font";
"editor.semanticHighlighting.enabled" = true;
"nix.enableLanguageServer" = true;
"nix.serverPath" = "${pkgs.nil}/bin/nil";
"nix.serverSettings" = {
"nil"."formatting"."command" = [ "nixpkgs-fmt" ];
};
"terminal.integrated.minimumContrastRatio" = 1;
"window.titleBarStyle" = "custom";
};
};
};
config,
pkgs,
flakeSelf,
...
}: let
inputs = flakeSelf.inputs;
in {
nixpkgs.overlays = [inputs.catppuccin-vsc.overlays.default];
home-manager.users.toast = {
home.packages = with pkgs; [
nixpkgs-fmt
];
programs.vscode = {
enable = true;
package = pkgs.vscodium;
mutableExtensionsDir = false;
extensions = with inputs.vscode-extensions.extensions.x86_64-linux.open-vsx; [
jnoortheen.nix-ide
(pkgs.catppuccin-vsc.override {
workbenchMode = "flat";
extraBordersEnabled = true;
})
catppuccin.catppuccin-vsc-icons
waderyan.gitblame
];
userSettings = {
# VSCode doesn't like nested settings
# https://stackoverflow.com/questions/74134436/is-it-possible-to-express-settings-in-vs-codes-settings-json-where-each-dot-sep
# TODO: write a function that unnests settings
"workbench.colorTheme" = "Catppuccin Mocha";
"workbench.iconTheme" = "catppuccin-mocha";
"editor.fontFamily" = "JetBrainsMono Nerd Font";
"editor.semanticHighlighting.enabled" = true;
"nix.enableLanguageServer" = true;
"nix.serverPath" = "${pkgs.nil}/bin/nil";
"nix.serverSettings" = {
"nil"."formatting"."command" = ["nixpkgs-fmt"];
};
"terminal.integrated.minimumContrastRatio" = 1;
"window.titleBarStyle" = "custom";
};
};
};
}

View file

@ -1,12 +1,10 @@
{ ... }:
{
imports = [
./ssh-agent.nix
./flatpak.nix
./syncthing.nix
./pipewire.nix
./printing.nix
./networkmanager.nix
];
{...}: {
imports = [
./ssh-agent.nix
./flatpak.nix
./syncthing.nix
./pipewire.nix
./printing.nix
./networkmanager.nix
];
}

View file

@ -1,19 +1,22 @@
{ config, pkgs, flakeSelf, ... }:
{
services.flatpak.enable = true;
config,
pkgs,
flakeSelf,
...
}: {
services.flatpak.enable = true;
home-manager = {
sharedModules = [{ imports = [ flakeSelf.inputs.nix-flatpak.homeManagerModules.nix-flatpak ]; }];
users.toast = {
services.flatpak = {
packages = [ "tv.plex.PlexDesktop" ];
uninstallUnmanagedPackages = true;
update.auto = {
enable = true;
onCalendar = "weekly";
};
};
};
};
home-manager = {
sharedModules = [{imports = [flakeSelf.inputs.nix-flatpak.homeManagerModules.nix-flatpak];}];
users.toast = {
services.flatpak = {
packages = ["tv.plex.PlexDesktop"];
uninstallUnmanagedPackages = true;
update.auto = {
enable = true;
onCalendar = "weekly";
};
};
};
};
}

View file

@ -1,10 +1,6 @@
{ config, ... }:
let
{config, ...}: let
tailscaleName = config.services.tailscale.interfaceName;
in
{
in {
networking.networkmanager = {
enable = true;
unmanaged = [

View file

@ -1,11 +1,9 @@
{ config, ... }:
{config, ...}: {
services.pipewire = {
enable = true;
pulse.enable = true;
};
{
services.pipewire = {
enable = true;
pulse.enable = true;
};
# This allows pipewire to get realtime priority, which (hopefully) gets rid of stutters
security.rtkit.enable = true;
# This allows pipewire to get realtime priority, which (hopefully) gets rid of stutters
security.rtkit.enable = true;
}

View file

@ -1,9 +1,7 @@
{ config, ... }:
{
services.printing = {
enable = true;
startWhenNeeded = true;
stateless = true;
};
{config, ...}: {
services.printing = {
enable = true;
startWhenNeeded = true;
stateless = true;
};
}

View file

@ -1,21 +1,23 @@
{ config, pkgs, ... }:
{
programs.ssh.startAgent = true;
/*
Home assistant added an option that does this
https://github.com/nix-community/home-manager/commit/2d9210f25ed18d5d4e11e6b886de4027c0c51a94
but since I still need to fix home-manager's envvars not applying I'll stick to the NixOS one
*/
/*
TODO: fix SSH_AUTH_SOCK not being set in Plasma
Turns out the NixOS module also has issues :3
The env is set but only in bash, not in the DE, so
keepass can't pick it up. For now I'll just set it manually
*/
home-manager.users.toast.xdg.configFile."plasma-workspace/env/ssh-agent.sh".text = ''
if [[ -z "$SSH_AUTH_SOCK" ]]; then
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent
fi
'';
config,
pkgs,
...
}: {
programs.ssh.startAgent = true;
/*
Home assistant added an option that does this
https://github.com/nix-community/home-manager/commit/2d9210f25ed18d5d4e11e6b886de4027c0c51a94
but since I still need to fix home-manager's envvars not applying I'll stick to the NixOS one
*/
/*
TODO: fix SSH_AUTH_SOCK not being set in Plasma
Turns out the NixOS module also has issues :3
The env is set but only in bash, not in the DE, so
keepass can't pick it up. For now I'll just set it manually
*/
home-manager.users.toast.xdg.configFile."plasma-workspace/env/ssh-agent.sh".text = ''
if [[ -z "$SSH_AUTH_SOCK" ]]; then
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent
fi
'';
}

View file

@ -1,25 +1,23 @@
{ config, ... }:
{
services.syncthing = {
enable = true;
user = "toast";
group = "users";
dataDir = config.users.users.toast.home;
settings.folders."passwords".path = "~/Documents/Passwords";
};
# Allow regular users to stop syncthing
# https://stackoverflow.com/questions/61480914/using-policykit-to-allow-non-root-users-to-start-and-stop-a-service
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (
action.id == "org.freedesktop.systemd1.manage-units" &&
action.lookup("unit") == "syncthing.service" &&
subject.user == "${config.services.syncthing.user}"
)
{
return polkit.Result.YES;
}
})
'';
{config, ...}: {
services.syncthing = {
enable = true;
user = "toast";
group = "users";
dataDir = config.users.users.toast.home;
settings.folders."passwords".path = "~/Documents/Passwords";
};
# Allow regular users to stop syncthing
# https://stackoverflow.com/questions/61480914/using-policykit-to-allow-non-root-users-to-start-and-stop-a-service
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (
action.id == "org.freedesktop.systemd1.manage-units" &&
action.lookup("unit") == "syncthing.service" &&
subject.user == "${config.services.syncthing.user}"
)
{
return polkit.Result.YES;
}
})
'';
}