feat: marleyos config -> marleycfg

fucking infinite recursion
This commit is contained in:
punkfairie 2025-05-25 20:06:03 -07:00
parent f9d633f4c2
commit 8f64cd0822
Signed by: punkfairie
GPG key ID: B3C5488E9A1A7CA6
17 changed files with 27 additions and 32 deletions

View file

@ -1,5 +1,5 @@
{config, ...}: let {config, ...}: let
inherit (config.marleyos.my) name; inherit (config.marleycfg.my) name;
in { in {
networking = { networking = {
computerName = "mairley"; computerName = "mairley";
@ -7,9 +7,7 @@ in {
localHostName = "mairley"; localHostName = "mairley";
}; };
marleyos = { marleycfg.profiles.desktop = true;
profiles.desktop = true;
};
users = { users = {
knownUsers = [name]; knownUsers = [name];

View file

@ -1,13 +1,11 @@
{config, ...}: let {config, ...}: let
inherit (config.marleyos.my) name; inherit (config.marleycfg.my) name;
in { in {
imports = [./hardware-configuration.nix]; imports = [./hardware-configuration.nix];
networking.hostName = "marleycentre"; networking.hostName = "marleycentre";
marleyos = { marleycfg.profiles.server = true;
profiles.server = true;
};
users.users = { users.users = {
marley.openssh.authorizedKeys.keys = [ marley.openssh.authorizedKeys.keys = [

View file

@ -3,15 +3,16 @@
marleylib, marleylib,
... ...
}: let }: let
inherit (config.marleyos.my) name; inherit (config.marleycfg.my) name;
inherit (marleylib.module) enabled; inherit (marleylib.module) enabled;
in { in {
imports = [./hardware-configuration.nix]; imports = [./hardware-configuration.nix];
networking.hostName = "marleynet"; networking.hostName = "marleynet";
marleycfg.profiles.server = true;
marleyos = { marleyos = {
profiles.server = true;
services.ddclient = enabled; services.ddclient = enabled;
}; };

View file

@ -4,7 +4,7 @@
... ...
}: let }: let
inherit (marleylib.module) enabled; inherit (marleylib.module) enabled;
inherit (config.marleyos.my) name; inherit (config.marleycfg.my) name;
in { in {
imports = [./hardware-configuration.nix ./mounts.nix ./autorandr.nix]; imports = [./hardware-configuration.nix ./mounts.nix ./autorandr.nix];
@ -13,11 +13,9 @@ in {
# For local dev. # For local dev.
networking.firewall.allowedTCPPorts = [8080]; networking.firewall.allowedTCPPorts = [8080];
marleyos = { marleycfg.profiles.desktop = true;
profiles = {
desktop = true;
};
marleyos = {
hardware = { hardware = {
nvidia = enabled; nvidia = enabled;
}; };

View file

@ -6,7 +6,7 @@ let
email = "marley@punkfairie.net"; email = "marley@punkfairie.net";
}; };
in { in {
marleyos.my = my; marleycfg.my = my;
home-manager = { home-manager = {
useUserPackages = true; useUserPackages = true;

View file

@ -3,7 +3,7 @@
inputs, inputs,
... ...
}: let }: let
inherit (config.marleyos.my) name; inherit (config.marleycfg.my) name;
in { in {
imports = [inputs.home-manager.darwinModules.home-manager]; imports = [inputs.home-manager.darwinModules.home-manager];

View file

@ -1,7 +1,7 @@
{osConfig, ...}: let {osConfig, ...}: let
cfg = osConfig.marleyos; cfg = osConfig.marleycfg;
in { in {
marleyos = { marleycfg = {
profiles = { profiles = {
inherit (cfg.profiles) desktop server; inherit (cfg.profiles) desktop server;
}; };

View file

@ -6,7 +6,7 @@
}: { }: {
boot = { boot = {
kernelPackages = kernelPackages =
lib.mkIf (!config.marleyos.profiles.server) lib.mkIf (!config.marleycfg.profiles.server)
pkgs.linuxPackages_xanmod; pkgs.linuxPackages_xanmod;
loader = { loader = {

View file

@ -3,7 +3,7 @@
inputs, inputs,
... ...
}: let }: let
inherit (config.marleyos.my) name; inherit (config.marleycfg.my) name;
in { in {
imports = [inputs.home-manager.nixosModules.home-manager]; imports = [inputs.home-manager.nixosModules.home-manager];
config = { config = {

View file

@ -1,6 +1,6 @@
{config, ...}: { {config, ...}: {
time.timeZone = time.timeZone =
if config.marleyos.profiles.server if config.marleycfg.profiles.server
then "UTC" then "UTC"
else "America/Los_Angeles"; else "America/Los_Angeles";

View file

@ -11,6 +11,6 @@
allowedTCPPorts = [80 443]; allowedTCPPorts = [80 443];
}; };
wireless.enable = lib.mkIf config.marleyos.profiles.server false; wireless.enable = lib.mkIf config.marleycfg.profiles.server false;
}; };
} }

View file

@ -13,7 +13,7 @@
desktopPass = "$y$j9T$ztWf9WeUCENC2T12qS4mi1$51ihV/5cQ8mdJJrNe7MMguk4hPB61S5xHawsfi.1hL3"; desktopPass = "$y$j9T$ztWf9WeUCENC2T12qS4mi1$51ihV/5cQ8mdJJrNe7MMguk4hPB61S5xHawsfi.1hL3";
serverPass = "$y$j9T$8hA7OWZsdQMHqYIy8LkYQ1$hFeP2ak3QA4FtoIYIwqPg10//ZOSZrAw1PzJj0PuGSA"; serverPass = "$y$j9T$8hA7OWZsdQMHqYIy8LkYQ1$hFeP2ak3QA4FtoIYIwqPg10//ZOSZrAw1PzJj0PuGSA";
in { in {
marleyos.my = { marleycfg.my = {
inherit (my) name username fullName email; inherit (my) name username fullName email;
}; };
@ -34,7 +34,7 @@ in {
++ (lib.optional config.networking.networkmanager.enable "networkmanager") ++ (lib.optional config.networking.networkmanager.enable "networkmanager")
++ (lib.optional config.virtualisation.docker.enable "docker"); ++ (lib.optional config.virtualisation.docker.enable "docker");
hashedPassword = hashedPassword =
if config.marleyos.profiles.server if config.marleycfg.profiles.server
then serverPass then serverPass
else desktopPass; else desktopPass;
}; };

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: { }: {
config = lib.mkIf (!config.marleyos.profiles.server) { config = lib.mkIf (!config.marleycfg.profiles.server) {
security.rtkit.enable = true; # for pulseaudio security.rtkit.enable = true; # for pulseaudio
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;

View file

@ -5,7 +5,7 @@
}: let }: let
cfg = config.marleyos.mounts.babeshare; cfg = config.marleyos.mounts.babeshare;
user = config.users.users."${config.marleyos.my.name}"; user = config.users.users."${config.marleycfg.my.name}";
uid = uid =
if user.uid != null if user.uid != null
then user.uid then user.uid

View file

@ -4,7 +4,7 @@
lib, lib,
... ...
}: let }: let
cfg = config.marleyos.profiles; cfg = config.marleycfg.profiles;
inherit (marleylib.module) enabled; inherit (marleylib.module) enabled;
in { in {

View file

@ -3,7 +3,7 @@
config, config,
... ...
}: { }: {
options.marleyos.my = rec { options.marleycfg.my = rec {
name = lib.mkOption { name = lib.mkOption {
type = with lib.types; str; type = with lib.types; str;
default = "marley"; default = "marley";
@ -30,12 +30,12 @@
}; };
config = let config = let
cfg = config.marleyos.my; cfg = config.marleycfg.my;
in { in {
assertions = [ assertions = [
{ {
assertion = cfg.name != null; assertion = cfg.name != null;
message = "marleyos.my.name must be set."; message = "marleycfg.my.name must be set.";
} }
]; ];
}; };

View file

@ -1,5 +1,5 @@
{lib, ...}: { {lib, ...}: {
options.marleyos.profiles = { options.marleycfg.profiles = {
desktop = lib.mkEnableOption "graphical desktop profile"; desktop = lib.mkEnableOption "graphical desktop profile";
server = lib.mkEnableOption "server profile"; server = lib.mkEnableOption "server profile";
}; };