Migrate .xinitrc file into Nix

This commit is contained in:
Oliver Davies 2025-02-20 21:19:21 +00:00
parent 219d032974
commit 9177cb3f9d
3 changed files with 28 additions and 0 deletions

View file

@ -18,6 +18,7 @@
desktop = {
copyq.enable = true;
discord.enable = true;
dwm.enable = true;
espanso.enable = true;
flameshot.enable = true;
gtk.enable = true;

View file

@ -2,6 +2,7 @@
imports = [
./copyq.nix
./discord.nix
./dwm.nix
./espanso.nix
./flameshot.nix
./gtk.nix

View file

@ -0,0 +1,26 @@
{
config,
lib,
pkgs,
...
}:
with lib;
{
options.features.desktop.dwm.enable = mkEnableOption "Enable dwm";
config = mkIf config.features.desktop.dwm.enable {
home.file.".xinitrc".text = ''
systemctl --user import-environment DISPLAY
${pkgs.autorandr}/bin/autorandr --change
${pkgs.copyq}/bin/copyq &
systemctl --user start dwm-status &
exec ${pkgs.dwm}/bin/dwm
'';
};
}