Skip to content

Commit

Permalink
feat: syncthing and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
sioodmy committed Dec 3, 2023
1 parent 504a92a commit 75a5006
Show file tree
Hide file tree
Showing 16 changed files with 280 additions and 224 deletions.
266 changes: 133 additions & 133 deletions flake.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
nix-super.url = "github:privatevoid-net/nix-super";

schizofox = {
url = "github:schizofox/schizofox";
url = "github:schizofox/schizofox/wavefox";
# url = "path:/home/sioodmy/dev/schizofox";
inputs = {
nixpkgs.follows = "nixpkgs";
Expand Down
3 changes: 2 additions & 1 deletion home/impermanence.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ _: {
"music"
"dev"
"docs"
".keepass"
"vids"
"other"
{
Expand All @@ -26,8 +27,8 @@ _: {
".cache/tealdeer"
".local/share/distrobox"
".cache/containers"
".cache/flutter"
".config/syncthing"
".cache/flutter"
".local/share/PrismLauncher"
".local/share/TelegramDesktop"
".local/share/keyrings"
Expand Down
1 change: 0 additions & 1 deletion home/misc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
./media.nix
./schizofox.nix
./rnnoise.nix
./syncthing.nix
./swayidle.nix
];
}
42 changes: 19 additions & 23 deletions home/misc/schizofox.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,37 @@
package = pkgs.firefox-esr-115-unwrapped;
security = {
sanitizeOnShutdown = false;
sandbox = false;
sandbox = true;
userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0";
};

theme = {
background-darker = "181825";
background = "1e1e2e";
foreground = "cdd6f4";
darkTheme = true;
font = "Lexend";
simplefox.enable = true;
wavefox = {
enable = true;
transparency = "High";
tabs = {
oneline = "NavBarFirst";
shadowSaturation = "High";
};
menu.density = "Compact";
};
darkreader.enable = true;
};

extensions.extraExtensions = {
"webextension@metamask.io".install_url = "https://addons.mozilla.org/firefox/downloads/latest/ether-metamask/latest.xpi";
};
search = {
defaultSearchEngine = "Google";
searx-randomizer = {
enable = true;
instances = ["searx.be" "search.notashelf.dev" "searx.tiekoetter.com" "opnxng.com"];
};
defaultSearchEngine = "Searx";
removeEngines = ["Bing" "Amazon.com" "eBay" "Twitter" "Wikipedia"];
addEngines = [
{
Name = "LibreY";
Description = "femboy search :3";
Alias = "!ly";
Method = "GET";
URLTemplate = "https://search.ahwx.org/search.php?q={searchTerms}&p=0&t=0";
}
{
Name = "Etherscan";
Description = "Checking balances";
Alias = "!eth";
Method = "GET";
URLTemplate = "https://etherscan.io/search?f=0&q={searchTerms}";
}
];
};
extensions.extraExtensions = {
"webextension@metamask.io".install_url = "https://addons.mozilla.org/firefox/downloads/latest/ether-metamask/latest.xpi";
};
};
}
5 changes: 0 additions & 5 deletions home/misc/syncthing.nix

This file was deleted.

3 changes: 2 additions & 1 deletion home/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
postBuild = "wrapProgram $out/bin/ledger-live-desktop --add-flags --use-gl=desktop";
})
inputs.blahaj.packages.${pkgs.system}.default
anytype
distrobox
gnome.geary
cargo-tauri
Expand All @@ -23,6 +22,8 @@
caprine-bin
pulseaudio
onefetch
brave
session-desktop
pfetch-rs
qrcp
nheko
Expand Down
2 changes: 1 addition & 1 deletion home/rice/hyprland/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ in {
animation = "fromTop";
};
spotify = {
command = "foot --title scratchpad-spotify -e spt";
command = "foot --title scratchpad-spotify -e sh -c 'systemctl --user restart spotifyd; sleep 1; spt'";
margin = 50;
unfocus = "hide";
animation = "fromTop";
Expand Down
93 changes: 46 additions & 47 deletions home/rice/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,58 +15,57 @@ in {
imports = [./config.nix];
home.packages = with pkgs;
with inputs.hyprcontrib.packages.${pkgs.system};
with inputs.xdg-portal-hyprland.packages.${pkgs.system};
with inputs.hyprpicker.packages.${pkgs.system};
with inputs.shadower.packages.${pkgs.system}; [
libnotify
wf-recorder
brightnessctl
xdg-desktop-portal-hyprland
pamixer
python39Packages.requests
slurp
grim
hyprpicker
swappy
grimblast
shadower
hyprpicker
wl-clip-persist
wl-clipboard
pngquant
cliphist
(writeShellScriptBin
"pauseshot"
''
${hyprpicker}/bin/hyprpicker -r -z &
picker_proc=$!
# with inputs.xdg-portal-hyprland.packages.${pkgs.system};
# with inputs.hyprpicker.packages.${pkgs.system};
# with inputs.shadower.packages.${pkgs.system}; [
[
libnotify
wf-recorder
brightnessctl
xdg-desktop-portal-hyprland
pamixer
python39Packages.requests
slurp
grim
hyprpicker
swappy
grimblast
# shadower
hyprpicker
wl-clip-persist
wl-clipboard
pngquant
cliphist
(writeShellScriptBin
"pauseshot"
''
${hyprpicker}/bin/hyprpicker -r -z &
picker_proc=$!
${grimblast}/bin/grimblast save area -
${grimblast}/bin/grimblast save area -
kill $picker_proc
'')
(pkgs.python3Packages.buildPythonPackage rec {
pname = "pyprland";
version = "1.4.1";
src = pkgs.fetchPypi {
inherit pname version;
sha256 = "sha256-JRxUn4uibkl9tyOe68YuHuJKwtJS//Pmi16el5gL9n8=";
};
format = "pyproject";
propagatedBuildInputs = with pkgs; [
python3Packages.setuptools
python3Packages.poetry-core
poetry
];
doCheck = false;
})
];
kill $picker_proc
'')
(pkgs.python3Packages.buildPythonPackage rec {
pname = "pyprland";
version = "1.4.1";
src = pkgs.fetchPypi {
inherit pname version;
sha256 = "sha256-JRxUn4uibkl9tyOe68YuHuJKwtJS//Pmi16el5gL9n8=";
};
format = "pyproject";
propagatedBuildInputs = with pkgs; [
python3Packages.setuptools
python3Packages.poetry-core
poetry
];
doCheck = false;
})
];

wayland.windowManager.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.default.override {
enableNvidiaPatches = true;
};
package = inputs.hyprland.packages.${pkgs.system}.default;
systemd.enable = true;
};

Expand Down
13 changes: 4 additions & 9 deletions secrets/secrets.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
{config, ...}: let
let
sioodmy = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE9ExEl6WqtCI4yCqbSAhAGmzvVp/nYADbgy/Qi4AKQy sioodmy@anthe";

anthe = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC3LBESPBY559NbAJ7KL/+K4S5InhWf5YDQgl2XjT5ZxTtPg0x24IDcEmxrPi+7nKSAvMJCkneTfWHPYoRYrNA/G15a+Pqr/9w1EtuK+D054qtz2q+oUM029JdTP/0qzbKxAV/qzUXyJyrgcGRnRYhFRKmg3Sl7G7mxhYN20RIYL3ENXnpfculGrnqX8yONda7YRQfjyEQAsLUIS4aEN7pQsUGO2lGzvXueHcRGRflbatVD59REWoD5kYE984EVhgbky092HHhDR5rIFnFJygrhl9irYk7x6Un98qsvKBeRKzpNMZ1iqs8EFdSbayNdRimooSyFLx83pUhx7SY01cJXxuVmW8Rec9xgnW8rrclz2H+ArQHSZQz/T/QPH2zZgtE3A2xX5HsmQnCu/h7yOpwD6ULTyR8/xK61jHgx4AM1hLyGGrMoPailSXyvT9OGnmXuvcIrx8R2oHy7e48DGWiTHoW8+nltWURkUjdolg373ruLxT+Rqf1JFgPcFwCEVSjVxtTz33ljFD31OOKjs5O2y/9jndwcx54twlgLr+H/6Y1SWIPNeuhNO3IiGuFkH3+JLrQLXVN9UIE1/qHyOIIJpR3ONd4uW6xDsnl8SBZUWuYf468FQGHkinWZxdYdi1SlHbulXxGPTiRjqSUBeR9fB+CND2WJEvfeSJccofk29w== root@anthe";
in {
age.identityPaths =
if config.custom.impermanence.enable
then [
"/persist/home/sioodmy/.ssh/id_ed25519"
]
else [
"/home/sioodmy/.ssh/id_ed25519"
];
age.identityPaths = "/persist/home/sioodmy/.ssh/id_ed25519";
"spotify.age".publicKeys = [sioodmy anthe];
"syncthing-key.age".publicKeys = [sioodmy anthe];
"syncthing-cert.age".publicKeys = [sioodmy anthe];
}
Binary file added secrets/syncthing-cert.age
Binary file not shown.
Binary file added secrets/syncthing-key.age
Binary file not shown.
1 change: 1 addition & 0 deletions system/core/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
./system.nix
./schizo.nix
./network.nix
./syncthing.nix
./impermanence.nix
./virtualisation.nix
./nix.nix
Expand Down
13 changes: 11 additions & 2 deletions system/core/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@
owner = "sioodmy";
group = "users";
};
age.secrets.syncthing-key = {
file = ../../secrets/syncthing-key.age;
owner = "sioodmy";
group = "users";
};
age.secrets.syncthing-cert = {
file = ../../secrets/syncthing-cert.age;
owner = "sioodmy";
group = "users";
};

nh = {
enable = true;
Expand All @@ -62,8 +72,7 @@
"nvidia-x11"
"nvidia-settings"
# they got fossed recently so idk
"Anytype"
"Anytype-0.35.4"
"Anytype-0.35.25-beta"
];
overlays = [
inputs.nixpkgs-wayland.overlay
Expand Down
59 changes: 59 additions & 0 deletions system/core/syncthing.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{config, ... }: {
networking.firewall.allowedTCPPorts = [8384];
services.syncthing = let
hm = "/home/sioodmy";
in {
enable = true;
systemService = true;
user = "sioodmy";
configDir = "${hm}/.config/syncthing";
dataDir = "${hm}/.config/syncthing";
openDefaultPorts = true;
guiAddress = "127.0.0.1:8384";
overrideDevices = true;
overrideFolders = true;
key = config.age.secrets.syncthing-key.path;
cert = config.age.secrets.syncthing-cert.path;
settings = {
devices = {
"methone" = {id = "FDHPTFD-BJK2ER6-2C4A5DU-5VMUAOF-M4VGKM2-VZJS5IT-KP7ADOQ-UEFJLAU";};
};
folders = {
"photos" = {
id = "pixel_7_pro_6dj3-photos";
path = "${hm}/pics/cam";
devices = ["methone"];
versioning = {
type = "staggered";
params = {
cleanInterval = "3600"; # 1 hour
maxAge = "1209600"; # 14 days
};
};
};
"keepass" = {
id = "wwm5g-uhgoz";
path = "${hm}/.keepass";
devices = ["methone"];
versioning = {
type = "staggered";
params = {
cleanInterval = "3600"; # 1 hour
maxAge = "1209600"; # 14 days
};
};
};
};
};
};

# credits: Ramblurr
# https://github.com/Ramblurr/nixcfg/blob/7343640bd4f5474eeba3b115424c2b0ccc809858/hosts/unstable/x86_64-linux/quine/syncthing.nix#L103
# FIX: home-manager impermanence
# when using with home-manager impermanence we need to ensure that home-manager activates before
# syncthing. otherwise the syncthing init will create ~/.config/syncthing, but ~/.config will be created
# with root:root ownership.
systemd.services.syncthing.after = ["home-manager-sioodmy.service"];
systemd.services.syncthing-init.after = ["home-manager-sioodmy.service"];
# END FIX: home-manager impermanence
}
1 change: 1 addition & 0 deletions system/wayland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-hyprland
];
};

Expand Down

0 comments on commit 75a5006

Please sign in to comment.