testing the new config before pushing to main
This commit is contained in:
parent
a545953c2d
commit
c53123d2c5
38 changed files with 370 additions and 198 deletions
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
1
system/modules/bootloader/grub/default.nix
Normal file
1
system/modules/bootloader/grub/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
## to be implemented
|
||||
17
system/modules/bootloader/systemd/default.nix
Normal file
17
system/modules/bootloader/systemd/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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";
|
||||
};
|
||||
|
|
|
|||
13
system/modules/displayManager/default.nix
Normal file
13
system/modules/displayManager/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./tuigreet
|
||||
];
|
||||
|
||||
options.systemModules.displayManager = {
|
||||
tuigreet = {
|
||||
enable = lib.mkEnableOption "Enable tuigreet display manager module";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
29
system/modules/displayManager/tuigreet/default.nix
Normal file
29
system/modules/displayManager/tuigreet/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
22
system/modules/hardware/backlight.nix
Normal file
22
system/modules/hardware/backlight.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
23
system/modules/hardware/bluetooth.nix
Normal file
23
system/modules/hardware/bluetooth.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
21
system/modules/hardware/default.nix
Normal file
21
system/modules/hardware/default.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
32
system/modules/hardware/power.nix
Normal file
32
system/modules/hardware/power.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@ in
|
|||
];
|
||||
};
|
||||
time.timeZone = lib.mkDefault "Pacific/Auckland";
|
||||
location.provider = "geoclue2";
|
||||
services.geoclue2.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
imports = [
|
||||
./nh.nix
|
||||
./nix.nix
|
||||
./nixpkgs
|
||||
./nixpkgs.nix
|
||||
./subs.nix
|
||||
];
|
||||
|
||||
|
|
|
|||
13
system/modules/programs/default.nix
Normal file
13
system/modules/programs/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./gnomeServices.nix
|
||||
];
|
||||
|
||||
options.systemModules.programs = {
|
||||
gnomeServices = {
|
||||
enable = lib.mkEnableOption "Enable gnome services module";
|
||||
};
|
||||
};
|
||||
}
|
||||
18
system/modules/programs/gnomeServices.nix
Normal file
18
system/modules/programs/gnomeServices.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -33,8 +33,8 @@ in
|
|||
enable = true;
|
||||
wheelNeedsPassword = false;
|
||||
};
|
||||
rtkit.enable = true;
|
||||
};
|
||||
rtkit.enable = true;
|
||||
|
||||
# security tweaks borrowed from @hlissner
|
||||
boot.kernel.sysctl = {
|
||||
|
|
@ -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};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue