modules: refactoring complete

Hopefully works
This commit is contained in:
vali 2024-07-21 15:32:30 +02:00
commit 873ff746b4
87 changed files with 524 additions and 3085 deletions

View file

@ -1,82 +0,0 @@
{
config,
pkgs,
lib,
inputs,
...
}:
with lib; let
inherit (config.modules.other.system) username;
cfg = config.modules.programs.anyrun;
in {
options.modules.programs.anyrun.enable = mkEnableOption "anyrun";
config = mkIf cfg.enable {
home-manager.users.${username} = {
imports = [inputs.anyrun.homeManagerModules.default];
programs.anyrun = {
enable = true;
config = {
plugins = with inputs.anyrun.packages.${pkgs.system}; [
applications
dictionary
#rink
shell
# symbols
#translate
websearch
];
hideIcons = false;
ignoreExclusiveZones = false;
layer = "overlay";
hidePluginInfo = true;
closeOnClick = true;
showResultsImmediately = true;
maxEntries = 10;
width.fraction = 0.3;
y.absolute = 15;
};
extraCss = builtins.readFile ./style.css;
extraConfigFiles = {
"applications.ron".text = ''
Config(
max_entries: 10,
terminal: Some("foot"),
)
'';
"websearch.ron".text = ''
Config(
prefix: "?",
engines: [DuckDuckGo]
)
'';
"symbols.ron".text = ''
Config(
// The prefix that the search needs to begin with to yield symbol results
prefix: ":sy",
// Custom user defined symbols to be included along the unicode symbols
symbols: {
// "name": "text to be copied"
"shrug": "¯\\_()_/¯",
},
// The number of entries to be displayed
max_entries: 5,
)
'';
"translate.ron".text = ''
Config(
prefix: ":tr",
language_delimiter: ">",
max_entries: 3,
)
'';
};
};
};
};
}

View file

@ -1 +0,0 @@
_: {imports = [./anyrun.nix];}

View file

@ -1,69 +0,0 @@
* {
all: unset;
font-size: 1.3rem;
font-family: "JetBrains Mono"
}
#window,
#match,
#entry,
#plugin,
#main {
background: transparent;
}
#match.activatable {
border-radius: 16px;
padding: 0.3rem 0.9rem;
margin-top: 0.01rem;
}
#match.activatable:first-child {
margin-top: 0.7rem;
}
#match.activatable:last-child {
margin-bottom: 0.6rem;
}
#plugin:hover #match.activatable {
border-radius: 10px;
padding: 0.3rem;
margin-top: 0.01rem;
margin-bottom: 0;
}
#match:selected,
#match:hover,
#plugin:hover {
background: rgba(255, 255, 255, 0.1);
}
#entry {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 16px;
margin: 0.5rem;
padding: 0.3rem 1rem;
}
list > #plugin {
border-radius: 16px;
margin: 0 0.3rem;
}
list > #plugin:first-child {
margin-top: 0.3rem;
}
list > #plugin:last-child {
margin-bottom: 0.3rem;
}
list > #plugin:hover {
padding: 0.6rem;
}
box#main {
background: rgba(0, 0, 0, 0.5);
box-shadow:
inset 0 0 0 1px rgba(255, 255, 255, 0.1),
0 0 0 1px rgba(0, 0, 0, 0.5);
border-radius: 24px;
padding: 0.3rem;
}

View file

