testing the new config before pushing to main

This commit is contained in:
ooks-io 2024-01-19 20:28:53 +13:00
parent a545953c2d
commit c53123d2c5
38 changed files with 370 additions and 198 deletions

View file

@ -1,17 +1,13 @@
{ lib, config, ... }:
let
cfg = config.systemModules.bootloader;
in
{ lib, ... }:
{
config = lib.mkIf cfg.enable {
boot.loader = {
systemd-boot = {
enable = true;
consoleMode = "max";
imports = [ ./systemd ];
options.systemModules = {
bootloader = {
systemd = {
enable = lib.mkEnableOption "Enable systemd bootloader module";
};
efi.canTouchEfiVariables = true;
};
};
}

View file

@ -0,0 +1 @@
## to be implemented

View file

@ -0,0 +1,17 @@
{ lib, config, ... }:
let
cfg = config.systemModules.bootloader.systemd;
in
{
config = lib.mkIf cfg.enable {
boot.loader = {
systemd-boot = {
enable = true;
consoleMode = "max";
};
efi.canTouchEfiVariables = true;
};
};
}

View file

@ -3,10 +3,16 @@
{
imports = [
./hardware
./networking
./bootloader
./nix
./programs
./user
./displayManager
./networking.nix
./locale.nix
./virtualisation.nix
./pipewire.nix
./security.nix
];
@ -14,9 +20,6 @@
security = {
enable = lib.mkEnableOption "Enable security module";
};
bootloader = {
enable = lib.mkEnableOption "Enable systemd bootloader module";
};
pipewire = {
enable = lib.mkEnableOption "Enable pipewire module";
};

View file

@ -0,0 +1,13 @@
{ lib, ... }:
{
imports = [
./tuigreet
];
options.systemModules.displayManager = {
tuigreet = {
enable = lib.mkEnableOption "Enable tuigreet display manager module";
};
};
}

View file

@ -1,26 +0,0 @@
{ pkgs, ... }:
let
tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet";
in
{
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${tuigreet} --time --remember --cmd Hyprland";
user = "greeter";
};
};
};
systemd.services.greetd.serviceConfig = {
Type = "idle";
StandardInput = "tty";
StandardOutput = "tty";
StandardError = "journal"; # Without this errors will spam on screen
# Without these bootlogs will spam on screen
TTYReset = true;
TTYVHangup = true;
TTYVTDisallocate = true;
};
}

View file

@ -0,0 +1,29 @@
{ pkgs, lib, config, ... }:
let
tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet";
cfg = config.systemModules.displayManager.tuigreet;
in
{
config = lib.mkIf cfg.enable {
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${tuigreet} --time --remember --cmd Hyprland";
user = "greeter";
};
};
};
systemd.services.greetd.serviceConfig = {
Type = "idle";
StandardInput = "tty";
StandardOutput = "tty";
StandardError = "journal"; # Without this errors will spam on screen
# Without these bootlogs will spam on screen
TTYReset = true;
TTYVHangup = true;
TTYVTDisallocate = true;
};
};
}

View file

@ -0,0 +1,22 @@
{ lib, config, ... }:
let
cfg = config.systemModules.hardware.backlight;
in
{
config = lib.mkIf cfg.enable {
hardware.brillo.enable = true;
services.clight = {
enable = true;
settings = {
verbose = true;
backlight.disabled = true;
dpms.timeouts = [900 300];
dimmer.timeouts = [870 270];
gamma.long_transition = true;
screen.disabled = true;
};
};
};
}

View file

@ -1,14 +0,0 @@
{
hardware.brillo.enable = true;
services.clight = {
enable = true;
settings = {
verbose = true;
backlight.disabled = true;
dpms.timeouts = [900 300];
dimmer.timeouts = [870 270];
gamma.long_transition = true;
screen.disabled = true;
};
};
}

View file

@ -0,0 +1,23 @@
{ config, lib, pkgs, ... }:
let
cfg = config.systemModules.hardware.bluetooth;
in
{
config = lib.mkIf cfg.enable {
hardware.bluetooth = {
enable = true;
package = pkgs.bluez5-experimental;
};
environment.systemPackages = with pkgs; [
galaxy-buds-client
live-buds-cli
bluetuith
];
# https://github.com/NixOS/nixpkgs/issues/114222
systemd.user.services.telephony_client.enable = false;
};
}

View file

@ -1,17 +0,0 @@
{ config, lib, pkgs, ... }:
{
hardware.bluetooth = {
enable = true;
package = pkgs.bluez5-experimental;
};
environment.systemPackages = with pkgs; [
galaxy-buds-client
live-buds-cli
bluetuith
];
# https://github.com/NixOS/nixpkgs/issues/114222
systemd.user.services.telephony_client.enable = false;
}

View file

@ -0,0 +1,21 @@
{ lib, ... }:
{
imports = [
./bluetooth.nix
./backlight.nix
./power.nix
];
options.systemModules.hardware = {
bluetooth = {
enable = lib.mkEnableOption "Enable bluetooth module";
};
backlight= {
enable = lib.mkEnableOption "Enable backlight module";
};
power = {
enable = lib.mkEnableOption "Enable power module";
};
};
}

View file

@ -0,0 +1,32 @@
{ lib, config, ... }:
let
cfg = config.systemModules.hardware.power;
in
{
config = lib.mkIf cfg.enable {
services.system76-scheduler.settings.cfsProfiles.enable = true;
services.tlp = {
enable = true;
settings = {
cpu_boost_on_ac = 1;
cpu_boost_on_bat = 0;
cpu_scaling_governor_on_ac = "performance";
cpu_scaling_governor_on_bat = "powersave";
};
};
services = {
upower.enable = true;
thermald.enable = true;
power-profiles-daemon.enable = false;
logind = {
lidSwitch = "suspend";
};
};
powerManagement.powertop.enable = true;
};
}

View file

@ -13,6 +13,7 @@ in
];
};
time.timeZone = lib.mkDefault "Pacific/Auckland";
location.provider = "geoclue2";
services.geoclue2.enable = true;
};
}

View file

@ -4,7 +4,7 @@
imports = [
./nh.nix
./nix.nix
./nixpkgs
./nixpkgs.nix
./subs.nix
];

View file

@ -0,0 +1,13 @@
{ lib, ... }:
{
imports = [
./gnomeServices.nix
];
options.systemModules.programs = {
gnomeServices = {
enable = lib.mkEnableOption "Enable gnome services module";
};
};
}

View file

@ -0,0 +1,18 @@
{ config, lib, pkgs, ... }:
let
cfg = config.systemModules.programs.gnomeServices;
in
{
config = lib.mkIf cfg.enable {
services = {
dbus.packages = with pkgs; [
gcr
gnome.gnome-settings-daemon
];
gnome.gnome-keyring.enable = true;
gvfs.enable = true;
};
};
}

View file

@ -33,8 +33,8 @@ in
enable = true;
wheelNeedsPassword = false;
};
rtkit.enable = true;
};
rtkit.enable = true;
# security tweaks borrowed from @hlissner
boot.kernel.sysctl = {

View file

@ -2,7 +2,7 @@
let
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
cfg = config.systemModule.user.ooks;
cfg = config.systemModules.user.ooks;
in
{
@ -22,7 +22,6 @@ in
packages = [ pkgs.home-manager ];
};
home-manager.users.ooks = import ../../../../home/user/ooks/${config.networking.hostName};
home-manager.users.ooks = import ../../../home/user/ooks/${config.networking.hostName};
};
}