Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
elythh committed Aug 29, 2024
1 parent 3096b10 commit f478299
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 34 deletions.
1 change: 1 addition & 0 deletions homes/x86_64-linux/gwen@grovetender/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ in
video = enabled;
};

theme.enable = true;
theme.name = "paradise";
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
...
}:
let
inherit (lib) mkIf;
inherit (lib) mkIf mkEnableOption;
inherit (lib.${namespace}) mkBoolOpt;

cfg = config.${namespace}.programs.graphical.editors.neovim;
cfg = config.${namespace}.programs.terminal.editors.neovim;

nixvim' = inputs.nixvim.packages."x86_64-linux".default;
nixvim = nixvim'.extend {
Expand Down Expand Up @@ -45,17 +45,17 @@ let
in
{
options.${namespace}.programs.terminal.editors.neovim = {
enable = mkBoolOpt false "Enable neovim";
enable = mkEnableOption "neovim";
default = mkBoolOpt true "Whether to set Neovim as the session EDITOR";

};

config = mkIf cfg.enable {
home = {
sessionVariables = {
EDITOR = mkIf cfg.default "nvim";

packages = [ nixvim ];
};
packages = [ nixvim ];
};
};
}
1 change: 0 additions & 1 deletion modules/home/suites/desktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ in
input-leap
kdePackages.ark
kdePackages.gwenview
pkgs.${namespace}.pocketcasts
realvnc-vnc-viewer
# FIXME: broken nixpkgs
# rustdesk
Expand Down
1 change: 0 additions & 1 deletion modules/home/suites/music/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ in
spicetify-cli
tageditor
youtube-music
pkgs.${namespace}.yt-music
];
};
}
10 changes: 7 additions & 3 deletions modules/home/theme/stylix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
...
}:
let
inherit (lib) mkIf mkOption types;
inherit (lib.${namespace}) mkBoolOpt;
inherit (lib)
mkIf
mkOption
mkEnableOption
types
;

cfg = config.${namespace}.theme;
in
{
options.${namespace}.theme = {
enable = mkBoolOpt false "Weather to enable the theming";
enable = mkEnableOption "Wether to enable stylix";
name = mkOption {
type = types.str;
default = "paradise";
Expand Down
24 changes: 0 additions & 24 deletions modules/home/user/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,13 @@ let
"/Users/${cfg.name}"
else
"/home/${cfg.name}";

defaultIcon = pkgs.stdenvNoCC.mkDerivation {
name = "default-icon";
src = ./. + "/${defaultIconFileName}";

dontUnpack = true;

installPhase = # bash
''
cp $src $out
'';

passthru = {
fileName = defaultIconFileName;
};
};
defaultIconFileName = "profile.png";
in
{
options.${namespace}.user = {
enable = mkOpt types.bool false "Whether to configure the user account.";
email = mkOpt types.str "gwen@omg.lol" "The email of the user.";
fullName = mkOpt types.str "Gwenc'hlan Le Kerneau" "The full name of the user.";
home = mkOpt (types.nullOr types.str) home-directory "The user's home directory.";
icon = mkOpt (types.nullOr types.package) defaultIcon "The profile picture to use for the user.";
name = mkOpt (types.nullOr types.str) config.snowfallorg.user.name "The user account.";
};

Expand All @@ -71,15 +53,12 @@ in

home = {
file = {
".face".source = cfg.icon;
".face.icon".source = cfg.icon;
"Desktop/.keep".text = "";
"Documents/.keep".text = "";
"Downloads/.keep".text = "";
"Music/.keep".text = "";
"Pictures/.keep".text = "";
"Videos/.keep".text = "";
"Pictures/${cfg.icon.fileName or (builtins.baseNameOf cfg.icon)}".source = cfg.icon;
};

homeDirectory = mkDefault cfg.home;
Expand Down Expand Up @@ -141,9 +120,6 @@ in

programs.home-manager = enabled;

xdg.configFile = {
"sddm/faces/.${cfg.name}".source = cfg.icon;
};
}
]);
}
113 changes: 113 additions & 0 deletions packages/teams-for-linux/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
lib,
stdenv,
buildNpmPackage,
fetchFromGitHub,
alsa-utils,
copyDesktopItems,
electron_30,
makeDesktopItem,
makeWrapper,
which,
}:

let
electronDist = "${electron_30}/${if stdenv.isDarwin then "Applications" else "libexec/electron"}";
in
buildNpmPackage rec {
pname = "teams-for-linux";
version = "1.9.5";

src = fetchFromGitHub {
owner = "IsmaelMartinez";
repo = "teams-for-linux";
rev = "refs/tags/v${version}";
hash = "sha256-+rEGDg+/qvjCMhGHccb4p+CKOo/65RpkFT/WnCDlCgU=";
};

npmDepsHash = "sha256-vDRFFxkIQo5qU9gmkSwUhPz4FG2XbUNkTw6SCuvMqCc=";

nativeBuildInputs = [
makeWrapper
] ++ lib.optionals stdenv.isLinux [ copyDesktopItems ];

env = {
# disable code signing on Darwin
CSC_IDENTITY_AUTO_DISCOVERY = "false";
ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
};

buildPhase = ''
runHook preBuild
cp -r ${electronDist} electron-dist
chmod -R u+w electron-dist
npm exec electron-builder -- \
--dir \
-c.npmRebuild=true \
-c.asarUnpack="**/*.node" \
-c.electronDist=electron-dist \
-c.electronVersion=${electron_30.version}
runHook postBuild
'';

installPhase =
''
runHook preInstall
''
+ lib.optionalString stdenv.isLinux ''
mkdir -p $out/share/{applications,teams-for-linux}
cp dist/*-unpacked/resources/app.asar $out/share/teams-for-linux/
pushd build/icons
for image in *png; do
mkdir -p $out/share/icons/hicolor/''${image%.png}/apps
cp -r $image $out/share/icons/hicolor/''${image%.png}/apps/teams-for-linux.png
done
popd
# Linux needs 'aplay' for notification sounds
makeWrapper '${lib.getExe electron_30}' "$out/bin/teams-for-linux" \
--prefix PATH : ${
lib.makeBinPath [
alsa-utils
which
]
} \
--add-flags "$out/share/teams-for-linux/app.asar" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
''
+ lib.optionalString stdenv.isDarwin ''
mkdir -p $out/Applications
cp -r dist/mac*/teams-for-linux.app $out/Applications
makeWrapper $out/Applications/teams-for-linux.app/Contents/MacOS/teams-for-linux $out/bin/teams-for-linux
''
+ ''
runHook postInstall
'';

desktopItems = [
(makeDesktopItem {
name = "teams-for-linux";
exec = "teams-for-linux";
icon = "teams-for-linux";
desktopName = "Microsoft Teams for Linux";
comment = meta.description;
categories = [
"Network"
"InstantMessaging"
"Chat"
];
})
];

meta = {
description = "Unofficial Microsoft Teams client for Linux";
mainProgram = "teams-for-linux";
platforms = with lib.platforms; darwin ++ linux;
};
}

0 comments on commit f478299

Please # to comment.