summaryrefslogtreecommitdiff
path: root/os/core
diff options
context:
space:
mode:
Diffstat (limited to 'os/core')
-rw-r--r--os/core/default.nix2
-rw-r--r--os/core/fonts.nix11
-rw-r--r--os/core/networking.nix64
-rw-r--r--os/core/ssh.nix55
-rw-r--r--os/core/tailscale.nix19
5 files changed, 54 insertions, 97 deletions
diff --git a/os/core/default.nix b/os/core/default.nix
index 1899553..1146f2d 100644
--- a/os/core/default.nix
+++ b/os/core/default.nix
@@ -15,9 +15,7 @@ in
./networking.nix
./power.nix
./security.nix
- ./ssh.nix
./storage.nix
- ./tailscale.nix
./users.nix
];
diff --git a/os/core/fonts.nix b/os/core/fonts.nix
index dac0ee7..ee61591 100644
--- a/os/core/fonts.nix
+++ b/os/core/fonts.nix
@@ -1,4 +1,9 @@
-{ config, lib, pkgs, ... }:
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
let
cfg = config.os.core.fonts;
in
@@ -18,6 +23,10 @@ in
nerd-fonts.jetbrains-mono
nerd-fonts.fira-mono
nerd-fonts.fira-code
+ noto-fonts
+ noto-fonts-cjk-sans
+ noto-fonts-cjk-serif
+ noto-fonts-color-emoji
];
};
}
diff --git a/os/core/networking.nix b/os/core/networking.nix
index 0a93cb9..22fc206 100644
--- a/os/core/networking.nix
+++ b/os/core/networking.nix
@@ -8,26 +8,50 @@ let
cfg = config.os.core.network;
in
{
- options.os.core.network.enable = lib.mkEnableOption "system-wide networking setup";
- config = lib.mkIf cfg.enable {
- networking = {
- networkmanager = {
- enable = true;
- wifi = {
- macAddress = "random";
- backend = "iwd";
- };
- ethernet.macAddress = "random";
- dns = "systemd-resolved";
- };
- firewall = {
- enable = true;
- allowedTCPPorts = [ ];
- allowedUDPPorts = [ ];
- };
+ options.os.core.network = {
+ enable = lib.mkEnableOption "system-wide networking setup";
+
+ profile = lib.mkOption {
+ type = lib.types.enum [
+ "client"
+ "server"
+ ];
+ default = "client";
+ description = "Which networking profile configuration to apply";
};
- environment.systemPackages = [ pkgs.impala ];
- services.resolved.enable = true;
- systemd.services."NetworkManager-wait-online".enable = false;
};
+
+ config = lib.mkIf cfg.enable (
+ lib.mkMerge [
+ {
+ networking.networkmanager = {
+ enable = true;
+ dns = "systemd-resolved";
+ };
+
+ services.resolved.enable = true;
+ }
+
+ (lib.mkIf (cfg.profile == "client") {
+ networking.networkmanager = {
+ wifi.macAddress = "random";
+ wifi.backend = "iwd";
+ ethernet.macAddress = "random";
+ };
+
+ systemd.services."NetworkManager-wait-online".enable = false;
+
+ environment.systemPackages = [
+ pkgs.impala
+ ];
+ })
+
+ (lib.mkIf (cfg.profile == "server") {
+ networking.networkmanager = {
+ wifi.macAddress = "keep";
+ ethernet.macAddress = "keep";
+ };
+ })
+ ]
+ );
}
diff --git a/os/core/ssh.nix b/os/core/ssh.nix
deleted file mode 100644
index 52b7c32..0000000
--- a/os/core/ssh.nix
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- config,
- lib,
- username,
- ...
-}:
-let
- cfg = config.os.core.ssh;
- keys = {
- main = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC610CJfgc3yII7MpLVqzEzQGa8Tsm+dih+CTXHXTnv4";
- oci = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCgWmRbNTP/kcaZ8JNV1boVTZ/FQVV4qP/9eTKL9buzDvz9HJdgyWmbCiVZicNSert31IRdWOF/wm1sFjZ48nSkGDHbrnc//MPSdHULTx+kMES/NW9SZwwpaquFIJClrObysxrFYBAqweD+DJ3bp451WIymBs7lRBMNKPgoHBpJ5WN2CfIQjl60Jqnli7ML5seCsrquPEemcMPr1TFPmrFCbirzgDVkzCLL5kOowSD2uprtSA08fFm/pZ6nZh6KTQaEgPO4zR9tK+NQ46oCynWwBTI7JOPB4/LtIOiC5TjEUrkXZ/sJzpCBiNPYSRI8RWnAD0N/uVFJ4EYPUKLO2C/d";
- };
-in
-{
- options.os.core.ssh.enable = lib.mkEnableOption "enables ssh server setup";
-
- config = lib.mkIf cfg.enable {
- services.openssh = {
- enable = true;
- settings = {
- PasswordAuthentication = false;
- KbdInteractiveAuthentication = false;
- };
- };
-
- programs.ssh.startAgent = true;
- services.gnome.gcr-ssh-agent.enable = false;
-
- users.users.${username}.openssh.authorizedKeys.keys = [ "${keys.main} adikro@disroot.org" ];
-
- environment.etc."ssh/allowed_signers".text = "adikro@disroot.org ${keys.main}";
- home-manager.users.${username} = {
- programs.ssh = {
- enable = true;
- enableDefaultConfig = false;
-
- matchBlocks = {
- "github.com codeberg.org" = {
- identityFile = "~/.ssh/main_id_ed25519.pub";
- identitiesOnly = true;
- user = "git";
- };
- "oci" = {
- hostname = "130.162.223.123";
- user = "opc";
- };
- };
- };
- home.file = {
- ".ssh/main_id_ed25519.pub".text = keys.main;
- ".ssh/oci.pub".text = keys.oci;
- };
- };
- };
-}
diff --git a/os/core/tailscale.nix b/os/core/tailscale.nix
deleted file mode 100644
index 795fdbb..0000000
--- a/os/core/tailscale.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ config, lib, ... }:
-let
- cfg = config.os.core.tailscale;
-in
-{
- options.os.core.tailscale.enable = lib.mkEnableOption "enables tailscale vpn";
-
- config = lib.mkIf cfg.enable {
- services.tailscale = {
- enable = true;
- openFirewall = true;
- useRoutingFeatures = "client";
- };
- networking.firewall = {
- trustedInterfaces = [ "tailscale0" ];
- checkReversePath = "loose";
- };
- };
-}