diff --git a/hosts/catbook-j/configuration.nix b/hosts/catbook-j/configuration.nix index 35fd1e6..14a50e2 100644 --- a/hosts/catbook-j/configuration.nix +++ b/hosts/catbook-j/configuration.nix @@ -2,7 +2,26 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, lib, ... }: { +{ config, pkgs, lib, ... }: +let + evremap = pkgs.rustPlatform.buildRustPackage { + pname = "evremap"; + version = "0.1.0"; + src = pkgs.fetchFromGitHub { + owner = "wez"; + repo = "evremap"; + rev = "4480c4eda223b98899b0fbd926bc34f7bd0e1a18"; + sha256 = "sha256-BxSrphgW1n465FX6bKVkq6O0XE2JqanfSYlsGwWUWkQ="; + }; + cargoHash = ""; + cargoLock.lockFile = ../../other/evremap.Cargo.lock; + postPatch = '' + cp ${../../other/evremap.Cargo.lock} Cargo.lock + ''; + nativeBuildInputs = [ pkgs.pkg-config ]; + buildInputs = [ pkgs.libevdev ]; + }; +in { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix @@ -58,6 +77,13 @@ "/crypto_keyfile.bin" = null; }; + systemd.services = { + evremap = { + script = "${evremap}/bin/evremap remap ${../../other/remaps-catbook.toml}"; + wantedBy = ["multi-user.target"]; + }; + }; + # nixpkgs = { # overlays = [ # (self: super: { @@ -110,7 +136,6 @@ LC_TELEPHONE = "de_DE.UTF-8"; LC_TIME = "de_DE.UTF-8"; }; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/hosts/potatobook-g/configuration.nix b/hosts/potatobook-g/configuration.nix index 8925823..4bdf4b3 100644 --- a/hosts/potatobook-g/configuration.nix +++ b/hosts/potatobook-g/configuration.nix @@ -1,4 +1,23 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +let + evremap = pkgs.rustPlatform.buildRustPackage { + pname = "evremap"; + version = "0.1.0"; + src = pkgs.fetchFromGitHub { + owner = "wez"; + repo = "evremap"; + rev = "4480c4eda223b98899b0fbd926bc34f7bd0e1a18"; + sha256 = "sha256-BxSrphgW1n465FX6bKVkq6O0XE2JqanfSYlsGwWUWkQ="; + }; + cargoHash = ""; + cargoLock.lockFile = ../../other/evremap.Cargo.lock; + postPatch = '' + cp ${../../other/evremap.Cargo.lock} Cargo.lock + ''; + nativeBuildInputs = [ pkgs.pkg-config ]; + buildInputs = [ pkgs.libevdev ]; + }; +in { nix.settings = { trusted-substituters = [ "https://t2linux.cachix.org" @@ -166,6 +185,10 @@ fi ''; }; + evremap = { + script = "${evremap}/bin/evremap remap ${../../other/remaps.toml}"; + wantedBy = ["multi-user.target"]; + }; }; services.logind.extraConfig = '' diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index b508479..ee31ec1 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -26,7 +26,6 @@ in with lib; { ./social.nix ./mail.nix ./specific-hardware - ./evremap.nix ./xmonad.nix ]; diff --git a/modules/desktop/evremap.nix b/modules/desktop/evremap.nix deleted file mode 100644 index 183647c..0000000 --- a/modules/desktop/evremap.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ pkgs, config, ... }: -let - evremap = pkgs.rustPlatform.buildRustPackage { - pname = "evremap"; - version = "0.1.0"; - src = pkgs.fetchFromGitHub { - owner = "wez"; - repo = "evremap"; - rev = "4480c4eda223b98899b0fbd926bc34f7bd0e1a18"; - sha256 = "sha256-BxSrphgW1n465FX6bKVkq6O0XE2JqanfSYlsGwWUWkQ="; - }; - cargoHash = ""; - cargoLock.lockFile = ../../other/evremap.Cargo.lock; - postPatch = '' - cp ${../../other/evremap.Cargo.lock} Cargo.lock - ''; - nativeBuildInputs = [ pkgs.pkg-config ]; - buildInputs = [ pkgs.libevdev ]; - }; -in { - systemd.services.evremap = { - script = "${evremap}/bin/evremap remap ${../../other/remaps-${config.networking.hostName}.toml}"; - wantedBy = [ "multi-user.target" ]; - }; -} diff --git a/modules/desktop/xkeysnail.nix b/modules/desktop/xkeysnail.nix new file mode 100644 index 0000000..6d5ff5c --- /dev/null +++ b/modules/desktop/xkeysnail.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: +{ + config = { + services.xserver.windowManager.i3.extraPackages = with pkgs; [ + xkeysnail + xorg.xhost + xorg.setxkbmap + ]; + + home-manager.users.jade = { pkgs, ... }: { + xsession.windowManager.i3.config.startup = [ + { + command = "xhost +"; + } + { + command = "${pkgs.xkeysnail}/bin/xkeysnail ${../../other/xkeysnail.py}"; + always = true; + } + { + command = "sleep 4 && setxkbmap -layout us -variant altgr-intl"; + always = true; + } + ]; + }; + }; +} diff --git a/other/remaps-catbook-j.toml b/other/remaps-catbook.toml similarity index 100% rename from other/remaps-catbook-j.toml rename to other/remaps-catbook.toml diff --git a/other/remaps-potatobook-g.toml b/other/remaps.toml similarity index 100% rename from other/remaps-potatobook-g.toml rename to other/remaps.toml