Add fancontrol #16
11 changed files with 123 additions and 70 deletions
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
mkDashDefault,
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
|
|
@ -10,19 +11,18 @@
|
|||
in {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
#(modulesPath + "/misc/nixpkgs/read-only.nix")
|
||||
];
|
||||
|
||||
wsl.enable = config.conf.wsl;
|
||||
wsl.enable = mkDashDefault config.conf.wsl;
|
||||
|
||||
# Bootloader.
|
||||
boot = lib.mkIf (!config.conf.wsl) {
|
||||
consoleLogLevel = 0;
|
||||
consoleLogLevel = mkDashDefault 0;
|
||||
|
||||
lanzaboote = lib.mkIf config.conf.secureBoot {
|
||||
enable = true;
|
||||
pkiBundle = "/var/lib/sbctl";
|
||||
settings.reboot-for-bitlocker = true;
|
||||
enable = mkDashDefault true;
|
||||
pkiBundle = mkDashDefault "/var/lib/sbctl";
|
||||
settings.reboot-for-bitlocker = mkDashDefault true;
|
||||
};
|
||||
|
||||
loader = {
|
||||
|
|
@ -32,15 +32,15 @@ in {
|
|||
then lib.mkForce false
|
||||
else if config.conf.useSystemdBootloader
|
||||
then true
|
||||
else false;
|
||||
else mkDashDefault false;
|
||||
configurationLimit = 5;
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
efi.canTouchEfiVariables = mkDashDefault true;
|
||||
};
|
||||
|
||||
kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
|
||||
kernelPackages = mkDashDefault pkgs.linuxPackages_latest;
|
||||
initrd = {
|
||||
verbose = false;
|
||||
verbose = mkDashDefault false;
|
||||
availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
|
|
@ -60,46 +60,46 @@ in {
|
|||
};
|
||||
|
||||
networking = {
|
||||
useDHCP = lib.mkDefault true;
|
||||
networkmanager.enable = true;
|
||||
hostName = hostName;
|
||||
useDHCP = mkDashDefault true;
|
||||
networkmanager.enable = mkDashDefault true;
|
||||
hostName = mkDashDefault hostName;
|
||||
};
|
||||
|
||||
time = {
|
||||
timeZone = config.conf.timezone;
|
||||
hardwareClockInLocalTime = config.conf.systemLocalTime;
|
||||
timeZone = mkDashDefault config.conf.timezone;
|
||||
hardwareClockInLocalTime = mkDashDefault config.conf.systemLocalTime;
|
||||
};
|
||||
|
||||
i18n.defaultLocale = config.conf.locale;
|
||||
i18n.defaultLocale = mkDashDefault config.conf.locale;
|
||||
|
||||
services = {
|
||||
lorri.enable = true;
|
||||
xserver.enable = true;
|
||||
fstrim.enable = lib.mkDefault true;
|
||||
pulseaudio.enable = false;
|
||||
lorri.enable = mkDashDefault true;
|
||||
xserver.enable = mkDashDefault true;
|
||||
fstrim.enable = mkDashDefault true;
|
||||
pulseaudio.enable = mkDashDefault false;
|
||||
pipewire = {
|
||||
enable = true;
|
||||
enable = mkDashDefault true;
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
enable = mkDashDefault true;
|
||||
support32Bit = mkDashDefault true;
|
||||
};
|
||||
jack.enable = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = mkDashDefault true;
|
||||
pulse.enable = mkDashDefault true;
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault config.conf.system;
|
||||
nixpkgs.hostPlatform = mkDashDefault config.conf.system;
|
||||
nix = {
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 7d --delete-generations +5";
|
||||
automatic = mkDashDefault true;
|
||||
dates = mkDashDefault "weekly";
|
||||
options = mkDashDefault "--delete-older-than 7d --delete-generations +5";
|
||||
};
|
||||
settings = {
|
||||
trusted-users = [username];
|
||||
auto-optimise-store = true;
|
||||
auto-optimise-store = mkDashDefault true;
|
||||
|
||||
builders-use-substitutes = true;
|
||||
builders-use-substitutes = mkDashDefault true;
|
||||
|
||||
substituters = [
|
||||
"https://hyprland.cachix.org"
|
||||
|
|
@ -129,29 +129,30 @@ in {
|
|||
"chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
|
||||
];
|
||||
|
||||
experimental-features = "nix-command flakes pipe-operators";
|
||||
experimental-features = mkDashDefault "nix-command flakes pipe-operators";
|
||||
};
|
||||
};
|
||||
|
||||
hardware = {
|
||||
cpu.${config.conf.cpu}.updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
mkDashDefault
|
||||
config.hardware.enableRedistributableFirmware;
|
||||
};
|
||||
|
||||
security.rtkit.enable = true;
|
||||
security.rtkit.enable = mkDashDefault true;
|
||||
|
||||
environment.variables = {
|
||||
XDG_CACHE_HOME = "$HOME/.cache";
|
||||
DIRENV_LOG_FORMAT = "";
|
||||
QT_QPA_PLATFORMTHEME = "qt5ct";
|
||||
XDG_CACHE_HOME = mkDashDefault "$HOME/.cache";
|
||||
DIRENV_LOG_FORMAT = mkDashDefault "";
|
||||
QT_QPA_PLATFORMTHEME = mkDashDefault "qt5ct";
|
||||
};
|
||||
|
||||
# allows user change later on
|
||||
users = {
|
||||
mutableUsers = true;
|
||||
mutableUsers = mkDashDefault true;
|
||||
users.${username} = {
|
||||
isNormalUser = true;
|
||||
description = username;
|
||||
isNormalUser = mkDashDefault true;
|
||||
description = mkDashDefault username;
|
||||
extraGroups = [
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
|
|
@ -167,7 +168,7 @@ in {
|
|||
];
|
||||
# this password will only last for the first login
|
||||
# e.g. login, then change to whatever else, this also ensures no public hash is available
|
||||
password = "firstlogin";
|
||||
password = mkDashDefault "firstlogin";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
21
base/env.nix
21
base/env.nix
|
|
@ -1,22 +1,23 @@
|
|||
{
|
||||
mkDashDefault,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
environment = {
|
||||
variables = {
|
||||
GSETTINGS_SCHEMA_DIR = "${pkgs.glib.getSchemaPath pkgs.gsettings-desktop-schemas}";
|
||||
NEOVIDE_MAXIMIZED = "0";
|
||||
GPG_TTY = "$(tty)";
|
||||
EDITOR = "neovide --no-fork";
|
||||
SUDO_EDITOR = "neovide --no-fork";
|
||||
SCRIPTS = "$HOME/.config/scripts";
|
||||
GSETTINGS_SCHEMA_DIR = mkDashDefault "${pkgs.glib.getSchemaPath pkgs.gsettings-desktop-schemas}";
|
||||
NEOVIDE_MAXIMIZED = mkDashDefault "0";
|
||||
GPG_TTY = mkDashDefault "$(tty)";
|
||||
EDITOR = mkDashDefault "neovide --no-fork";
|
||||
SUDO_EDITOR = mkDashDefault "neovide --no-fork";
|
||||
SCRIPTS = mkDashDefault "$HOME/.config/scripts";
|
||||
};
|
||||
sessionVariables = {
|
||||
NIXOS_OZONE_WL = "1";
|
||||
GOPATH = "$HOME/.go";
|
||||
FLAKE = config.conf.nixosConfigPath;
|
||||
NH_FLAKE = config.conf.nixosConfigPath;
|
||||
NIXOS_OZONE_WL = mkDashDefault "1";
|
||||
GOPATH = mkDashDefault "$HOME/.go";
|
||||
FLAKE = mkDashDefault config.conf.nixosConfigPath;
|
||||
NH_FLAKE = mkDashDefault config.conf.nixosConfigPath;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
{pkgs, ...}: let
|
||||
{
|
||||
mkDashDefault,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
layout = pkgs.writeText "dashie" ''
|
||||
xkb_symbols "dashie"
|
||||
{
|
||||
|
|
@ -10,7 +14,7 @@
|
|||
};
|
||||
'';
|
||||
in {
|
||||
environment.systemPackages = [pkgs.xorg.xkbcomp];
|
||||
environment.systemPackages = mkDashDefault [pkgs.xorg.xkbcomp];
|
||||
services.xserver.xkb.extraLayouts.dashie = {
|
||||
description = "US layout with 'umlaut'";
|
||||
languages = ["eng"];
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@
|
|||
|
||||
zen-browser.url = "github:youwen5/zen-browser-flake";
|
||||
|
||||
# TODO move to upstream repository after merged nix flake pr
|
||||
fancontrol.url = "git+https://github.com/DashieTM/fancontrol-gui?ref=nix-flake";
|
||||
|
||||
stylix.url = "github:danth/stylix";
|
||||
base16.url = "github:SenchoPens/base16.nix";
|
||||
disko.url = "github:nix-community/disko/latest";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
mkDashDefault,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
|
|
@ -6,30 +7,30 @@
|
|||
username = config.conf.username;
|
||||
in {
|
||||
manual = {
|
||||
html.enable = false;
|
||||
json.enable = false;
|
||||
manpages.enable = false;
|
||||
html.enable = mkDashDefault false;
|
||||
json.enable = mkDashDefault false;
|
||||
manpages.enable = mkDashDefault false;
|
||||
};
|
||||
|
||||
fonts.fontconfig.enable = true;
|
||||
fonts.fontconfig.enable = mkDashDefault true;
|
||||
|
||||
home = {
|
||||
username = username;
|
||||
homeDirectory = "/home/${username}";
|
||||
username = mkDashDefault username;
|
||||
homeDirectory = mkDashDefault "/home/${username}";
|
||||
sessionPath = ["$HOME/.cargo/bin"];
|
||||
|
||||
enableNixpkgsReleaseCheck = false;
|
||||
enableNixpkgsReleaseCheck = mkDashDefault false;
|
||||
sessionVariables = {
|
||||
GOROOT = "$HOME/.go";
|
||||
QT_QPA_PLATFORMTHEME = "qt5ct";
|
||||
GOROOT = mkDashDefault "$HOME/.go";
|
||||
QT_QPA_PLATFORMTHEME = mkDashDefault "qt5ct";
|
||||
};
|
||||
|
||||
keyboard = null;
|
||||
keyboard = mkDashDefault null;
|
||||
};
|
||||
|
||||
programs.nix-index = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
enable = mkDashDefault true;
|
||||
enableFishIntegration = mkDashDefault true;
|
||||
};
|
||||
|
||||
nix = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
mkDashDefault,
|
||||
additionalHomeConfig,
|
||||
additionalHomeMods,
|
||||
additionalInputs,
|
||||
|
|
@ -16,17 +17,18 @@
|
|||
...
|
||||
}: {
|
||||
xdg = {
|
||||
portal.config.common.default = "*";
|
||||
portal.config.common.default = mkDashDefault "*";
|
||||
portal = {
|
||||
enable = true;
|
||||
enable = mkDashDefault true;
|
||||
extraPortals = [pkgs.xdg-desktop-portal-gtk];
|
||||
};
|
||||
};
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
useGlobalPkgs = mkDashDefault true;
|
||||
useUserPackages = mkDashDefault true;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs root additionalInputs alternativePkgs system stable unstable;
|
||||
mkDashDefault = import ../lib/override.nix {inherit lib;};
|
||||
};
|
||||
|
||||
users.${config.conf.username} = {
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@
|
|||
inputs.reset.homeManagerModules.default
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
inputs.dashvim.homeManagerModules.dashvim
|
||||
inputs.fancontrol.homeManagerModules.default
|
||||
../modules
|
||||
];
|
||||
},
|
||||
|
|
@ -105,6 +106,7 @@
|
|||
homeMods = mods.home;
|
||||
additionalHomeMods = additionalMods.home;
|
||||
additionalInputs = additionalInputs;
|
||||
mkDashDefault = import ./override.nix {inherit lib;};
|
||||
};
|
||||
in
|
||||
inputs.unstable.lib.nixosSystem {
|
||||
|
|
|
|||
1
lib/override.nix
Normal file
1
lib/override.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{lib, ...}: value: lib.mkOverride 999 value
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
./coding.nix
|
||||
./containers.nix
|
||||
./drives.nix
|
||||
./fancontrol.nix
|
||||
./fastfetch.nix
|
||||
./fish.nix
|
||||
./flatpak.nix
|
||||
|
|
|
|||
36
modules/programs/fancontrol.nix
Normal file
36
modules/programs/fancontrol.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
options,
|
||||
...
|
||||
}: {
|
||||
options.mods.fancontrol = {
|
||||
enable = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
type = lib.types.bool;
|
||||
description = "Enables fancontrol-gui with needed drivers";
|
||||
};
|
||||
forceId = lib.mkOption {
|
||||
default = null;
|
||||
example = "force_id=0x8628";
|
||||
type = with lib.types; nullOr str;
|
||||
description = "Modprobe options for the it87 driver. Information at: https://wiki.archlinux.org/title/Lm_sensors#Gigabyte_B250/Z370/B450M/B560M/B660M/Z690/B550_motherboards";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf config.mods.fancontrol.enable (
|
||||
lib.optionalAttrs (options ? home.packages) {
|
||||
programs.fancontrol-gui.enable = true;
|
||||
}
|
||||
// (lib.optionalAttrs (options ? boot.kernelModules) {
|
||||
boot = {
|
||||
kernelParams = ["acpi_enforce_resources=lax"];
|
||||
extraModulePackages = with config.boot.kernelPackages; [liquidtux it87];
|
||||
kernelModules = ["v4l2loopback" "it87"];
|
||||
extraModprobeConfig = lib.mkIf (config.mods.fancontrol.forceId != null) ''
|
||||
options it87 ${config.mods.fancontrol.forceId}
|
||||
'';
|
||||
};
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
mkDashDefault,
|
||||
lib,
|
||||
config,
|
||||
options,
|
||||
|
|
@ -100,7 +101,7 @@
|
|||
];
|
||||
in {
|
||||
enable = true;
|
||||
enable32Bit = lib.mkDefault true;
|
||||
enable32Bit = mkDashDefault true;
|
||||
extraPackages =
|
||||
amdPackages
|
||||
++ (lib.lists.optionals (config.mods.gpu.vapi.rocm.enable && config.mods.gpu.amdgpu.enable) rocmPackages);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue