Compare commits

..

No commits in common. "a38498eef2f570755372a9d15c673cb24fb62aac" and "d87680738d2e90850f284765e07a26e87cd4eb4e" have entirely different histories.

6 changed files with 25 additions and 179 deletions

View file

@ -16,5 +16,4 @@ My NixOS and home-manager flake
This configuration was massively inspired by the following amazing projects: This configuration was massively inspired by the following amazing projects:
- <https://git.notashelf.dev/NotAShelf/nyx> (major inspiration) - <https://git.notashelf.dev/NotAShelf/nyx> (major inspiration)
- <https://github.com/spikespaz/dotfiles>
- <https://git.jacekpoz.pl/jacekpoz/niksos> - <https://git.jacekpoz.pl/jacekpoz/niksos>

View file

@ -9,7 +9,7 @@ in {
browser = "firefox.desktop"; browser = "firefox.desktop";
textEditor = browser; # nvim doesn't work properly with xdg-open, just use the browser textEditor = browser; # nvim doesn't work properly with xdg-open, just use the browser
emailClient = browser; emailClient = browser;
documentViewer = browser; # TODO: consider zathura (org.pwmt.zathura.desktop.desktop) pdfViewer = browser; # TODO: consider zathura (org.pwmt.zathura.desktop.desktop)
fileManager = "pcmanfm-qt.desktop"; # TODO: change fileManager = "pcmanfm-qt.desktop"; # TODO: change
archiveManager = "org.kde.ark.desktop"; archiveManager = "org.kde.ark.desktop";
imageViewer = imageViewer =
@ -18,10 +18,10 @@ in {
else if cfg.applications.nomacs.enable else if cfg.applications.nomacs.enable
then "org.nomacs.ImageLounge.desktop" then "org.nomacs.ImageLounge.desktop"
else browser; else browser;
mediaPlayer = "mpv.desktop"; videoPlayer = "mpv.desktop";
audioPlayer = "mpv.desktop";
associations = { associations = {
# Browser
"text/html" = [browser]; "text/html" = [browser];
"x-scheme-handler/http" = [browser]; "x-scheme-handler/http" = [browser];
"x-scheme-handler/https" = [browser]; "x-scheme-handler/https" = [browser];
@ -30,172 +30,36 @@ in {
"application/x-extension-htm" = [browser]; "application/x-extension-htm" = [browser];
"application/x-extension-html" = [browser]; "application/x-extension-html" = [browser];
"application/x-extension-shtml" = [browser]; "application/x-extension-shtml" = [browser];
"application/xhtml+xml" = [browser];
"application/x-extension-xhtml" = [browser]; "application/x-extension-xhtml" = [browser];
"application/x-extension-xht" = [browser]; "application/x-extension-xht" = [browser];
"application/xhtml+xml" = [browser];
"application/xhtml_xml" = [browser];
# Image viewer "application/pdf" = [pdfViewer];
"image/*" = [imageViewer]; # wildcard associations don't work everywhere "x-scheme-handler/mailto" = [emailClient];
"image/bmp" = [imageViewer];
"image/gif" = [imageViewer];
"image/jpeg" = [imageViewer];
"image/jpg" = [imageViewer];
"image/png" = [imageViewer];
"image/tiff" = [imageViewer];
"image/x-bmp" = [imageViewer];
"image/x-pcx" = [imageViewer];
"image/x-tga" = [imageViewer];
"image/x-portable-pixmap" = [imageViewer];
"image/x-portable-bitmap" = [imageViewer];
"image/x-portable-greymap" = [imageViewer];
"image/x-targa" = [imageViewer];
"image/svg+xml" = [imageViewer];
"image/svg_xml" = [imageViewer];
# Media Player (video + audio)
"video/*" = [mediaPlayer]; # wildcard associations don't work everywhere
"audio/*" = [mediaPlayer]; # -||-
"video/mpeg" = [mediaPlayer];
"video/x-mpeg2" = [mediaPlayer];
"video/x-mpeg3" = [mediaPlayer];
"video/mp4v-es" = [mediaPlayer];
"video/x-m4v" = [mediaPlayer];
"video/mp4" = [mediaPlayer];
"video/divx" = [mediaPlayer];
"video/vnd.divx" = [mediaPlayer];
"video/msvideo" = [mediaPlayer];
"video/x-msvideo" = [mediaPlayer];
"video/ogg" = [mediaPlayer];
"video/quicktime" = [mediaPlayer];
"video/vnd.rn-realvideo" = [mediaPlayer];
"video/x-avi" = [mediaPlayer];
"video/avi" = [mediaPlayer];
"video/x-flic" = [mediaPlayer];
"video/fli" = [mediaPlayer];
"video/x-flc" = [mediaPlayer];
"video/flv" = [mediaPlayer];
"video/x-flv" = [mediaPlayer];
"video/x-theora" = [mediaPlayer];
"video/x-theora+ogg" = [mediaPlayer];
"video/x-matroska" = [mediaPlayer];
"video/mkv" = [mediaPlayer];
"video/webm" = [mediaPlayer];
"video/x-ogm" = [mediaPlayer];
"video/x-ogm+ogg" = [mediaPlayer];
"video/dv" = [mediaPlayer];
"video/mp2t" = [mediaPlayer];
"video/vnd.mpegurl" = [mediaPlayer];
"video/3gp" = [mediaPlayer];
"video/3gpp" = [mediaPlayer];
"video/3gpp2" = [mediaPlayer];
"application/x-cue" = [mediaPlayer];
"application/vnd.ms-asf" = [mediaPlayer];
"application/x-matroska" = [mediaPlayer];
"application/x-ogm" = [mediaPlayer];
"application/x-ogm-audio" = [mediaPlayer];
"application/x-ogm-video" = [mediaPlayer];
"application/x-shorten" = [mediaPlayer];
"application/x-mpegurl" = [mediaPlayer];
"application/vnd.apple.mpegurl" = [mediaPlayer];
"application/ogg" = [mediaPlayer];
"application/x-ogg" = [mediaPlayer];
"application/mxf" = [mediaPlayer];
"application/sdp" = [mediaPlayer];
"application/smil" = [mediaPlayer];
"application/x-smil" = [mediaPlayer];
"application/streamingmedia" = [mediaPlayer];
"application/x-streamingmedia" = [mediaPlayer];
"application/vnd.rn-realmedia" = [mediaPlayer];
"application/vnd.rn-realmedia-vbr" = [mediaPlayer];
"application/x-extension-m4a" = [mediaPlayer];
"audio/x-matroska" = [mediaPlayer];
"audio/webm" = [mediaPlayer];
"audio/vorbis" = [mediaPlayer];
"audio/x-vorbis" = [mediaPlayer];
"audio/x-vorbis+ogg" = [mediaPlayer];
"audio/x-shorten" = [mediaPlayer];
"audio/x-ape" = [mediaPlayer];
"audio/x-wavpack" = [mediaPlayer];
"audio/x-tta" = [mediaPlayer];
"audio/AMR" = [mediaPlayer];
"audio/ac3" = [mediaPlayer];
"audio/eac3" = [mediaPlayer];
"audio/amr-wb" = [mediaPlayer];
"audio/flac" = [mediaPlayer];
"audio/mp4" = [mediaPlayer];
"audio/x-pn-au" = [mediaPlayer];
"audio/3gpp" = [mediaPlayer];
"audio/3gpp2" = [mediaPlayer];
"audio/dv" = [mediaPlayer];
"audio/opus" = [mediaPlayer];
"audio/x-ms-asf" = [mediaPlayer];
"audio/vnd.dts" = [mediaPlayer];
"audio/vnd.dts.hd" = [mediaPlayer];
"audio/x-adpcm" = [mediaPlayer];
"audio/m3u" = [mediaPlayer];
"audio/aac" = [mediaPlayer];
"audio/x-aac" = [mediaPlayer];
"audio/vnd.dolby.heaac.1" = [mediaPlayer];
"audio/vnd.dolby.heaac.2" = [mediaPlayer];
"audio/aiff" = [mediaPlayer];
"audio/x-aiff" = [mediaPlayer];
"audio/m4a" = [mediaPlayer];
"audio/x-m4a" = [mediaPlayer];
"audio/mp1" = [mediaPlayer];
"audio/x-mp1" = [mediaPlayer];
"audio/mp2" = [mediaPlayer];
"audio/x-mp2" = [mediaPlayer];
"audio/mp3" = [mediaPlayer];
"audio/x-mp3" = [mediaPlayer];
"audio/mpeg" = [mediaPlayer];
"audio/mpeg2" = [mediaPlayer];
"audio/mpeg3" = [mediaPlayer];
"audio/mpegurl" = [mediaPlayer];
"audio/x-mpegurl" = [mediaPlayer];
"audio/mpg" = [mediaPlayer];
"audio/x-mpg" = [mediaPlayer];
"audio/rn-mpeg" = [mediaPlayer];
"audio/musepack" = [mediaPlayer];
"audio/x-musepack" = [mediaPlayer];
"audio/ogg" = [mediaPlayer];
"audio/scpls" = [mediaPlayer];
"audio/x-scpls" = [mediaPlayer];
"audio/vnd.rn-realaudio" = [mediaPlayer];
"audio/wav" = [mediaPlayer];
"audio/x-pn-wav" = [mediaPlayer];
"audio/x-pn-windows-pcm" = [mediaPlayer];
"audio/x-realaudio" = [mediaPlayer];
"audio/x-pn-realaudio" = [mediaPlayer];
"audio/x-ms-wma" = [mediaPlayer];
"audio/x-pls" = [mediaPlayer];
"audio/x-wav" = [mediaPlayer];
# Document Viewer
"application/pdf" = [documentViewer];
"application/epub" = [documentViewer];
"application/djvu" = [documentViewer];
"application/mobi" = [documentViewer];
# File & archive manager(s)
"inode/directory" = [fileManager]; "inode/directory" = [fileManager];
"application/zip" = [archiveManager]; "application/zip" = [archiveManager];
"application/x-xz-compressed-tar" = [archiveManager]; "application/x-xz-compressed-tar" = [archiveManager];
# Plain-text "image/*" = [imageViewer];
"audio/*" = [audioPlayer];
"video/*" = [videoPlayer];
# The wildcard associations don't work everywhere, so we
# still need specific ones
"image/jpeg" = [imageViewer];
"image/png" = [imageViewer];
"image/svg+xml" = [imageViewer];
"image/gif" = [imageViewer];
"video/mp4" = [videoPlayer];
"text/plain" = [textEditor]; "text/plain" = [textEditor];
"application/json" = [textEditor]; "application/json" = [textEditor];
# Application specific schemes
"x-scheme-handler/spotify" = ["spotify.desktop"]; "x-scheme-handler/spotify" = ["spotify.desktop"];
"x-scheme-handler/tg" = ["telegramdesktop.desktop"]; "x-scheme-handler/tg" = ["telegramdesktop.desktop"];
"x-scheme-handler/discord" = ["vesktop.desktop"]; "x-scheme-handler/discord" = ["vesktop.desktop"];
"x-scheme-handler/msteams" = ["teams.desktop"]; # I need it for school, don't judge me "x-scheme-handler/msteams" = ["teams.desktop"]; # I need it for school, don't judge me
# Misc
"x-scheme-handler/mailto" = [emailClient];
}; };
in { in {
enable = true; enable = true;

View file

@ -30,6 +30,7 @@
username = "itsdrike"; username = "itsdrike";
sound.enable = true; sound.enable = true;
bluetooth.enable = true;
impermanence = { impermanence = {
root = { root = {
@ -60,7 +61,6 @@
cpu.type = "amd"; cpu.type = "amd";
gpu.type = "hybrid-nvidia"; gpu.type = "hybrid-nvidia";
hasTPM = true; hasTPM = true;
bluetooth.enable = true;
}; };
security = { security = {

View file

@ -35,6 +35,7 @@
username = "itsdrike"; username = "itsdrike";
sound.enable = true; sound.enable = true;
bluetooth.enable = true;
impermanence = { impermanence = {
root = { root = {
@ -114,7 +115,6 @@
cpu.type = "amd"; cpu.type = "amd";
gpu.type = "amd"; gpu.type = "amd";
hasTPM = true; hasTPM = true;
bluetooth.enable = true;
}; };
security = { security = {

View file

@ -1,5 +1,4 @@
{ lib, ... }: let { lib, ... }: with lib; let
inherit (lib) mkOption mkEnableOption types;
in in
{ {
options.myOptions.device = { options.myOptions.device = {
@ -35,25 +34,9 @@ in
}; };
hasTPM = mkOption { hasTPM = mkOption {
type = types.bool; type = lib.types.bool;
default = false; default = false;
description = "Does this device have a TPM (Trusted Platform Module)?"; description = "Does this device have a TPM (Trusted Platform Module)?";
}; };
bluetooth = {
enable = mkEnableOption "bluetooth modules, drivers and configuration program(s)";
powerOnBoot = mkOption {
type = types.bool;
default = false;
description = ''
Should bluetooth be powered on automatically during boot?
This will worsen the battery life and is not recommended. Instead, you can
always turn bluetooth on manually once booted, when you need it. Unless you
have constant need for bluetooth / have some devices to connect to automatically
you, leave this off.
'';
};
};
}; };
} }

View file

@ -6,14 +6,14 @@
}: let }: let
inherit (lib) mkIf; inherit (lib) mkIf;
cfg = config.myOptions.device.bluetooth; sys = config.myOptions.system.bluetooth;
in { in {
config = mkIf cfg.enable { config = mkIf sys.enable {
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = true;
package = pkgs.bluez5-experimental; package = pkgs.bluez5-experimental;
powerOnBoot = cfg.powerOnBoot;
#hsphfpd.enable = true; #hsphfpd.enable = true;
powerOnBoot = true;
disabledPlugins = ["sap"]; disabledPlugins = ["sap"];
settings = { settings = {
General = { General = {