Merge pull request 'Add host options & hotfixes.' (#3) from features into develop
Reviewed-on: #3
This commit is contained in:
commit
71f677ee67
14 changed files with 288 additions and 25 deletions
24
devices/thinkbook/boot.nix
Normal file
24
devices/thinkbook/boot.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackages_zen;
|
||||
kernelParams = [
|
||||
"quiet"
|
||||
"splash"
|
||||
"boot.shell_on_fail"
|
||||
"loglevel=3"
|
||||
"rd.systemd.show_status=false"
|
||||
"rd.udev.log_level=3"
|
||||
"udev.log_priority=3"
|
||||
];
|
||||
|
||||
consoleLogLevel = 0;
|
||||
initrd.verbose = false;
|
||||
|
||||
loader = {
|
||||
timeout = 60;
|
||||
efi.canTouchEfiVariables = true;
|
||||
systemd-boot.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -16,5 +16,8 @@
|
|||
};
|
||||
};
|
||||
|
||||
device.zram.enable = false;
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
memoryPercent = 100;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ let
|
|||
;
|
||||
};
|
||||
|
||||
userPackagesConfig = import ../users/${hostName}/packages-config.nix { inherit lib; };
|
||||
userPackagesConfig = import ../users/${hostName}/packages_config.nix { inherit lib; };
|
||||
|
||||
additionalArgs = { inherit inputs customFunctions userData; };
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,9 @@ in
|
|||
enable32Bit = true;
|
||||
};
|
||||
|
||||
security.rtkit.enable = lib.mkIf cfg.sound.enable true;
|
||||
security.rtkit = lib.mkIf cfg.sound.enable {
|
||||
enable = true;
|
||||
};
|
||||
services.pulseaudio = lib.mkIf cfg.sound.enable {
|
||||
enable = false;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
cfg = device.zram;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
device.zram = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Zram settings for the device.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
memoryPercent = 100;
|
||||
};
|
||||
};
|
||||
}
|
||||
43
options/host/locale.nix
Normal file
43
options/host/locale.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.host.locale;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
host.locale = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Basic locale settings.";
|
||||
};
|
||||
|
||||
timeZone = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "America/New_York";
|
||||
description = "Time Zone Locale.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_US.UTF-8";
|
||||
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||
LC_MEASUREMENT = "en_US.UTF-8";
|
||||
LC_MONETARY = "en_US.UTF-8";
|
||||
LC_NAME = "en_US.UTF-8";
|
||||
LC_NUMERIC = "en_US.UTF-8";
|
||||
LC_PAPER = "en_US.UTF-8";
|
||||
LC_TELEPHONE = "en_US.UTF-8";
|
||||
LC_TIME = "en_US.UTF-8";
|
||||
};
|
||||
|
||||
time.timeZone = cfg.timeZone;
|
||||
};
|
||||
}
|
||||
25
options/host/network_manager.nix
Normal file
25
options/host/network_manager.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
cfg = config.host.xserver;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
host.xserver = {
|
||||
enable = lib.mkOption {
|
||||
types = lib.types.bool;
|
||||
default = true;
|
||||
description = "Xserver configurations for host.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
xkb = {
|
||||
layout = "us";
|
||||
variant = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
44
options/host/nix.nix
Normal file
44
options/host/nix.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.host.nix;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
host.nix = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Nix settings for host.";
|
||||
};
|
||||
optimization.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Nix store optimization.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
nix = {
|
||||
package = pkgs.nix;
|
||||
|
||||
settings = {
|
||||
warn-dirty = false;
|
||||
experimental-features = [
|
||||
"flakes"
|
||||
"nix-command"
|
||||
"pipe-operators"
|
||||
];
|
||||
};
|
||||
|
||||
optimise = lib.mkIf cfg.optimization.enable {
|
||||
automatic = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
27
options/host/polkit.nix
Normal file
27
options/host/polkit.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.host.polkit;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
host.polkit = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Polkit configurations for host.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
security.polkit = {
|
||||
enable = true;
|
||||
package = pkgs.polkit;
|
||||
};
|
||||
};
|
||||
}
|
||||
20
options/host/version.nix
Normal file
20
options/host/version.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.host.version;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
host.version = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "25.05";
|
||||
description = "System version.";
|
||||
};
|
||||
};
|
||||
|
||||
config.system.stateVersion = cfg;
|
||||
}
|
||||
58
options/host/window_managers.nix
Normal file
58
options/host/window_managers.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.host.window_managers.kde;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
host.window_managers.kde = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "KDE Clear configurations for host.";
|
||||
};
|
||||
sddm.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "SDDM configurations for host.";
|
||||
};
|
||||
|
||||
powerProfiles.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = !config.device.battery.enable;
|
||||
description = "Power Profiles Daemon configurations for host.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
|
||||
environment.plasma6.excludePackages = with pkgs.kdePackages; [
|
||||
kate
|
||||
elisa
|
||||
konsole
|
||||
kdepim-runtime
|
||||
plasma-browser-integration
|
||||
];
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.wl-clipboard
|
||||
pkgs.wayland-utils
|
||||
]
|
||||
++ lib.optional cfg.sddm.enable [
|
||||
pkgs.kdePackages.sddm-kcm
|
||||
];
|
||||
|
||||
services.power-profiles-daemon.enable = cfg.powerProfiles.enable;
|
||||
|
||||
services.displayManager.sddm = lib.mkIf cfg.sddm.enable {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
25
options/host/xserver.nix
Normal file
25
options/host/xserver.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
cfg = config.host.xserver;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
host.xserver = {
|
||||
enable = lib.mkOption {
|
||||
types = lib.types.bool;
|
||||
default = true;
|
||||
description = "Xserver configurations for host.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
xkb = {
|
||||
layout = "us";
|
||||
variant = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
14
users/geekiot/packages_config.nix
Normal file
14
users/geekiot/packages_config.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ lib }:
|
||||
{
|
||||
allowUnfree = false;
|
||||
allowBroken = false;
|
||||
|
||||
allowUnfreePredicate =
|
||||
pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
"steam"
|
||||
"steam-original"
|
||||
"steam-unwrapped"
|
||||
"steam-run"
|
||||
];
|
||||
}
|
||||
Reference in a new issue