Restructure flake.nix for a simpler config for building different images off the same NixOS config.

This commit is contained in:
Tom Alexander
2025-10-11 00:08:02 -04:00
parent 69b5cf9217
commit 3bf84445a3
121 changed files with 2937 additions and 3074 deletions

View File

@@ -313,7 +313,7 @@ in
# Probably would be cleaner to use environment.sessionVariables but programs.sway.extraSessionCommands is sway-specific.
programs.sway.extraSessionCommands =
if config.me.buildingIso then
if config.me.buildingPortable then
''
export WLR_RENDERER_ALLOW_SOFTWARE=1
export NIXOS_OZONE_WL=1 # Wayland support for chromium and electron
@@ -330,7 +330,7 @@ in
enable = true;
wrapperFeatures.gtk = true;
extraOptions =
if config.me.buildingIso then
if config.me.buildingPortable then
[
"--config"
"${sway-config}"
@@ -343,7 +343,7 @@ in
];
};
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
environment.persistence."/state" = lib.mkIf (config.me.mountPersistence) {
hideMounts = true;
users.talexander = {
files = [

View File

@@ -18,8 +18,9 @@ in
{
imports = [ ];
me.swayIncludes = lib.mkAfter [
start_sway_session
];
config = lib.mkIf (config.me.graphical && config.me.sway.enable) {
me.swayIncludes = lib.mkAfter [
start_sway_session
];
};
}

View File

@@ -16,7 +16,7 @@ in
{
imports = [ ];
config = lib.mkIf (config.me.buildingIso && config.me.graphical && config.me.sway.enable) {
config = lib.mkIf (config.me.buildingPortable && config.me.graphical && config.me.sway.enable) {
# Launch a terminal at boot in the live ISO for when hotkeys don't work.
me.swayIncludes = [
launch_terminal

View File

@@ -22,7 +22,7 @@ in
rofimoji_sway_config
];
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
environment.persistence."/state" = lib.mkIf (config.me.mountPersistence) {
hideMounts = true;
users.talexander = {
directories = [