Move sway startups to desktop files

This commit is contained in:
Natsu Kagami 2024-06-25 20:24:48 +02:00
parent 47b96aee71
commit 41106623e8
Signed by: nki
GPG key ID: 55A032EB38B49ADB
4 changed files with 32 additions and 32 deletions

View file

@ -37,6 +37,7 @@
# Enable X11 configuration
linux.graphical.type = "wayland";
linux.graphical.wallpaper = ./images/pixiv_18776904.png;
linux.graphical.defaults.webBrowser = "librewolf.desktop";
programs.my-sway.enable = true;
programs.my-sway.fontSize = 15.0;
programs.my-sway.enableLaptopBars = false;

View file

@ -33,11 +33,16 @@ in
startup = mkOption {
type = types.listOf types.package;
description = "List of packages to include in ~/.config/autostart";
default = [ ];
default = with pkgs; [
librewolf
thunderbird
vesktop
premid
];
};
defaults.webBrowser = mkOption {
type = types.str;
default = "firefox.desktop";
default = "librewolf.desktop";
description = "Desktop file of the default web browser";
};
};
@ -52,7 +57,6 @@ in
feh # For images?
deluge # Torrent client
pavucontrol # PulseAudio control panel
firefox
cinnamon.nemo # File manager
thunderbird # Email
sublime-music # For navidrome
@ -72,9 +76,7 @@ in
whatsapp-for-linux
obs-studio
(librewolf.override {
nativeMessagingHosts = with pkgs; [ kdePackages.plasma-browser-integration ];
})
librewolf
## CLI stuff
dex # .desktop file management, startup
@ -88,12 +90,7 @@ in
]));
nki.programs.discord.enable = pkgs.stdenv.isx86_64;
nki.programs.discord.package = pkgs.vesktop.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ pkgs.nss_latest pkgs.makeWrapper ];
postFixup = (attrs.postFixup or "") + ''
ln -s $out/bin/vesktop $out/bin/discord
'';
});
nki.programs.discord.package = pkgs.vesktop;
# Yellow light!
services.wlsunset = {
@ -224,9 +221,7 @@ in
let
srcFile = pkgs.runCommand "${pkg.name}-startup" { } ''
mkdir -p $out
cp $
(ls - d ${
pkg}/share/applications/*.desktop | head -n 1) $out/${pkg.name}.desktop
cp $(ls -d ${pkg}/share/applications/*.desktop | head -n 1) $out/${pkg.name}.desktop
'';
in
"${srcFile}/${pkg.name}.desktop";

View file

@ -78,11 +78,6 @@ in
description = "The command for the browser";
default = "${pkgs.firefox-wayland}/bin/firefox";
};
discord = mkOption {
type = types.nullOr types.str;
description = "The command for discord";
default = "${config.nki.programs.discord.package}/bin/discord";
};
lockCmd = mkOption {
type = types.str;
@ -164,18 +159,9 @@ in
{ command = "${pkgs.dex}/bin/dex -ae sway"; }
# Waybar
{ command = "systemctl --user restart waybar"; always = true; }
# Startup programs
{ command = "${cfg.browser}"; }
{ command = "thunderbird"; }
# IME
{ command = "fcitx5"; }
] ++ (if cfg.discord != null then [
{ command = "${cfg.discord}"; }
] ++ lib.lists.optional
(!pkgs.stdenv.isAarch64)
(
{ command = "${pkgs.premid}/bin/premid"; }
) else [ ]);
];
### Keybindings
#

View file

@ -68,10 +68,28 @@ let
})
];
});
librewolf = (prev.librewolf.override {
nativeMessagingHosts = with final; [ kdePackages.plasma-browser-integration ];
});
# Add desktop file to premid
premid = final.symlinkJoin {
name = prev.premid.name;
paths = [
prev.premid
(final.makeDesktopItem {
name = prev.premid.name;
desktopName = "PreMID";
exec = final.lib.getExe prev.premid;
icon = "premid";
})
];
};
};
overlay-libs = final: prev: {
libs.crane = inputs.crane.lib.${prev.system};
libs.crane = inputs.crane.mkLib final;
};
overlay-packages = final: prev: {