🚚 [shared] Added shared config that shared desktop config inherits from

This commit is contained in:
2025-05-20 21:52:00 +02:00
parent adb02fbcc2
commit 9a8cc63674
92 changed files with 41 additions and 25 deletions

View File

@ -93,7 +93,6 @@
wayland.enable = false;
ssh.publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIARDv5nRlfPDXdV+Db4FaqeSJZ3/3MO0frYGzuVeqYAl";
}
# TODO Homelab config
];
defaultAttrs = {

View File

@ -6,7 +6,7 @@
{
imports = [
(lib.custom.relativeToRoot "shared/modules")
(lib.custom.relativeToDesktop "modules")
./bluetooth.nix
./hardware-configuration.nix
];

View File

@ -5,7 +5,7 @@
{
imports = [
(lib.custom.relativeToRoot "shared/home-manager")
(lib.custom.relativeToDesktop "home-manager")
./hyprpaper.nix
./settings.nix
];

View File

@ -7,10 +7,10 @@
{
imports = with lib.custom; [
(relativeToRoot "shared/modules/nix-helper.nix")
(relativeToRoot "shared/modules/nixos.nix")
(relativeToRoot "shared/modules/shell.nix")
(relativeToRoot "shared/modules/security/sops.nix")
(relativeToRoot "shared/desktop/modules/nix-helper.nix")
(relativeToRoot "shared/desktop/modules/nixos.nix")
(relativeToRoot "shared/desktop/modules/shell.nix")
(relativeToRoot "shared/desktop/modules/security/sops.nix")
./boot.nix
./development.nix
./hardware.nix

View File

@ -9,14 +9,14 @@
{
imports = [
inputs.catppuccin.homeModules.catppuccin
(lib.custom.relativeToRoot "shared/home-manager/development/git.nix")
(lib.custom.relativeToRoot "shared/home-manager/development/helix.nix")
(lib.custom.relativeToRoot "shared/home-manager/shell/btop.nix")
(lib.custom.relativeToRoot "shared/home-manager/shell/eza.nix")
(lib.custom.relativeToRoot "shared/home-manager/shell/fastfetch.nix")
(lib.custom.relativeToRoot "shared/home-manager/shell/fish.nix")
(lib.custom.relativeToRoot "shared/home-manager/shell/zoxide.nix")
(lib.custom.relativeToRoot "shared/home-manager/gpg.nix")
(lib.custom.relativeToRoot "shared/desktop/home-manager/development/git.nix")
(lib.custom.relativeToRoot "shared/desktop/home-manager/development/helix.nix")
(lib.custom.relativeToRoot "shared/desktop/home-manager/shell/btop.nix")
(lib.custom.relativeToRoot "shared/desktop/home-manager/shell/eza.nix")
(lib.custom.relativeToRoot "shared/desktop/home-manager/shell/fastfetch.nix")
(lib.custom.relativeToRoot "shared/desktop/home-manager/shell/fish.nix")
(lib.custom.relativeToRoot "shared/desktop/home-manager/shell/zoxide.nix")
(lib.custom.relativeToRoot "shared/desktop/home-manager/gpg.nix")
];
home.stateVersion = systemConfig.version;

View File

@ -6,7 +6,7 @@
{
imports = [
(lib.custom.relativeToRoot "shared/modules")
(lib.custom.relativeToDesktop "modules")
./battery.nix
./bluetooth.nix
./hardware-configuration.nix

View File

@ -5,7 +5,7 @@
{
imports = [
(lib.custom.relativeToRoot "shared/home-manager")
(lib.custom.relativeToDesktop "home-manager")
./hyprland
./zen
];

View File

@ -1,16 +1,19 @@
# FIXME(lib.custom): Add some stuff from hmajid2301/dotfiles/lib/module/default.nix, as simplifies option declaration
{ lib, ... }:
with builtins;
{
getSecret = with lib.strings; filePath: trim (removeSuffix "\n" (builtins.readFile filePath));
getSecret = with lib.strings; filePath: trim (removeSuffix "\n" (readFile filePath));
# use path relative to the root of the project
relativeToRoot = lib.path.append ../.;
relativeToBase = lib.path.append ../shared/base;
relativeToDesktop = lib.path.append ../shared/desktop;
scanPaths =
path:
builtins.map (f: (path + "/${f}")) (
builtins.attrNames (
map (f: (path + "/${f}")) (
attrNames (
lib.attrsets.filterAttrs (
path: _type:
(_type == "directory") # include directories
@ -18,7 +21,7 @@
(path != "default.nix") # ignore default.nix
&& (lib.strings.hasSuffix ".nix" path) # include .nix files
)
) (builtins.readDir path)
) (readDir path)
)
);
}

View File

@ -0,0 +1,3 @@
{
imports = [ ./ssh.nix ];
}

View File

@ -1,5 +1,10 @@
# ~/.ssh/config
{ systemConfig, ... }:
{
systemConfig,
systems,
common,
...
}:
{
programs.ssh = {
@ -9,7 +14,7 @@
block = hostname: {
port = 22;
user = systemConfig.username;
hostname = "${hostname}.dns.martials.no";
hostname = "${hostname}.dns.${common.domain}";
};
in
{

View File

@ -0,0 +1,3 @@
{
imports = [ ./networking.nix ];
}

View File

@ -1,6 +1,7 @@
{
inputs,
outputs,
lib,
common,
systemConfig,
...
@ -10,6 +11,7 @@ let
in
{
imports = [
(lib.custom.relativeToBase "home-manager")
inputs.catppuccin.homeModules.catppuccin
./cursors.nix
./default-applications.nix
@ -25,7 +27,6 @@ in
./shell
./sioyek.nix
./spicetify.nix
./ssh.nix
./zen
];

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,5 +1,8 @@
{ lib, ... }:
{
imports = [
(lib.custom.relativeToBase "modules")
./boot.nix
./development
./electron.nix
@ -11,7 +14,6 @@
./locale.nix
./mail.nix
./media.nix
./networking.nix
./nixos.nix
./nix-helper.nix
./office.nix