backups n stuff

This commit is contained in:
mjallen18
2024-08-01 21:59:05 -05:00
parent c685f3bfdf
commit 26cc1b223f
6 changed files with 190 additions and 52 deletions

View File

@@ -84,6 +84,67 @@ in
desktopManager.plasma6.enable = false;
};
};
hyprland.configuration = {
services = {
displayManager.sddm.enable = true;
displayManager.defaultSession = "hyprland";
# disable plasma
desktopManager.plasma6.enable = false;
};
programs.hyprland = {
enable = true;
xwayland.enable = true;
};
# Hint Electon apps to use wayland
environment.sessionVariables = {
NIXOS_OZONE_WL = "1";
};
environment.systemPackages = with pkgs; [
hyprland
swww # for wallpapers
xdg-desktop-portal-gtk
xdg-desktop-portal-hyprland
xwayland
meson
wayland-protocols
wayland-utils
wl-clipboard
wlroots
networkmanagerapplet
kitty
rofi-wayland
wofi
dunst
libnotify
waybar
];
services.dbus.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
];
};
fonts.fonts = with pkgs; [
nerdfonts
meslo-lgs-nf
];
nixpkgs.overlays = [
(self: super: {
waybar = super.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
});
})
];
};
};
apps.discover-wrapped.enable = false;
@@ -154,27 +215,38 @@ in
ratbagd.enable = true;
};
systemd.services = {
fix-wifi = {
path = [
pkgs.bash
pkgs.networkmanager
pkgs.kmod
];
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = [ "${resetNetworkScript}/bin/reset-network" ];
systemd = {
services = {
fix-wifi = {
path = [
pkgs.bash
pkgs.networkmanager
pkgs.kmod
];
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = [ "${resetNetworkScript}/bin/reset-network" ];
};
};
};
# rsync-home = {
# path = [ pkgs.bash pkgs.rsync ];
# script = ''
# rsync -rtpogv --progress --ignore-existing --exclude={'/home/matt/Games/*', '/home/matt/1TB/*'} -lHzs /home/matt /media/nas/backup/desktop-nix/home
# '';
# };
user.services = {
rclone-home-proton = {
path = [ pkgs.bash pkgs.rclone ];
script = ''
rclone sync /home/matt proton-drive:backup-nix --exclude '/home/matt/Games/**' --exclude '/home/matt/1TB/**' --exclude '/home/matt/Downloads/**'
'';
};
rsync-home = {
path = [ pkgs.bash pkgs.rsync pkgs.openssh ];
script = ''
rsync -rtpogvPlHzs --ignore-existing --exclude={'/home/matt/Games', '/home/matt/1TB', '/home/matt/Downloads/*', '/home/matt/.cache'} -e ssh /home/matt admin@10.0.1.18:/media/nas/main/backup/desktop-nix/home
'';
};
};
};
# Networking configs
@@ -218,8 +290,11 @@ in
nano
onlyoffice-bin
os-prober
nil
papirus-icon-theme
pciutils
rclone
rclone-browser
rsync
sbctl
vim
@@ -248,6 +323,7 @@ in
"wheel"
"networkmanager"
"ratbagd"
"input"
]; # Enable sudo for the user.
shell = pkgs.zsh;
};

View File

@@ -1,7 +1,4 @@
{ pkgs, ... }:
# let
# gnome = false;
# in
{
home.username = "matt";
@@ -23,6 +20,7 @@
shellAliases = {
ll = "ls -alh";
update = "sudo nixos-rebuild switch";
update-flake = "sudo nix flake update ~/nix-config";
update-specialisation = "sudo nixos-rebuild switch --specialisation";
nas-update = "nixos-rebuild switch --use-remote-sudo --target-host admin@jallen-nas.local --build-host localhost --flake ~/nix-config#jallen-nas";
nas-ssh = "ssh admin@jallen-nas.local";
@@ -68,6 +66,7 @@
gamescope-wsi_git
goverlay
heroic
home-manager
libreoffice-qt6-fresh
lm_sensors
lutris
@@ -84,6 +83,11 @@
protonvpn-gui
protonvpn-gui
python3
python312Packages.tox
python312Packages.setuptools
python312Packages.pytest
python312Packages.pytest-cov
python312Packages.pyaml
spotify
tree
virt-manager
@@ -124,4 +128,32 @@
};
};
specialisation.hyprland.configuration = {
wayland.windowManager.hyprland.enable = true;
wayland.windowManager.hyprland.settings = {
"$mod" = "SUPER";
bind =
[
"$mod, F, exec, firefox"
", Print, exec, grimblast copy area"
]
++ (
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
builtins.concatLists (builtins.genList (
x: let
ws = let
c = (x + 1) / 10;
in
builtins.toString (x + 1 - (c * 10));
in [
"$mod, ${ws}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
]
)
10)
);
};
};
}

View File

@@ -97,6 +97,7 @@ in
nodejs-18_x
nut
nmon
pass
protonvpn-cli
protonmail-bridge
pass
@@ -147,6 +148,7 @@ in
# Admin account
users."${user}" = {
isNormalUser = true;
linger = true;
extraGroups = [
"wheel"
"networkmanager"

View File

@@ -88,7 +88,16 @@
];
};
swapDevices = [ { device = "/dev/disk/by-uuid/c08ba901-a8a9-4006-9688-002bb24da1b6"; } ];
swapDevices = [
{
device = "/dev/disk/by-id/ata-Samsung_SSD_860_EVO_500GB_S3Z1NW0KA10457X-part2";
randomEncryption.enable = true;
}
{
device = "/dev/disk/by-id/ata-SSD2SC240G1SA754D117-820_PNY29140000558890457";
randomEncryption.enable = true;
}
];
# 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

View File

@@ -155,9 +155,28 @@ in
};
};
systemd.user.services = {
protonmail-bridge = {
description = "Protonmail Bridge";
enable = true;
script = "${pkgs.protonmail-bridge}/bin/protonmail-bridge --noninteractive";
path = [ pkgs.pass pkgs.protonmail-bridge ];
wantedBy = [ "multi-user.target" ];
partOf = [ "multi-user.target" ];
};
};
systemd.services = {
rsync-ssd = {
path = [ pkgs.bash pkgs.rsync ];
script = ''
rsync -rtpogvPlHzs --ignore-existing /media/nas/ssd /media/nas/main/backup/ssd
'';
};
tailscale-autoconnect = {
enable = false;
description = "Automatic connection to Tailscale";
# make sure tailscale is running before trying to connect to tailscale