From e36a4d48f36593a4f4f300c2615d1ccd4a11fc19 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 13 Apr 2024 02:05:59 +0200 Subject: [PATCH] fae: improve headless setup by conditionally checking if sway is enabled --- flake.nix | 2 +- hosts/fae/fae.nix | 5 +++-- modules/core/networking.nix | 2 +- modules/terminal-life/bash/default.nix | 4 ++-- modules/user/session-variables.nix | 3 ++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index b95693db..68d5c85f 100644 --- a/flake.nix +++ b/flake.nix @@ -109,7 +109,7 @@ #}; fae = { - hostname = "192.168.178.35"; + hostname = "192.168.13.35"; sshUser = "pub-solar"; }; powder = { diff --git a/hosts/fae/fae.nix b/hosts/fae/fae.nix index 911223f5..9b2b47eb 100644 --- a/hosts/fae/fae.nix +++ b/hosts/fae/fae.nix @@ -15,7 +15,7 @@ }; }; - networking.hostName = "fae"; + networking.hostName = "paperless"; services.openssh = { enable = true; @@ -26,7 +26,8 @@ "boot.shell_on_fail=1" ]; - environment.noXlibs = true; + # Would decrease closure size, but currenly broken (cairo) + #environment.noXlibs = true; nix = { gc.automatic = true; diff --git a/modules/core/networking.nix b/modules/core/networking.nix index 4539c16a..ef1ffb32 100644 --- a/modules/core/networking.nix +++ b/modules/core/networking.nix @@ -11,7 +11,7 @@ networking.networkmanager = { # Enable networkmanager. REMEMBER to add yourself to group in order to use nm related stuff. - enable = lib.mkDefault true; + enable = if config.programs.sway.enable then lib.mkDefault true else false; # not as stable as wpa_supplicant yet, also more trouble with 5 GHz networks #wifi.backend = "iwd"; }; diff --git a/modules/terminal-life/bash/default.nix b/modules/terminal-life/bash/default.nix index ae68ac6b..65777a76 100644 --- a/modules/terminal-life/bash/default.nix +++ b/modules/terminal-life/bash/default.nix @@ -12,9 +12,9 @@ in { historyControl = ["ignorespace"]; # Run when initializing a login shell - profileExtra = '' + profileExtra = if config.programs.sway.enable then '' [ "$(tty)" = "/dev/tty1" ] && exec systemd-cat --identifier=sway ${pkgs.sway}/bin/sway - ''; + '' else ""; # Run when initializing an interactive shell initExtra = '' diff --git a/modules/user/session-variables.nix b/modules/user/session-variables.nix index 0d643d98..72dcf95d 100644 --- a/modules/user/session-variables.nix +++ b/modules/user/session-variables.nix @@ -24,7 +24,8 @@ VISUAL = "/etc/profiles/per-user/${psCfg.user.name}/bin/nvim"; # fix "xdg-open fork-bomb" your preferred browser from here - BROWSER = "${pkgs.firefox-wayland}/bin/firefox"; + + BROWSER = if config.programs.sway.enable then "${pkgs.firefox-wayland}/bin/firefox" else ""; # node NODE_REPL_HISTORY = "${xdg.dataHome}/node_repl_history";