diff --git a/config/hyprland/hypridle.conf b/config/hyprland/hypridle.conf index cedd10362..913022879 100644 --- a/config/hyprland/hypridle.conf +++ b/config/hyprland/hypridle.conf @@ -19,16 +19,29 @@ listener { on-resume = brightnessctl -r } -# Lock screen after 5 minutes +# Lock screen after 5 minutes (only on battery) listener { timeout = 300 - on-timeout = loginctl lock-session + on-timeout = bash -c 'cat /sys/class/power_supply/AC*/online | grep -q 0 && loginctl lock-session' } -# Turn off display after 5.5 minutes +# Lock screen after 10 minutes (only on AC) +listener { + timeout = 600 + on-timeout = bash -c 'cat /sys/class/power_supply/AC*/online | grep -q 1 && loginctl lock-session' +} + +# Turn off display after 5.5 minutes (only on battery) listener { timeout = 330 - on-timeout = hyprctl dispatch dpms off + on-timeout = bash -c 'cat /sys/class/power_supply/AC*/online | grep -q 0 && hyprctl dispatch dpms off' + on-resume = hyprctl dispatch dpms on +} + +# Turn off display after 10.5 minutes (only on AC) +listener { + timeout = 630 + on-timeout = bash -c 'cat /sys/class/power_supply/AC*/online | grep -q 1 && hyprctl dispatch dpms off' on-resume = hyprctl dispatch dpms on } diff --git a/home-manager/default.nix b/home-manager/default.nix index 7e3cf0ac8..cc0b3190c 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -8,9 +8,9 @@ }: let hmConfig = import ../config { inherit inputs; }; - packages = import ./packages { inherit pkgs inputs; }; - misc = import ./misc; modules = import ./modules; + nix = import ./nix; + packages = import ./packages { inherit pkgs inputs; }; programs = import ./programs { inherit config lib pkgs; sources = { }; @@ -22,8 +22,8 @@ in { imports = hmConfig - ++ misc ++ modules + ++ nix ++ programs ++ services ++ [ diff --git a/home-manager/misc/default.nix b/home-manager/misc/default.nix deleted file mode 100644 index 2bc15e204..000000000 --- a/home-manager/misc/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -[ - ./nix -] diff --git a/home-manager/misc/nix/default.nix b/home-manager/misc/nix/default.nix deleted file mode 100644 index fb2bba57b..000000000 --- a/home-manager/misc/nix/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ lib, pkgs, ... }: -{ - nix = { - package = lib.mkDefault pkgs.nix; - enable = true; - extraOptions = '' - experimental-features = nix-command flakes - ''; - }; -} diff --git a/home-manager/nix/default.nix b/home-manager/nix/default.nix new file mode 100644 index 000000000..755bdc727 --- /dev/null +++ b/home-manager/nix/default.nix @@ -0,0 +1,3 @@ +[ + ./nix.nix +] diff --git a/home-manager/nix/nix.nix b/home-manager/nix/nix.nix new file mode 100644 index 000000000..ed7dab4fe --- /dev/null +++ b/home-manager/nix/nix.nix @@ -0,0 +1,37 @@ +{ + lib, + pkgs, + inputs, + ... +}: +{ + nix = { + package = lib.mkDefault pkgs.lixPackageSets.latest.lix; + enable = true; + registry.nixpkgs.flake = inputs.nixpkgs; + settings = { + experimental-features = [ + "nix-command" + "flakes" + ]; + use-xdg-base-directories = true; + substituters = [ + "https://cache.nixos.org" + "https://cache.garnix.io" + "https://cloudtide.cachix.org" + "https://nix-community.cachix.org" + "https://yazi.cachix.org" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + "cloudtide.cachix.org-1:9NZ1Mah2+u8cd/CmVffFV23z5uFNpZSrhfgTt5fuN/4=" + "yazi.cachix.org-1:Dcdz63NZKfvUCbDGngQDAZq6kOroIrFoyO064uvLh8k=" + ]; + }; + gc = { + automatic = true; + }; + }; +} diff --git a/named-hosts/matic/default.nix b/named-hosts/matic/default.nix index c9e680796..a4f07c34f 100644 --- a/named-hosts/matic/default.nix +++ b/named-hosts/matic/default.nix @@ -336,20 +336,19 @@ inputs.nixpkgs.lib.nixosSystem { zlib ]; - # Nix settings + # NixOS-level nix settings (complements home-manager nix/) nix = { + channel.enable = false; settings = { - experimental-features = [ - "nix-command" - "flakes" - ]; + nix-path = lib.mkForce "nixpkgs=/etc/nix/inputs/nixpkgs"; trusted-users = [ - "root" username + "@wheel" + "root" ]; }; - package = pkgs.nixVersions.stable; }; + environment.etc."nix/inputs/nixpkgs".source = "${inputs.nixpkgs}"; system.stateVersion = "24.11"; } diff --git a/nix-darwin/config/system.nix b/nix-darwin/config/system.nix index 40c4b9513..a676e99a3 100644 --- a/nix-darwin/config/system.nix +++ b/nix-darwin/config/system.nix @@ -29,6 +29,7 @@ "com.apple.screensaver" = { askForPassword = true; askForPasswordDelay = 0; + idleTime = 600; }; "com.apple.screencapture" = { location = "~/Desktop";