diff --git a/flake.lock b/flake.lock index c9eb174..8082996 100644 --- a/flake.lock +++ b/flake.lock @@ -825,11 +825,11 @@ }, "nur": { "locked": { - "lastModified": 1728877747, - "narHash": "sha256-OGSawABgsGqgJoSdWmR0hAuz8gRlAwPcwz4M3u27QaM=", + "lastModified": 1728878648, + "narHash": "sha256-JYNGkY30+zGclR1zebnyHOtRhWKfKHLw6T4IoqhmJFs=", "owner": "nix-community", "repo": "NUR", - "rev": "6f359b976f93fc46a3674b2a92ffb79dad8e8840", + "rev": "23d88faa35dc9de0e35fc3dc2a863c4cf451a8f8", "type": "github" }, "original": { @@ -952,11 +952,11 @@ ] }, "locked": { - "lastModified": 1728792969, - "narHash": "sha256-TwQNBUFNmvr7rSOH5onI2Rj6FoJ6wWzdnMH6P4mwyps=", + "lastModified": 1728879439, + "narHash": "sha256-spvD0mgjj0xMv4qinSl5lxGLe8V8JAeIWNs0HF0i3kE=", "owner": "gerg-l", "repo": "spicetify-nix", - "rev": "1f3c6931100c64f6747d47f8a7b8d7a75fc5844e", + "rev": "c3463a8497fef3150aa8635d32b61b16e17a1e6b", "type": "github" }, "original": { diff --git a/hosts/laptop/boot.nix b/hosts/laptop/boot.nix new file mode 100644 index 0000000..d75a88c --- /dev/null +++ b/hosts/laptop/boot.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ + boot = { + kernelModules = ["acpi_call"]; + extraModulePackages = with config.boot.kernelPackages; + [ + acpi_call + cpupower + ] + ++ [pkgs.cpupower-gui]; + }; +} diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index d03f9e6..2304677 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -4,88 +4,9 @@ imports = [ ./../../modules/sys ./hardware.nix + ./boot.nix + ./services.nix + ./environment.nix + ./settings.nix ]; - - system.stateVersion = "24.05"; - nixpkgs.config.allowUnfree = true; - nix = { - settings = { - auto-optimise-store = true; - experimental-features = [ "nix-command" "flakes" ]; - substituters = [ "https://nix-gaming.cachix.org" ]; - }; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; - }; - - environment = { - variables = { - XCURSOR_SIZE = "24"; - PATH = "${pkgs.clang-tools}/bin:$PATH"; - }; - shells = with pkgs; [ - zsh - bash - ]; - systemPackages = with pkgs; [ - acpi - brightnessctl - cpupower-gui - powertop - ]; - }; - - time.timeZone = "America/New_York"; - i18n.defaultLocale = "en_US.UTF-8"; - - services = { - power-profiles-daemon.enable = true; - - upower = { - enable = true; - percentageLow = 20; - percentageCritical = 5; - percentageAction = 3; - criticalPowerAction = "PowerOff"; - }; - - tlp.settings = { - CPU_ENERGY_PERF_POLICY_ON_AC = "power"; - CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; - - CPU_BOOST_ON_AC = 1; - CPU_BOOST_ON_BAT = 1; - - CPU_HWP_DYN_BOOST_ON_AC = 1; - CPU_HWP_DYN_BOOST_ON_BAT = 1; - - PLATFORM_PROFILE_ON_AC = "performance"; - PLATFORM_PROFILE_ON_BAT = "performance"; - - INTEL_GPU_MIN_FREQ_ON_AC=500; - INTEL_GPU_MIN_FREQ_ON_BAT=500; - # INTEL_GPU_MAX_FREQ_ON_AC=0; - # INTEL_GPU_MAX_FREQ_ON_BAT=0; - # INTEL_GPU_BOOST_FREQ_ON_AC=0; - # INTEL_GPU_BOOST_FREQ_ON_BAT=0; - - PCIE_ASPM_ON_AC = "default"; - PCIE_ASPM_ON_BAT = "powersupersave"; - }; - }; - - powerManagement.cpuFreqGovernor = "performance"; - - boot = { - kernelModules = ["acpi_call"]; - extraModulePackages = with config.boot.kernelPackages; - [ - acpi_call - cpupower - ] - ++ [pkgs.cpupower-gui]; - }; } diff --git a/hosts/laptop/environment.nix b/hosts/laptop/environment.nix new file mode 100644 index 0000000..38d23f0 --- /dev/null +++ b/hosts/laptop/environment.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: + +{ + environment = { + variables = { + XCURSOR_SIZE = "24"; + PATH = "${pkgs.clang-tools}/bin:$PATH"; + }; + shells = with pkgs; [ + zsh + bash + ]; + systemPackages = with pkgs; [ + acpi + brightnessctl + cpupower-gui + powertop + ]; + }; +} diff --git a/hosts/laptop/services.nix b/hosts/laptop/services.nix new file mode 100644 index 0000000..986f4ad --- /dev/null +++ b/hosts/laptop/services.nix @@ -0,0 +1,39 @@ +{ ... }: + +{ + services = { + power-profiles-daemon.enable = true; + + upower = { + enable = true; + percentageLow = 20; + percentageCritical = 5; + percentageAction = 3; + criticalPowerAction = "PowerOff"; + }; + + tlp.settings = { + CPU_ENERGY_PERF_POLICY_ON_AC = "power"; + CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + + CPU_BOOST_ON_AC = 1; + CPU_BOOST_ON_BAT = 1; + + CPU_HWP_DYN_BOOST_ON_AC = 1; + CPU_HWP_DYN_BOOST_ON_BAT = 1; + + PLATFORM_PROFILE_ON_AC = "performance"; + PLATFORM_PROFILE_ON_BAT = "performance"; + + INTEL_GPU_MIN_FREQ_ON_AC=500; + INTEL_GPU_MIN_FREQ_ON_BAT=500; + # INTEL_GPU_MAX_FREQ_ON_AC=0; + # INTEL_GPU_MAX_FREQ_ON_BAT=0; + # INTEL_GPU_BOOST_FREQ_ON_AC=0; + # INTEL_GPU_BOOST_FREQ_ON_BAT=0; + + PCIE_ASPM_ON_AC = "default"; + PCIE_ASPM_ON_BAT = "powersupersave"; + }; + }; +} diff --git a/hosts/laptop/settings.nix b/hosts/laptop/settings.nix new file mode 100644 index 0000000..7bae0d9 --- /dev/null +++ b/hosts/laptop/settings.nix @@ -0,0 +1,25 @@ +{ ... }: + +{ + system.stateVersion = "24.05"; + nixpkgs.config.allowUnfree = true; + nix = { + settings = { + auto-optimise-store = true; + experimental-features = [ "nix-command" "flakes" ]; + substituters = [ "https://nix-gaming.cachix.org" ]; + }; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + }; + + + time.timeZone = "America/New_York"; + i18n.defaultLocale = "en_US.UTF-8"; + + + powerManagement.cpuFreqGovernor = "performance"; +} diff --git a/modules/home/desktop.nix b/modules/home/desktop.nix index fbb4170..7d10d8c 100644 --- a/modules/home/desktop.nix +++ b/modules/home/desktop.nix @@ -5,16 +5,17 @@ { imports = - [ (import ./programs/btop.nix) ] + [ (import ./programs/btop.nix) ] ++ [ (import ./programs/yazi.nix) ] ++ [ (import ./programs/kitty.nix) ] ++ [ (import ./programs/fuzzel.nix) ] - ++ [ (import ./programs/eza.nix) ] - ++ [ (import ./programs/cava.nix) ] - ++ [ (import ./programs/bat.nix) ] - ++ [ (import ./programs/fzf.nix) ] + ++ [ (import ./programs/eza.nix) ] + ++ [ (import ./programs/cava.nix) ] + ++ [ (import ./programs/bat.nix) ] + ++ [ (import ./programs/fzf.nix) ] + ++ [ (import ./programs/git.nix) ] ++ [ (import ./programs/password-store.nix) ] - ++ [ (import ./programs/autojump.nix) ] + ++ [ (import ./programs/autojump.nix) ] ++ [ (import ./environment/gtk.nix) ] ++ [ (import ./environment/spicetify.nix) ] ++ [ (import ./environment/starship.nix) ] @@ -22,7 +23,7 @@ ++ [ (import ./environment/zshell.nix) ] ++ [ (import ./firefox/firefox.nix) ] ++ [ (import ./hyprland) ] - ++ [ (import ./scripts ) ] + ++ [ (import ./scripts ) ] ++ [ (import ./swaync/swaync.nix) ] - ++ [ (import ./waybar) ]; + ++ [ (import ./waybar) ]; } diff --git a/modules/home/laptop.nix b/modules/home/laptop.nix index 529cd29..c2f871a 100644 --- a/modules/home/laptop.nix +++ b/modules/home/laptop.nix @@ -12,6 +12,7 @@ ++ [ (import ./programs/eza.nix) ] ++ [ (import ./programs/cava.nix) ] ++ [ (import ./programs/bat.nix) ] + ++ [ (import ./programs/git.nix) ] ++ [ (import ./environment/gtk.nix) ] ++ [ (import ./environment/spicetify.nix) ] ++ [ (import ./environment/starship.nix) ] diff --git a/modules/home/programs/git.nix b/modules/home/programs/git.nix new file mode 100644 index 0000000..5626f58 --- /dev/null +++ b/modules/home/programs/git.nix @@ -0,0 +1,9 @@ +{ ... }: + +{ + programs.git = { + enable = true; + userEmail = "pagedmov@gmail.com"; + userName = "pagedmov"; + }; +}