Compare commits
2 Commits
b8abf4e3dd
...
e13cd11a68
Author | SHA1 | Date |
---|---|---|
htran | e13cd11a68 | |
htran | 187890cc9b |
742
flake.lock
742
flake.lock
File diff suppressed because it is too large
Load Diff
|
@ -5,3 +5,4 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFQN5Ia8rTalnQgcvdxH2n7UNNT1Tq9UvNdJeg9ziJ
|
||||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCgmng5xL/auvI2F8ufFAfId2Ey55ONHjgnKKSEWLVWkPMutXT3BCnSglNAuEVRLX2zfzg3beQd80AHTow+qro5QWI/rYfeL1QPNEwoThbRFcvtWLTlgzBGA4ejjpIF9sCPNp0sXrrQRfxRP7w4b23BcRJQcsDoaEtKGKJZ2GQIoOafkYypwcunANb54EAouZTfHEPKDr26Gfw8usc2Sae32G/80QLBF2jGabyexJjNE3F6hdJTwq5iiqIVdSr4ue82zo3M8jBdtCMDGaOliI5RWSa9iuX9o2scCGDU69Gkw7ma+JHOP/e9Z8sUz03TkjPbEnGi3EC3YAHEoDzmwqTi07hppCuzacLB5NZ9UZ1g5PzBIZR8TJTONngT08EQyGrkNv2sUnn0dtBqve5tHR04NuXy65ym7Iwl2DDVbAL0NlM4gKWzOGZ2CnSLT0WmkG2sQKU37NmS2pBJ8RXJBatUFe4vQVzqlFj39iRGIBV5XR0I9xcxDfCxBHFs3aIqAqE= hwtr@hwtr-prince
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCgmng5xL/auvI2F8ufFAfId2Ey55ONHjgnKKSEWLVWkPMutXT3BCnSglNAuEVRLX2zfzg3beQd80AHTow+qro5QWI/rYfeL1QPNEwoThbRFcvtWLTlgzBGA4ejjpIF9sCPNp0sXrrQRfxRP7w4b23BcRJQcsDoaEtKGKJZ2GQIoOafkYypwcunANb54EAouZTfHEPKDr26Gfw8usc2Sae32G/80QLBF2jGabyexJjNE3F6hdJTwq5iiqIVdSr4ue82zo3M8jB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XIAmNCnmMHelObCSDPzYg8psZAUk1ZZY//pnhp9JRPsC2JxsshN7HCNIED9aFgrJkvUt+wUVGjVHzyQwyR6J7m1yyoivTwdmYdulG7OriLeeNq8vkoDmLGgLSC+zKehzJYOZsH3EKuxuZjQ3J9tK/NseQOhsQglRHE/OvphMwT/J96gl9dZR/LQXp4S6hwLccTzFfs8rLaTOIK6CEpqBUuBonot/1vJP5j5E73hfkHwZO7TQKwfXtpRCxCl5Nm3cB2Y3kz5mArDiwWioVsX4qd0XR0F9MFtuTVTn2f4K/Gwr9P3XMkLWXU1+1KbQiWIg+Zf5DpQgBW5HWryZzsMcjyMC2I2BJCl6Q+V8ofSM= nixos@Felia
|
||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJvOCZ4nyFiiKK7gkwzP4hXJ6NmtgbdUJdWgIzUL0GMA htran@Hungs-MacBook-Pro.local
|
||||||
|
|
|
@ -4,3 +4,6 @@ post-build-hook = /etc/nix/upload-to-cache.sh
|
||||||
trusted-users = root htran hungtran hwtr
|
trusted-users = root htran hungtran hwtr
|
||||||
max-jobs = 8
|
max-jobs = 8
|
||||||
cores = 12
|
cores = 12
|
||||||
|
# default is true for Linux, false for every one else
|
||||||
|
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-sandbox
|
||||||
|
sandbox = true
|
||||||
|
|
|
@ -2,8 +2,9 @@ let
|
||||||
# user-specific (~/.ssh/id_ed25519.pub)
|
# user-specific (~/.ssh/id_ed25519.pub)
|
||||||
users = {
|
users = {
|
||||||
"hungtr@bao" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK+1+gps6phbZboIb9fH51VNPUCkhSSOAbkI3tq3Ou0Z";
|
"hungtr@bao" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK+1+gps6phbZboIb9fH51VNPUCkhSSOAbkI3tq3Ou0Z";
|
||||||
|
"htran@Hungs-MacBook-Pro.local" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJvOCZ4nyFiiKK7gkwzP4hXJ6NmtgbdUJdWgIzUL0GMA";
|
||||||
};
|
};
|
||||||
# System-specific settings (/etc/ssh/ssh_hsot_ed25519_key.pub)
|
# System-specific settings (/etc/ssh/ssh_host_ed25519_key.pub)
|
||||||
systems = {
|
systems = {
|
||||||
"bao" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIBuAaAE7TiQmMH300VRj/pYCri1qPmHjd+y9aX2J0Fs";
|
"bao" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIBuAaAE7TiQmMH300VRj/pYCri1qPmHjd+y9aX2J0Fs";
|
||||||
};
|
};
|
||||||
|
|
|
@ -49,6 +49,7 @@ in {
|
||||||
home.homeDirectory = "/Users/htran";
|
home.homeDirectory = "/Users/htran";
|
||||||
home.stateVersion = "23.11";
|
home.stateVersion = "23.11";
|
||||||
}
|
}
|
||||||
|
home-profiles.passman
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
cell,
|
||||||
|
}: {
|
||||||
|
rclone-mount = {
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.services.rclone;
|
||||||
|
rcloneCommand = "${pkgs.rclone}/bin/rclone";
|
||||||
|
|
||||||
|
inherit (lib) mkEnableOption mkOption types mkIf mapAttrs' nameValuePair;
|
||||||
|
makeMountService = name: mountCfg: {
|
||||||
|
Unit = {
|
||||||
|
Description = "Rclone Mount ${name}";
|
||||||
|
After = ["network.target"];
|
||||||
|
};
|
||||||
|
|
||||||
|
Service = {
|
||||||
|
ExecStart = "${rcloneCommand} mount ${mountCfg.remotePath} ${mountCfg.mountPoint}";
|
||||||
|
Restart = "on-failure";
|
||||||
|
};
|
||||||
|
|
||||||
|
Install = {WantedBy = ["default.target"];};
|
||||||
|
};
|
||||||
|
|
||||||
|
makeLaunchdService = name: mountCfg: {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
ProgramArguments = ["/bin/sh" "-c" "${rcloneCommand} mount ${mountCfg.remotePath} ${mountCfg.mountPoint}"];
|
||||||
|
KeepAlive = {
|
||||||
|
NetworkState = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options.services.rclone = {
|
||||||
|
enable = mkEnableOption "rclone mount service";
|
||||||
|
|
||||||
|
mounts = mkOption {
|
||||||
|
type = types.attrsOf (types.submodule {
|
||||||
|
options = {
|
||||||
|
remotePath = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
description = "The remote path to mount via rclone";
|
||||||
|
};
|
||||||
|
|
||||||
|
mountPoint = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
description = "The local mount point for the rclone mount";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
default = {};
|
||||||
|
description = "Rclone mounts";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [pkgs.rclone];
|
||||||
|
|
||||||
|
systemd.user.services = mapAttrs' (n: v: nameValuePair "rclone-mount-${n}" (makeMountService n v)) cfg.mounts;
|
||||||
|
|
||||||
|
launchd.user.agents = mapAttrs' (n: v: nameValuePair "rclone-mount-${n}" (makeLaunchdService n v)) cfg.mounts;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -209,4 +209,10 @@ in {
|
||||||
inputs.nixpkgs.zk
|
inputs.nixpkgs.zk
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
passman = {
|
||||||
|
# Bruh, keepassxc on Darwin doesn't contain cli
|
||||||
|
# On Linux, however, it correctly gives `keepassxc-cli`
|
||||||
|
home.packages = [cell.packages.kpxc];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# TODO: vim-plug and Mason supports laziness. Probably worth it to explore incremental dependencies based on the project
|
# TODO: vim-plug and Mason supports laziness. Probably worth it to explore incremental dependencies based on the project
|
||||||
# TODO: just install these things, then symlink to mason's bin directory
|
# TODO: just install these things, then symlink to mason's bin directory
|
||||||
# One thing to consider, though, /nix/store of `nix-shell` or `nix-develop`
|
# One thing to consider, though, /nix/store of `nix-shell` or `nix-develop`
|
||||||
# might be different from `home-manager`'s (~/.nix_profile/bin/jq)
|
# might be different from `home-manager`'s (~/.nix_profile/bin/jq)
|
||||||
|
@ -176,15 +176,14 @@ in {
|
||||||
vim-dispatch-neovim
|
vim-dispatch-neovim
|
||||||
vim-fugitive
|
vim-fugitive
|
||||||
vim-jack-in
|
vim-jack-in
|
||||||
({
|
{
|
||||||
plugin = sg-nvim;
|
plugin = sg-nvim;
|
||||||
# Wait, this mean the plugin is only lua only since package.cpath is Lua API
|
# NOTE: Wait, this mean the plugin is exclusively lua only since package.cpath is Lua API
|
||||||
config = ''
|
config = ''
|
||||||
package.cpath = package.cpath .. ";${sg-nvim}/lib/*.so;${sg-nvim}/lib/*.dylib"
|
package.cpath = package.cpath .. ";${sg-nvim}/lib/*.so;${sg-nvim}/lib/*.dylib"
|
||||||
'';
|
'';
|
||||||
type = "lua";
|
type = "lua";
|
||||||
|
}
|
||||||
})
|
|
||||||
nui-nvim
|
nui-nvim
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,37 @@
|
||||||
{
|
{
|
||||||
inputs,
|
inputs,
|
||||||
cell,
|
cell,
|
||||||
}: {
|
}: let
|
||||||
|
pkgs = inputs.nixpkgs;
|
||||||
|
in {
|
||||||
inherit (inputs.cells.dotfiles.packages) kpcli-py;
|
inherit (inputs.cells.dotfiles.packages) kpcli-py;
|
||||||
|
kpxc = let
|
||||||
|
inherit (pkgs) keepassxc;
|
||||||
|
in
|
||||||
|
pkgs.stdenv.mkDerivation {
|
||||||
|
pname = "keepassxc-darwin";
|
||||||
|
version = keepassxc.version;
|
||||||
|
|
||||||
|
phases = ["installPhase"];
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp -r ${keepassxc}/* $out/
|
||||||
|
|
||||||
|
${
|
||||||
|
if pkgs.stdenv.hostPlatform.isDarwin
|
||||||
|
then ''
|
||||||
|
for exe in $(find $out/Applications/KeePassXC.app/Contents/MacOS/ -type f -executable); do
|
||||||
|
exe_name=$(basename $exe)
|
||||||
|
ln -s $exe $out/bin/$exe_name
|
||||||
|
done
|
||||||
|
''
|
||||||
|
else ""
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
meta =
|
||||||
|
keepassxc.meta
|
||||||
|
// {
|
||||||
|
description = "Wrapper for keepassxc and keepassxc-cli with additional Darwin-specific fixes";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue