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

View File

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

View File

@ -1,29 +1,40 @@
{ config, pkgs, lib, ... }:
let
cfg = config.custom.desktop.awesome;
in
{
services.xserver = {
enable = true;
windowManager.awesome.enable = true;
options.custom.desktop.awesome = {
enable = lib.mkEnableOption "awesome";
};
home-manager.users.jake.xdg.configFile."awesome/rc.lua" =
let
awesomeConfig = ''
-- 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";
config = lib.mkIf cfg.enable {
services.xserver = {
enable = true;
windowManager.awesome.enable = true;
};
home-manager.users.jake.programs.alacritty = {
enable = true;
settings = {
font = {
size = 8.0;
home-manager.users."${config.custom.user}" = {
xdg.configFile."awesome/rc.lua" =
let
awesomeConfig = ''
-- 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;
};
};
};
};
};