refactor(nix): More split

Also added floorp, but not functional at the moment, it requires 24.11
This commit is contained in:
Ahmad Ansori Palembani 2024-10-18 21:06:26 +07:00
parent 0e80eb3083
commit 98d28abc3f
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
8 changed files with 142 additions and 42 deletions

14
.config/nix/flake.lock generated
View file

@ -99,11 +99,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720042825, "lastModified": 1726989464,
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -156,16 +156,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1720599075, "lastModified": 1729242558,
"narHash": "sha256-0pS6J6Jr7PEkjxkGolrWvilDIlgcEnMHAG9vxPuBeoE=", "narHash": "sha256-VgcLDu4igNT0eYua6OAl9pWCI0cYXhDbR+pWP44tte0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f694c70847dff1a24c29d2ff6b90966fe5619729", "rev": "4a3f2d3195b60d07530574988df92e049372c10e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixpkgs-24.05-darwin", "ref": "release-24.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View file

@ -31,7 +31,7 @@
}; };
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-24.05-darwin"; nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
nix-darwin = { nix-darwin = {
url = "github:LnL7/nix-darwin"; url = "github:LnL7/nix-darwin";

View file

@ -0,0 +1,80 @@
{ pkgs, config, vars, ... }:
{
programs = {
floorp = {
enable = true;
package = pkgs.emptyDirectory; # we only want the config
profiles.ziro = {
userChrome =
''
/**
* Better Floorp vertical tabs
*
* This makes Floorp's (expanded) vertical tabs not affecting sites' width,
* which can cause lag on heavy websites like Twitch and YouTube.
*
* This also fixed vertical tabs' width breaking when some preference related
* to browser's "head" is changed
*
* Based on my changes for Pulse, but Pulse is dead.
* REF: https://github.com/null2264/pulse/commit/fce966a110c2987b08d35bcd04c5992655b24b13
*/
:root {
/* from Floorp source code, too big for me */
/*--default-verticaltab-width: 45px;*/
/*--hoverd-verticaltab-width: 20em;*/
--default-verticaltab-width: 35px !important;
--hoverd-verticaltab-width: 18em;
}
@charset "UTF-8";
@-moz-document url(chrome://browser/content/browser.xhtml) {
.browserContainer {
border-inline-width: 0 !important;
}
/* >> Fix height being inconsistent on hover */
.tab-icon-stack,
.tab-label-container {
height: 2.7em !important;
}
.tab-icon-stack {
align-items: center;
}
/* << Fix height being inconsistent on hover */
#sidebar-select-box {
width: var(--default-verticaltab-width) !important;
min-width: var(--default-verticaltab-width) !important;
max-width: var(--default-verticaltab-width) !important;
}
#TabsToolbar {
position: relative !important;
transition: all 300ms !important;
width: calc(var(--default-verticaltab-width) + 5px) !important;
min-width: calc(var(--default-verticaltab-width) + 5px) !important;
max-width: calc(var(--default-verticaltab-width) + 5px) !important;
z-index: 1; /* Probably not needed, since Floorp already handle this */
}
#TabsToolbar:not(:hover) {
scrollbar-width: none !important;
}
#TabsToolbar:hover {
transition: all 300ms !important;
width: var(--hoverd-verticaltab-width) !important;
min-width: var(--hoverd-verticaltab-width) !important;
max-width: var(--hoverd-verticaltab-width) !important;
z-index: 2; /* Probably not needed, since Floorp already handle this */
margin-right: calc((var(--hoverd-verticaltab-width) - var(--default-verticaltab-width) - 5px) * -1) !important;
}
}
'';
};
};
};
}

View file

@ -24,7 +24,22 @@ in
inherit pkgs; inherit pkgs;
extraSpecialArgs = { inherit inputs pkgs home-manager vars; }; extraSpecialArgs = { inherit inputs pkgs home-manager vars; };
modules = [ modules = [
./ziro.nix ./ziro
./ziro/darwin.nix
];
};
"ziro@potato" =
let
inherit (mkSystem "x86_64-linux" nixpkgs) system pkgs;
in
home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit inputs pkgs home-manager vars; };
modules = [
./ziro
./ziro/linux.nix
#../modules/home-manager/floorp.nix # FIXME: Added on 24.11
]; ];
}; };
} }

View file

@ -1,33 +0,0 @@
{ pkgs, config, vars, ... }:
let
dirPrefix = if pkgs.stdenv.isDarwin then "/Users/" else "/home/";
in {
home = {
username = "ziro";
homeDirectory = dirPrefix + "ziro";
};
programs = {
browserpass = {
enable = true;
browsers = [ "brave" "chrome" ]; # Arc and Chrome share the same `Application Support` dir, not sure why tbh.
};
};
# 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.stateVersion = "24.05";
}

View file

@ -0,0 +1,24 @@
{ pkgs, config, vars, ... }:
{
home.homeDirectory = "/Users/ziro";
programs.browserpass = {
enable = true;
browsers = [ "brave" "chrome" ]; # Arc and Chrome share the same `Application Support` dir, not sure why tbh.
};
# 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;
};
};
}

View file

@ -0,0 +1,9 @@
{ pkgs, config, vars, ... }:
{
home = {
username = "ziro";
};
home.stateVersion = "24.05";
}

View file

@ -0,0 +1,5 @@
{ pkgs, config, vars, ... }:
{
home.homeDirectory = "/home/ziro";
}