forked from poz/niksos
start moving shit to options
This commit is contained in:
parent
47043046d0
commit
4d2d3705fb
14 changed files with 145 additions and 92 deletions
|
@ -39,22 +39,6 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
documentation = {
|
|
||||||
enable = true;
|
|
||||||
dev.enable = true;
|
|
||||||
doc.enable = false;
|
|
||||||
info.enable = false;
|
|
||||||
man = {
|
|
||||||
enable = true;
|
|
||||||
generateCaches = false;
|
|
||||||
man-db.enable = false;
|
|
||||||
mandoc.enable = true;
|
|
||||||
};
|
|
||||||
nixos = {
|
|
||||||
includeAllModules = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostName = config'.hostname;
|
hostName = config'.hostname;
|
||||||
networkmanager = {
|
networkmanager = {
|
||||||
|
@ -73,11 +57,6 @@
|
||||||
services.NetworkManager-wait-online.wantedBy = lib.mkForce []; # default is [ "network-online.target" ]
|
services.NetworkManager-wait-online.wantedBy = lib.mkForce []; # default is [ "network-online.target" ]
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.oomd = {
|
|
||||||
enable = true;
|
|
||||||
enableUserSlices = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
time.timeZone = "Europe/Warsaw";
|
time.timeZone = "Europe/Warsaw";
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
|
@ -154,10 +133,6 @@
|
||||||
|
|
||||||
AMD_VULKAN_ICD = "radv";
|
AMD_VULKAN_ICD = "radv";
|
||||||
};
|
};
|
||||||
systemPackages = with pkgs; [
|
|
||||||
man-pages
|
|
||||||
man-pages-posix
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
@ -198,37 +173,6 @@
|
||||||
enableSSHSupport = true;
|
enableSSHSupport = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware = {
|
|
||||||
opentabletdriver = {
|
|
||||||
enable = true;
|
|
||||||
daemon.enable = true;
|
|
||||||
};
|
|
||||||
bluetooth = {
|
|
||||||
enable = true;
|
|
||||||
input.General.ClassicBondedOnly = true;
|
|
||||||
};
|
|
||||||
opengl = {
|
|
||||||
enable = true;
|
|
||||||
driSupport = true;
|
|
||||||
driSupport32Bit = true;
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
mesa
|
|
||||||
amdvlk
|
|
||||||
libdrm
|
|
||||||
libva
|
|
||||||
vaapiVdpau
|
|
||||||
libvdpau-va-gl
|
|
||||||
];
|
|
||||||
extraPackages32 = with pkgs; [
|
|
||||||
driversi686Linux.mesa
|
|
||||||
driversi686Linux.amdvlk
|
|
||||||
driversi686Linux.vaapiVdpau
|
|
||||||
driversi686Linux.libvdpau-va-gl
|
|
||||||
];
|
|
||||||
};
|
|
||||||
cpu.amd.updateMicrocode = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.btrfs = {
|
services.btrfs = {
|
||||||
autoScrub = {
|
autoScrub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -248,45 +192,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
services.udev = {
|
services.udev = {
|
||||||
extraRules = let
|
|
||||||
inherit (inputs.hyprland.packages.${pkgs.system}) hyprland;
|
|
||||||
|
|
||||||
power_supply = pkgs.writeShellScript "on_power_supply" ''
|
|
||||||
${pkgs.asusctl}/bin/asusctl profile -P Performance
|
|
||||||
#${pkgs.supergfxctl}/bin/supergfxctl -m Hybrid
|
|
||||||
${config.boot.kernelPackages.cpupower}/bin/cpupower frequency-set -g performance
|
|
||||||
${hyprland}/bin/hyprctl keyword decoration:blur:enabled true
|
|
||||||
${hyprland}/bin/hyprctl keyword animations:enabled true
|
|
||||||
'';
|
|
||||||
battery = pkgs.writeShellScript "on_battery" ''
|
|
||||||
${pkgs.asusctl}/bin/asusctl profile -P Quiet
|
|
||||||
#${pkgs.supergfxctl}/bin/supergfxctl -m Integrated
|
|
||||||
${config.boot.kernelPackages.cpupower}/bin/cpupower frequency-set -g powersave
|
|
||||||
${hyprland}/bin/hyprctl keyword decoration:blur:enabled false
|
|
||||||
${hyprland}/bin/hyprctl keyword animations:enabled false
|
|
||||||
'';
|
|
||||||
in ''
|
|
||||||
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="1",RUN+="${power_supply}"
|
|
||||||
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="0",RUN+="${battery}"
|
|
||||||
'';
|
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
yubikey-personalization
|
yubikey-personalization
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
powerManagement = {
|
|
||||||
enable = true;
|
|
||||||
powerDownCommands = ''
|
|
||||||
${pkgs.mpc-cli}/bin/mpc pause
|
|
||||||
${inputs.nixpkgs-wayland.packages.${pkgs.system}.swaylock-effects}/bin/swaylock
|
|
||||||
${pkgs.coreutils-full}/bin/sleep 1
|
|
||||||
'';
|
|
||||||
powerUpCommands = ''
|
|
||||||
${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/hyprctl dispatch dpms off HDMI-A-1
|
|
||||||
${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/hyprctl dispatch dpms on HDMI-A-1
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# this makes usb devices autosuspend
|
# this makes usb devices autosuspend
|
||||||
#powerManagement.powertop.enable = true;
|
#powerManagement.powertop.enable = true;
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ _: {
|
||||||
./fcitx5.nix
|
./fcitx5.nix
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
#./mullvad.nix
|
#./mullvad.nix
|
||||||
|
./profile.nix
|
||||||
./programs.nix
|
./programs.nix
|
||||||
#./restic.nix
|
#./restic.nix
|
||||||
./waydroid.nix
|
./waydroid.nix
|
||||||
|
|
14
hosts/niks/profile.nix
Normal file
14
hosts/niks/profile.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
_: {
|
||||||
|
imports = [
|
||||||
|
../../options/common/cpu/amd.nix
|
||||||
|
../../options/common/docs.nix
|
||||||
|
../../options/common/gpu/amd.nix
|
||||||
|
../../options/common/oomd.nix
|
||||||
|
../../options/common/pin-registry.nix
|
||||||
|
../../options/common/preserve-system.nix
|
||||||
|
../../options/desktop/bluetooth.nix
|
||||||
|
../../options/desktop/opentabletdriver.nix
|
||||||
|
../../options/desktop/power-supply.nix
|
||||||
|
../../options/desktop/suspend.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,8 +1,6 @@
|
||||||
_: {
|
_: {
|
||||||
imports = [
|
imports = [
|
||||||
./home-manager.nix
|
./home-manager.nix
|
||||||
./pin-registry.nix
|
|
||||||
./preserve-system.nix
|
|
||||||
./xdg.nix
|
./xdg.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
11
options/common/cpu/amd.nix
Normal file
11
options/common/cpu/amd.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
_: {
|
||||||
|
hardware.cpu.amd.updateMicrocode = true;
|
||||||
|
|
||||||
|
services.auto-epp = {
|
||||||
|
enable = true;
|
||||||
|
settings.Settings = {
|
||||||
|
epp_state_for_BAT = "power";
|
||||||
|
epp_state_for_AC = "balance_power";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
25
options/common/docs.nix
Normal file
25
options/common/docs.nix
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
documentation = {
|
||||||
|
enable = true;
|
||||||
|
dev.enable = true;
|
||||||
|
doc.enable = false;
|
||||||
|
info.enable = false;
|
||||||
|
man = {
|
||||||
|
enable = true;
|
||||||
|
generateCaches = false;
|
||||||
|
man-db.enable = false;
|
||||||
|
mandoc.enable = true;
|
||||||
|
};
|
||||||
|
nixos = {
|
||||||
|
includeAllModules = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
man-pages
|
||||||
|
man-pages-posix
|
||||||
|
];
|
||||||
|
}
|
26
options/common/gpu/amd.nix
Normal file
26
options/common/gpu/amd.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
hardware = {
|
||||||
|
opengl = {
|
||||||
|
enable = true;
|
||||||
|
driSupport = true;
|
||||||
|
driSupport32Bit = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
mesa
|
||||||
|
amdvlk
|
||||||
|
libdrm
|
||||||
|
libva
|
||||||
|
vaapiVdpau
|
||||||
|
libvdpau-va-gl
|
||||||
|
];
|
||||||
|
extraPackages32 = with pkgs; [
|
||||||
|
driversi686Linux.mesa
|
||||||
|
driversi686Linux.amdvlk
|
||||||
|
driversi686Linux.vaapiVdpau
|
||||||
|
driversi686Linux.libvdpau-va-gl
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
8
options/common/oomd.nix
Normal file
8
options/common/oomd.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
_: {
|
||||||
|
systemd.oomd = {
|
||||||
|
enable = true;
|
||||||
|
enableSystemSlice = true;
|
||||||
|
enableRootSlice = true;
|
||||||
|
enableUserSlices = true;
|
||||||
|
};
|
||||||
|
}
|
6
options/desktop/bluetooth.nix
Normal file
6
options/desktop/bluetooth.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
_: {
|
||||||
|
hardware.bluetooth = {
|
||||||
|
enable = true;
|
||||||
|
input.General.ClassicBondedOnly = true;
|
||||||
|
};
|
||||||
|
}
|
6
options/desktop/opentabletdriver.nix
Normal file
6
options/desktop/opentabletdriver.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
_: {
|
||||||
|
hardware.opentabletdriver = {
|
||||||
|
enable = true;
|
||||||
|
daemon.enable = true;
|
||||||
|
};
|
||||||
|
}
|
30
options/desktop/power-supply.nix
Normal file
30
options/desktop/power-supply.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
services.udev = {
|
||||||
|
extraRules = let
|
||||||
|
inherit (inputs.hyprland.packages.${pkgs.system}) hyprland;
|
||||||
|
|
||||||
|
power_supply = pkgs.writeShellScript "on_power_supply" ''
|
||||||
|
${pkgs.asusctl}/bin/asusctl profile -P Performance
|
||||||
|
#${pkgs.supergfxctl}/bin/supergfxctl -m Hybrid
|
||||||
|
${config.boot.kernelPackages.cpupower}/bin/cpupower frequency-set -g performance
|
||||||
|
${hyprland}/bin/hyprctl keyword decoration:blur:enabled true
|
||||||
|
${hyprland}/bin/hyprctl keyword animations:enabled true
|
||||||
|
'';
|
||||||
|
battery = pkgs.writeShellScript "on_battery" ''
|
||||||
|
${pkgs.asusctl}/bin/asusctl profile -P Quiet
|
||||||
|
#${pkgs.supergfxctl}/bin/supergfxctl -m Integrated
|
||||||
|
${config.boot.kernelPackages.cpupower}/bin/cpupower frequency-set -g powersave
|
||||||
|
${hyprland}/bin/hyprctl keyword decoration:blur:enabled false
|
||||||
|
${hyprland}/bin/hyprctl keyword animations:enabled false
|
||||||
|
'';
|
||||||
|
in ''
|
||||||
|
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="1",RUN+="${power_supply}"
|
||||||
|
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="0",RUN+="${battery}"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
18
options/desktop/suspend.nix
Normal file
18
options/desktop/suspend.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
powerManagement = {
|
||||||
|
enable = true;
|
||||||
|
powerDownCommands = ''
|
||||||
|
${pkgs.mpc-cli}/bin/mpc pause
|
||||||
|
${inputs.nixpkgs-wayland.packages.${pkgs.system}.swaylock-effects}/bin/swaylock
|
||||||
|
${pkgs.coreutils-full}/bin/sleep 1
|
||||||
|
'';
|
||||||
|
powerUpCommands = ''
|
||||||
|
${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/hyprctl dispatch dpms off HDMI-A-1
|
||||||
|
${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/hyprctl dispatch dpms on HDMI-A-1
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue