style: avoid repeated keys in modules

This commit is contained in:
Leon Schwarzäugl 2025-03-21 20:00:14 +01:00
parent 34b7222665
commit 658d2bb7ba
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
16 changed files with 840 additions and 760 deletions

View file

@ -3760,12 +3760,16 @@ This lets me set some basic flags about the hardware of the configured systems.
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.hasBluetooth = lib.mkEnableOption "bluetooth availability"; options.swarselsystems = {
options.swarselsystems.hasFingerprint = lib.mkEnableOption "fingerprint sensor availability"; hasBluetooth = lib.mkEnableOption "bluetooth availability";
options.swarselsystems.trackpoint.isAvailable = lib.mkEnableOption "trackpoint availability"; hasFingerprint = lib.mkEnableOption "fingerprint sensor availability";
options.swarselsystems.trackpoint.device = lib.mkOption { trackpoint = {
type = lib.types.str; isAvailable = lib.mkEnableOption "trackpoint availability";
default = ""; trackpoint.device = lib.mkOption {
type = lib.types.str;
default = "";
};
};
}; };
} }
#+end_src #+end_src
@ -3780,31 +3784,33 @@ I usually use =mutableUsers = false= in my NixOS configuration. However, on a ne
#+begin_src nix :tangle modules/nixos/setup.nix #+begin_src nix :tangle modules/nixos/setup.nix
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.user = lib.mkOption { options.swarselsystems = {
type = lib.types.str; user = lib.mkOption {
default = "swarsel"; type = lib.types.str;
}; default = "swarsel";
options.swarselsystems.withHomeManager = lib.mkOption { };
type = lib.types.bool; withHomeManager = lib.mkOption {
default = true; type = lib.types.bool;
}; default = true;
options.swarselsystems.isSwap = lib.mkOption { };
type = lib.types.bool; isSwap = lib.mkOption {
default = true; type = lib.types.bool;
}; default = true;
options.swarselsystems.swapSize = lib.mkOption { };
type = lib.types.str; swapSize = lib.mkOption {
default = "8G"; type = lib.types.str;
}; default = "8G";
options.swarselsystems.rootDisk = lib.mkOption { };
type = lib.types.str; rootDisk = lib.mkOption {
default = ""; type = lib.types.str;
}; default = "";
options.swarselsystems.isCrypted = lib.mkEnableOption "uses full disk encryption"; };
options.swarselsystems.initialSetup = lib.mkEnableOption "initial setup (no sops keys available)"; isCrypted = lib.mkEnableOption "uses full disk encryption";
initialSetup = lib.mkEnableOption "initial setup (no sops keys available)";
options.swarselsystems.isImpermanence = lib.mkEnableOption "use impermanence on this system"; isImpermanence = lib.mkEnableOption "use impermanence on this system";
options.swarselsystems.isSecureBoot = lib.mkEnableOption "use secure boot on this system"; isSecureBoot = lib.mkEnableOption "use secure boot on this system";
};
} }
#+end_src #+end_src
@ -3816,25 +3822,29 @@ I usually use =mutableUsers = false= in my NixOS configuration. However, on a ne
#+begin_src nix :tangle modules/nixos/server.nix #+begin_src nix :tangle modules/nixos/server.nix
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.server.enable = lib.mkEnableOption "is a server machine"; options.swarselsystems = {
options.swarselsystems.server.kavita = lib.mkEnableOption "enable kavita on server"; server = {
options.swarselsystems.server.jellyfin = lib.mkEnableOption "enable jellyfin on server"; enable = lib.mkEnableOption "is a server machine";
options.swarselsystems.server.navidrome = lib.mkEnableOption "enable navidrome on server"; kavita = lib.mkEnableOption "enable kavita on server";
options.swarselsystems.server.spotifyd = lib.mkEnableOption "enable spotifyd on server"; jellyfin = lib.mkEnableOption "enable jellyfin on server";
options.swarselsystems.server.mpd = lib.mkEnableOption "enable mpd on server"; navidrome = lib.mkEnableOption "enable navidrome on server";
options.swarselsystems.server.matrix = lib.mkEnableOption "enable matrix on server"; spotifyd = lib.mkEnableOption "enable spotifyd on server";
options.swarselsystems.server.nextcloud = lib.mkEnableOption "enable nextcloud on server"; mpd = lib.mkEnableOption "enable mpd on server";
options.swarselsystems.server.immich = lib.mkEnableOption "enable immich on server"; matrix = lib.mkEnableOption "enable matrix on server";
options.swarselsystems.server.paperless = lib.mkEnableOption "enable paperless on server"; nextcloud = lib.mkEnableOption "enable nextcloud on server";
options.swarselsystems.server.transmission = lib.mkEnableOption "enable transmission and friends on server"; immich = lib.mkEnableOption "enable immich on server";
options.swarselsystems.server.syncthing = lib.mkEnableOption "enable syncthing on server"; paperless = lib.mkEnableOption "enable paperless on server";
options.swarselsystems.server.restic = lib.mkEnableOption "enable restic backups on server"; transmission = lib.mkEnableOption "enable transmission and friends on server";
options.swarselsystems.server.monitoring = lib.mkEnableOption "enable monitoring on server"; syncthing = lib.mkEnableOption "enable syncthing on server";
options.swarselsystems.server.jenkins = lib.mkEnableOption "enable jenkins on server"; restic = lib.mkEnableOption "enable restic backups on server";
options.swarselsystems.server.emacs = lib.mkEnableOption "enable emacs server on server"; monitoring = lib.mkEnableOption "enable monitoring on server";
options.swarselsystems.server.forgejo = lib.mkEnableOption "enable forgejo on server"; jenkins = lib.mkEnableOption "enable jenkins on server";
options.swarselsystems.server.ankisync = lib.mkEnableOption "enable ankisync on server"; emacs = lib.mkEnableOption "enable emacs server on server";
options.swarselsystems.server.freshrss = lib.mkEnableOption "enable freshrss on server"; forgejo = lib.mkEnableOption "enable forgejo on server";
ankisync = lib.mkEnableOption "enable ankisync on server";
freshrss = lib.mkEnableOption "enable freshrss on server";
};
};
} }
#+end_src #+end_src
@ -3868,33 +3878,38 @@ Laptops are not always plugged in, so they should show a battery icon in Waybar.
#+begin_src nix :tangle modules/home/laptop.nix #+begin_src nix :tangle modules/home/laptop.nix
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.isLaptop = lib.mkEnableOption "laptop host"; options.swarselsystems = {
config.swarselsystems.touchpad = lib.mkIf config.swarselsystems.isLaptop { isLaptop = lib.mkEnableOption "laptop host";
"type:touchpad" = { };
dwt = "enabled";
tap = "enabled"; config.swarselsystems = {
natural_scroll = "enabled"; touchpad = lib.mkIf config.swarselsystems.isLaptop {
middle_emulation = "enabled"; "type:touchpad" = {
drag_lock = "disabled"; dwt = "enabled";
}; tap = "enabled";
natural_scroll = "enabled";
middle_emulation = "enabled";
drag_lock = "disabled";
};
};
waybarModules = lib.mkIf config.swarselsystems.isLaptop [
"custom/outer-left-arrow-dark"
"mpris"
"custom/left-arrow-light"
"network"
"custom/vpn"
"custom/left-arrow-dark"
"pulseaudio"
"custom/left-arrow-light"
"battery"
"custom/left-arrow-dark"
"group/hardware"
"custom/left-arrow-light"
"clock#2"
"custom/left-arrow-dark"
"clock#1"
];
}; };
config.swarselsystems.waybarModules = lib.mkIf config.swarselsystems.isLaptop [
"custom/outer-left-arrow-dark"
"mpris"
"custom/left-arrow-light"
"network"
"custom/vpn"
"custom/left-arrow-dark"
"pulseaudio"
"custom/left-arrow-light"
"battery"
"custom/left-arrow-dark"
"group/hardware"
"custom/left-arrow-light"
"clock#2"
"custom/left-arrow-dark"
"clock#1"
];
} }
#+end_src #+end_src
@ -3908,18 +3923,22 @@ This section is mostly used to deliver the correct information to Waybar. AMD sy
#+begin_src nix :tangle modules/home/hardware.nix #+begin_src nix :tangle modules/home/hardware.nix
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.cpuCount = lib.mkOption { options.swarselsystems = {
type = lib.types.int; cpuCount = lib.mkOption {
default = 8; type = lib.types.int;
}; default = 8;
options.swarselsystems.temperatureHwmon.isAbsolutePath = lib.mkEnableOption "absolute temperature path"; };
options.swarselsystems.temperatureHwmon.path = lib.mkOption { temperatureHwmon = {
type = lib.types.str; isAbsolutePath = lib.mkEnableOption "absolute temperature path";
default = ""; path = lib.mkOption {
}; type = lib.types.str;
options.swarselsystems.temperatureHwmon.input-filename = lib.mkOption { default = "";
type = lib.types.str; };
default = ""; input-filename = lib.mkOption {
type = lib.types.str;
default = "";
};
};
}; };
} }
#+end_src #+end_src
@ -3939,32 +3958,34 @@ The most part of this configuration is done here: [[#h:0bf51f63-01c0-4053-a591-7
generateIcons = n: lib.concatStringsSep " " (builtins.map (x: "{icon" + toString x + "}") (lib.range 0 (n - 1))); generateIcons = n: lib.concatStringsSep " " (builtins.map (x: "{icon" + toString x + "}") (lib.range 0 (n - 1)));
in in
{ {
options.swarselsystems.cpuString = lib.mkOption { options.swarselsystems = {
type = lib.types.str; cpuString = lib.mkOption {
default = generateIcons config.swarselsystems.cpuCount; type = lib.types.str;
description = "The generated icons string for use by Waybar."; default = generateIcons config.swarselsystems.cpuCount;
internal = true; description = "The generated icons string for use by Waybar.";
}; internal = true;
options.swarselsystems.waybarModules = lib.mkOption { };
type = lib.types.listOf lib.types.str; waybarModules = lib.mkOption {
default = [ type = lib.types.listOf lib.types.str;
"custom/outer-left-arrow-dark" default = [
"mpris" "custom/outer-left-arrow-dark"
"custom/left-arrow-light" "mpris"
"network" "custom/left-arrow-light"
"custom/vpn" "network"
"custom/left-arrow-dark" "custom/vpn"
"pulseaudio" "custom/left-arrow-dark"
"custom/left-arrow-light" "pulseaudio"
"custom/pseudobat" "custom/left-arrow-light"
"battery" "custom/pseudobat"
"custom/left-arrow-dark" "battery"
"group/hardware" "custom/left-arrow-dark"
"custom/left-arrow-light" "group/hardware"
"clock#2" "custom/left-arrow-light"
"custom/left-arrow-dark" "clock#2"
"clock#1" "custom/left-arrow-dark"
]; "clock#1"
];
};
}; };
} }
#+end_src #+end_src
@ -3979,21 +4000,23 @@ This allows me to define my monitors in the machine's =default.nix=.
#+begin_src nix :tangle modules/home/monitors.nix #+begin_src nix :tangle modules/home/monitors.nix
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.monitors = lib.mkOption { options.swarselsystems = {
type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); monitors = lib.mkOption {
default = { }; type = lib.types.attrsOf (lib.types.attrsOf lib.types.str);
}; default = { };
options.swarselsystems.sharescreen = lib.mkOption { };
type = lib.types.str; sharescreen = lib.mkOption {
default = ""; type = lib.types.str;
}; default = "";
options.swarselsystems.lowResolution = lib.mkOption { };
type = lib.types.str; lowResolution = lib.mkOption {
default = ""; type = lib.types.str;
}; default = "";
options.swarselsystems.highResolution = lib.mkOption { };
type = lib.types.str; highResolution = lib.mkOption {
default = ""; type = lib.types.str;
default = "";
};
}; };
} }
#+end_src #+end_src
@ -4008,39 +4031,41 @@ This allows me to configure input options. Here, I am globally defining my split
#+begin_src nix :tangle modules/home/input.nix #+begin_src nix :tangle modules/home/input.nix
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.inputs = lib.mkOption { options.swarselsystems = {
type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); inputs = lib.mkOption {
default = { }; type = lib.types.attrsOf (lib.types.attrsOf lib.types.str);
}; default = { };
options.swarselsystems.kyria = lib.mkOption { };
type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); kyria = lib.mkOption {
default = { type = lib.types.attrsOf (lib.types.attrsOf lib.types.str);
"36125:53060:splitkb.com_splitkb.com_Kyria_rev3" = { default = {
xkb_layout = "us"; "36125:53060:splitkb.com_splitkb.com_Kyria_rev3" = {
xkb_variant = "altgr-intl"; xkb_layout = "us";
}; xkb_variant = "altgr-intl";
"7504:24926:Kyria_Keyboard" = { };
xkb_layout = "us"; "7504:24926:Kyria_Keyboard" = {
xkb_variant = "altgr-intl"; xkb_layout = "us";
xkb_variant = "altgr-intl";
};
}; };
}; };
}; touchpad = lib.mkOption {
options.swarselsystems.touchpad = lib.mkOption { type = lib.types.attrsOf (lib.types.attrsOf lib.types.str);
type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); default = { };
default = { }; };
}; standardinputs = lib.mkOption {
options.swarselsystems.standardinputs = lib.mkOption { type = lib.types.attrsOf (lib.types.attrsOf lib.types.str);
type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); default = lib.recursiveUpdate (lib.recursiveUpdate config.swarselsystems.touchpad config.swarselsystems.kyria) config.swarselsystems.inputs;
default = lib.recursiveUpdate (lib.recursiveUpdate config.swarselsystems.touchpad config.swarselsystems.kyria) config.swarselsystems.inputs; internal = true;
internal = true; };
}; keybindings = lib.mkOption {
options.swarselsystems.keybindings = lib.mkOption { type = lib.types.attrsOf lib.types.str;
type = lib.types.attrsOf lib.types.str; default = { };
default = { }; };
}; shellAliases = lib.mkOption {
options.swarselsystems.shellAliases = lib.mkOption { type = lib.types.attrsOf lib.types.str;
type = lib.types.attrsOf lib.types.str; default = { };
default = { }; };
}; };
} }
#+end_src #+end_src
@ -4055,37 +4080,41 @@ These are some extra options that will be used if the machine also runs NixOS. F
#+begin_src nix :noweb yes :tangle modules/home/nixos.nix #+begin_src nix :noweb yes :tangle modules/home/nixos.nix
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.flakePath = lib.mkOption { options.swarselsystems = {
type = lib.types.str; flakePath = lib.mkOption {
default = ""; type = lib.types.str;
default = "";
};
isNixos = lib.mkEnableOption "nixos host";
isPublic = lib.mkEnableOption "is a public machine (no secrets)";
swayfxConfig = lib.mkOption {
type = lib.types.str;
default = "
blur enable
blur_xray disable
blur_passes 1
blur_radius 1
shadows enable
corner_radius 2
titlebar_separator disable
default_dim_inactive 0.02
";
internal = true;
};
}; };
options.swarselsystems.isNixos = lib.mkEnableOption "nixos host";
options.swarselsystems.isPublic = lib.mkEnableOption "is a public machine (no secrets)";
config.swarselsystems.startup = lib.mkIf (!config.swarselsystems.isNixos) [
{ command = "sleep 60 && nixGL nextcloud --background"; }
{ command = "sleep 60 && nixGL vesktop --start-minimized -enable-features=UseOzonePlatform -ozone-platform=wayland"; }
{ command = "sleep 60 && nixGL syncthingtray --wait"; }
{ command = "sleep 60 && ANKI_WAYLAND=1 nixGL anki"; }
{ command = "nm-applet --indicator"; }
{ command = "sleep 60 && OBSIDIAN_USE_WAYLAND=1 nixGL obsidian -enable-features=UseOzonePlatform -ozone-platform=wayland"; }
{ command = "sleep 60 && element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
];
options.swarselsystems.swayfxConfig = lib.mkOption { config.swarselsystems = {
type = lib.types.str; startup = lib.mkIf (!config.swarselsystems.isNixos) [
default = " { command = "sleep 60 && nixGL nextcloud --background"; }
blur enable { command = "sleep 60 && nixGL vesktop --start-minimized -enable-features=UseOzonePlatform -ozone-platform=wayland"; }
blur_xray disable { command = "sleep 60 && nixGL syncthingtray --wait"; }
blur_passes 1 { command = "sleep 60 && ANKI_WAYLAND=1 nixGL anki"; }
blur_radius 1 { command = "nm-applet --indicator"; }
shadows enable { command = "sleep 60 && OBSIDIAN_USE_WAYLAND=1 nixGL obsidian -enable-features=UseOzonePlatform -ozone-platform=wayland"; }
corner_radius 2 { command = "sleep 60 && element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
titlebar_separator disable ];
default_dim_inactive 0.02 swayfxConfig = lib.mkIf (!config.swarselsystems.isNixos) " ";
";
internal = true;
}; };
config.swarselsystems.swayfxConfig = lib.mkIf (!config.swarselsystems.isNixos) " ";
} }
#+end_src #+end_src
@ -4099,8 +4128,10 @@ Provides settings related to nix-darwin systems. At the moment, I am only making
#+begin_src nix :noweb yes :tangle modules/home/setup.nix #+begin_src nix :noweb yes :tangle modules/home/setup.nix
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.isDarwin = lib.mkEnableOption "darwin host"; options.swarselsystems = {
options.swarselsystems.isLinux = lib.mkEnableOption "whether this is a linux machine"; isDarwin = lib.mkEnableOption "darwin host";
isLinux = lib.mkEnableOption "whether this is a linux machine";
};
} }
#+end_src #+end_src
@ -4122,17 +4153,19 @@ Do not that =syncthingtray= is also not mentioned here. It is installed as a hom
#+begin_src nix :tangle modules/home/startup.nix #+begin_src nix :tangle modules/home/startup.nix
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.startup = lib.mkOption { options.swarselsystems = {
type = lib.types.listOf (lib.types.attrsOf lib.types.str); startup = lib.mkOption {
default = [ type = lib.types.listOf (lib.types.attrsOf lib.types.str);
{ command = "nextcloud --background"; } default = [
{ command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; } { command = "nextcloud --background"; }
{ command = "element-desktop --hidden --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; } { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; }
{ command = "ANKI_WAYLAND=1 anki"; } { command = "element-desktop --hidden --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
{ command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; } { command = "ANKI_WAYLAND=1 anki"; }
{ command = "nm-applet"; } { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
{ command = "feishin"; } { command = "nm-applet"; }
]; { command = "feishin"; }
];
};
}; };
} }
#+end_src #+end_src
@ -4147,9 +4180,11 @@ Again, I set the wallpaper here for =stylix=.
#+begin_src nix :tangle modules/home/wallpaper.nix #+begin_src nix :tangle modules/home/wallpaper.nix
{ self, lib, ... }: { self, lib, ... }:
{ {
options.swarselsystems.wallpaper = lib.mkOption { options.swarselsystems = {
type = lib.types.path; wallpaper = lib.mkOption {
default = self + /wallpaper/lenovowp.png; type = lib.types.path;
default = self + /wallpaper/lenovowp.png;
};
}; };
} }
@ -4165,7 +4200,9 @@ Another duplicated option for the filesystem.
#+begin_src nix :tangle modules/home/filesystem.nix #+begin_src nix :tangle modules/home/filesystem.nix
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.isBtrfs = lib.mkEnableOption "use btrfs filesystem"; options.swarselsystems = {
isBtrfs = lib.mkEnableOption "use btrfs filesystem";
};
} }
#+end_src #+end_src
@ -4191,148 +4228,149 @@ Set in firefox =about:config > toolkit.legacyUserProfileCustomizations.styleshee
}; };
in in
{ {
options.swarselsystems.firefox = lib.mkOption { options.swarselsystems = {
type = lib.types.attrs; firefox = lib.mkOption {
default = { type = lib.types.attrs;
isDefault = false; default = {
userChrome = builtins.readFile "${self}/programs/firefox/chrome/userChrome.css"; isDefault = false;
extensions = { userChrome = builtins.readFile "${self}/programs/firefox/chrome/userChrome.css";
packages = with pkgs.nur.repos.rycee.firefox-addons; [ extensions = {
tridactyl packages = with pkgs.nur.repos.rycee.firefox-addons; [
tampermonkey tridactyl
sidebery tampermonkey
browserpass sidebery
clearurls browserpass
darkreader clearurls
enhancer-for-youtube darkreader
istilldontcareaboutcookies enhancer-for-youtube
translate-web-pages istilldontcareaboutcookies
ublock-origin translate-web-pages
reddit-enhancement-suite ublock-origin
sponsorblock reddit-enhancement-suite
web-archives sponsorblock
onepassword-password-manager web-archives
single-file onepassword-password-manager
widegithub single-file
enhanced-github widegithub
unpaywall enhanced-github
don-t-fuck-with-paste unpaywall
plasma-integration don-t-fuck-with-paste
(buildFirefoxXpiAddon { plasma-integration
pname = "shortkeys"; (buildFirefoxXpiAddon {
version = "4.0.2"; pname = "shortkeys";
addonId = "Shortkeys@Shortkeys.com"; version = "4.0.2";
url = "https://addons.mozilla.org/firefox/downloads/file/3673761/shortkeys-4.0.2.xpi"; addonId = "Shortkeys@Shortkeys.com";
sha256 = "c6fe12efdd7a871787ac4526eea79ecc1acda8a99724aa2a2a55c88a9acf467c"; url = "https://addons.mozilla.org/firefox/downloads/file/3673761/shortkeys-4.0.2.xpi";
meta = with lib; sha256 = "c6fe12efdd7a871787ac4526eea79ecc1acda8a99724aa2a2a55c88a9acf467c";
{ meta = with lib;
description = "Easily customizable custom keyboard shortcuts for Firefox. To configure this addon go to Addons (ctrl+shift+a) ->Shortkeys ->Options. Report issues here (please specify that the issue is found in Firefox): https://github.com/mikecrittenden/shortkeys"; {
mozPermissions = [ description = "Easily customizable custom keyboard shortcuts for Firefox. To configure this addon go to Addons (ctrl+shift+a) ->Shortkeys ->Options. Report issues here (please specify that the issue is found in Firefox): https://github.com/mikecrittenden/shortkeys";
"tabs" mozPermissions = [
"downloads" "tabs"
"clipboardWrite" "downloads"
"browsingData" "clipboardWrite"
"storage" "browsingData"
"bookmarks" "storage"
"sessions" "bookmarks"
"<all_urls>" "sessions"
"<all_urls>"
];
platforms = platforms.all;
};
})
];
};
settings =
{
"extensions.autoDisableScopes" = 0;
"browser.bookmarks.showMobileBookmarks" = lock-true;
"toolkit.legacyUserProfileCustomizations.stylesheets" = lock-true;
"browser.search.suggest.enabled" = lock-false;
"browser.search.suggest.enabled.private" = lock-false;
"browser.urlbar.suggest.searches" = lock-false;
"browser.urlbar.showSearchSuggestionsFirst" = lock-false;
"browser.topsites.contile.enabled" = lock-false;
"browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false;
"browser.newtabpage.activity-stream.feeds.snippets" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false;
"browser.newtabpage.activity-stream.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.system.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false;
};
search = {
default = "Kagi";
privateDefault = "Kagi";
engines = {
"Kagi" = {
urls = [{
template = "https://kagi.com/search";
params = [
{ name = "q"; value = "{searchTerms}"; }
]; ];
platforms = platforms.all; }];
}; iconUpdateURL = "https://kagi.com/favicon.ico";
}) updateInterval = 24 * 60 * 60 * 1000; # every day
]; definedAliases = [ "@k" ];
}; };
settings = "Nix Packages" = {
{ urls = [{
"extensions.autoDisableScopes" = 0; template = "https://search.nixos.org/packages";
"browser.bookmarks.showMobileBookmarks" = lock-true; params = [
"toolkit.legacyUserProfileCustomizations.stylesheets" = lock-true; { name = "type"; value = "packages"; }
"browser.search.suggest.enabled" = lock-false; { name = "query"; value = "{searchTerms}"; }
"browser.search.suggest.enabled.private" = lock-false; ];
"browser.urlbar.suggest.searches" = lock-false; }];
"browser.urlbar.showSearchSuggestionsFirst" = lock-false; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
"browser.topsites.contile.enabled" = lock-false; definedAliases = [ "@np" ];
"browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false; };
"browser.newtabpage.activity-stream.feeds.snippets" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false; "NixOS Wiki" = {
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false; urls = [{
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false; template = "https://nixos.wiki/index.php?search={searchTerms}";
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false; }];
"browser.newtabpage.activity-stream.showSponsored" = lock-false; iconUpdateURL = "https://nixos.wiki/favicon.png";
"browser.newtabpage.activity-stream.system.showSponsored" = lock-false; updateInterval = 24 * 60 * 60 * 1000; # every day
"browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; definedAliases = [ "@nw" ];
};
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Home Manager Options" = {
urls = [{
template = "https://home-manager-options.extranix.com/";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@hm" "@ho" "@hmo" ];
};
"Google".metaData.alias = "@g";
};
force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart
}; };
search = {
default = "Kagi";
privateDefault = "Kagi";
engines = {
"Kagi" = {
urls = [{
template = "https://kagi.com/search";
params = [
{ name = "q"; value = "{searchTerms}"; }
];
}];
iconUpdateURL = "https://kagi.com/favicon.ico";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@k" ];
};
"Nix Packages" = {
urls = [{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"NixOS Wiki" = {
urls = [{
template = "https://nixos.wiki/index.php?search={searchTerms}";
}];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Home Manager Options" = {
urls = [{
template = "https://home-manager-options.extranix.com/";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@hm" "@ho" "@hmo" ];
};
"Google".metaData.alias = "@g";
};
force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart
}; };
}; };
}; };
} }
#+end_src #+end_src
@ -4341,48 +4379,50 @@ Set in firefox =about:config > toolkit.legacyUserProfileCustomizations.styleshee
#+begin_src nix :noweb yes :tangle modules/home/stylix.nix #+begin_src nix :noweb yes :tangle modules/home/stylix.nix
{ self, lib, pkgs, ... }: { self, lib, pkgs, ... }:
{ {
options.swarselsystems.stylix = lib.mkOption { options.swarselsystems = {
type = lib.types.attrs; stylix = lib.mkOption {
default = { type = lib.types.attrs;
enable = true; default = {
base16Scheme = "${self}/programs/stylix/swarsel.yaml"; enable = true;
polarity = "dark"; base16Scheme = "${self}/programs/stylix/swarsel.yaml";
opacity.popups = 0.5; polarity = "dark";
cursor = { opacity.popups = 0.5;
package = pkgs.banana-cursor; cursor = {
# package = pkgs.capitaine-cursors; package = pkgs.banana-cursor;
name = "Banana"; # package = pkgs.capitaine-cursors;
# name = "capitaine-cursors"; name = "Banana";
size = 16; # name = "capitaine-cursors";
}; size = 16;
fonts = {
sizes = {
terminal = 10;
applications = 11;
}; };
serif = { fonts = {
# package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; }); sizes = {
package = pkgs.cantarell-fonts; terminal = 10;
# package = pkgs.montserrat; applications = 11;
name = "Cantarell"; };
# name = "FiraCode Nerd Font Propo"; serif = {
# name = "Montserrat"; # package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
}; package = pkgs.cantarell-fonts;
sansSerif = { # package = pkgs.montserrat;
# package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; }); name = "Cantarell";
package = pkgs.cantarell-fonts; # name = "FiraCode Nerd Font Propo";
# package = pkgs.montserrat; # name = "Montserrat";
name = "Cantarell"; };
# name = "FiraCode Nerd Font Propo"; sansSerif = {
# name = "Montserrat"; # package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
}; package = pkgs.cantarell-fonts;
monospace = { # package = pkgs.montserrat;
package = pkgs.nerd-fonts.fira-mono; # has overrides name = "Cantarell";
name = "FiraCode Nerd Font Mono"; # name = "FiraCode Nerd Font Propo";
}; # name = "Montserrat";
emoji = { };
package = pkgs.noto-fonts-emoji; monospace = {
name = "Noto Color Emoji"; package = pkgs.nerd-fonts.fira-mono; # has overrides
name = "FiraCode Nerd Font Mono";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
}; };
}; };
}; };

View file

@ -1,4 +1,6 @@
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.isBtrfs = lib.mkEnableOption "use btrfs filesystem"; options.swarselsystems = {
isBtrfs = lib.mkEnableOption "use btrfs filesystem";
};
} }

View file

@ -10,146 +10,147 @@ let
}; };
in in
{ {
options.swarselsystems.firefox = lib.mkOption { options.swarselsystems = {
type = lib.types.attrs; firefox = lib.mkOption {
default = { type = lib.types.attrs;
isDefault = false; default = {
userChrome = builtins.readFile "${self}/programs/firefox/chrome/userChrome.css"; isDefault = false;
extensions = { userChrome = builtins.readFile "${self}/programs/firefox/chrome/userChrome.css";
packages = with pkgs.nur.repos.rycee.firefox-addons; [ extensions = {
tridactyl packages = with pkgs.nur.repos.rycee.firefox-addons; [
tampermonkey tridactyl
sidebery tampermonkey
browserpass sidebery
clearurls browserpass
darkreader clearurls
enhancer-for-youtube darkreader
istilldontcareaboutcookies enhancer-for-youtube
translate-web-pages istilldontcareaboutcookies
ublock-origin translate-web-pages
reddit-enhancement-suite ublock-origin
sponsorblock reddit-enhancement-suite
web-archives sponsorblock
onepassword-password-manager web-archives
single-file onepassword-password-manager
widegithub single-file
enhanced-github widegithub
unpaywall enhanced-github
don-t-fuck-with-paste unpaywall
plasma-integration don-t-fuck-with-paste
(buildFirefoxXpiAddon { plasma-integration
pname = "shortkeys"; (buildFirefoxXpiAddon {
version = "4.0.2"; pname = "shortkeys";
addonId = "Shortkeys@Shortkeys.com"; version = "4.0.2";
url = "https://addons.mozilla.org/firefox/downloads/file/3673761/shortkeys-4.0.2.xpi"; addonId = "Shortkeys@Shortkeys.com";
sha256 = "c6fe12efdd7a871787ac4526eea79ecc1acda8a99724aa2a2a55c88a9acf467c"; url = "https://addons.mozilla.org/firefox/downloads/file/3673761/shortkeys-4.0.2.xpi";
meta = with lib; sha256 = "c6fe12efdd7a871787ac4526eea79ecc1acda8a99724aa2a2a55c88a9acf467c";
{ meta = with lib;
description = "Easily customizable custom keyboard shortcuts for Firefox. To configure this addon go to Addons (ctrl+shift+a) ->Shortkeys ->Options. Report issues here (please specify that the issue is found in Firefox): https://github.com/mikecrittenden/shortkeys"; {
mozPermissions = [ description = "Easily customizable custom keyboard shortcuts for Firefox. To configure this addon go to Addons (ctrl+shift+a) ->Shortkeys ->Options. Report issues here (please specify that the issue is found in Firefox): https://github.com/mikecrittenden/shortkeys";
"tabs" mozPermissions = [
"downloads" "tabs"
"clipboardWrite" "downloads"
"browsingData" "clipboardWrite"
"storage" "browsingData"
"bookmarks" "storage"
"sessions" "bookmarks"
"<all_urls>" "sessions"
"<all_urls>"
];
platforms = platforms.all;
};
})
];
};
settings =
{
"extensions.autoDisableScopes" = 0;
"browser.bookmarks.showMobileBookmarks" = lock-true;
"toolkit.legacyUserProfileCustomizations.stylesheets" = lock-true;
"browser.search.suggest.enabled" = lock-false;
"browser.search.suggest.enabled.private" = lock-false;
"browser.urlbar.suggest.searches" = lock-false;
"browser.urlbar.showSearchSuggestionsFirst" = lock-false;
"browser.topsites.contile.enabled" = lock-false;
"browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false;
"browser.newtabpage.activity-stream.feeds.snippets" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false;
"browser.newtabpage.activity-stream.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.system.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false;
};
search = {
default = "Kagi";
privateDefault = "Kagi";
engines = {
"Kagi" = {
urls = [{
template = "https://kagi.com/search";
params = [
{ name = "q"; value = "{searchTerms}"; }
]; ];
platforms = platforms.all; }];
}; iconUpdateURL = "https://kagi.com/favicon.ico";
}) updateInterval = 24 * 60 * 60 * 1000; # every day
]; definedAliases = [ "@k" ];
}; };
settings = "Nix Packages" = {
{ urls = [{
"extensions.autoDisableScopes" = 0; template = "https://search.nixos.org/packages";
"browser.bookmarks.showMobileBookmarks" = lock-true; params = [
"toolkit.legacyUserProfileCustomizations.stylesheets" = lock-true; { name = "type"; value = "packages"; }
"browser.search.suggest.enabled" = lock-false; { name = "query"; value = "{searchTerms}"; }
"browser.search.suggest.enabled.private" = lock-false; ];
"browser.urlbar.suggest.searches" = lock-false; }];
"browser.urlbar.showSearchSuggestionsFirst" = lock-false; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
"browser.topsites.contile.enabled" = lock-false; definedAliases = [ "@np" ];
"browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false; };
"browser.newtabpage.activity-stream.feeds.snippets" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false; "NixOS Wiki" = {
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false; urls = [{
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false; template = "https://nixos.wiki/index.php?search={searchTerms}";
"browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false; }];
"browser.newtabpage.activity-stream.showSponsored" = lock-false; iconUpdateURL = "https://nixos.wiki/favicon.png";
"browser.newtabpage.activity-stream.system.showSponsored" = lock-false; updateInterval = 24 * 60 * 60 * 1000; # every day
"browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; definedAliases = [ "@nw" ];
};
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Home Manager Options" = {
urls = [{
template = "https://home-manager-options.extranix.com/";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@hm" "@ho" "@hmo" ];
};
"Google".metaData.alias = "@g";
};
force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart
}; };
search = {
default = "Kagi";
privateDefault = "Kagi";
engines = {
"Kagi" = {
urls = [{
template = "https://kagi.com/search";
params = [
{ name = "q"; value = "{searchTerms}"; }
];
}];
iconUpdateURL = "https://kagi.com/favicon.ico";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@k" ];
};
"Nix Packages" = {
urls = [{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"NixOS Wiki" = {
urls = [{
template = "https://nixos.wiki/index.php?search={searchTerms}";
}];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};
"NixOS Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Home Manager Options" = {
urls = [{
template = "https://home-manager-options.extranix.com/";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@hm" "@ho" "@hmo" ];
};
"Google".metaData.alias = "@g";
};
force = true; # this is required because otherwise the search.json.mozlz4 symlink gets replaced on every firefox restart
}; };
}; };
}; };
} }

View file

@ -1,16 +1,20 @@
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.cpuCount = lib.mkOption { options.swarselsystems = {
type = lib.types.int; cpuCount = lib.mkOption {
default = 8; type = lib.types.int;
}; default = 8;
options.swarselsystems.temperatureHwmon.isAbsolutePath = lib.mkEnableOption "absolute temperature path"; };
options.swarselsystems.temperatureHwmon.path = lib.mkOption { temperatureHwmon = {
type = lib.types.str; isAbsolutePath = lib.mkEnableOption "absolute temperature path";
default = ""; path = lib.mkOption {
}; type = lib.types.str;
options.swarselsystems.temperatureHwmon.input-filename = lib.mkOption { default = "";
type = lib.types.str; };
default = ""; input-filename = lib.mkOption {
type = lib.types.str;
default = "";
};
};
}; };
} }

View file

@ -1,37 +1,39 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.inputs = lib.mkOption { options.swarselsystems = {
type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); inputs = lib.mkOption {
default = { }; type = lib.types.attrsOf (lib.types.attrsOf lib.types.str);
}; default = { };
options.swarselsystems.kyria = lib.mkOption { };
type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); kyria = lib.mkOption {
default = { type = lib.types.attrsOf (lib.types.attrsOf lib.types.str);
"36125:53060:splitkb.com_splitkb.com_Kyria_rev3" = { default = {
xkb_layout = "us"; "36125:53060:splitkb.com_splitkb.com_Kyria_rev3" = {
xkb_variant = "altgr-intl"; xkb_layout = "us";
}; xkb_variant = "altgr-intl";
"7504:24926:Kyria_Keyboard" = { };
xkb_layout = "us"; "7504:24926:Kyria_Keyboard" = {
xkb_variant = "altgr-intl"; xkb_layout = "us";
xkb_variant = "altgr-intl";
};
}; };
}; };
}; touchpad = lib.mkOption {
options.swarselsystems.touchpad = lib.mkOption { type = lib.types.attrsOf (lib.types.attrsOf lib.types.str);
type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); default = { };
default = { }; };
}; standardinputs = lib.mkOption {
options.swarselsystems.standardinputs = lib.mkOption { type = lib.types.attrsOf (lib.types.attrsOf lib.types.str);
type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); default = lib.recursiveUpdate (lib.recursiveUpdate config.swarselsystems.touchpad config.swarselsystems.kyria) config.swarselsystems.inputs;
default = lib.recursiveUpdate (lib.recursiveUpdate config.swarselsystems.touchpad config.swarselsystems.kyria) config.swarselsystems.inputs; internal = true;
internal = true; };
}; keybindings = lib.mkOption {
options.swarselsystems.keybindings = lib.mkOption { type = lib.types.attrsOf lib.types.str;
type = lib.types.attrsOf lib.types.str; default = { };
default = { }; };
}; shellAliases = lib.mkOption {
options.swarselsystems.shellAliases = lib.mkOption { type = lib.types.attrsOf lib.types.str;
type = lib.types.attrsOf lib.types.str; default = { };
default = { }; };
}; };
} }

View file

@ -1,30 +1,35 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.isLaptop = lib.mkEnableOption "laptop host"; options.swarselsystems = {
config.swarselsystems.touchpad = lib.mkIf config.swarselsystems.isLaptop { isLaptop = lib.mkEnableOption "laptop host";
"type:touchpad" = { };
dwt = "enabled";
tap = "enabled"; config.swarselsystems = {
natural_scroll = "enabled"; touchpad = lib.mkIf config.swarselsystems.isLaptop {
middle_emulation = "enabled"; "type:touchpad" = {
drag_lock = "disabled"; dwt = "enabled";
}; tap = "enabled";
natural_scroll = "enabled";
middle_emulation = "enabled";
drag_lock = "disabled";
};
};
waybarModules = lib.mkIf config.swarselsystems.isLaptop [
"custom/outer-left-arrow-dark"
"mpris"
"custom/left-arrow-light"
"network"
"custom/vpn"
"custom/left-arrow-dark"
"pulseaudio"
"custom/left-arrow-light"
"battery"
"custom/left-arrow-dark"
"group/hardware"
"custom/left-arrow-light"
"clock#2"
"custom/left-arrow-dark"
"clock#1"
];
}; };
config.swarselsystems.waybarModules = lib.mkIf config.swarselsystems.isLaptop [
"custom/outer-left-arrow-dark"
"mpris"
"custom/left-arrow-light"
"network"
"custom/vpn"
"custom/left-arrow-dark"
"pulseaudio"
"custom/left-arrow-light"
"battery"
"custom/left-arrow-dark"
"group/hardware"
"custom/left-arrow-light"
"clock#2"
"custom/left-arrow-dark"
"clock#1"
];
} }

View file

@ -1,19 +1,21 @@
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.monitors = lib.mkOption { options.swarselsystems = {
type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); monitors = lib.mkOption {
default = { }; type = lib.types.attrsOf (lib.types.attrsOf lib.types.str);
}; default = { };
options.swarselsystems.sharescreen = lib.mkOption { };
type = lib.types.str; sharescreen = lib.mkOption {
default = ""; type = lib.types.str;
}; default = "";
options.swarselsystems.lowResolution = lib.mkOption { };
type = lib.types.str; lowResolution = lib.mkOption {
default = ""; type = lib.types.str;
}; default = "";
options.swarselsystems.highResolution = lib.mkOption { };
type = lib.types.str; highResolution = lib.mkOption {
default = ""; type = lib.types.str;
default = "";
};
}; };
} }

View file

@ -1,34 +1,38 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselsystems.flakePath = lib.mkOption { options.swarselsystems = {
type = lib.types.str; flakePath = lib.mkOption {
default = ""; type = lib.types.str;
default = "";
};
isNixos = lib.mkEnableOption "nixos host";
isPublic = lib.mkEnableOption "is a public machine (no secrets)";
swayfxConfig = lib.mkOption {
type = lib.types.str;
default = "
blur enable
blur_xray disable
blur_passes 1
blur_radius 1
shadows enable
corner_radius 2
titlebar_separator disable
default_dim_inactive 0.02
";
internal = true;
};
}; };
options.swarselsystems.isNixos = lib.mkEnableOption "nixos host";
options.swarselsystems.isPublic = lib.mkEnableOption "is a public machine (no secrets)";
config.swarselsystems.startup = lib.mkIf (!config.swarselsystems.isNixos) [
{ command = "sleep 60 && nixGL nextcloud --background"; }
{ command = "sleep 60 && nixGL vesktop --start-minimized -enable-features=UseOzonePlatform -ozone-platform=wayland"; }
{ command = "sleep 60 && nixGL syncthingtray --wait"; }
{ command = "sleep 60 && ANKI_WAYLAND=1 nixGL anki"; }
{ command = "nm-applet --indicator"; }
{ command = "sleep 60 && OBSIDIAN_USE_WAYLAND=1 nixGL obsidian -enable-features=UseOzonePlatform -ozone-platform=wayland"; }
{ command = "sleep 60 && element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
];
options.swarselsystems.swayfxConfig = lib.mkOption { config.swarselsystems = {
type = lib.types.str; startup = lib.mkIf (!config.swarselsystems.isNixos) [
default = " { command = "sleep 60 && nixGL nextcloud --background"; }
blur enable { command = "sleep 60 && nixGL vesktop --start-minimized -enable-features=UseOzonePlatform -ozone-platform=wayland"; }
blur_xray disable { command = "sleep 60 && nixGL syncthingtray --wait"; }
blur_passes 1 { command = "sleep 60 && ANKI_WAYLAND=1 nixGL anki"; }
blur_radius 1 { command = "nm-applet --indicator"; }
shadows enable { command = "sleep 60 && OBSIDIAN_USE_WAYLAND=1 nixGL obsidian -enable-features=UseOzonePlatform -ozone-platform=wayland"; }
corner_radius 2 { command = "sleep 60 && element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
titlebar_separator disable ];
default_dim_inactive 0.02 swayfxConfig = lib.mkIf (!config.swarselsystems.isNixos) " ";
";
internal = true;
}; };
config.swarselsystems.swayfxConfig = lib.mkIf (!config.swarselsystems.isNixos) " ";
} }

View file

@ -1,5 +1,7 @@
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.isDarwin = lib.mkEnableOption "darwin host"; options.swarselsystems = {
options.swarselsystems.isLinux = lib.mkEnableOption "whether this is a linux machine"; isDarwin = lib.mkEnableOption "darwin host";
isLinux = lib.mkEnableOption "whether this is a linux machine";
};
} }

