aboutsummaryrefslogtreecommitdiff
path: root/modules/global.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/global.nix')
-rw-r--r--modules/global.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/modules/global.nix b/modules/global.nix
new file mode 100644
index 0000000..309159a
--- /dev/null
+++ b/modules/global.nix
@@ -0,0 +1,51 @@
+{ config, lib, pkgs, ...}:
+let
+ cfg = config.modules.global;
+in
+{
+ imports = [ ./default.nix ];
+
+ options.modules.global = with lib.options; {
+ notNixOS = mkOption {
+ type = lib.types.bool;
+ default = false;
+ description = "Whether nix is running outside of NixOS.";
+ };
+ wayland = mkEnableOption "Wayland";
+ };
+
+ config = {
+ modules = {
+ global.wayland = true;
+ foot.enable = true;
+ sway = {
+ enable = true;
+ package = if cfg.noNixOS then
+ config.lib.nixGL.wrap pkgs.sway else pkgs.sway;
+ };
+ };
+
+ programs = {
+ home-manager.enable = true;
+ };
+
+ targets.genericLinux.enable = cfg.notNixOS;
+
+ home = {
+ username = "stefan";
+ homeDirectory = "/home/stefan";
+ stateVersion = "24.11";
+
+ packages = with pkgs; [
+ nerd-fonts.comic-shanns-mono
+ ] ++ (lib.optional cfg.notNixOS nixgl.auto.nixGLDefault)
+ ++ (lib.optionals cfg.wayland
+ [
+ wl-clipboard
+ mako
+ wmenu
+ ]);
+ };
+
+ };
+}