@ -8,7 +8,6 @@ _: {
./qt.nix
./zathura.nix
./spicetify.nix
./anyrun
./rofi.nix
./kitty.nix
#./vivado.nix

View file

@ -5,23 +5,17 @@
pkgs,
...
}: let
cfg = config.modules.programs.foot;
cfg = config.modules.system.programs.terminals.foot;
inherit (config.modules.other.system) username;
inherit (lib) mkEnableOption mkIf;
inherit (lib) mkIf;
in {
options.modules.programs.foot = {
enable = mkEnableOption "foot";
server = mkEnableOption "foot server mode";
};
config = mkIf cfg.enable {
environment.sessionVariables = {TERM = "foot";};
home-manager.users.${username} = {
programs.foot = {
enable = true;
package = inputs.nixpkgs-wayland.packages.${pkgs.system}.foot;
server.enable = cfg.server;
settings = {
main = {
term = "foot";

View file

@ -1,26 +1,21 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.programs.kitty;
username = config.modules.other.system.username;
cfg = config.modules.system.programs.terminals.kitty;
inherit (config.modules.other.system) username;
in {
options.modules.programs.kitty.enable = mkEnableOption "kitty";
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.kitty = {
enable = true;
settings = {
# font_size = "13.0";
mouse_hide_wait = -1;
allow_remote_control = true;
url_style = "curly";
open_url_with = "default";
#background_opacity = "0.9";
confirm_os_window_close = "0";
};
};

View file

@ -3,13 +3,11 @@
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.programs.mpv;
username = config.modules.other.system.username;
}: let
cfg = config.modules.usrEnv.programs.media.mpv;
inherit (config.modules.other.system) username;
inherit (lib) mkIf;
in {
options.modules.programs.mpv.enable = mkEnableOption "mpv";
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.mpv = {

View file

@ -1,145 +0,0 @@
{
config,
inputs,
lib,
...
}: let
cfg = config.modules.programs.schizofox;
inherit (config.modules.other.system) username;
inherit (lib) mkEnableOption mkIf;
in {
options.modules.programs.schizofox = {enable = mkEnableOption "schizofox";};
config = mkIf cfg.enable {
home-manager.users.${username} = {
imports = [inputs.schizofox.homeManagerModule];
programs.schizofox = {
enable = true;
theme = {
# colors = {
# background-darker = "181825";
# background = "1e1e2e";
# foreground = "cdd6f4";
# };
colors = {
background-darker = "1d2021";
background = "282828";
foreground = "ebdbb2";
};
font = "Lexend";
extraUserChrome = ''
body {
color: red !important;
}
'';
};
search = {
defaultSearchEngine = "DuckDuckGo";
removeEngines = ["Google" "Bing" "Amazon.com" "eBay" "Twitter" "Wikipedia"];
addEngines = [
{
Name = "NixOS Packages";
Description = "NixOS Unstable package search";
Alias = "!np";
Method = "GET";
URLTemplate = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}";
}
{
Name = "NixOS Options";
Description = "NixOS Unstable option search";
Alias = "!no";
Method = "GET";
URLTemplate = "https://search.nixos.org/options?channel=unstable&query={searchTerms}";
}
{
Name = "NixOS Wiki";
Description = "NixOS Wiki search";
Alias = "!nw";
Method = "GET";
URLTemplate = "https://nixos.wiki/index.php?search={searchTerms}";
}
{
Name = "Home Manager Options";
Description = "Home Manager option search";
Alias = "!hm";
Method = "GET";
URLTemplate = "https://home-manager-options.extranix.com/?query={searchTerms}&release=master";
}
{
Name = "Arch Wiki";
Description = "Arch Wiki search";
Alias = "!aw";
Method = "GET";
URLTemplate = "https://wiki.archlinux.org/index.php?search={searchTerms}";
}
{
Name = "Gentoo Wiki";
Description = "Gentoo Wiki search";
Alias = "!gw";
Method = "GET";
URLTemplate = "https://wiki.gentoo.org/index.php?search={searchTerms}";
}
{
Name = "Debian Wiki";
Description = "Debian Wiki search";
Alias = "!dw";
Method = "GET";
URLTemplate = "https://wiki.debian.org/FrontPage?action=fullsearch&value={searchTerms}";
}
{
Name = "noogle";
Descriptiom = "Noogle Search";
Alias = "!ng";
Method = "GET";
URLTemplate = "https://noogle.dev/";
}
];
};
extensions = {
simplefox.enable = true;
darkreader.enable = true;
extraExtensions = let
mkUrl = name: "https://addons.mozilla.org/firefox/downloads/latest/${name}/latest.xpi";
extensions = [
{
id = "1018e4d6-728f-4b20-ad56-37578a4de76";
name = "flagfox";
}
{
id = "{c2c003ee-bd69-42a2-b0e9-6f34222cb046}";
name = "auto-tab-discard";
}
{
id = "{a4c4eda4-fb84-4a84-b4a1-f7c1cbf2a1ad}";
name = "refined-github-";
}
{
id = "sponsorBlocker@ajay.app";
name = "sponsorblock";
}
{
id = "uBlock0@raymondhill.net";
name = "UBlock Origin";
}
];
extraExtensions = builtins.foldl' (acc: ext: acc // {ext.id = {install_url = mkUrl ext.name;};}) {} extensions;
in
extraExtensions;
};
security = {
sanitizeOnShutdown = false;
sandbox = true;
userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0";
};
misc = {
drm.enable = true;
disableWebgl = true;
};
};
};
};
}

View file

@ -5,12 +5,11 @@
inputs,
...
}: let
cfg = config.modules.programs.spicetify;
username = config.modules.other.system.username;
cfg = config.modules.system.programs.spotify;
inherit (config.modules.other.system) username;
spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default;
# inherit (inputs.spicetify-nix.packages.${pkgs.system}) spicetify-nix;
in {
options.modules.programs.spicetify.enable = lib.mkEnableOption "spicetify";
config = lib.mkIf cfg.enable {
home-manager.users.${username} = {
imports = [inputs.spicetify-nix.homeManagerModule];

View file

@ -5,11 +5,9 @@
...
}:
with lib; let
cfg = config.modules.programs.vesktop;
username = config.modules.other.system.username;
cfg = config.modules.system.programs.discord;
inherit (config.modules.other.system) username;
in {
options.modules.programs.vesktop = {enable = mkEnableOption "vesktop";};
config = mkIf cfg.enable {
home-manager.users.${username} = {
home.packages = with pkgs; [vesktop];

View file

@ -5,7 +5,7 @@
...
}:
with lib; let
cfg = config.modules.programs.zathura;
cfg = config.modules.system.programs.zathura;
inherit (config.modules.other.system) username;
catppuccin = pkgs.fetchFromGitHub {
owner = "catppuccin";
@ -14,8 +14,6 @@ with lib; let
hash = "sha256-/vD/hOi6KcaGyAp6Az7jL5/tQSGRzIrf0oHjAJf4QbI=";
};
in {
options.modules.programs.zathura.enable = mkEnableOption "zathura";
config = mkIf cfg.enable {
home-manager.users.${username} = {
xdg.configFile."zathura/catppuccin-mocha".source = "${catppuccin}/src/catppuccin-mocha";