View file

@ -1,15 +1,17 @@
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.startup = lib.mkOption { options.swarselsystems = {
type = lib.types.listOf (lib.types.attrsOf lib.types.str); startup = lib.mkOption {
default = [ type = lib.types.listOf (lib.types.attrsOf lib.types.str);
{ command = "nextcloud --background"; } default = [
{ command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; } { command = "nextcloud --background"; }
{ command = "element-desktop --hidden --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; } { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; }
{ command = "ANKI_WAYLAND=1 anki"; } { command = "element-desktop --hidden --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
{ command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; } { command = "ANKI_WAYLAND=1 anki"; }
{ command = "nm-applet"; } { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
{ command = "feishin"; } { command = "nm-applet"; }
]; { command = "feishin"; }
];
};
}; };
} }

View file

@ -1,47 +1,49 @@
{ self, lib, pkgs, ... }: { self, lib, pkgs, ... }:
{ {
options.swarselsystems.stylix = lib.mkOption { options.swarselsystems = {
type = lib.types.attrs; stylix = lib.mkOption {
default = { type = lib.types.attrs;
enable = true; default = {
base16Scheme = "${self}/programs/stylix/swarsel.yaml"; enable = true;
polarity = "dark"; base16Scheme = "${self}/programs/stylix/swarsel.yaml";
opacity.popups = 0.5; polarity = "dark";
cursor = { opacity.popups = 0.5;
package = pkgs.banana-cursor; cursor = {
# package = pkgs.capitaine-cursors; package = pkgs.banana-cursor;
name = "Banana"; # package = pkgs.capitaine-cursors;
# name = "capitaine-cursors"; name = "Banana";
size = 16; # name = "capitaine-cursors";
}; size = 16;
fonts = {
sizes = {
terminal = 10;
applications = 11;
}; };
serif = { fonts = {
# package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; }); sizes = {
package = pkgs.cantarell-fonts; terminal = 10;
# package = pkgs.montserrat; applications = 11;
name = "Cantarell"; };
# name = "FiraCode Nerd Font Propo"; serif = {
# name = "Montserrat"; # package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
}; package = pkgs.cantarell-fonts;
sansSerif = { # package = pkgs.montserrat;
# package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; }); name = "Cantarell";
package = pkgs.cantarell-fonts; # name = "FiraCode Nerd Font Propo";
# package = pkgs.montserrat; # name = "Montserrat";
name = "Cantarell"; };
# name = "FiraCode Nerd Font Propo"; sansSerif = {
# name = "Montserrat"; # package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
}; package = pkgs.cantarell-fonts;
monospace = { # package = pkgs.montserrat;
package = pkgs.nerd-fonts.fira-mono; # has overrides name = "Cantarell";
name = "FiraCode Nerd Font Mono"; # name = "FiraCode Nerd Font Propo";
}; # name = "Montserrat";
emoji = { };
package = pkgs.noto-fonts-emoji; monospace = {
name = "Noto Color Emoji"; package = pkgs.nerd-fonts.fira-mono; # has overrides
name = "FiraCode Nerd Font Mono";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
}; };
}; };
}; };

View file

@ -1,7 +1,9 @@
{ self, lib, ... }: { self, lib, ... }:
{ {
options.swarselsystems.wallpaper = lib.mkOption { options.swarselsystems = {
type = lib.types.path; wallpaper = lib.mkOption {
default = self + /wallpaper/lenovowp.png; type = lib.types.path;
default = self + /wallpaper/lenovowp.png;
};
}; };
} }

View file

@ -3,31 +3,33 @@ let
generateIcons = n: lib.concatStringsSep " " (builtins.map (x: "{icon" + toString x + "}") (lib.range 0 (n - 1))); generateIcons = n: lib.concatStringsSep " " (builtins.map (x: "{icon" + toString x + "}") (lib.range 0 (n - 1)));
in in
{ {
options.swarselsystems.cpuString = lib.mkOption { options.swarselsystems = {
type = lib.types.str; cpuString = lib.mkOption {
default = generateIcons config.swarselsystems.cpuCount; type = lib.types.str;
description = "The generated icons string for use by Waybar."; default = generateIcons config.swarselsystems.cpuCount;
internal = true; description = "The generated icons string for use by Waybar.";
}; internal = true;
options.swarselsystems.waybarModules = lib.mkOption { };
type = lib.types.listOf lib.types.str; waybarModules = lib.mkOption {
default = [ type = lib.types.listOf lib.types.str;
"custom/outer-left-arrow-dark" default = [
"mpris" "custom/outer-left-arrow-dark"
"custom/left-arrow-light" "mpris"
"network" "custom/left-arrow-light"
"custom/vpn" "network"
"custom/left-arrow-dark" "custom/vpn"
"pulseaudio" "custom/left-arrow-dark"
"custom/left-arrow-light" "pulseaudio"
"custom/pseudobat" "custom/left-arrow-light"
"battery" "custom/pseudobat"
"custom/left-arrow-dark" "battery"
"group/hardware" "custom/left-arrow-dark"
"custom/left-arrow-light" "group/hardware"
"clock#2" "custom/left-arrow-light"
"custom/left-arrow-dark" "clock#2"
"clock#1" "custom/left-arrow-dark"
]; "clock#1"
];
};
}; };
} }

View file

@ -1,11 +1,15 @@
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.hasBluetooth = lib.mkEnableOption "bluetooth availability"; options.swarselsystems = {
options.swarselsystems.hasFingerprint = lib.mkEnableOption "fingerprint sensor availability"; hasBluetooth = lib.mkEnableOption "bluetooth availability";
options.swarselsystems.trackpoint.isAvailable = lib.mkEnableOption "trackpoint availability"; hasFingerprint = lib.mkEnableOption "fingerprint sensor availability";
options.swarselsystems.trackpoint.device = lib.mkOption { trackpoint = {
type = lib.types.str; isAvailable = lib.mkEnableOption "trackpoint availability";
default = ""; trackpoint.device = lib.mkOption {
type = lib.types.str;
default = "";
};
};
}; };
} }

View file

@ -1,22 +1,26 @@
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.server.enable = lib.mkEnableOption "is a server machine"; options.swarselsystems = {
options.swarselsystems.server.kavita = lib.mkEnableOption "enable kavita on server"; server = {
options.swarselsystems.server.jellyfin = lib.mkEnableOption "enable jellyfin on server"; enable = lib.mkEnableOption "is a server machine";
options.swarselsystems.server.navidrome = lib.mkEnableOption "enable navidrome on server"; kavita = lib.mkEnableOption "enable kavita on server";
options.swarselsystems.server.spotifyd = lib.mkEnableOption "enable spotifyd on server"; jellyfin = lib.mkEnableOption "enable jellyfin on server";
options.swarselsystems.server.mpd = lib.mkEnableOption "enable mpd on server"; navidrome = lib.mkEnableOption "enable navidrome on server";
options.swarselsystems.server.matrix = lib.mkEnableOption "enable matrix on server"; spotifyd = lib.mkEnableOption "enable spotifyd on server";
options.swarselsystems.server.nextcloud = lib.mkEnableOption "enable nextcloud on server"; mpd = lib.mkEnableOption "enable mpd on server";
options.swarselsystems.server.immich = lib.mkEnableOption "enable immich on server"; matrix = lib.mkEnableOption "enable matrix on server";
options.swarselsystems.server.paperless = lib.mkEnableOption "enable paperless on server"; nextcloud = lib.mkEnableOption "enable nextcloud on server";
options.swarselsystems.server.transmission = lib.mkEnableOption "enable transmission and friends on server"; immich = lib.mkEnableOption "enable immich on server";
options.swarselsystems.server.syncthing = lib.mkEnableOption "enable syncthing on server"; paperless = lib.mkEnableOption "enable paperless on server";
options.swarselsystems.server.restic = lib.mkEnableOption "enable restic backups on server"; transmission = lib.mkEnableOption "enable transmission and friends on server";
options.swarselsystems.server.monitoring = lib.mkEnableOption "enable monitoring on server"; syncthing = lib.mkEnableOption "enable syncthing on server";
options.swarselsystems.server.jenkins = lib.mkEnableOption "enable jenkins on server"; restic = lib.mkEnableOption "enable restic backups on server";
options.swarselsystems.server.emacs = lib.mkEnableOption "enable emacs server on server"; monitoring = lib.mkEnableOption "enable monitoring on server";
options.swarselsystems.server.forgejo = lib.mkEnableOption "enable forgejo on server"; jenkins = lib.mkEnableOption "enable jenkins on server";
options.swarselsystems.server.ankisync = lib.mkEnableOption "enable ankisync on server"; emacs = lib.mkEnableOption "enable emacs server on server";
options.swarselsystems.server.freshrss = lib.mkEnableOption "enable freshrss on server"; forgejo = lib.mkEnableOption "enable forgejo on server";
ankisync = lib.mkEnableOption "enable ankisync on server";
freshrss = lib.mkEnableOption "enable freshrss on server";
};
};
} }

