common aspects reworked into base aspect

This commit is contained in:
William 2026-02-15 14:20:57 -03:00
parent bfa2521ed0
commit 5d1b54c8bf
15 changed files with 72 additions and 112 deletions

View file

@ -1,16 +1,22 @@
{ ... }: { inputs, ... }:
{ {
flake.modules.nixos.common-programs = flake.modules.nixos.base =
{ lib, pkgs, ... }: { lib, pkgs, ... }:
{ {
imports = with inputs.self.modules.nixos; [
boot
console
firewall
locale
nix
security
ssh
];
environment = { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [
### Dev Tools ###
git git
### System Utilities ###
fastfetch fastfetch
nixos-firewall-tool nixos-firewall-tool
nvd
sysz sysz
wget wget
yazi yazi
@ -26,14 +32,16 @@
command-not-found.enable = false; command-not-found.enable = false;
fish = { fish = {
enable = true; enable = true;
interactiveShellInit = '' };
set fish_greeting };
if set -q SSH_CONNECTION; and not set -q IN_NIX_SHELL; or not set -q TMUX
export TERM=xterm-256color services = {
clear dbus.implementation = "broker";
fastfetch irqbalance.enable = true;
end fstrim.enable = true;
''; tailscale = {
enable = true;
extraUpFlags = [ "--operator=user" ];
}; };
}; };
}; };

View file

@ -1,6 +1,6 @@
{ ... }: { ... }:
{ {
flake.modules.nixos.common-boot = flake.modules.nixos.boot =
{ pkgs, ... }: { pkgs, ... }:
{ {
boot = { boot = {

View file

@ -1,6 +1,6 @@
{ ... }: { ... }:
{ {
flake.modules.nixos.common-console = flake.modules.nixos.console =
{ ... }: { ... }:
{ {
console = { console = {

View file

@ -1,6 +1,6 @@
{ ... }: { ... }:
{ {
flake.modules.nixos.common-firewall = flake.modules.nixos.firewall =
{ ... }: { ... }:
{ {
networking = { networking = {

View file

@ -1,6 +1,6 @@
{ ... }: { ... }:
{ {
flake.modules.nixos.common-locale = flake.modules.nixos.locale =
{ ... }: { ... }:
{ {
time.timeZone = "America/Bahia"; time.timeZone = "America/Bahia";

View file

@ -1,6 +1,6 @@
{ ... }: { ... }:
{ {
flake.modules.nixos.common-nix = flake.modules.nixos.nix =
{ inputs, ... }: { inputs, ... }:
{ {
imports = [ inputs.nixos-cli.nixosModules.nixos-cli ]; imports = [ inputs.nixos-cli.nixosModules.nixos-cli ];

View file

@ -1,6 +1,6 @@
{ ... }: { ... }:
{ {
flake.modules.nixos.common-security = flake.modules.nixos.security =
{ ... }: { ... }:
{ {
security.sudo = { security.sudo = {

32
aspects/base/ssh.nix Normal file
View file

@ -0,0 +1,32 @@
{ ... }:
{
flake.modules.nixos.ssh =
{ ... }:
{
services.openssh = {
enable = true;
settings.PermitRootLogin = "no";
extraConfig = ''
PrintLastLog no
'';
};
programs = {
bash.interactiveShellInit = ''
if { [ -n "$SSH_CONNECTION" ] && [ -z "$IN_NIX_SHELL" ]; } || [ -z "$TMUX" ]; then
export TERM=xterm-256color
clear
fastfetch
fi
'';
fish.interactiveShellInit = ''
set fish_greeting
if set -q SSH_CONNECTION; and not set -q IN_NIX_SHELL; or not set -q TMUX
export TERM=xterm-256color
clear
fastfetch
end
'';
};
};
}

View file

@ -1,14 +0,0 @@
{ ... }:
{
flake.modules.nixos.common-openssh =
{ ... }:
{
services.openssh = {
enable = true;
settings.PermitRootLogin = "no";
extraConfig = ''
PrintLastLog no
'';
};
};
}

View file

@ -1,12 +0,0 @@
{ ... }:
{
flake.modules.nixos.common-services =
{ ... }:
{
services = {
dbus.implementation = "broker";
irqbalance.enable = true;
fstrim.enable = true;
};
};
}

View file

@ -1,11 +0,0 @@
{ ... }:
{
flake.modules.nixos.common-tailscale =
{ ... }:
{
services.tailscale = {
enable = true;
extraUpFlags = [ "--operator=user" ];
};
};
}

View file

@ -16,21 +16,11 @@
((inputs.import-tree.initFilter (p: lib.hasSuffix ".nix" p)) ./_alexandria) ((inputs.import-tree.initFilter (p: lib.hasSuffix ".nix" p)) ./_alexandria)
] ]
++ (with inputs.self.modules.nixos; [ ++ (with inputs.self.modules.nixos; [
# system aspects
base
cli cli
# Common aspects (always included) # user aspects
common-boot
common-console
common-firewall
common-locale
common-nix
common-openssh
common-programs
common-security
common-services
common-tailscale
# User aspects
user user
root root

View file

@ -19,21 +19,11 @@
}) })
] ]
++ (with inputs.self.modules.nixos; [ ++ (with inputs.self.modules.nixos; [
# system aspects
base
cli cli
# Common aspects (always included) # user aspects
common-boot
common-console
common-firewall
common-locale
common-nix
common-openssh
common-programs
common-security
common-services
common-tailscale
# User aspects
user user
root root

View file

@ -19,21 +19,11 @@
}) })
] ]
++ (with inputs.self.modules.nixos; [ ++ (with inputs.self.modules.nixos; [
# system aspects
base
cli cli
# Common aspects (always included) # user aspects
common-boot
common-console
common-firewall
common-locale
common-nix
common-openssh
common-programs
common-security
common-services
common-tailscale
# User aspects
user user
root root

View file

@ -12,30 +12,17 @@
inputs.self.overlays.default inputs.self.overlays.default
]; ];
} }
((inputs.import-tree.initFilter (p: lib.hasSuffix ".nix" p)) ./_trantor)
# Factory-generated ephemeral module
(inputs.self.factory.ephemeral { (inputs.self.factory.ephemeral {
rootDevice = "/dev/disk/by-id/scsi-360b207ed25d84372a95d1ecf842f8e20-part2"; rootDevice = "/dev/disk/by-id/scsi-360b207ed25d84372a95d1ecf842f8e20-part2";
}) })
((inputs.import-tree.initFilter (p: lib.hasSuffix ".nix" p)) ./_trantor)
] ]
++ (with inputs.self.modules.nixos; [ ++ (with inputs.self.modules.nixos; [
# system aspects
base
cli cli
# Common aspects (always included) # user aspects
common-boot
common-console
common-firewall
common-locale
common-nix
common-openssh
common-programs
common-security
common-services
common-tailscale
# User aspects
user user
root root