Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
heraldofsolace committed Nov 24, 2023
2 parents 004fc23 + b83fb42 commit 32a2587
Show file tree
Hide file tree
Showing 18 changed files with 475 additions and 62 deletions.
6 changes: 6 additions & 0 deletions cells/common/overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,11 @@ in {
jetbrains
siril
obs-studio
vial
via
wally-cli
kanata
fcitx5-openbangla-keyboard
electron
;
}
4 changes: 4 additions & 0 deletions cells/common/packages/_files/10-dygma.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="2201", MODE="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="2200", MODE="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="35ef", MODE="0666"
KERNEL=="hidraw*", ATTRS{idVendor}=="35ef", MODE="0666"
55 changes: 55 additions & 0 deletions cells/common/packages/bazecor.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{ lib
, appimageTools
, fetchurl
, ...
}:

appimageTools.wrapAppImage rec {
pname = "bazecor";
version = "1.3.6";

src = appimageTools.extract {
inherit pname version;
src = fetchurl {
url = "https://github.com/Dygmalab/Bazecor/releases/download/v.${version}/Bazecor-${version}-x64.AppImage";
hash = "sha256-Mz7T/AAlyfMzdfy/ZV4AEP3ClTolwr2pPzkSCPL66/w=";
};

# Workaround for https://github.com/Dygmalab/Bazecor/issues/370
postExtract = ''
substituteInPlace \
$out/usr/lib/bazecor/resources/app/.webpack/main/index.js \
--replace \
'checkUdev=()=>{try{if(c.default.existsSync(f))return c.default.readFileSync(f,"utf-8").trim()===l.trim()}catch(e){console.error(e)}return!1}' \
'checkUdev=()=>{return 1}'
'';
};

# also make sure to update the udev rules in ./10-dygma.rules; most recently
# taken from
# https://github.com/Dygmalab/Bazecor/blob/v1.3.6/src/main/utils/udev.ts#L6

extraPkgs = p: (appimageTools.defaultFhsEnvArgs.multiPkgs p) ++ [
p.glib
];

# Also expose the udev rules here, so it can be used as:
# services.udev.packages = [ pkgs.bazecor ];
# to allow non-root modifications to the keyboards.

extraInstallCommands = ''
mv $out/bin/bazecor-* $out/bin/bazecor
mkdir -p $out/lib/udev/rules.d
ln -s --target-directory=$out/lib/udev/rules.d ${./_files/10-dygma.rules}
'';

meta = {
description = "Graphical configurator for Dygma Products";
homepage = "https://github.com/Dygmalab/Bazecor";
changelog = "https://github.com/Dygmalab/Bazecor/releases/tag/v${version}";
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ amesgen ];
platforms = [ "x86_64-linux" ];
};
}
56 changes: 56 additions & 0 deletions cells/common/packages/siril-new2.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{ lib, stdenv, fetchFromGitLab, fetchpatch, pkg-config, meson, ninja, cmake
, git, criterion, gtk3, libconfig, gnuplot, opencv, json-glib
, fftwFloat, cfitsio, gsl, exiv2, librtprocess, wcslib, ffmpeg
, libraw, libtiff, libpng, libjpeg, libheif, ffms, wrapGAppsHook
, glib-networking, curl, ...
}:

stdenv.mkDerivation rec {
pname = "siril-new2";
version = "1.2.0";

src = fetchFromGitLab {
owner = "free-astro";
repo = "siril";
rev = version;
hash = "sha256-lCoFQ7z6cZbyNPEm5s40DNdvTwFonHK3KCd8RniqQWs=";
};

patches = [
(fetchpatch {
name = "siril-1.2-exiv2-0.28.patch";
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-astronomy/siril/files/siril-1.2-exiv2-0.28.patch?id=002882203ad6a2b08ce035a18b95844a9f4b85d0";
hash = "sha256-R1yslW6hzvJHKo0/IqBxkCuqcX6VrdRSz68gpAExxVE=";
})
];

nativeBuildInputs = [
meson ninja cmake pkg-config git criterion wrapGAppsHook glib-networking curl
];

buildInputs = [
gtk3 cfitsio gsl exiv2 gnuplot opencv fftwFloat librtprocess wcslib
libconfig libraw libtiff libpng libjpeg libheif ffms ffmpeg json-glib glib-networking curl
];

# Necessary because project uses default build dir for flatpaks/snaps
dontUseMesonConfigure = true;
dontUseCmakeConfigure = true;

configureScript = ''
${meson}/bin/meson setup --buildtype release -Denable-libcurl=yes nixbld .
'';

postConfigure = ''
cd nixbld
'';

meta = with lib; {
homepage = "https://www.siril.org/";
description = "Astrophotographic image processing tool";
license = licenses.gpl3Plus;
changelog = "https://gitlab.com/free-astro/siril/-/blob/HEAD/ChangeLog";
maintainers = with maintainers; [ hjones2199 ];
platforms = platforms.linux;
};
}
10 changes: 10 additions & 0 deletions cells/home/profiles/audio.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
_: {pkgs, ...}: {
home.packages = with pkgs; [
qpwgraph
audacity
ardour
guitarix
alsa-scarlett-gui
bitwig-studio
];
}
198 changes: 198 additions & 0 deletions cells/home/profiles/misc/_files/kanata.kbd
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
(defcfg
process-unmapped-keys yes
sequence-timeout 150
sequence-input-mode hidden-delay-type
)

(defsrc
esc 9 3 1 5 7 min eql 6 2 0 4 8 bspc
caps w f m p v [ ] / . q ' z
r s n t b \ a e i h j
lsft lalt lctrl rsft ralt rctrl
x c l d g u o y k
tab spc ret grv

)
(deflayer default
esc 9 3 1 5 7 @chmin eql 6 2 0 4 8 bspc
caps @chw @chf @chm @chp v [ ] / . @adq ' z
@chr @chs @chn @cht @adb \ @cha @che @chi @chh j
lsft lalt lctrl rsft ralt rctrl
@chx @chc @chl @chd @chg @chu @cho @chy @chk
tab spc ret grv
)

(defalias
chu (chord adkeys u)
chy (chord adkeys y)
chmin (chord adkeys min)
chk (chord adkeys k)
cho (chord adkeys o)
chx (chord adkeys x)
chc (chord adkeys c)
chl (chord adkeys l)
chd (chord adkeys d)
chw (chord adkeys w)
chf (chord adkeys f)
chr (chord adkeys r)
chs (chord adkeys s)
cht (chord adkeys t)
chp (chord adkeys p)
chg (chord adkeys g)
chm (chord adkeys m)
chn (chord adkeys n)
cha (chord adkeys a)
che (chord adkeys e)
chi (chord adkeys i)
chh (chord adkeys h)
qu (macro q u)
Qu (multi (release-key lsft) (release-key rsft) (macro S-q u))
th (macro t h)
Th (multi (release-key lsft) (release-key rsft) (macro S-t h))
sh (macro s h)
Sh (multi (release-key lsft) (release-key rsft) (macro S-s h))
ch (macro c h)
Ch (multi (release-key lsft) (release-key rsft) (macro S-c h))
wh (macro w h)
Wh (multi (release-key lsft) (release-key rsft) (macro S-w h))
gh (macro g h)
Gh (multi (release-key lsft) (release-key rsft) (macro S-g h))
ph (macro p h)
Ph (multi (release-key lsft) (release-key rsft) (macro S-p h))
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
)

(deflayer adaptive1
esc 9 3 1 5 7 min eql 6 2 0 4 8 bspc
caps w f l p b [ ] / u q ' z
@chr @chs @chn @cht b \ @cha @che i h j
lsft lalt lctrl rsft ralt rctrl
@chx @chc @chl l @chg @chu o @chy k
tab spc ret grv
)



(defalias
adq (multi
q
(on-press-fakekey fk-adaptive1 press)
(macro 200 (on-press-fakekey fk-adaptive1 release)))
adb (multi
b
(on-press-fakekey fk-adaptive1 press)
(macro 200 (on-press-fakekey fk-adaptive1 release)))
)

(deffakekeys
fk-adaptive1 (layer-while-held adaptive1)
)

(defchords adkeys 200
(u ) u
( y) y
(u y) (switch
(lsft rsft) @Qu break
() @qu break
)

(min ) min
( o ) o
( k ) k
(min u ) (macro C-S-u @2 @0 @1 @3 ret)
(min o ) (macro C-S-u @2 @0 @1 @4 ret)
(min k ) C-grv
( u k ) S-min
( y k ) eql

(x ) x
( c ) c
( l ) l
( d) (macro sldr d)
(x c ) C-z
(x l ) C-x
( c l ) C-c
( l d) C-v
(x d) C-a
( c d) C-f


(w ) w
( f ) (multi
f
(on-press-fakekey fk-adaptive1 press)
(macro 200 (on-press-fakekey fk-adaptive1 release)))
(w f ) (fork z S-z (lsft rsft))
( r ) r
( s ) s
( t ) t
( n ) n
( p ) (macro sldr p)
( g) g
( m) (multi
m
(on-press-fakekey fk-adaptive1 press)
(macro 200 (on-press-fakekey fk-adaptive1 release)))
( r s ) tab
( r t ) esc
( t n ) (switch
(lsft rsft) @Th break
() @th break
)
( s n ) (switch
(lsft rsft) @Sh break
() @sh break
)
( s t ) (switch
(lsft rsft) @Ch break
() @ch break
)
( f p ) (switch
(lsft rsft) @Wh break
() @wh break
)
( d g ) (switch
(lsft rsft) @Gh break
() @gh break
)
( p m) (switch
(lsft rsft) @Ph break
() @ph break
)

(a ) a
( e ) e
( i ) i
( h) h
(a e) (macro C-S-u @0 @3 @0 @1 ret)
(e i) (macro C-S-u @0 @3 @0 @0 ret)
(a i) (macro C-S-u @0 @3 @0 @2 ret)
(a h) (macro C-S-u @0 @3 @0 @8 ret)
(e h) (macro C-S-u @0 @3 @2 @7 ret)
(i h) (fork
(macro C-S-u @0 @0 d f ret)
(macro C-S-u @1 e @9 e ret)
(lsft rsft)
)
)

(defseq
pv-adaptive (p v)
pm-adaptive (p m)
db-adaptive (d b)
)

(deffakekeys
pv-adaptive (macro l v)
pm-adaptive (macro p l)
db-adaptive (macro l b)
)
41 changes: 41 additions & 0 deletions cells/home/profiles/misc/keyboard.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
_: {pkgs, lib, ...}: {
home.packages = with pkgs; [
wally-cli
via
vial
bazecor
kanata
];


# [Unit]
# Description=Kanata keyboard remapper
# Documentation=https://github.com/jtroo/kanata

# [Service]
# Environment=PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin
# Environment=DISPLAY=:0
# Environment=HOME=/path/to/home/folder
# Type=simple
# ExecStart=/usr/local/bin/kanata --cfg /path/to/kanata/config/file
# Restart=never

# [Install]
# WantedBy=default.target
systemd.user.services.kanata = let configFile = pkgs.writeText "kanata.cfg" (builtins.readFile ./_files/kanata.kbd); in
{
Unit = {
Description = "Kanata keyboard remapper";
Documentation = "https://github.com/jtroo/kanata";
};
Service = {
Type = "simple";
ExecStart = "${pkgs.kanata}/bin/kanata --cfg ${configFile}";
Restart = "no";
Environment = [
"PATH=${lib.makeBinPath [ pkgs.coreutils pkgs.kanata ]}"
"DISPLAY=:0"
];
};
};
}
Loading

0 comments on commit 32a2587

Please sign in to comment.