View file

@ -1,28 +1,30 @@
{ lib, ... }: { lib, ... }:
{ {
options.swarselsystems.user = lib.mkOption { options.swarselsystems = {
type = lib.types.str; user = lib.mkOption {
default = "swarsel"; type = lib.types.str;
}; default = "swarsel";
options.swarselsystems.withHomeManager = lib.mkOption { };
type = lib.types.bool; withHomeManager = lib.mkOption {
default = true; type = lib.types.bool;
}; default = true;
options.swarselsystems.isSwap = lib.mkOption { };
type = lib.types.bool; isSwap = lib.mkOption {
default = true; type = lib.types.bool;
}; default = true;
options.swarselsystems.swapSize = lib.mkOption { };
type = lib.types.str; swapSize = lib.mkOption {
default = "8G"; type = lib.types.str;
}; default = "8G";
options.swarselsystems.rootDisk = lib.mkOption { };
type = lib.types.str; rootDisk = lib.mkOption {
default = ""; type = lib.types.str;
}; default = "";
options.swarselsystems.isCrypted = lib.mkEnableOption "uses full disk encryption"; };
options.swarselsystems.initialSetup = lib.mkEnableOption "initial setup (no sops keys available)"; isCrypted = lib.mkEnableOption "uses full disk encryption";
initialSetup = lib.mkEnableOption "initial setup (no sops keys available)";
options.swarselsystems.isImpermanence = lib.mkEnableOption "use impermanence on this system"; isImpermanence = lib.mkEnableOption "use impermanence on this system";
options.swarselsystems.isSecureBoot = lib.mkEnableOption "use secure boot on this system"; isSecureBoot = lib.mkEnableOption "use secure boot on this system";
};
} }