regular backup

This commit is contained in:
arielherself 2024-10-11 12:53:27 +08:00
parent 88fb1877ea
commit eb59759b6f
Signed by: arielherself
SSH Key Fingerprint: SHA256:AK3cyo9tFsp7Mox7K0sYphleC8hReXhnRKxwuDT5LBc
2 changed files with 46 additions and 12 deletions

View File

@ -24,8 +24,17 @@ in {
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader = {
efi.canTouchEfiVariables = true;
grub = {
enable =true;
devices = [ "nodev" ];
efiSupport = true;
useOSProber = true;
};
};
# boot.loader.systemd-boot.enable = true;
# boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "zbook"; # Define your hostname.
# Pick only one of the below networking options.
@ -33,7 +42,10 @@ in {
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "Asia/Shanghai";
time = {
timeZone = "Asia/Shanghai";
hardwareClockInLocalTime = true;
};
# Configure network proxy if necessary
networking.nameservers = [
@ -93,6 +105,13 @@ in {
};
# services.networking.wireless.userControlled = true;
services.blueman.enable = true;
services.earlyoom = {
enable = true;
freeMemThreshold = 3;
freeSwapThreshold = 3;
};
services.gvfs.enable = true;
services.udisks2.enable = true;
@ -119,7 +138,7 @@ in {
enable = true;
enableOffloadCmd = true;
};
amdgpuBusId = "PCI:101:0:0";
amdgpuBusId = "PCI:102:0:0";
nvidiaBusId = "PCI:1:0:0";
};
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
@ -168,6 +187,7 @@ in {
"wireshark"
"vboxusers"
"networkmanager"
"docker"
]; # Enable sudo for the user.
packages = with pkgs; [
home-manager
@ -199,6 +219,10 @@ in {
iptables
];
environment.etc."fuse.conf".text = ''
user_allow_other
'';
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
programs.mtr.enable = true;
@ -230,15 +254,24 @@ in {
htb = { config = '' config /home/user/Downloads/starting_point_bzw.ovpn ''; };
};
virtualisation.virtualbox = {
host = {
enable = true;
enableExtensionPack = true;
virtualisation = {
virtualbox = {
host = {
enable = true;
enableExtensionPack = true;
};
guest = {
enable = true;
draganddrop = true;
clipboard = true;
};
};
guest = {
docker = {
enable = true;
draganddrop = true;
clipboard = true;
rootless = {
enable = true;
setSocketVariable = true;
};
};
};
@ -278,6 +311,7 @@ in {
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "24.05"; # Did you read the comment?
system.autoUpgrade.enable = true;
}

View File

@ -74,7 +74,7 @@ struct range_hash {
template <typename T>
range_hash(const T& vec) {
hp.emplace_back();
hash_vec<ll> hs(vec.size());
hash_vec<ll> hs(vec.size() + 1);
for (auto&& x : vec) {
hs.push_back(x);
hp.emplace_back(hs.hash());