blob: f26be5fec1a537e6429053706cff3312489bf39f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
{ config, lib, pkgs, inputs, ...}:
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;
wrapWithNixGL = true;
# package = if cfg.notNixOS then
# (config.lib.nixGL.wrap pkgs.sway) else pkgs.sway;
# package = config.lib.nixGL.wrap pkgs.sway;
};
};
nixGL = lib.mkIf cfg.notNixOS {
packages = inputs.nixgl.packages;
defaultWrapper = "mesa";
};
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
cmatrix
]);
};
};
}
|