Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
VTimofeenko committed May 14, 2024
1 parent 0fe5133 commit 9c62422
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 55 deletions.
2 changes: 1 addition & 1 deletion checks/xremap-multiple-devices.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
name = "xremap-single-device";
nodes.machine1 =
{ config, pkgs, ... }:
{ config, ... }:
{
services.getty.autologinUser = "root";
imports = [
Expand Down
2 changes: 1 addition & 1 deletion checks/xremap-no-features-root-test.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
name = "xremap-no-features-root-test";
nodes.machine1 =
{ config, pkgs, ... }:
{ config, ... }:
{
services.getty.autologinUser = "root";
imports = [
Expand Down
2 changes: 1 addition & 1 deletion checks/xremap-single-device.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
name = "xremap-single-device";
nodes.machine1 =
{ config, pkgs, ... }:
{ config, ... }:
{
services.getty.autologinUser = "root";
imports = [
Expand Down
2 changes: 0 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
perSystem =
{
config,
self',
inputs',
pkgs,
system,
...
Expand Down
6 changes: 3 additions & 3 deletions lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ in
# Check that 0 or 1 features are enabled, since upstream throws an error otherwise
assert
(
lib.lists.count (x: x == true) (
lib.lists.count (x: x) (
builtins.attrValues {
inherit (cfg)
withSway
Expand Down Expand Up @@ -163,7 +163,7 @@ in
mkExecStart =
configFile:
let
mkDeviceString = (x: "--device '${x}'");
mkDeviceString = x: "--device '${x}'";
in
builtins.concatStringsSep " " (
lib.flatten (
Expand Down Expand Up @@ -195,7 +195,7 @@ in
++ lib.optional cfg.watch "--watch"
++ lib.optional cfg.mouse "--mouse"
++ cfg.extraArgs
++ lib.lists.singleton (configFile)
++ lib.lists.singleton configFile
)
);
}
11 changes: 3 additions & 8 deletions modules/system-service.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{ mkExecStart, configFile }:
{
pkgs,
lib,
config,
...
}:
{ lib, config, ... }:

let
cfg = config.services.xremap;
Expand Down Expand Up @@ -76,11 +71,11 @@ in
# Need 'tmpfs' here so that the socket may be actually bind-mounted through Bind*Paths
ProtectHome = "tmpfs";
# This is needed, otherwise xremap cannot read from sway socket
BindReadOnlyPaths = lib.mkIf (cfg.withSway) [ userPath ];
BindReadOnlyPaths = lib.mkIf cfg.withSway [ userPath ];
# Sway socket gets generated as $XDG_RUNTIME_DIR/sway-ipc.$UID.$SWAY_PID
# Hacky way to allow sway socket
# Systemd does not support wildcards :(
InaccessiblePaths = lib.mkIf (cfg.withSway) (
InaccessiblePaths = lib.mkIf cfg.withSway (
map (x: "-${userPath}/${x}") [
"app"
"bus"
Expand Down
9 changes: 2 additions & 7 deletions modules/user-service.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{ mkExecStart, configFile }:
{
pkgs,
lib,
config,
...
}:
{ lib, config, ... }:

let
inherit (lib) mkIf optionalString;
Expand All @@ -26,7 +21,7 @@ in
path = [ cfg.package ];
# NOTE: xremap needs DISPLAY:, WAYLAND_DISPLAY: and a bunch of other stuff in the environment to launch graphical applications (launch:)
# On Gnome after gnome-session.target is up - those variables are populated
after = lib.mkIf (cfg.withGnome == true) [ "gnome-session.target" ];
after = lib.mkIf cfg.withGnome [ "gnome-session.target" ];
wantedBy = [ "graphical-session.target" ];
serviceConfig = {
KeyringMode = "private";
Expand Down
24 changes: 11 additions & 13 deletions nixosConfigurations/hypr-common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.alice =
{ ... }:
{
home.stateVersion = "23.05";
wayland.windowManager.hyprland = {
enable = true;
# Makes xremap auto-start with hyprland
systemdIntegration = true;
extraConfig = ''
bind = SUPER CTRL, k, exec, ${lib.getExe pkgs.kitty}
bind = SUPER CTRL, f, exec, ${lib.getExe pkgs.foot}
'';
};
users.alice = _: {
home.stateVersion = "23.05";
wayland.windowManager.hyprland = {
enable = true;
# Makes xremap auto-start with hyprland
systemdIntegration = true;
extraConfig = ''
bind = SUPER CTRL, k, exec, ${lib.getExe pkgs.kitty}
bind = SUPER CTRL, f, exec, ${lib.getExe pkgs.foot}
'';
};
};
};
}
3 changes: 1 addition & 2 deletions nixosConfigurations/kde-common.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{ ... }:
{
_: {
services.xserver = {
enable = true;
desktopManager.plasma5.enable = true;
Expand Down
7 changes: 1 addition & 6 deletions nixosConfigurations/sway-common.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
config,
lib,
pkgs,
...
}:
{ pkgs, ... }:

{
environment.etc."sway/config.d/test".text = ''
Expand Down
7 changes: 1 addition & 6 deletions nixosConfigurations/vm-config.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# NOTE: modulesPath and imports are taken from nixpkgs#59219
# Most of this file is very specific to running a dev VM for this project
{
modulesPath,
pkgs,
lib,
...
}:
{ modulesPath, pkgs, ... }:
{
imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ];
users.users.root.password = "root";
Expand Down
6 changes: 1 addition & 5 deletions overlay/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Overlay file that contains the definition of building a package
{
xremap,
craneLib,
pkgs,
}:
{ xremap, craneLib, ... }:
let
commonArgs = {
src = xremap;
Expand Down

0 comments on commit 9c62422

Please sign in to comment.