flake: rework modules folder structure
This commit is contained in:
parent
5d64c56d40
commit
0952665f6b
56 changed files with 3 additions and 3 deletions
8
modules/nixos/services/fstrim.nix
Normal file
8
modules/nixos/services/fstrim.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.settings.services.fstrim = {
|
||||
enable = lib.mkEnableOption "enables fstrim";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.settings.services.fstrim.enable { services.fstrim.enable = true; };
|
||||
}
|
||||
41
modules/nixos/services/gnome.nix
Normal file
41
modules/nixos/services/gnome.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.settings.gnome = {
|
||||
enable = lib.mkEnableOption "enable gnome de";
|
||||
};
|
||||
|
||||
#todo make this more configurable
|
||||
config = lib.mkIf config.settings.gnome.enable {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager.gdm.enable = true;
|
||||
desktopManager.gnome.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.gnome-tweaks ];
|
||||
|
||||
#enable browser connector for installing extensions
|
||||
services.gnome.gnome-browser-connector.enable = true;
|
||||
|
||||
# Gnome enables pulse by default smh
|
||||
# make sure to have PIPEWIRE enabled
|
||||
hardware.pulseaudio.enable = false;
|
||||
|
||||
# remove various bloat
|
||||
environment.gnome.excludePackages = with pkgs; [
|
||||
gnome-contacts
|
||||
gnome-maps
|
||||
gnome-music
|
||||
gnome-weather
|
||||
gnome-tour
|
||||
epiphany
|
||||
totem
|
||||
yelp
|
||||
];
|
||||
};
|
||||
}
|
||||
22
modules/nixos/services/openssh.nix
Normal file
22
modules/nixos/services/openssh.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.settings.services.openssh = {
|
||||
enable = lib.mkEnableOption "enable openSSH";
|
||||
usePAM = lib.mkEnableOption "use PAM for ssh authentication";
|
||||
};
|
||||
|
||||
#further move these options into settings
|
||||
config = lib.mkIf config.settings.services.openssh.enable {
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [ 12342 ];
|
||||
settings = {
|
||||
UsePAM = config.settings.services.openssh.usePAM;
|
||||
PasswordAuthentication = true;
|
||||
AllowUsers = null;
|
||||
X11Forwarding = false;
|
||||
PermitRootLogin = "prohibit-password";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
21
modules/nixos/services/pam.nix
Normal file
21
modules/nixos/services/pam.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.settings.services.pam = {
|
||||
enable = lib.mkEnableOption "enables PAM";
|
||||
sshd = {
|
||||
useGoogleAuth = lib.mkEnableOption "use pam_google_authenticator.so module";
|
||||
gnupg = lib.mkEnableOption "enable gnuPG integration";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.settings.services.pam.enable {
|
||||
security.pam = {
|
||||
services.sshd = {
|
||||
name = "sshd";
|
||||
unixAuth = true;
|
||||
googleAuthenticator.enable = config.settings.services.pam.sshd.useGoogleAuth;
|
||||
gnupg.enable = config.settings.services.pam.sshd.gnupg;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
20
modules/nixos/services/pipewire.nix
Normal file
20
modules/nixos/services/pipewire.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.settings.services.audio = {
|
||||
enable = lib.mkEnableOption "enable sound through pipewire and its compat layers";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.settings.services.audio.enable {
|
||||
|
||||
#enable RealtimeKit for realtime audio ( req by PulseAudio )
|
||||
security.rtkit.enable = true;
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
19
modules/nixos/services/printing.nix
Normal file
19
modules/nixos/services/printing.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.settings.services.printing = {
|
||||
enable = lib.mkEnableOption "enable printing";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.settings.services.printing.enable {
|
||||
services = {
|
||||
printing = {
|
||||
enable = true;
|
||||
};
|
||||
avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
10
modules/nixos/services/switcheroo.nix
Normal file
10
modules/nixos/services/switcheroo.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.settings.services.switcheroo = {
|
||||
enable = lib.mkEnableOption "enable switcheroo-control for nvidia optimus management";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.settings.services.switcheroo.enable {
|
||||
services.switcherooControl.enable = true;
|
||||
};
|
||||
}
|
||||
8
modules/nixos/services/tlp.nix
Normal file
8
modules/nixos/services/tlp.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.settings.services.tlp = {
|
||||
enable = lib.mkEnableOption "enables tlp for power management";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.settings.services.tlp.enable { services.tlp.enable = true; };
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue