remove system folder and relocate modules

This commit is contained in:
Tyler Starr 2024-10-26 19:26:44 -07:00
parent 663b5cad56
commit 6fa1f92b1b
10 changed files with 37 additions and 34 deletions

View File

@ -42,10 +42,7 @@
};
services = {
samba-client.enable = true;
};
system = {
ssh.enable = true;
terminal.enable = true;
};
};
}

View File

@ -49,6 +49,7 @@
};
programs = {
beancount.enable = true;
borg.enable = true;
chezmoi.apply = true;
kitty.enable = true;
virt-manager.enable = true;
@ -63,11 +64,7 @@
};
services = {
samba-client.enable = true;
};
system = {
backup.enable = true;
ssh.enable = true;
terminal.enable = true;
};
};
}

View File

@ -1,4 +1,10 @@
{ ... }:
{
imports = [ ./desktop ./devel ./gaming ./programs ./system ./services ];
imports = [
./desktop
./devel
./gaming
./programs
./services
];
}

View File

@ -1,10 +1,15 @@
{ config, lib, pkgs, user, ... }:
let cfg = config.modules.system.terminal;
let cfg = config.modules.programs.base.terminal;
in {
options.modules.system.terminal.enable = lib.mkEnableOption "terminal";
config = lib.mkIf cfg.enable {
options.modules.programs.base.terminal = with lib; {
enable = lib.mkOption {
type = with types; bool;
default = true;
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
killall # Command-line utility to terminate processes by name.
pciutils # Utilities for inspecting and manipulating devices connected to the PCI bus.

View File

@ -1,10 +1,9 @@
{ config, pkgs, user, lib, ... }:
let cfg = config.modules.system.backup;
let cfg = config.modules.programs.borg;
in {
options.modules.system.backup.enable = lib.mkEnableOption "backup";
options.modules.programs.borg.enable = lib.mkEnableOption "borg";
config = lib.mkIf cfg.enable {
services.borgmatic.enable = true;
environment.systemPackages = with pkgs; [
borgbackup # Deduplicating backup program
tree
@ -22,5 +21,6 @@ in {
rm /tmp/docker_images
'')
];
services.borgmatic.enable = true;
};
}

View File

@ -1,7 +1,9 @@
{ ... }:
{
imports = [
./base/terminal.nix
./beancount.nix
./borg.nix
./chrome
./firefox
./git.nix

View File

@ -2,5 +2,6 @@
{
imports = [
./samba-client.nix
./ssh.nix
];
}

View File

@ -0,0 +1,15 @@
{ config, lib, pkgs, user, ... }:
let cfg = config.modules.services.ssh;
in {
options.modules.services.ssh.enable = lib.mkEnableOption "ssh";
config = lib.mkIf cfg.enable {
services.openssh.enable = true;
services.pcscd.enable = true;
programs.gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-curses;
enableSSHSupport = true;
};
};
}

View File

@ -1,4 +0,0 @@
{ ... }:
{
imports = [ ./backup.nix ./ssh.nix ./terminal.nix ];
}

View File

@ -1,16 +0,0 @@
{ config, lib, pkgs, user, ... }:
let cfg = config.modules.system.ssh;
in {
options.modules.system.ssh.enable = lib.mkEnableOption "ssh";
config = lib.mkIf cfg.enable {
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.pcscd.enable = true;
programs.gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-curses;
enableSSHSupport = true;
};
};
}