Compare commits
3 commits
ba5cca65ef
...
8ee65af888
Author | SHA1 | Date | |
---|---|---|---|
8ee65af888 | |||
fe773b64cb | |||
ab6ce5aad5 |
5 changed files with 83 additions and 9 deletions
4
Justfile
4
Justfile
|
@ -31,3 +31,7 @@ alias gc := collectgarbage
|
|||
[group('maintainence')]
|
||||
collectgarbage:
|
||||
nh clean all
|
||||
|
||||
alias s := search
|
||||
search this:
|
||||
nh search {{this}}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
{
|
||||
description = "marleyOS";
|
||||
|
||||
outputs =
|
||||
inputs:
|
||||
outputs = inputs:
|
||||
inputs.snowfall-lib.mkFlake {
|
||||
inherit inputs;
|
||||
src = ./.;
|
||||
|
@ -72,7 +71,6 @@
|
|||
marleyvim = {
|
||||
url = "git+https://codewith.babesonthe.net/punkfairie/marleyvim";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.unstable.follows = "unstable";
|
||||
};
|
||||
|
||||
# Rose pine themes that aren't included in the above flake:
|
||||
|
|
|
@ -2,14 +2,12 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
}: let
|
||||
inherit (lib.marleyos) enabled;
|
||||
in
|
||||
{
|
||||
imports = [ ./autorandr.nix ];
|
||||
in {
|
||||
imports = [./autorandr.nix];
|
||||
|
||||
home.keyboard.options = [ "apple:alupckeys" ];
|
||||
home.keyboard.options = ["apple:alupckeys"];
|
||||
|
||||
# FIXME: Remove once we are on NixOS
|
||||
targets.genericLinux = enabled;
|
||||
|
@ -72,6 +70,7 @@ in
|
|||
};
|
||||
services = {
|
||||
clipboard = enabled;
|
||||
kanata = enabled;
|
||||
syncthing = enabled;
|
||||
};
|
||||
xorg = {
|
||||
|
|
30
modules/home/services/kanata/config.kbd
Normal file
30
modules/home/services/kanata/config.kbd
Normal file
|
@ -0,0 +1,30 @@
|
|||
;; vim: ft=commonlisp
|
||||
|
||||
(defcfg
|
||||
process-unmapped-keys yes
|
||||
)
|
||||
|
||||
(defsrc
|
||||
caps a s d f j k l ;
|
||||
)
|
||||
|
||||
(defvar
|
||||
tap-time 150
|
||||
hold-time 200
|
||||
)
|
||||
|
||||
(defalias
|
||||
escctrl (tap-hold 100 100 esc caps)
|
||||
a (tap-hold $tap-time $hold-time a lmet)
|
||||
s (tap-hold $tap-time $hold-time s lalt)
|
||||
d (tap-hold $tap-time $hold-time d lsft)
|
||||
f (tap-hold $tap-time $hold-time f lctl)
|
||||
j (tap-hold $tap-time $hold-time j rctl)
|
||||
k (tap-hold $tap-time $hold-time k rsft)
|
||||
l (tap-hold $tap-time $hold-time l ralt)
|
||||
; (tap-hold $tap-time $hold-time ; rmet)
|
||||
)
|
||||
|
||||
(deflayer base
|
||||
@escctrl @a @s @d @f @j @k @l @;
|
||||
)
|
43
modules/home/services/kanata/default.nix
Normal file
43
modules/home/services/kanata/default.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf getExe' getExe;
|
||||
inherit (lib.snowfall.system) is-darwin;
|
||||
|
||||
cfg = config.marleyos.services.kanata;
|
||||
isGenericLinux = config.targets.genericLinux.enable;
|
||||
isNotNixOS = isGenericLinux || (is-darwin system);
|
||||
in {
|
||||
options.marleyos.services.kanata.enable = mkEnableOption "kanata";
|
||||
|
||||
# Kanata is available as a module for nixOS and that should be preferred when
|
||||
# possible.
|
||||
config = mkIf (cfg.enable && isNotNixOS) {
|
||||
home.packages = with pkgs; [
|
||||
kanata
|
||||
];
|
||||
|
||||
systemd.user.services.kanata = {
|
||||
Unit = {
|
||||
Description = "Kanata keyboard remapper";
|
||||
Documentation = "https://github.com/jtroo/kanata";
|
||||
};
|
||||
|
||||
Service = {
|
||||
Environment = [
|
||||
"PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin"
|
||||
"DISPLAY=:0"
|
||||
];
|
||||
Type = "simple";
|
||||
ExecStart = "${getExe' pkgs.klibc "sh"} -c 'exec ${getExe pkgs.kanata} --cfg ${./config.kbd}'";
|
||||
Restart = "no";
|
||||
};
|
||||
|
||||
Install.WantedBy = ["default.target"];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue