mirror of
https://github.com/Ascyii/nixos.git
synced 2025-12-31 22:44:23 -05:00
Changed layouts
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
# Nix fun
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix.settings.experimental-features = ["flakes" "nix-command"];
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
programs.nix-ld.enable = true;
|
||||
time.timeZone = "Europe/Berlin";
|
||||
programs.nix-ld.enable = true; # Linking support
|
||||
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
@@ -19,9 +19,6 @@
|
||||
zoxide
|
||||
rsync
|
||||
];
|
||||
pathsToLink = [
|
||||
"/share/icons"
|
||||
];
|
||||
};
|
||||
|
||||
networking = {
|
||||
@@ -45,7 +42,6 @@
|
||||
"history-substring-search"
|
||||
"git"
|
||||
"zoxide"
|
||||
"sudo"
|
||||
"vi-mode"
|
||||
"systemadmin"
|
||||
];
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
# Basic services
|
||||
services.printing.enable = true;
|
||||
|
||||
environment = {
|
||||
sessionVariables = {
|
||||
NIXOS_OZONE_WL = "1";
|
||||
LD_LIBRARY_PATH = "${pkgs.libclang.lib}/lib";
|
||||
QTWEBENGINE_CHROMIUM_FLAGS="--blink-settings=darkModeEnabled=true";
|
||||
QT_QPA_PLATFORMTHEME = "qt6ct";
|
||||
WLR_NO_HARDWARE_CURSORS= "1";
|
||||
QT_STYLE_OVERRIDE = "kvantum";
|
||||
QT_QPA_PLATFORM="xcb";
|
||||
};
|
||||
|
||||
@@ -1,26 +1,25 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
let inherit (lib) mkOption types;
|
||||
in {
|
||||
options.bootMode = mkOption {
|
||||
type = types.enum [ "uefi" "legacy" ];
|
||||
default = "uefi";
|
||||
};
|
||||
options.bootMode = mkOption {
|
||||
type = types.enum [ "uefi" "legacy" ];
|
||||
default = "uefi";
|
||||
};
|
||||
|
||||
config = {
|
||||
boot.consoleLogLevel = 0;
|
||||
boot.kernelParams = [ "quiet" "udev.log_level=3" ];
|
||||
config = {
|
||||
boot.consoleLogLevel = 0;
|
||||
boot.kernelParams = [ "quiet" "udev.log_level=3" ];
|
||||
|
||||
boot.loader = if config.bootMode == "uefi" then {
|
||||
efi.canTouchEfiVariables = true;
|
||||
systemd-boot.enable = true;
|
||||
timeout = 0;
|
||||
} else {
|
||||
grub.enable = true;
|
||||
grub.device = "/dev/sda";
|
||||
timeout = 0;
|
||||
};
|
||||
};
|
||||
boot.loader = {
|
||||
timeout = 0;
|
||||
} // (if config.bootMode == "uefi" then {
|
||||
efi.canTouchEfiVariables = true;
|
||||
systemd-boot.enable = true;
|
||||
} else {
|
||||
grub.enable = true;
|
||||
grub.device = "/dev/sda";
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,26 +1,42 @@
|
||||
{ config, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
hardware.graphics = { enable = true; };
|
||||
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = false;
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
let inherit (lib) mkOption types;
|
||||
in {
|
||||
options = {
|
||||
enableCuda = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Enable CUDA support for Blender and other packages.
|
||||
Warning: This can cause very long build times.
|
||||
'';
|
||||
};
|
||||
nvidiaOpen = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
# Cuda for blender long build times
|
||||
#environment.systemPackages = with pkgs; [
|
||||
# (blender.override {
|
||||
# cudaSupport = true;
|
||||
# })
|
||||
#];
|
||||
config = {
|
||||
hardware.graphics.enable = true;
|
||||
|
||||
# This causes very long build times
|
||||
#nixpkgs.config.cudaSupport = true;
|
||||
#hardware.enableAllFirmware = true;
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = false;
|
||||
open = config.nvidiaOpen;
|
||||
nvidiaSettings = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
|
||||
# Apply CUDA-specific settings if enabled
|
||||
nixpkgs.config.cudaSupport = config.enableCuda;
|
||||
hardware.enableAllFirmware = config.enableCuda;
|
||||
|
||||
environment.systemPackages = (if config.enableCuda then
|
||||
[ (pkgs.blender.override { cudaSupport = true; }) ]
|
||||
else
|
||||
[ ]);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,8 +1,19 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let inherit (lib) mkOption types;
|
||||
in {
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
singleBat = {
|
||||
START_CHARGE_THRESH_BAT0 = 65;
|
||||
STOP_CHARGE_THRESH_BAT0 = 85;
|
||||
};
|
||||
|
||||
doubleBat = singleBat // {
|
||||
START_CHARGE_THRESH_BAT1 = 65;
|
||||
STOP_CHARGE_THRESH_BAT1 = 85;
|
||||
};
|
||||
|
||||
in {
|
||||
options.batMode = mkOption {
|
||||
type = types.enum [ "single" "double" ];
|
||||
default = "single";
|
||||
@@ -10,56 +21,22 @@ in {
|
||||
|
||||
config = {
|
||||
powerManagement.powertop.enable = true;
|
||||
|
||||
services.upower = {
|
||||
enable = true;
|
||||
|
||||
# In accordance with the waybar battery colors
|
||||
# In accordance with waybar battery colors
|
||||
percentageLow = 30;
|
||||
percentageCritical = 20;
|
||||
percentageAction = 10;
|
||||
percentageAction = 15;
|
||||
|
||||
criticalPowerAction = "PowerOff"; # This can destroy work
|
||||
usePercentageForPolicy = true;
|
||||
};
|
||||
|
||||
services.tlp = if config.batMode == "single" then {
|
||||
services.tlp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
START_CHARGE_THRESH_BAT0 = 65;
|
||||
STOP_CHARGE_THRESH_BAT0 = 85;
|
||||
|
||||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||
|
||||
CPU_MIN_PERF_ON_AC = 0;
|
||||
CPU_MAX_PERF_ON_AC = 100;
|
||||
CPU_MIN_PERF_ON_BAT = 0;
|
||||
CPU_MAX_PERF_ON_BAT = 65;
|
||||
};
|
||||
} else {
|
||||
enable = true;
|
||||
settings = {
|
||||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||||
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
||||
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||
|
||||
CPU_MIN_PERF_ON_AC = 0;
|
||||
CPU_MAX_PERF_ON_AC = 100;
|
||||
CPU_MIN_PERF_ON_BAT = 0;
|
||||
CPU_MAX_PERF_ON_BAT = 75;
|
||||
|
||||
# 0 is first
|
||||
START_CHARGE_THRESH_BAT0 = 60;
|
||||
STOP_CHARGE_THRESH_BAT0 = 85;
|
||||
|
||||
# 1 is second
|
||||
START_CHARGE_THRESH_BAT1 = 60;
|
||||
STOP_CHARGE_THRESH_BAT1 = 85;
|
||||
};
|
||||
settings = if config.batMode == "single" then singleBat else doubleBat;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
5
modules/services/printing.nix
Normal file
5
modules/services/printing.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.printing.enable = true;
|
||||
}
|
||||
@@ -19,16 +19,15 @@
|
||||
after = [ "network-online.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
what = "https://dav.hahn1.one";
|
||||
where = "/home/jonas/webdav";
|
||||
where = "/webdav";
|
||||
type = "davfs";
|
||||
options = "uid=1000,gid=1000,file_mode=0664,dir_mode=2775,_netdev"; # What is netdev?
|
||||
options = "uid=1000,gid=1000,file_mode=0664,dir_mode=2775,_netdev";
|
||||
mountConfig.TimeoutSec = "5s";
|
||||
}];
|
||||
|
||||
# Is this too much power drain?
|
||||
systemd.automounts = [{
|
||||
description = "Webdav automount";
|
||||
where = "/home/jonas/webdav";
|
||||
where = "/webdav";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
automountConfig = { TimeoutIdleSec = "2m"; };
|
||||
}];
|
||||
|
||||
Reference in New Issue
Block a user