Major update to handle multiple systems

This commit is contained in:
Emmet 2025-02-12 14:12:11 -06:00
parent 0453901d17
commit cd1d2d866b
34 changed files with 2040 additions and 456 deletions

View file

@ -1,26 +1,20 @@
{ config, lib, pkgs, inputs, ... }:
let
caches = import inputs.secrets.caches;
in {
{
config = {
nix = {
package = pkgs.nix;
settings = {
substituters =
(lib.optionals (caches ? urls) caches.urls) ++
[
"https://cache.nixos.org"
"https://hyprland.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys =
(lib.optionals (caches ? publicKeys) caches.publicKeys) ++
[
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
substituters = [
"https://cache.nixos.org"
"https://hyprland.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
trusted-users = config.systemSettings.adminUsers ++ [ "@wheel" ];
auto-optimise-store = true;
download-buffer-size = 500000000;

View file

@ -2,10 +2,17 @@
{
options = {
systemSettings.dotfilesDir = lib.mkOption {
default = "/etc/nixos";
description = "Absolute path to the dotfiles directory";
type = lib.types.path;
systemSettings = {
dotfilesDir = lib.mkOption {
default = "/etc/nixos";
description = "Absolute path to the dotfiles directory";
type = lib.types.path;
};
secretsFlakeDir = lib.mkOption {
default = "/etc/nixos.secrets";
description = "Absolute path to my secrets flake";
type = lib.types.path;
};
};
};
# TODO disabled for debugging

View file

@ -0,0 +1,43 @@
{ config, lib, pkgs, ...}:
let
cfg = config.systemSettings.plasma;
in {
options = {
systemSettings.plasma = {
enable = lib.mkEnableOption "Enable plasma";
};
};
config = lib.mkIf cfg.enable {
services.xserver.enable = true;
services.xserver = {
layout = "us";
xkbVariant = "";
xkbOptions = "caps:escape";
};
services.xserver.displayManager.sddm.enable = true;
services.xserver.displayManager.sddm.wayland.enable = true;
services.xserver.desktopManager.plasma6.enable = true;
services.printing.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
environment.systemPackages = with pkgs; [
kdePackages.kate
kdePackages.dolphin
];
virtualisation.waydroid.enable = true;
services.avahi.nssmdns.enable = true;
};
}

View file

@ -1,7 +1,6 @@
{ config, lib, inputs, ... }:
let
userInfo = import inputs.secrets.userInfo;
in {
{
options = {
systemSettings = {
users = lib.mkOption {
@ -20,7 +19,6 @@ in {
(map (user: {
name = user;
value = {
description = userInfo.${user}.name;
isNormalUser = true;
extraGroups = [ "networkmanager" "input" "dialout" "video" "render" ] ++ (lib.optionals (lib.any (x: x == user) config.systemSettings.adminUsers) [ "wheel" ]);
createHome = true;
@ -33,8 +31,6 @@ in {
value = {
home.username = user;
home.homeDirectory = "/home/"+user;
userSettings.name = lib.mkIf (userInfo.${user} ? name) userInfo.${user}.name;
userSettings.email = lib.mkIf (userInfo.${user} ? email ) userInfo.${user}.email;
};
}) config.systemSettings.users);
};