if else options added to config

This commit is contained in:
foglar 2024-12-25 19:16:22 +01:00
parent fdce9542ef
commit 0d45744904
6 changed files with 192 additions and 74 deletions

View File

@ -1,41 +0,0 @@
MenuBar=Disabled
[$Version]
update_info=dolphin_detailsmodesettings.upd:rename-leading-padding
[General]
ShowSelectionToggle=false
ShowStatusBar=false
Version=202
ViewPropsTimestamp=2023,4,26,16,58,48.324
[IconsMode]
MaximumTextLines=1
PreviewSize=112
[InformationPanel]
dateFormat=ShortFormat
[KFileDialog Settings]
Places Icons Auto-resize=false
Places Icons Static Size=16
[KPropertiesDialog]
1920x1080 screen: Window-Maximized=true
[MainWindow]
MenuBar=Disabled
ToolBarsMovable=Disabled
[MainWindow][Toolbar mainToolBar]
IconSize=16
ToolButtonStyle=IconOnly
[PlacesPanel]
IconSize=16
[PreviewSettings]
Plugins=appimagethumbnail,audiothumbnail,comicbookthumbnail,cursorthumbnail,djvuthumbnail,ebookthumbnail,exrthumbnail,imagethumbnail,jpegthumbnail,kraorathumbnail,windowsexethumbnail,windowsimagethumbnail,opendocumentthumbnail,svgthumbnail,ffmpegthumbs
[Toolbar mainToolBar]
ToolButtonStyle=IconOnly

View File

