awesome: modularise properly
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Jake Hillion 2023-04-19 20:41:53 +01:00
parent 07d249a6f9
commit 8bc4fa4501
3 changed files with 34 additions and 20 deletions

View File

@ -3,7 +3,6 @@
{ {
imports = [ imports = [
../../modules/common/default.nix ../../modules/common/default.nix
../../modules/desktop/awesome/default.nix
../../modules/spotify/default.nix ../../modules/spotify/default.nix
./bluetooth.nix ./bluetooth.nix
./hardware-configuration.nix ./hardware-configuration.nix
@ -19,6 +18,9 @@
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
## Desktop
custom.desktop.awesome.enable = true;
## Resilio ## Resilio
custom.resilio.enable = true; custom.resilio.enable = true;

View File

@ -2,6 +2,7 @@
{ {
imports = [ imports = [
./desktop/awesome/default.nix
./resilio.nix ./resilio.nix
./tailscale.nix ./tailscale.nix
./www/global.nix ./www/global.nix

View File

@ -1,29 +1,40 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let
cfg = config.custom.desktop.awesome;
in
{ {
services.xserver = { options.custom.desktop.awesome = {
enable = true; enable = lib.mkEnableOption "awesome";
windowManager.awesome.enable = true;
}; };
home-manager.users.jake.xdg.configFile."awesome/rc.lua" = config = lib.mkIf cfg.enable {
let services.xserver = {
awesomeConfig = '' enable = true;
-- Configure paths filled in by Nix windowManager.awesome.enable = true;
terminal = "${pkgs.alacritty}/bin/alacritty"
tmux = "${pkgs.tmux}/bin/tmux"
'' + builtins.readFile ./rc.lua;
in
{
text = awesomeConfig;
onChange = with pkgs; "echo 'awesome.restart()' | ${awesome}/bin/awesome-client";
}; };
home-manager.users.jake.programs.alacritty = { home-manager.users."${config.custom.user}" = {
enable = true; xdg.configFile."awesome/rc.lua" =
settings = { let
font = { awesomeConfig = ''
size = 8.0; -- Configure paths filled in by Nix
terminal = "${pkgs.alacritty}/bin/alacritty"
tmux = "${pkgs.tmux}/bin/tmux"
'' + builtins.readFile ./rc.lua;
in
{
text = awesomeConfig;
onChange = with pkgs; "echo 'awesome.restart()' | ${awesome}/bin/awesome-client";
};
programs.alacritty = {
enable = true;
settings = {
font = {
size = 8.0;
};
};
}; };
}; };
}; };