From 7815017528fca3e0addb848dbf64d8858f4ed0cb Mon Sep 17 00:00:00 2001 From: William Date: Sun, 15 Feb 2026 16:36:06 -0300 Subject: [PATCH] rework system, programs, desktop, cli and base aspects --- aspects/{shell => base}/bash.nix | 2 +- aspects/base/fish.nix | 47 +++++++++++++++++++ aspects/{programs => desktop}/graphics.nix | 0 aspects/{programs => desktop}/media.nix | 0 aspects/{programs => desktop}/office.nix | 0 aspects/{programs => desktop}/web.nix | 0 aspects/server/boot.nix | 14 ------ aspects/server/tailscale.nix | 22 --------- aspects/shell/fish.nix | 40 ---------------- aspects/{base => systems}/base.nix | 8 +--- aspects/{cli => systems}/cli.nix | 0 aspects/{desktop => systems}/desktop.nix | 0 .../{server/nix.nix => systems/server.nix} | 18 ++++++- 13 files changed, 66 insertions(+), 85 deletions(-) rename aspects/{shell => base}/bash.nix (82%) create mode 100644 aspects/base/fish.nix rename aspects/{programs => desktop}/graphics.nix (100%) rename aspects/{programs => desktop}/media.nix (100%) rename aspects/{programs => desktop}/office.nix (100%) rename aspects/{programs => desktop}/web.nix (100%) delete mode 100644 aspects/server/boot.nix delete mode 100644 aspects/server/tailscale.nix delete mode 100644 aspects/shell/fish.nix rename aspects/{base => systems}/base.nix (87%) rename aspects/{cli => systems}/cli.nix (100%) rename aspects/{desktop => systems}/desktop.nix (100%) rename aspects/{server/nix.nix => systems/server.nix} (51%) diff --git a/aspects/shell/bash.nix b/aspects/base/bash.nix similarity index 82% rename from aspects/shell/bash.nix rename to aspects/base/bash.nix index e451148..6ba97ef 100644 --- a/aspects/shell/bash.nix +++ b/aspects/base/bash.nix @@ -1,6 +1,6 @@ { ... }: { - flake.modules.homeManager.shell-bash = + flake.modules.homeManager.bash = { config, lib, diff --git a/aspects/base/fish.nix b/aspects/base/fish.nix new file mode 100644 index 0000000..8ed326a --- /dev/null +++ b/aspects/base/fish.nix @@ -0,0 +1,47 @@ +{ ... }: +{ + flake.modules = { + nixos.fish = + { ... }: + { + programs.fish.enable = true; + }; + homeManager.fish = + { + config, + lib, + pkgs, + ... + }: + { + programs.fish = { + enable = true; + interactiveShellInit = '' + set fish_greeting + ${lib.getExe pkgs.nix-your-shell} fish | source + ''; + loginShellInit = "${lib.getExe pkgs.nix-your-shell} fish | source"; + plugins = [ + { + name = "bang-bang"; + src = pkgs.fetchFromGitHub { + owner = "oh-my-fish"; + repo = "plugin-bang-bang"; + rev = "f969c618301163273d0a03d002614d9a81952c1e"; + sha256 = "sha256-A8ydBX4LORk+nutjHurqNNWFmW6LIiBPQcxS3x4nbeQ="; + }; + } + { + name = "z"; + src = pkgs.fetchFromGitHub { + owner = "jethrokuan"; + repo = "z"; + rev = "067e867debee59aee231e789fc4631f80fa5788e"; + sha256 = "sha256-emmjTsqt8bdI5qpx1bAzhVACkg0MNB/uffaRjjeuFxU="; + }; + } + ]; + }; + }; + }; +} diff --git a/aspects/programs/graphics.nix b/aspects/desktop/graphics.nix similarity index 100% rename from aspects/programs/graphics.nix rename to aspects/desktop/graphics.nix diff --git a/aspects/programs/media.nix b/aspects/desktop/media.nix similarity index 100% rename from aspects/programs/media.nix rename to aspects/desktop/media.nix diff --git a/aspects/programs/office.nix b/aspects/desktop/office.nix similarity index 100% rename from aspects/programs/office.nix rename to aspects/desktop/office.nix diff --git a/aspects/programs/web.nix b/aspects/desktop/web.nix similarity index 100% rename from aspects/programs/web.nix rename to aspects/desktop/web.nix diff --git a/aspects/server/boot.nix b/aspects/server/boot.nix deleted file mode 100644 index 38634d1..0000000 --- a/aspects/server/boot.nix +++ /dev/null @@ -1,14 +0,0 @@ -# aspects/server/boot.nix -{ ... }: -{ - flake.modules.nixos.server-boot = - { - config, - lib, - pkgs, - ... - }: - { - boot.kernelPackages = pkgs.linuxPackages_hardened; - }; -} diff --git a/aspects/server/tailscale.nix b/aspects/server/tailscale.nix deleted file mode 100644 index cf2fa4b..0000000 --- a/aspects/server/tailscale.nix +++ /dev/null @@ -1,22 +0,0 @@ -# aspects/server/tailscale.nix -{ ... }: -{ - flake.modules.nixos.server-tailscale = - { - config, - lib, - pkgs, - ... - }: - { - services.tailscale = { - extraSetFlags = [ "--advertise-exit-node" ]; - useRoutingFeatures = "server"; - }; - - boot.kernel.sysctl = { - "net.ipv4.ip_forward" = 1; - "net.ipv6.conf.all.forwarding" = 1; - }; - }; -} diff --git a/aspects/shell/fish.nix b/aspects/shell/fish.nix deleted file mode 100644 index 22c0f5c..0000000 --- a/aspects/shell/fish.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ ... }: -{ - flake.modules.homeManager.shell-fish = - { - config, - lib, - pkgs, - ... - }: - { - programs.fish = { - enable = true; - interactiveShellInit = '' - set fish_greeting - ${lib.getExe pkgs.nix-your-shell} fish | source - ''; - loginShellInit = "${lib.getExe pkgs.nix-your-shell} fish | source"; - plugins = [ - { - name = "bang-bang"; - src = pkgs.fetchFromGitHub { - owner = "oh-my-fish"; - repo = "plugin-bang-bang"; - rev = "f969c618301163273d0a03d002614d9a81952c1e"; - sha256 = "sha256-A8ydBX4LORk+nutjHurqNNWFmW6LIiBPQcxS3x4nbeQ="; - }; - } - { - name = "z"; - src = pkgs.fetchFromGitHub { - owner = "jethrokuan"; - repo = "z"; - rev = "067e867debee59aee231e789fc4631f80fa5788e"; - sha256 = "sha256-emmjTsqt8bdI5qpx1bAzhVACkg0MNB/uffaRjjeuFxU="; - }; - } - ]; - }; - }; -} diff --git a/aspects/base/base.nix b/aspects/systems/base.nix similarity index 87% rename from aspects/base/base.nix rename to aspects/systems/base.nix index 08841b2..5fef6b9 100644 --- a/aspects/base/base.nix +++ b/aspects/systems/base.nix @@ -7,6 +7,7 @@ boot console firewall + fish locale nix security @@ -28,12 +29,7 @@ }; }; - programs = { - command-not-found.enable = false; - fish = { - enable = true; - }; - }; + programs.command-not-found.enable = false; services = { dbus.implementation = "broker"; diff --git a/aspects/cli/cli.nix b/aspects/systems/cli.nix similarity index 100% rename from aspects/cli/cli.nix rename to aspects/systems/cli.nix diff --git a/aspects/desktop/desktop.nix b/aspects/systems/desktop.nix similarity index 100% rename from aspects/desktop/desktop.nix rename to aspects/systems/desktop.nix diff --git a/aspects/server/nix.nix b/aspects/systems/server.nix similarity index 51% rename from aspects/server/nix.nix rename to aspects/systems/server.nix index 1cb8e8b..c3c24f0 100644 --- a/aspects/server/nix.nix +++ b/aspects/systems/server.nix @@ -1,7 +1,7 @@ -# aspects/server/nix.nix { inputs, ... }: + { - flake.modules.nixos.server-nix = + flake.modules.nixos.server = { config, lib, @@ -9,6 +9,14 @@ ... }: { + boot = { + kernelPackages = pkgs.linuxPackages_hardened; + kernel.sysctl = { + "net.ipv4.ip_forward" = 1; + "net.ipv6.conf.all.forwarding" = 1; + }; + }; + environment.etc."channels/nixpkgs".source = inputs.nixpkgs-stable.outPath; nix = { @@ -18,5 +26,11 @@ "/nix/var/nix/profiles/per-user/root/channels" ]; }; + + services.tailscale = { + extraSetFlags = [ "--advertise-exit-node" ]; + useRoutingFeatures = "server"; + }; + }; }