diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 36b0e74..db40124 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -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; } diff --git a/nvim/lua/snippets/hash-vec.lua b/nvim/lua/snippets/hash-vec.lua index f761435..53417ee 100644 --- a/nvim/lua/snippets/hash-vec.lua +++ b/nvim/lua/snippets/hash-vec.lua @@ -74,7 +74,7 @@ struct range_hash { template range_hash(const T& vec) { hp.emplace_back(); - hash_vec hs(vec.size()); + hash_vec hs(vec.size() + 1); for (auto&& x : vec) { hs.push_back(x); hp.emplace_back(hs.hash());