From 7165501955cc5ae32e9d2d9d0eb0218621f0ce16 Mon Sep 17 00:00:00 2001 From: Ahmad Ansori Palembani Date: Mon, 4 Nov 2024 09:51:40 +0700 Subject: [PATCH] refactor(nix/floorp): Move profile options to `users/` --- .../{userChrome.css => ziro-userChrome.css} | 0 .config/nix/modules/home-manager/floorp.nix | 17 +++--------- .config/nix/users/default.nix | 2 -- .config/nix/users/ziro/default.nix | 27 +++++++++++++++++-- 4 files changed, 28 insertions(+), 18 deletions(-) rename .config/nix/files/floorp/{userChrome.css => ziro-userChrome.css} (100%) diff --git a/.config/nix/files/floorp/userChrome.css b/.config/nix/files/floorp/ziro-userChrome.css similarity index 100% rename from .config/nix/files/floorp/userChrome.css rename to .config/nix/files/floorp/ziro-userChrome.css diff --git a/.config/nix/modules/home-manager/floorp.nix b/.config/nix/modules/home-manager/floorp.nix index ad44bab..ebed939 100644 --- a/.config/nix/modules/home-manager/floorp.nix +++ b/.config/nix/modules/home-manager/floorp.nix @@ -5,20 +5,9 @@ enable = true; # REF: https://github.com/nix-community/home-manager/blob/342a1d682386d3a1d74f9555cb327f2f311dda6e/modules/programs/firefox/mkFirefoxModule.nix#L264 package = null; # we only want the config - profiles.${vars.name} = { - userChrome = builtins.replaceStrings ["/*ZI:VERTICAL-TAB-HOVER-WIDTH-IN-EM*/"] ["${builtins.toString vars.floorp.verticalTabHoverWidthInEm}em"] (builtins.readFile ../../files/floorp/userChrome.css); - settings = { - "browser.toolbars.bookmarks.visibility" = "newtab"; - "floorp.browser.sidebar.is.displayed" = false; - "floorp.browser.tabbar.settings" = 2; - "floorp.browser.tabs.verticaltab" = true; - "floorp.verticaltab.hover.enabled" = true; - "floorp.tabbar.style" = 2; - "network.dns.disableIPv6" = true; - "sidebar.position_start" = false; - "signon.management.page.breach-alerts.enabled" = false; - "signon.rememberSignons" = false; - }; + profiles.${config.home.username} = { + id = 0; + isDefault = true; }; }; } diff --git a/.config/nix/users/default.nix b/.config/nix/users/default.nix index 78de014..6fe7de7 100644 --- a/.config/nix/users/default.nix +++ b/.config/nix/users/default.nix @@ -31,7 +31,6 @@ in ]; } ) pkgs pkgs-unstable; - vars.name = "ziro"; vars.floorp.verticalTabHoverWidthInEm = 28; in home-manager.lib.homeManagerConfiguration { @@ -53,7 +52,6 @@ in unstable = nixpkgs-unstable; } ) system pkgs pkgs-unstable; - vars.name = "ziro"; in home-manager.lib.homeManagerConfiguration { pkgs = pkgs-unstable; # FIXME: switch to stable when 24.11 become stable diff --git a/.config/nix/users/ziro/default.nix b/.config/nix/users/ziro/default.nix index 9b60a2c..f1de490 100644 --- a/.config/nix/users/ziro/default.nix +++ b/.config/nix/users/ziro/default.nix @@ -1,14 +1,37 @@ { pkgs, pkgs-unstable, config, vars, ... }: -{ +let + username = "ziro"; + userChrome = builtins.replaceStrings ["/*ZI:VERTICAL-TAB-HOVER-WIDTH-IN-EM*/"] ["${builtins.toString vars.floorp.verticalTabHoverWidthInEm}em"] (builtins.readFile ../../files/floorp/ziro-userChrome.css); + settings = { + "browser.toolbars.bookmarks.visibility" = "newtab"; + "floorp.browser.sidebar.is.displayed" = false; + "floorp.browser.tabbar.settings" = 2; + "floorp.browser.tabs.verticaltab" = true; + "floorp.verticaltab.hover.enabled" = true; + "floorp.tabbar.style" = 2; + "network.dns.disableIPv6" = true; + "sidebar.position_start" = false; + "signon.management.page.breach-alerts.enabled" = false; + "signon.rememberSignons" = false; + }; +in { home = { - username = "ziro"; + inherit username; packages = [ pkgs.passff-host ]; }; + programs.floorp.profiles.${username} = { + inherit userChrome settings; + }; + programs.floorp.profiles.null = { + id = 1; + inherit userChrome settings; + }; + xdg.configFile = { "nix/nix.conf".text = ''