From a651a2150aca24d915f7d139f6a8bcce9c6f641b Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Thu, 3 Oct 2024 20:01:03 -0500 Subject: fix awesome with luajit and add some more cool stuff --- modules/root/autologin.nix | 13 +++++++++++++ modules/root/awesome.nix | 28 ++++++++++++++++++++++++++-- modules/root/default.nix | 3 +++ modules/root/normaluser.nix | 2 +- modules/root/powerkeys.nix | 7 +++++++ modules/root/software.nix | 1 + 6 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 modules/root/autologin.nix create mode 100644 modules/root/powerkeys.nix (limited to 'modules/root') diff --git a/modules/root/autologin.nix b/modules/root/autologin.nix new file mode 100644 index 0000000..6e66160 --- /dev/null +++ b/modules/root/autologin.nix @@ -0,0 +1,13 @@ +{ lib, config, userDetails, ... }: { + options = { + autologin.enable = lib.mkEnableOption "enables getty automatic login"; + #autologin.user = lib.mkEnableOption "populate username"; + #autologin.password = lib.mkEnableOption "populate password"; + }; + + config = lib.mkIf config.autologin.enable { + services.getty = { + autologinUser = userDetails.username; + }; + }; +} diff --git a/modules/root/awesome.nix b/modules/root/awesome.nix index 4db5230..af1318f 100644 --- a/modules/root/awesome.nix +++ b/modules/root/awesome.nix @@ -1,9 +1,33 @@ -{ lib, config, ... }: { +{ nixpkgs, pkgs, lib, config, ... }: { options = { xserver.awesome.enable = lib.mkEnableOption "enables awesomewm"; }; config = lib.mkIf config.xserver.awesome.enable { - services.xserver.windowManager.awesome.enable = true; + services.xserver.windowManager.awesome = { + enable = true; + noArgb = true; # disables transparency. why not? + luaModules = with pkgs; [ + luajitPackages.lgi + ]; + }; + + #getLuaPath = lib: dir: "${lib}/${dir}/lua/${pkgs.luajit.luaversion}"; + #makeSearchPath = lib.concatMapStrings ( + # path: + # " --search " + # + (getLuaPath path "share") + # + " --search " + # + (getLuaPath path "lib") + #); + + + environment.systemPackages = with pkgs; [ + (awesome.override { + gtk3Support = true; + gtk3 = gtk3; + lua = luajit; + }) + ]; }; } diff --git a/modules/root/default.nix b/modules/root/default.nix index b03fab4..2ef73aa 100644 --- a/modules/root/default.nix +++ b/modules/root/default.nix @@ -1,5 +1,6 @@ { lib, ... }: { imports = [ + ./autologin.nix ./awesome.nix ./cups.nix ./doas.nix @@ -11,12 +12,14 @@ ./nix.nix ./normaluser.nix ./pipewire.nix + ./powerkeys.nix ./software.nix ./virtualisation.nix ./wifi.nix ./x11.nix ]; + autologin.enable = lib.mkDefault true; cups.enable = lib.mkDefault true; doas.enable = lib.mkDefault true; docker = { diff --git a/modules/root/normaluser.nix b/modules/root/normaluser.nix index 5d436e8..192e64e 100644 --- a/modules/root/normaluser.nix +++ b/modules/root/normaluser.nix @@ -1,7 +1,7 @@ { userDetails, ... }: { users.users.${userDetails.username} = { description = userDetails.fullname; - home = userDetails.home.root; + #home = userDetails.home.root; isNormalUser = true; extraGroups = [ "wheel" ]; }; diff --git a/modules/root/powerkeys.nix b/modules/root/powerkeys.nix new file mode 100644 index 0000000..dcb3616 --- /dev/null +++ b/modules/root/powerkeys.nix @@ -0,0 +1,7 @@ +{ + services.logind = { + powerKey = "ignore"; + powerKeyLongPress = "poweroff"; + hibernateKey = "suspend"; + }; +} diff --git a/modules/root/software.nix b/modules/root/software.nix index 4aa6f64..f52f25c 100644 --- a/modules/root/software.nix +++ b/modules/root/software.nix @@ -35,6 +35,7 @@ inkscape qbittorrent qdirstat + thunderbird ungoogled-chromium ] ++ pkgs.lib.optionals config.software.dev.enable [ # Development -- cgit v1.2.3