Refactor back to a more modular configuration
This commit is contained in:
parent
19ea08a716
commit
2bedd41d83
178 changed files with 2245 additions and 1847 deletions
12
modules/nixos/core/avahi.nix
Normal file
12
modules/nixos/core/avahi.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
|
||||
publish = {
|
||||
enable = true;
|
||||
addresses = true;
|
||||
};
|
||||
};
|
||||
}
|
16
modules/nixos/core/bluetooth.nix
Normal file
16
modules/nixos/core/bluetooth.nix
Normal 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;
|
||||
};
|
||||
}
|
11
modules/nixos/core/default.nix
Normal file
11
modules/nixos/core/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
imports = [
|
||||
./avahi.nix
|
||||
./bluetooth.nix
|
||||
./gnupg.nix
|
||||
./openssh.nix
|
||||
./pipewire.nix
|
||||
./xbanish.nix
|
||||
./zram.nix
|
||||
];
|
||||
}
|
14
modules/nixos/core/gnupg.nix
Normal file
14
modules/nixos/core/gnupg.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
security.pam.services.login.gnupg.enable = true;
|
||||
|
||||
programs = {
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
|
||||
pinentryPackage = pkgs.pinentry-qt;
|
||||
};
|
||||
};
|
||||
}
|
23
modules/nixos/core/openssh.nix
Normal file
23
modules/nixos/core/openssh.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
23
modules/nixos/core/pipewire.nix
Normal file
23
modules/nixos/core/pipewire.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
14
modules/nixos/core/xbanish.nix
Normal file
14
modules/nixos/core/xbanish.nix
Normal 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;
|
||||
};
|
||||
}
|
18
modules/nixos/core/zram.nix
Normal file
18
modules/nixos/core/zram.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue