From 720828a097f3afdfba935940217f4d8dfa726366 Mon Sep 17 00:00:00 2001 From: martyTF Date: Tue, 16 Dec 2025 17:01:01 +0100 Subject: [PATCH] dam you can't conditionally import, cringe --- imports.nix | 30 ++++------------------ modules/development/git.nix | 13 +++++++++- modules/development/import_development.nix | 29 ++++----------------- modules/development/vscodium.nix | 16 ++++++++++-- modules/window_manager/hyprland.nix | 18 ++++++++++--- modules/window_manager/import_wm.nix | 25 +++--------------- modules/window_manager/waybar.nix | 14 +++++++++- 7 files changed, 68 insertions(+), 77 deletions(-) diff --git a/imports.nix b/imports.nix index 3795046..8c2a0b9 100644 --- a/imports.nix +++ b/imports.nix @@ -5,30 +5,10 @@ ... }: -let - modules = - if config.networking.hostName == "marty-pc" then - [ - ./system/import_system.nix - ./modules/imports.nix - - ] - else if config.networking.hostName == "marty-latitude" then - [ - ./system/import_system.nix - ./modules/imports.nix - - ] - else if config.networking.hostName == "marty-server" then - [ - ./system/import_system.nix - ./modules/imports.nix - - ] - else - [ ]; -in - { - imports = modules; + imports = [ + ./system/import_system.nix + ./modules/import_modules.nix + + ]; } diff --git a/modules/development/git.nix b/modules/development/git.nix index 5372713..ba9ad4c 100644 --- a/modules/development/git.nix +++ b/modules/development/git.nix @@ -4,11 +4,22 @@ pkgs, ... }: +let + enable_git = + if config.networking.hostName == "marty-pc" then + true + else if config.networking.hostName == "marty-latitude" then + true + else if config.networking.hostName == "marty-server" then + true + else + false; +in { programs = { git = { - enable = true; + enable = enable_git; config = { init = { defaultBranch = "main"; diff --git a/modules/development/import_development.nix b/modules/development/import_development.nix index e2b16b0..34c5a08 100644 --- a/modules/development/import_development.nix +++ b/modules/development/import_development.nix @@ -5,29 +5,10 @@ ... }: -let - modules = - if config.networking.hostName == "marty-pc" then - [ - ./git.nix - ./vscodium.nix - - ] - else if config.networking.hostName == "marty-latitude" then - [ - ./git.nix - ./vscodium.nix - - ] - else if config.networking.hostName == "marty-server" then - [ - ./git.nix - - ] - else - [ ]; -in - { - imports = modules; + imports = [ + ./git.nix + ./vscodium.nix + + ]; } diff --git a/modules/development/vscodium.nix b/modules/development/vscodium.nix index 3bfc7a4..e239e80 100644 --- a/modules/development/vscodium.nix +++ b/modules/development/vscodium.nix @@ -5,11 +5,23 @@ ... }: +let + enable_vscode = + if config.networking.hostName == "marty-pc" then + true + else if config.networking.hostName == "marty-latitude" then + true + else if config.networking.hostName == "marty-server" then + false + else + false; +in + { programs.vscode = { - enable = true; + enable = enable_vscode; package = pkgs.vscodium; - defaultEditor = true; + defaultEditor = enable_vscode; extensions = with pkgs.vscode-extensions; [ catppuccin.catppuccin-vsc catppuccin.catppuccin-vsc-icons diff --git a/modules/window_manager/hyprland.nix b/modules/window_manager/hyprland.nix index d4409a5..c759bd4 100644 --- a/modules/window_manager/hyprland.nix +++ b/modules/window_manager/hyprland.nix @@ -5,14 +5,26 @@ ... }: +let + enable_hyprland = + if config.networking.hostName == "marty-pc" then + true + else if config.networking.hostName == "marty-latitude" then + true + else if config.networking.hostName == "marty-server" then + false + else + false; +in + { programs = { hyprland = { - enable = true; - xwayland.enable = true; + enable = enable_hyprland; + xwayland.enable = enable_hyprland; }; hyprlock = { - enable = true; + enable = enable_hyprland; }; }; } diff --git a/modules/window_manager/import_wm.nix b/modules/window_manager/import_wm.nix index ffd5a01..387d7b1 100644 --- a/modules/window_manager/import_wm.nix +++ b/modules/window_manager/import_wm.nix @@ -5,26 +5,9 @@ ... }: -let - modules = - if config.networking.hostName == "marty-pc" then - [ - ./hyprland.nix - ./waybar.nix - ] - else if config.networking.hostName == "marty-latitude" then - [ - ./hyprland.nix - ./waybar.nix - ] - else if config.networking.hostName == "marty-server" then - [ - - ] - else - [ ]; -in - { - imports = modules; + imports = [ + ./hyprland.nix + ./waybar.nix + ]; } diff --git a/modules/window_manager/waybar.nix b/modules/window_manager/waybar.nix index 1a45ab0..483288f 100644 --- a/modules/window_manager/waybar.nix +++ b/modules/window_manager/waybar.nix @@ -5,10 +5,22 @@ ... }: +let + enable_waybar = + if config.networking.hostName == "marty-pc" then + true + else if config.networking.hostName == "marty-latitude" then + true + else if config.networking.hostName == "marty-server" then + false + else + false; +in + { programs = { waybar = { - enable = true; + enable = enable_waybar; }; }; }