refactoring for iServer and isWorkstation: part 2

This commit is contained in:
William 2025-03-13 13:33:41 -03:00
parent af1d9ac368
commit 021ab24e79
15 changed files with 116 additions and 131 deletions

View file

@ -1,9 +0,0 @@
{ ... }:
{
imports = [
./home-manager.nix
./impermanence.nix
./stylix.nix
];
}

View file

@ -1,10 +0,0 @@
{ ... }:
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "bkp";
users.user = import ../../../users/desktops/user.nix;
};
}

View file

@ -1,24 +0,0 @@
{ ... }:
{
environment.persistence.main = {
persistentStoragePath = "/persistent";
files = [
"/etc/machine-id"
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
];
directories = [
"/etc/NetworkManager/system-connections"
"/var/lib/bluetooth"
"/var/lib/flatpak"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/var/lib/systemd/timers"
"/var/lib/tailscale"
"/var/log"
];
};
}

View file

@ -1,47 +0,0 @@
{ config, pkgs, ... }:
{
stylix = {
enable = true;
image = pkgs.fetchurl {
url = "https://w.wallhaven.cc/full/dp/wallhaven-dpwvl3.jpg";
sha256 = "sha256-h9UeYj8jSRgSv8XL+zgds4KtooLlJ+IqwxZbQEXdCh4=";
};
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
cursor = {
package = pkgs.kdePackages.breeze-icons;
name = "Breeze_Light";
size = 24;
};
opacity = {
applications = 1.0;
desktop = 0.8;
popups = config.stylix.opacity.desktop;
terminal = 1.0;
};
fonts = {
serif = {
package = pkgs.source-serif;
name = "Source Serif 4 Display";
};
sansSerif = {
package = pkgs.inter;
name = "Inter";
};
monospace = {
package = pkgs.nerd-fonts.fira-code;
name = "FiraCode Nerd Font";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
sizes = {
applications = 10;
desktop = config.stylix.fonts.sizes.applications;
popups = config.stylix.fonts.sizes.applications;
terminal = 12;
};
};
};
}

View file

@ -17,10 +17,7 @@ let
in
{
imports = [
# Host-common imports
../common
# Desktop-common imports
./common
../modules
# Host-specific imports
./io
];

View file

@ -30,12 +30,8 @@ let
in
{
imports = [
# Host-common imports
../modules
# Desktop-common imports
./common
# Host-specific imports
./rotterdam
../modules
];
networking.hostName = "rotterdam";

View file

@ -5,12 +5,14 @@
./boot.nix
./console.nix
./desktop.nix
./impermanence.nix
./locale.nix
./networking.nix
./nix.nix
./programs.nix
./security.nix
./services.nix
./stylix.nix
./users.nix
./virtualisation.nix
];

View file

@ -0,0 +1,37 @@
{ hostType, lib, ... }:
{
config = lib.mkMerge [
# Common configuration
{
}
# Server specific configuration
(lib.mkIf hostType.isServer {
})
# Workstation specific configuration
(lib.mkIf hostType.isWorkstation {
environment.persistence.main = {
persistentStoragePath = "/persistent";
files = [
"/etc/machine-id"
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
];
directories = [
"/etc/NetworkManager/system-connections"
"/var/lib/bluetooth"
"/var/lib/flatpak"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/var/lib/systemd/timers"
"/var/lib/tailscale"
"/var/log"
];
};
})
];
}

66
hosts/modules/stylix.nix Normal file
View file

@ -0,0 +1,66 @@
{
config,
hostType,
lib,
pkgs,
...
}:
{
config = lib.mkMerge [
# Common configuration
{
}
# Server specific configuration
(lib.mkIf hostType.isServer {
})
# Workstation specific configuration
(lib.mkIf hostType.isWorkstation {
stylix = {
enable = true;
image = pkgs.fetchurl {
url = "https://w.wallhaven.cc/full/dp/wallhaven-dpwvl3.jpg";
sha256 = "sha256-h9UeYj8jSRgSv8XL+zgds4KtooLlJ+IqwxZbQEXdCh4=";
};
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
cursor = {
package = pkgs.kdePackages.breeze-icons;
name = "Breeze_Light";
size = 24;
};
opacity = {
applications = 1.0;
desktop = 0.8;
popups = config.stylix.opacity.desktop;
terminal = 1.0;
};
fonts = {
serif = {
package = pkgs.source-serif;
name = "Source Serif 4 Display";
};
sansSerif = {
package = pkgs.inter;
name = "Inter";
};
monospace = {
package = pkgs.nerd-fonts.fira-code;
name = "FiraCode Nerd Font";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
sizes = {
applications = 10;
desktop = config.stylix.fonts.sizes.applications;
popups = config.stylix.fonts.sizes.applications;
terminal = 12;
};
};
};
})
];
}

View file

@ -33,10 +33,17 @@
hashedPassword = "!";
};
};
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "bkp";
};
}
# Server specific configuration
(lib.mkIf hostType.isServer {
home-manager.users.user = import ../../users/servers/user.nix;
})
# Workstation specific configuration
@ -66,6 +73,8 @@
hashedPassword = "$y$j9T$yHLUDvj6bDIP19dchU.aA/$OY4qeFNtx/GvI.VUYx4LapHiiVwi0MEvs8AT0HN7j58";
};
};
home-manager.users.user = import ../../users/desktops/user.nix;
})
];
}

View file

@ -1,4 +0,0 @@
{ pkgs, ... }:
{
}

View file

@ -1,10 +0,0 @@
{ ... }:
{
imports = [
./boot.nix
./home-manager.nix
./nix.nix
./services.nix
];
}

View file

@ -1,10 +0,0 @@
{ ... }:
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "bkp";
users.user = import ../../../users/servers/user.nix;
};
}

View file

@ -1,4 +0,0 @@
{ inputs, ... }:
{
}

View file

@ -1,4 +0,0 @@
{ ... }:
{
}