@ -54,13 +54,13 @@
...
} @ inputs: let
userSettings = {
username = "foglar";
username = "foglar"; # konsta or foglar (else defaulting to foglar or none)
hostname = "laptop";
shell = "bash"; # bash, zsh
terminal = "kitty";
browser = "librewolf";
editor = "neovim";
terminal = "kitty"; # kitty, alacritty
browser = "librewolf"; # firefox, librewolf, qutebrowser
editor = "neovim"; # neovim, vscode
# List all themes: $ nix build nixpkgs#base16-schemes && ls result/share/themes
theme = "catppuccin-mocha"; #tokyo-night-dark, one-dark

View File

@ -2,6 +2,8 @@
config,
lib,
inputs,
pkgs,
userSettings,
...
}: {
options = {
@ -13,15 +15,137 @@
enable = true;
profiles.default = {
search.engines = {
"Nix Packages" = {
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
extensions = with inputs.firefox-addons.packages."x86_64-linux"; [
#enhancer-for-youtube
ublock-origin
simple-translate
duckduckgo-privacy-essentials
return-youtube-dislikes
user-agent-string-switcher
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@np"];
};
"Phind" = {
urls = [
{
template = "https://www.phind.com/search";
params = [
{
name = "q";
value = "{searchTerms}";
}
{
name = "searchMode";
value = "always";
}
{
name = "allowMultiSearch";
value = "false";
}
];
}
];
icon = "https://www.phind.com/favicon.ico";
definedAliases = ["@phind"];
};
};
search.force = true;
settings = {
"dom.security.https_only_mode" = true;
"privacy.clearOnShutdown.history" = true;
#"identity.fxaccounts.enabled" = false;
#"signon.rememberSignons" = false;
};
bookmarks = [
{
name = "Toolbar";
toolbar = true;
bookmarks = [
{
name = "Server";
bookmarks = [
{
name = "AudioBookshelf";
tags = ["audiobookshelf"];
keyword = "audio";
url = "http://foglar.local:8080";
}
{
name = "Photos";
tags = ["photoprism"];
keyword = "photos";
url = "http://foglar.local:2342";
}
{
name = "E-books";
tags = ["Kavita"];
keyword = "kavita";
url = "http://foglar.local:5000";
}
{
name = "Films";
tags = ["jellyfin"];
keyword = "films";
url = "http://foglar.local:8097";
}
{
name = "CasaOS";
tags = ["casaos"];
keyword = "casa";
url = "http://foglar.local:7788";
}
{
name = "Torrent";
tags = ["qbittorrent"];
keyword = "torrent";
url = "http://foglar.local:8181/";
}
{
name = "Syncthing";
tags = ["syncthing"];
keyword = "sync";
url = "https://foglar.local:8384/";
}
{
name = "Git";
tags = ["gitea"];
keyword = "git";
url = "https://git.foglar.tech";
}
];
}
];
}
];
extensions = with inputs.firefox-addons.packages."x86_64-linux";
[
ublock-origin
]
++ (
if (userSettings.username == "foglar")
then [
inputs.firefox-addons.packages."x86_64-linux".simple-translate
inputs.firefox-addons.packages."x86_64-linux".duckduckgo-privacy-essentials
inputs.firefox-addons.packages."x86_64-linux".return-youtube-dislikes
inputs.firefox-addons.packages."x86_64-linux".user-agent-string-switcher
]
else []
);
};
};
};

View File

@ -1,6 +1,7 @@
{
pkgs,
lib,
userSettings,
...
}: {
imports = [
@ -30,26 +31,32 @@
};
program = {
kitty.enable = lib.mkDefault true;
kitty.enable =
if userSettings.terminal == "kitty"
then lib.mkDefault true
else lib.mkDefault false;
tmux.enable = lib.mkDefault true;
zoxide.enable = lib.mkDefault true;
firefox.enable = lib.mkDefault true;
firefox.enable =
if userSettings.browser == "firefox"
then lib.mkDefault true
else lib.mkDefault false;
spotify.enable = lib.mkDefault true;
vscode = {
enable = lib.mkDefault true;
ide = {
python.enable = lib.mkDefault true;
go.enable = lib.mkDefault true;
csharp.enable = lib.mkDefault true;
python.enable = lib.mkDefault false;
go.enable = lib.mkDefault false;
csharp.enable = lib.mkDefault false;
cpp.enable = lib.mkDefault false;
web.enable = lib.mkDefault true;
web.enable = lib.mkDefault false;
};
nix.enable = lib.mkDefault true;
markdown.enable = lib.mkDefault true;
ai.enable = lib.mkDefault true;
git.enable = lib.mkDefault true;
nix.enable = lib.mkDefault false;
markdown.enable = lib.mkDefault false;
ai.enable = lib.mkDefault false;
git.enable = lib.mkDefault false;
themes.enable = lib.mkDefault false;
};

View File

@ -6,10 +6,15 @@
...
}: {
options = {
default-applications.enable = lib.mkEnableOption "Enable default applications";
sys.default-applications.enable = lib.mkEnableOption "Enable default applications";
xdg.da.browser = lib.mkOption {
type = lib.types.str;
default = "firefox";
description = "Default browser";
};
};
config = lib.mkIf config.default-applications.enable {
config = lib.mkIf config.sys.default-applications.enable {
environment.sessionVariables = {
DEFAULT_BROWSER = "${pkgs."${userSettings.browser}"}/bin/${userSettings.browser}";
TERMINAL = "${pkgs."${userSettings.terminal}"}/bin/${userSettings.terminal}";
@ -18,14 +23,25 @@
# Default applications configuration
xdg.mime.enable = true;
xdg.da.browser =
if userSettings.browser == "qutebrowser"
then "org.qutebrowser.qutebrowser"
else
(
if userSettings.browser == "librewolf"
then "librewolf"
else "firefox"
);
xdg.mime.defaultApplications = {
"text/html" = "librewolf.desktop";
"x-scheme-handler/http" = "librewolf.desktop";
"x-scheme-handler/https" = "librewolf.desktop";
"x-scheme-handler/about" = "librewolf.desktop";
"x-scheme-handler/unknown" = "librewolf.desktop";
"text/plain" = "nvim.desktop";
"application/pdf" = "evince";
"text/html" = "${config.xdg.da.browser}.desktop";
"x-scheme-handler/http" = "${config.xdg.da.browser}.desktop";
"x-scheme-handler/https" = "${config.xdg.da.browser}.desktop";
"x-scheme-handler/about" = "${config.xdg.da.browser}.desktop";
"x-scheme-handler/unknown" = "${config.xdg.da.browser}.desktop";
"text/plain" = "${userSettings.editor}.desktop";
"application/pdf" = "org.gnome.Evince.desktop";
};
};
}

View File

@ -37,8 +37,21 @@
vscode = {
enable = true;
ide = {
python.enable = true;
go.enable = true;
csharp.enable = true;
cpp.enable = false;
web.enable = true;
};
nix.enable = true;
markdown.enable = true;
ai.enable = true;
git.enable = true;
themes.enable = false;
};
git.enable = true;
neovim.enable = true;
@ -57,7 +70,6 @@
".config/hypr/hyprlock.conf".source = ../config/hyprlock.conf;
".config/hypr/mocha.conf".source = ../config/mocha.conf;
".config/hypr/hypridle.conf".source = ../config/hypridle.conf;
#".config/dolphinrc".source = ../config/dolphinrc;
".prettierrc".text = ''
{
"tabWidth": 4,