Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trivial misc fixes #99

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions config-processor-hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ let
};
};
boot.kernelParams = [
"intel_iommu=on,igx_off,sm_on"
"intel_iommu=on,igfx_off,sm_on"
"iommu=pt"
];
}
Expand All @@ -64,9 +64,7 @@ in {
flake = {
nixosConfigurations =
builtins.listToAttrs (map (t: lib.nameValuePair t.name t.hostConfiguration) targets);
packages = {
x86_64-linux =
builtins.listToAttrs (map (t: lib.nameValuePair t.name t.package) targets);
};
packages.${system} =
builtins.listToAttrs (map (t: lib.nameValuePair t.name t.package) targets);
};
}
32 changes: 24 additions & 8 deletions hydrajobs/flake-module.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
{self, ...}:
{
flake.hydraJobs = {
fmo-os-installer-public-debug.x86_64-linux = self.packages.x86_64-linux.fmo-os-installer-public-debug;
fmo-os-installer-public-release.x86_64-linux = self.packages.x86_64-linux.fmo-os-installer-public-release;
fmo-os-rugged-devices-public-debug.x86_64-linux = self.packages.x86_64-linux.fmo-os-rugged-devices-public-debug;
fmo-os-rugged-devices-public-release.x86_64-linux = self.packages.x86_64-linux.fmo-os-rugged-devices-public-release;
};
#
# TODO: For more robust target collection, maybe add an attribute
# to the package config, or some similar trickery instead of
# just checking the package name.
#
# Reference: https://wiki.nixos.org/wiki/Flakes#Output_schema
# hydraJobs."<attr>"."<system>" = derivation;
{
self,
lib,
...
}: let
packageFilter = name: value: ((lib.hasInfix "public" name) && !(lib.hasInfix "compressed" name));
in {
flake.hydraJobs =
lib.foldlAttrs
(
acc: system: packages: let
publicPackages = lib.filterAttrs packageFilter packages;
in
acc // (lib.mapAttrs' (name: package: lib.nameValuePair name {${system} = package;}) publicPackages)
)
{}
self.packages;
}
68 changes: 35 additions & 33 deletions modules/desktop/launchers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,39 @@
...
}: let
cfg = config.ghaf.graphics.app-launchers;
get_launcer = descr: ( let
extraArgs = if lib.hasAttr "extraArgs" descr then descr.extraArgs else "";
launcers_description = {
google-chrome = {
name = "Chrome";
path = "${pkgs.google-chrome}/bin/google-chrome-stable --enable-features=UseOzonePlatform --ozone-platform=wayland ${extraArgs}";
icon = "${pkgs.google-chrome}/share/icons/hicolor/48x48/apps/google-chrome.png";
package = [pkgs.google-chrome];
};
chromium = {
name = "Chromium";
path = "${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform --ozone-platform=wayland ${extraArgs}";
icon = "${pkgs.chromium}/share/icons/hicolor/48x48/apps/chromium.png";
package = [pkgs.chromium];
};
terminal = {
name = "Terminal";
path = "${pkgs.terminator}/bin/terminator ${extraArgs}";
icon = "${pkgs.terminator}/share/icons/hicolor/48x48/apps/terminator.png";
package = [pkgs.terminator];
};
nmLauncher = {
name = "nmLauncher";
path = "${pkgs.nmLauncher}/bin/nmLauncher ${extraArgs}";
icon = "${pkgs.networkmanagerapplet}/share/icons/hicolor/22x22/apps/nm-device-wwan.png";
package = [pkgs.nmLauncher pkgs.networkmanagerapplet];
};
getLauncers = descr: (let
extraArgs =
if lib.hasAttr "extraArgs" descr
then descr.extraArgs
else "";
launchers = {
google-chrome = {
name = "Chrome";
path = "${pkgs.google-chrome}/bin/google-chrome-stable --enable-features=UseOzonePlatform --ozone-platform=wayland ${extraArgs}";
icon = "${pkgs.google-chrome}/share/icons/hicolor/48x48/apps/google-chrome.png";
package = [pkgs.google-chrome];
};
chromium = {
name = "Chromium";
path = "${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform --ozone-platform=wayland ${extraArgs}";
icon = "${pkgs.chromium}/share/icons/hicolor/48x48/apps/chromium.png";
package = [pkgs.chromium];
};
terminal = {
name = "Terminal";
path = "${pkgs.terminator}/bin/terminator ${extraArgs}";
icon = "${pkgs.terminator}/share/icons/hicolor/48x48/apps/terminator.png";
package = [pkgs.terminator];
};
nmLauncher = {
name = "nmLauncher";
path = "${pkgs.nmLauncher}/bin/nmLauncher ${extraArgs}";
icon = "${pkgs.networkmanagerapplet}/share/icons/hicolor/22x22/apps/nm-device-wwan.png";
package = [pkgs.nmLauncher pkgs.networkmanagerapplet];
};
};
in
launcers_description."${descr.app}");


launchers."${descr.app}");
in {
options.ghaf.graphics.app-launchers = with lib; {
enabled-launchers = mkOption {
Expand Down Expand Up @@ -88,14 +89,15 @@ in {
};

config = lib.mkIf cfg.enableAppLaunchers {
ghaf.graphics.app-launchers.launchers = (map get_launcer cfg.enabled-launchers);
ghaf.graphics.app-launchers.launchers = map getLauncers cfg.enabled-launchers;

environment.systemPackages = lib.lists.flatten (
builtins.map (launcher: launcher.package) config.ghaf.graphics.app-launchers.launchers);
builtins.map (launcher: launcher.package) config.ghaf.graphics.app-launchers.launchers
);

# Needed for nm-applet as defined in
# https://github.com/NixOS/nixpkgs/blob/4cdde2bb35340a5b33e4a04e3e5b28d219985b7e/nixos/modules/programs/nm-applet.nix#L22
# Requires further testing
services.dbus.packages = [ pkgs.gcr ];
services.dbus.packages = [pkgs.gcr];
};
}
37 changes: 22 additions & 15 deletions modules/packages/squeekboard/squeekboard.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
{pkgs}:
pkgs.writeShellApplication {
name = "squeekboard-control";
runtimeInputs = [
pkgs.systemd
];
text = ''
function isVisible {
case "$(busctl --user get-property sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 Visible)" in
*true*) return 0;;
*) return 1;;
esac
}

{
pkgs,
}:
pkgs.writeScriptBin "squeekboard-control" ''
#${pkgs.bash}/bin/bash
i=$(busctl --user get-property sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 Visible)
echo $i
if [ "$i" == "b true" ]
then
pkill squeekboard
else
busctl --user call sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true
fi
echo "Toggling on-screen keyboard..."
''
echo "Toggling on-screen keyboard..."

if isVisible; then
busctl --user call sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false
else
busctl --user call sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true
fi
'';
}
41 changes: 21 additions & 20 deletions utils/launchers.nix
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
{
sysconf,
}: {
{sysconf}: {
lib,
pkgs,
...
}: with lib;
let
get_launcer = descr: (
let
extraArgs = if lib.hasAttr "extraArgs" descr then descr.extraArgs else "";
launcers_description = {
weston-terminal = {
path = "${pkgs.weston}/bin/weston-terminal ${extraArgs}";
icon = "${pkgs.weston}/share/weston/icon_terminal.png";
};
}:
with lib; let
getLauncher = descr: (
let
extraArgs =
if lib.hasAttr "extraArgs" descr
then descr.extraArgs
else "";
launchers = {
weston-terminal = {
path = "${pkgs.weston}/bin/weston-terminal ${extraArgs}";
icon = "${pkgs.weston}/share/weston/icon_terminal.png";
};

chromium = {
path = "${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform --ozone-platform=wayland ${extraArgs}";
icon = "${pkgs.chromium}/share/icons/hicolor/24x24/apps/chromium.png";
chromium = {
path = "${pkgs.chromium}/bin/chromium --enable-features=UseOzonePlatform --ozone-platform=wayland ${extraArgs}";
icon = "${pkgs.chromium}/share/icons/hicolor/24x24/apps/chromium.png";
};
};
};
in
launcers_description."${descr.app}"
in
launchers."${descr.app}"
);
in {
ghaf.graphics.weston.enableDemoApplications = lib.mkIf (lib.hasAttr "launchers" sysconf) (lib.mkForce false);
ghaf.graphics.weston.launchers = lib.mkIf (lib.hasAttr "launchers" sysconf) (map get_launcer sysconf.launchers);
ghaf.graphics.weston.launchers = lib.mkIf (lib.hasAttr "launchers" sysconf) (map getLauncher sysconf.launchers);
}
Loading