Refactor back to a more modular configuration

This commit is contained in:
Oliver Davies 2025-04-23 14:19:05 +01:00
parent 19ea08a716
commit 2bedd41d83
178 changed files with 2245 additions and 1847 deletions

View file

@ -0,0 +1,12 @@
{
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
publish = {
enable = true;
addresses = true;
};
};
}

View file

@ -0,0 +1,16 @@
{ config, lib, ... }:
with lib;
let
cfg = config.nixosModules.core.bluetooth;
in
{
options.nixosModules.core.bluetooth.enable = mkEnableOption "Enable bluetooth";
config = mkIf cfg.enable {
hardware.bluetooth.enable = true;
services.blueman.enable = true;
};
}

View file

@ -0,0 +1,11 @@
{
imports = [
./avahi.nix
./bluetooth.nix
./gnupg.nix
./openssh.nix
./pipewire.nix
./xbanish.nix
./zram.nix
];
}

View file

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
security.pam.services.login.gnupg.enable = true;
programs = {
gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryPackage = pkgs.pinentry-qt;
};
};
}

View file

@ -0,0 +1,23 @@
{ config, lib, ... }:
with lib;
let
cfg = config.nixosModules.core.openssh;
in
{
options.nixosModules.core.openssh.enable = mkEnableOption "Enable openssh";
config = mkIf cfg.enable {
services.openssh = {
enable = true;
openFirewall = lib.mkForce true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = lib.mkForce "no";
};
};
};
}

View file

@ -0,0 +1,23 @@
{ config, lib, ... }:
with lib;
let
cfg = config.nixosModules.core.pipewire;
in
{
options.nixosModules.core.pipewire.enable = mkEnableOption "Enable pipewire";
config = mkIf cfg.enable {
services.pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
};
};
}

View file

@ -0,0 +1,14 @@
{ config, lib, ... }:
with lib;
let
cfg = config.nixosModules.core.xbanish;
in
{
options.nixosModules.core.xbanish.enable = mkEnableOption "Enable xbanish";
config = mkIf cfg.enable {
services.xbanish.enable = true;
};
}

View file

@ -0,0 +1,18 @@
{ config, lib, ... }:
with lib;
let
cfg = config.nixosModules.core.zram;
in
{
options.nixosModules.core.zram.enable = mkEnableOption "Enable zram";
config = mkIf cfg.enable {
zramSwap = {
enable = true;
algorithm = "zstd";
memoryPercent = 90;
};
};
}