syncthing

This commit is contained in:
Lilith 2024-06-08 21:26:58 +02:00
parent da80e76c8d
commit bb7f4afae3
Signed by: lilith
GPG key ID: 8712A0F317C37175
16 changed files with 158 additions and 57 deletions

View file

@ -10,6 +10,7 @@
./git.nix ./git.nix
./gpg.nix ./gpg.nix
./helix.nix ./helix.nix
./hyprland
./packages.nix ./packages.nix
./playerctld.nix ./playerctld.nix
./rofi.nix ./rofi.nix

View file

@ -1,10 +1,12 @@
{...}: { { system-config, lib, ...}: {
imports = [ imports = [
./hyprgrass.nix # ./hyprgrass.nix
./utils.nix # ./utils.nix
]; ];
wayland.windowManager.hyprland = { wayland.windowManager = let
hyprDefaults = {
enable = true; enable = true;
xwayland.enable = true; xwayland.enable = true;
@ -16,8 +18,7 @@
"$fileManager" = "alacritty -e ranger"; "$fileManager" = "alacritty -e ranger";
monitor = [ monitor = [
"eDP-1, 1920x1080, 0x0, 1" ",preferred,1"
",preferred,auto,1"
]; ];
exec-once = [ exec-once = [
@ -55,8 +56,8 @@
gaps_in = 5; gaps_in = 5;
gaps_out = 5; gaps_out = 5;
border_size = 2; border_size = 2;
"col.active_border" = "rgba(5bcefaee) rgba(f5a9b8ee) 45deg"; # "col.active_border" = "rgba(5bcefaee) rgba(f5a9b8ee) 45deg";
"col.inactive_border" = "rgba(595959aa)"; # "col.inactive_border" = "rgba(595959aa)";
layout = "dwindle"; layout = "dwindle";
@ -75,7 +76,7 @@
drop_shadow = true; drop_shadow = true;
shadow_range = 4; shadow_range = 4;
shadow_render_power = 3; shadow_render_power = 3;
"col.shadow" = "rgba(1a1a1aee)"; # "col.shadow" = "rgba(1a1a1aee)";
}; };
animations = { animations = {
@ -170,4 +171,7 @@
]; ];
}; };
}; };
in {
hyprland = lib.recursiveUpdate hyprDefaults system-config.hyprlandOverrides;
};
} }

View file

@ -1,16 +1,15 @@
{ {lib, config}: {
lib,
config,
...
}: {
data = { data = {
directories = [ directories = [
".config/syncthing" ".config/syncthing"
".config/sops"
".gnupg" ".gnupg"
".local/share/PrismLauncher/instances" ".local/share/PrismLauncher/instances"
".ssh" ".ssh"
"nixos" "nixos"
"sync"
"code"
]; ];
files = []; files = [];
}; };
@ -22,18 +21,13 @@
".cargo" ".cargo"
".config/obsidian" ".config/obsidian"
".config/spotify" ".config/spotify"
(
lib.optional
config.gaming.enable
".local/share/PrismLauncher"
)
(
lib.optional
config.gaming.enable
".local/share/Steam"
)
".local/state/wireplumber" ".local/state/wireplumber"
".thunderbird" ".thunderbird"
"tmp"
] ++ lib.optionals config.gaming.enable [
".local/share/PrismLauncher"
".local/share/Steam"
".steam"
]; ];
files = []; files = [];
}; };

View file

@ -5,6 +5,6 @@
}: { }: {
imports = [sops-nix.homeManagerModules.sops]; imports = [sops-nix.homeManagerModules.sops];
sops = { sops = {
age.keyFile = "/persist/data${conf.home}/.config/sops/age/keys.txt"; age.keyFile = /persist/data${conf.home}/.config/sops/age/keys.txt;
}; };
} }

View file

@ -3,5 +3,20 @@
extraConfig = { extraConfig = {
config.gaming.enable = true; config.gaming.enable = true;
config.hyprlandOverrides = {
settings = {
input = {
kb_layout = "us,ru";
kb_options = "gpr:win_space_toggle";
};
monitor = [
"DP-3, 3840x2160, 0x0, 1.5"
"DP-4, 2560x1440, 2560x0, 1"
",preferred,auto,1"
];
};
};
}; };
} }

View file

@ -1,34 +1,60 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
config, imports =
lib, [ (modulesPath + "/installer/scan/not-detected.nix")
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod" "sdhci_pci"]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = []; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" =
device = "/dev/disk/by-uuid/080fa116-424e-4079-a2a6-658a230e2721"; { device = "tmpfs";
fsType = "ext4"; fsType = "tmpfs";
options = [ "defaults" ];
}; };
fileSystems."/boot" = { fileSystems."/persist/data" =
device = "/dev/disk/by-uuid/40E8-A12D"; { device = "/dev/disk/by-uuid/5dbe939d-54a5-4092-b9c6-83f6bd4cf925";
fsType = "btrfs";
neededForBoot = true;
options = [ "noatime" "compress=zstd" "subvol=persist/@data" ];
};
fileSystems."/persist/cache" =
{ device = "/dev/disk/by-uuid/5dbe939d-54a5-4092-b9c6-83f6bd4cf925";
fsType = "btrfs";
neededForBoot = true;
options = [ "noatime" "compress=zstd" "subvol=persist/@cache" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/5dbe939d-54a5-4092-b9c6-83f6bd4cf925";
fsType = "btrfs";
neededForBoot = true;
options = [ "noatime" "compress=zstd" "subvol=nix" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/6437-97E8";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp6s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View file

@ -3,6 +3,9 @@ user:
ssh: ssh:
public: ENC[AES256_GCM,data:DYYGLTFvmZa/bvAo0dvHiL9jt6cfSeZZN5Omo3af1lHhOfQYapqm7DXOf6xBn0HNr32L4gFEpE+2IquUaPUtY48nsC+PiuFSp1x/73/sjOCZdcTkGh7ehwZ4PECN3goIBw==,iv:Q4YZSMQhuIuiuiN94aHk2pwForVESEHhXjDAGTAhvR0=,tag:dFFBjKqIwn75m8GaXosjMQ==,type:str] public: ENC[AES256_GCM,data:DYYGLTFvmZa/bvAo0dvHiL9jt6cfSeZZN5Omo3af1lHhOfQYapqm7DXOf6xBn0HNr32L4gFEpE+2IquUaPUtY48nsC+PiuFSp1x/73/sjOCZdcTkGh7ehwZ4PECN3goIBw==,iv:Q4YZSMQhuIuiuiN94aHk2pwForVESEHhXjDAGTAhvR0=,tag:dFFBjKqIwn75m8GaXosjMQ==,type:str]
private: ENC[AES256_GCM,data:DHRNPGp2BRPuZ5mATxIsuKsKIjVo+hrzX+L+yZUWc/7xjjpMnlloZ7LCqlP4vXzJAEcolqwpnOLNM796WHtxO5I4HiK9R7p6EDfOGYor62RnhQ4YT7Rc75hWX0vX3dAsvd8/sAYcZMCxVAtCoc4c+UGHdNnh+0Nl6uWO5teakOGPnMqk+Wz1GI//quKxUWs9oRLrZ+093XqTjigcVJ8NcnYDl5RE46HLcgJOp8ii9PeSOI2XM2L6wSWpAO0E3OlAm3z0hTWUcvfIwKzWpkA132JCZJrQtNNsqez0ZBFJQkaaImRDi9y/jT6YInuDhc8gVct04oOda3qKxrm+JWXGOt7HkK54NQFouZbN6e3JZIQaMzz5jPhT/muPs6EsSudorcved/eoyR+rU2Yxn087EVRzqZUZXj3rZpCKWV9rZq8jzOd+g8P7pK1LyUqc98UqSigMdxYwcB6fp/iX7ZcG7wmoRNXbaXXhN1ksY36NqUSNtv5xrF95/THgxwFB6QgY6l+L/7bKblkeLGp1T4MeNSLjHku/0wKCF9fmBiGXTB3evyWl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3wEHjgrTA7v+agSgFfyQLZMV8YRH8eIbG4BLcr9afO84ahqZcWAH/ldFhZeC90nepHK2Lz0+zVIvKsGOPM45OU6Yypjr8FVTVinRr0yJpBgOciJTsZtFqnU2TFJxRoZuOTnTCrO2Kywg+rk1c7augAi30iljZx6Nfi24pBCrcwMeSkiT6uyAhkgiJH6XiIT3V7S/++krsijiTKqV2gqj6zgnE2aUQpinxTSMSj3V9+Hs9AMHdubjV+wb0Tm78m2Hev5iJ0f2gpVufadFCAjcy1ZPttfjBoZ26lOlKF16V,iv:0ewtb+t8woztUvr7XPE0gr94X97hnOaT0LomsmA3dQ0=,tag:0OBaQNkfrd3WQI9JBq15Ug==,type:str]
sops: sops:
kms: [] kms: []
gcp_kms: [] gcp_kms: []
@ -18,8 +21,8 @@ sops:
cFV0ZkliUHpKdEsyU0dEQUdNZ0kzb0UKSHUzMLKwB0s2CimzsIbktvng7dDReOzT cFV0ZkliUHpKdEsyU0dEQUdNZ0kzb0UKSHUzMLKwB0s2CimzsIbktvng7dDReOzT
ygaLq22ZrYvb1etPyroaJA1M5hzNo2VnCMVqa7vUbu/5ZHVLxW9n6Q== ygaLq22ZrYvb1etPyroaJA1M5hzNo2VnCMVqa7vUbu/5ZHVLxW9n6Q==
-----END AGE ENCRYPTED FILE----- -----END AGE ENCRYPTED FILE-----
lastmodified: "2024-06-07T22:26:31Z" lastmodified: "2024-06-08T18:44:51Z"
mac: ENC[AES256_GCM,data:dP0wFj2hx/YowxQ6+4/YvMsVbGakSlt66iKsZelEwDJVW2u6xjVyscQqaXLrmbq4fBopeumD7IfzHNKlt5dJgr13BYsoinllhPSTAOeJjdyi7okBEzF2Y13yryFZb/Pj6pKaUf4lXIhIxKD7azigJONO7NO38okFYdeCCNrEyfo=,iv:EVxMKMDSMiXpY8RbrzzIbCBpVywEBkwJBxEFBBcAr+A=,tag:5DSyNfDyVr/Dg+P/SG/QzQ==,type:str] mac: ENC[AES256_GCM,data:vDBK+lb0A9y8cgcHYpqA5DBxFlwS0hVk9NQgzKKqeRp+oSIRR0AlaLOJZbxEfZT4YXrQzMAIkIGTOs6Oz0Hn4aG04F+LPT/4N/d0lGacscQtuhpn+CdYpXpaCJ2YjbK+EoXCpparhmxSo15BOnHAGYiP2VEL/MmwvU7QS6+Ke4c=,iv:TzPiDgZsW91aK3gexVDz/xP3OTGlCSCgZ6VKvJB1TZc=,tag:f8TIqs8Z7PuaF5NtzjP3gA==,type:str]
pgp: pgp:
- created_at: "2024-06-07T11:56:01Z" - created_at: "2024-06-07T11:56:01Z"
enc: |- enc: |-

View file

@ -11,6 +11,7 @@
file file
htop htop
btop btop
git
jq jq
yq yq
du-dust du-dust

View file

@ -49,6 +49,7 @@ in {
./ssh.nix ./ssh.nix
./steam.nix ./steam.nix
./stylix.nix ./stylix.nix
./syncthing.nix
./wayland.nix ./wayland.nix
./zsh.nix ./zsh.nix

View file

@ -1,6 +1,7 @@
{...}: { {conf, ...}: {
environment.variables = { environment.variables = {
EDITOR = "hx"; EDITOR = "hx";
VISUAL = "hx"; VISUAL = "hx";
FLAKE = "/persist/data" + conf.home + "/nixos";
}; };
} }

View file

@ -1,4 +1,11 @@
{lib, ...}: { {lib, ...}: {
options.gaming.enable = lib.mkEnableOption "Enable gaming"; options.gaming.enable = lib.mkEnableOption "Enable gaming";
config.gaming.enable = lib.mkDefault false; config.gaming.enable = lib.mkDefault false;
options.hyprlandOverrides = lib.mkOption {
# type = lib.types.attributeSet;
default = {};
example = lib.literalExpression ''{ }'';
description = lib.mdDoc ''Override default Hyprland options in hm'';
};
} }

View file

@ -1,4 +1,4 @@
{impermanence, ...}: { {impermanence, conf, lib, config, ...}: {
imports = [impermanence.nixosModule]; imports = [impermanence.nixosModule];
environment.persistence."/persist/data" = { environment.persistence."/persist/data" = {
@ -10,7 +10,7 @@
]; ];
files = []; files = [];
# users.${conf.user} = (import ../home/persist.nix).data; users.${conf.user} = (import ../home/persist.nix { inherit config lib; }).data;
}; };
environment.persistence."/persist/cache" = { environment.persistence."/persist/cache" = {
@ -27,6 +27,6 @@
"/etc/machine-id" "/etc/machine-id"
]; ];
# users.${conf.user} = (import ../home/persist.nix).cache; users.${conf.user} = (import ../home/persist.nix { inherit config lib; }).cache;
}; };
} }

View file

@ -1,3 +1,6 @@
{sops-nix, ...}: { {sops-nix, conf, ...}: {
imports = [sops-nix.nixosModules.sops]; imports = [sops-nix.nixosModules.sops];
sops = {
age.keyFile = /persist/data${conf.home}/.config/sops/age/keys.txt;
};
} }

45
system/syncthing.nix Normal file
View file

@ -0,0 +1,45 @@
{ conf, config, ...}: {
sops.secrets."syncthing/key.pem" = {
sopsFile = ../hosts/${conf.hostname}/secrets/default.yaml
};
sops.secrets."syncthing/cert.pem" = {
sopsFile = ../hosts/${conf.hostname}/secrets/default.yaml
};
services.syncthing = {
user = conf.user;
dataDir = "$(conf.home)/sync";
configDir = "$(conf.home)/.config/syncthing";
overrideDevices = true;
overrideFolders = true;
settings = {
key = config.sops.secrets."syncthing/key.pem".path;
cert = config.sops.secrets."syncthing/cert.pem".path;
devices = {
"phone" = {id = "C2CKYRP-72UNJRX-MUPZIUY-CCHQYGF-6T4NA6B-MO7AEZB-RSN5EAG-CN2JCAF";};
"nixserver" = {id = "DW6GTZ3-3JPAHLO-UEB3LBL-AWOX3BT-QPI7ODT-OZ6Q4YR-K3KK22C-5RY3XQZ";};
"lilith-pc" = {id = "ZXFUFLA-MJJCNE4-SJTGTYD-SEJZUCX-3KIFTL6-LFIWBBU-HD2LX2F-7FQ5VAF";};
"lilith-pad" = {id = "GQJA6WA-G5YZZSN-4OOQMVE-JPIR22N-VFHPY4O-XMRG37D-DALH4R2-7DCTMQK";};
"lilith-old" = {id = "MSUZJ6K-4CIFE5D-ILO6FE4-SPRPTZI-VEWZQ7F-ECARCCF-2VLVMDQ-2HQUAAS";};
};
folders = {
"rdcj2-mfyb4" = {
path = "/home/spectre/sync";
devices = ["phone" "nixserver" "lilith-pad" "lilith-pc" "lilith-old"];
};
"sdpfs-2beqd" = {
path = "/home/spectre/.keepass";
devices = ["phone" "nixserver" "lilith-pad" "lilith-pc" "lilith-old"];
};
"7qim7-yzqpn" = {
path = "/home/spectre/obsidian";
devices = ["phone" "nixserver" "lilith-pad" "lilith-pc" "lilith-old"];
};
};
};
};
}

View file

@ -35,7 +35,7 @@
default_session = initial_session; default_session = initial_session;
initial_session = { initial_session = {
user = conf.user; user = conf.user;
command = "Hyprland; hyprlock"; command = "Hyprland";
}; };
}; };
}; };

View file

@ -1,4 +1,4 @@
{pkgs, ...}: { {pkgs, ...}: {
# programs.zsh.enable = true; programs.zsh.enable = true;
# users.defaultUserShell = pkgs.zsh; users.defaultUserShell = pkgs.zsh;
} }