all application options will adapt to environment
when used either with nixos (no home-manager) or home-manager standalone, `features.applications.<name>.enable` options still perform some functionality, rather than assuming a full nixos + home-manager setup like before
This commit is contained in:
17 files changed
+265
-151
No files matched your search
@@ -1,78 +1,109 @@
|
||||
{ inputs, self, ... }: {
|
||||
{ inputs, self, lib, ... }: let
|
||||
fluxer-package = { appimageTools, fetchurl, lib, pkgs, ... }:
|
||||
let
|
||||
pname = "fluxer";
|
||||
version = "0.0.8";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://api.fluxer.app/dl/desktop/stable/linux/x64/latest/appimage";
|
||||
sha256 = "sha256-GdoBK+Z/d2quEIY8INM4IQy5tzzIBBM+3CgJXQn0qAw=";
|
||||
};
|
||||
|
||||
appimageContents = appimageTools.extract { inherit pname version src; };
|
||||
in
|
||||
appimageTools.wrapType2 rec {
|
||||
inherit pname version src;
|
||||
|
||||
extraInstallCommands = ''
|
||||
install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop
|
||||
|
||||
install -m 444 -D ${appimageContents}/${pname}.png $out/share/icons/hicolor/512x512/apps/${pname}.png
|
||||
|
||||
substituteInPlace $out/share/applications/${pname}.desktop \
|
||||
--replace 'Exec=AppRun --no-sandbox %U' 'Exec=${pname} %U'
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Open-source, self-hosted alternative to Discord";
|
||||
homepage = "https://fluxer.app/";
|
||||
license = licenses.agpl3Only;
|
||||
maintainers = [ ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
};
|
||||
fluxer-canary-package = { appimageTools, fetchurl, lib, pkgs, ... }:
|
||||
let
|
||||
pname = "fluxer-canary";
|
||||
version = "2026.827.132039";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://api.canary.fluxer.app/dl/desktop/canary/linux/x64/latest/appimage";
|
||||
sha256 = "sha256-eRR9JZa4LPuUtjdDO+JvzaOLxQeDgVziLrFr5iIgr1Q=";
|
||||
};
|
||||
|
||||
appimageContents = appimageTools.extract { inherit pname version src; };
|
||||
in
|
||||
appimageTools.wrapType2 rec {
|
||||
inherit pname version src;
|
||||
|
||||
extraInstallCommands = ''
|
||||
install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop
|
||||
|
||||
install -m 444 -D ${appimageContents}/${pname}.png $out/share/icons/hicolor/512x512/apps/${pname}.png
|
||||
|
||||
substituteInPlace $out/share/applications/${pname}.desktop \
|
||||
--replace 'Exec=AppRun %U' 'Exec=${pname} %U'
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Open-source, self-hosted alternative to Discord";
|
||||
homepage = "https://fluxer.app/";
|
||||
license = licenses.agpl3Only;
|
||||
maintainers = [ ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
};
|
||||
mkIfElse = with lib; p: yes: no:
|
||||
mkMerge [
|
||||
(mkIf p yes)
|
||||
(mkIf (!p) no)
|
||||
];
|
||||
in {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui = {
|
||||
fluxer.enable = lib.mkEnableOption "fluxer";
|
||||
fluxer-canary.enable = lib.mkEnableOption "fluxer-canary";
|
||||
};
|
||||
|
||||
config = {
|
||||
environment.systemPackages = (if config.features.applications.gui.fluxer.enable then [
|
||||
(pkgs.callPackage ({ appimageTools, fetchurl, lib, pkgs, ... }:
|
||||
let
|
||||
pname = "fluxer";
|
||||
version = "0.0.8";
|
||||
config = lib.mkIf (config.features.applications.gui.fluxer.enable) (mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.fluxer.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [
|
||||
(pkgs.callPackage (fluxer-package) {})
|
||||
];
|
||||
}) // lib.mkIf (config.features.applications.gui.fluxer-canary.enable) (mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.fluxer-canary.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [
|
||||
(pkgs.callPackage (fluxer-canary-package) {})
|
||||
];
|
||||
});
|
||||
};
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://api.fluxer.app/dl/desktop/stable/linux/x64/latest/appimage";
|
||||
sha256 = "sha256-GdoBK+Z/d2quEIY8INM4IQy5tzzIBBM+3CgJXQn0qAw=";
|
||||
};
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui = {
|
||||
fluxer.enable = lib.mkEnableOption "fluxer";
|
||||
fluxer-canary.enable = lib.mkEnableOption "fluxer-canary";
|
||||
};
|
||||
|
||||
appimageContents = appimageTools.extract { inherit pname version src; };
|
||||
in
|
||||
appimageTools.wrapType2 rec {
|
||||
inherit pname version src;
|
||||
|
||||
extraInstallCommands = ''
|
||||
install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop
|
||||
|
||||
install -m 444 -D ${appimageContents}/${pname}.png $out/share/icons/hicolor/512x512/apps/${pname}.png
|
||||
|
||||
substituteInPlace $out/share/applications/${pname}.desktop \
|
||||
--replace 'Exec=AppRun --no-sandbox %U' 'Exec=${pname} %U'
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Open-source, self-hosted alternative to Discord";
|
||||
homepage = "https://fluxer.app/";
|
||||
license = licenses.agpl3Only;
|
||||
maintainers = [ ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
}) {})
|
||||
] else []) ++ (if config.features.applications.gui.fluxer-canary.enable then [
|
||||
(pkgs.callPackage ({ appimageTools, fetchurl, lib, pkgs, ... }:
|
||||
let
|
||||
pname = "fluxer-canary";
|
||||
version = "2026.827.132039";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://api.canary.fluxer.app/dl/desktop/canary/linux/x64/latest/appimage";
|
||||
sha256 = "sha256-eRR9JZa4LPuUtjdDO+JvzaOLxQeDgVziLrFr5iIgr1Q=";
|
||||
};
|
||||
|
||||
appimageContents = appimageTools.extract { inherit pname version src; };
|
||||
in
|
||||
appimageTools.wrapType2 rec {
|
||||
inherit pname version src;
|
||||
|
||||
extraInstallCommands = ''
|
||||
install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop
|
||||
|
||||
install -m 444 -D ${appimageContents}/${pname}.png $out/share/icons/hicolor/512x512/apps/${pname}.png
|
||||
|
||||
substituteInPlace $out/share/applications/${pname}.desktop \
|
||||
--replace 'Exec=AppRun %U' 'Exec=${pname} %U'
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Open-source, self-hosted alternative to Discord";
|
||||
homepage = "https://fluxer.app/";
|
||||
license = licenses.agpl3Only;
|
||||
maintainers = [ ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
}) {})
|
||||
] else []);
|
||||
config = lib.mkIf (config.features.applications.gui.fluxer.enable) {
|
||||
home.packages = [
|
||||
(pkgs.callPackage (fluxer-package) {})
|
||||
];
|
||||
} // lib.mkIf (config.features.applications.gui.fluxer-canary.enable) {
|
||||
home.packages = [
|
||||
(pkgs.callPackage (fluxer-canary-package) {})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user