refactor: Move nix outside of .config dir

Technically not a config but a compose file, so I think it's better to
have outside of `.config` dir
This commit is contained in:
Ahmad Ansori Palembani 2024-11-05 13:53:13 +07:00
parent 3484b4154a
commit 93a26accd1
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
22 changed files with 0 additions and 0 deletions

50
nix/users/ziro/darwin.nix Normal file
View file

@ -0,0 +1,50 @@
{ pkgs, pkgs-unstable, config, vars, lib, ... }:
{
home.homeDirectory = "/Users/ziro";
home.packages = lib.mkAfter
[
pkgs.casks.vscodium
];
programs.browserpass = {
enable = true;
browsers = [ "brave" "chrome" ]; # Arc and Chrome share the same `Application Support` dir, not sure why tbh.
};
home.file."Library/Application Support/Floorp/native-messaging-hosts/passff.json".source = "${pkgs.passff-host}/share/passff-host/passff.json";
# Swap CapsLock with Esc for better vi-mode experience.
launchd.agents.CapsEscSwap = {
enable = true;
config = {
ProgramArguments = [
"/usr/bin/hidutil"
"property"
"--set"
''{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x700000029},{"HIDKeyboardModifierMappingSrc":0x700000029,"HIDKeyboardModifierMappingDst":0x700000039}]}''
];
RunAtLoad = true;
};
};
home.sessionVariables.MOZ_LEGACY_PROFILES = 1;
home.activation.applications = let
env = pkgs.buildEnv {
name = "home-applications";
paths = config.home.packages;
pathsToLink = "/Applications";
};
in lib.hm.dag.entryAfter [ "writeBoundary" ] ''
echo "setting up ${config.home.homeDirectory}/Applications..." >&2
rm -rf "${config.home.homeDirectory}/Applications/Nix Home Manager Apps"
mkdir -p "${config.home.homeDirectory}/Applications/Nix Home Manager Apps"
find ${env}/Applications -maxdepth 1 -type l -exec readlink '{}' + |
while read src; do
app_name=$(basename "$src")
echo "copying $src" >&2
${pkgs.mkalias}/bin/mkalias "$src" "${config.home.homeDirectory}/Applications/Nix Home Manager Apps/$app_name"
done
'';
}

View file

@ -0,0 +1,48 @@
{ 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;
"extensions.autoDisableScopes" = 0; # Auto enable extensions
};
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
passff
ublock-origin
];
in {
home = {
inherit username;
packages =
[
pkgs.passff-host
];
};
programs.floorp.profiles.${username} = {
inherit userChrome settings extensions;
};
programs.floorp.profiles.null = {
id = 1;
inherit userChrome settings extensions;
};
xdg.configFile = {
"nix/nix.conf".text =
''
experimental-features = nix-command flakes
'';
};
home.stateVersion = "24.11";
}

7
nix/users/ziro/linux.nix Normal file
View file

@ -0,0 +1,7 @@
{ pkgs, pkgs-unstable, config, vars, ... }:
{
home.homeDirectory = "/home/ziro";
home.file.".floorp/native-messaging-hosts/passff.json".source = "${pkgs.passff-host}/share/passff-host/passff.json";
}