Browse Source

wtf ibus+mozc works now

rework-profiles
parent
commit
a24f20b2b3
Signed by: govanify GPG Key ID: DE62E1E2A6145556
6 changed files with 67 additions and 49 deletions
  1. +2
    -2
      README.md
  2. +1
    -0
      common/graphical.nix
  3. +17
    -21
      common/security.nix
  4. +36
    -26
      common/xdg.nix
  5. +3
    -0
      dotfiles/sway/config
  6. +8
    -0
      dotfiles/sway/locale.sh

+ 2
- 2
README.md View File

@ -13,8 +13,8 @@ TODo list sorted by priority:
* workflow: weechat-matrix and vim-prosession
* mail: make your replies appear in threads
* mail: make gpg less shobby(auto gather from sks, check why keyid does not work when encrypting
* locale: fix ibus daemon
* locale: check that ibus is fixed plus maybe recenter?
* security: security hardening through sandboxing
* workflow: set up patchouli to have regular and automated backups
* server: make firefox sync to fujiwara and setup fujiwara
* xdg: nixpkgs PR, mozilla PR or source patch if too slow
* xdg: nixpkgs PR, check if xdg patches actually work

+ 1
- 0
common/graphical.nix View File

@ -56,6 +56,7 @@
etc = {
# Put config files in /etc. Note that you also can put these in ~/.config, but then you can't manage them with NixOS anymore!
"sway/config".source = ./../dotfiles/sway/config;
"sway/locale.sh".source = ./../dotfiles/sway/locale.sh;
"sway/status.sh".source = ./../dotfiles/sway/status.sh;
};
};


+ 17
- 21
common/security.nix View File

@ -1,25 +1,21 @@
{ config, pkgs, ... }: {
#let
#kernelPackages = with pkgs;
#recurseIntoAttrs (linuxPackagesFor (linux_latest_hardened.override {
#features.ia32Emulation = true;
#}));
#in {
#imports = [
#<nixpkgs/nixos/modules/profiles/hardened.nix>
#];
{ config, pkgs, ... }:
let
kernelPackages = with pkgs;
recurseIntoAttrs (linuxPackagesFor (linux_latest_hardened.override {
features.ia32Emulation = true;
}));
in {
imports = [
<nixpkgs/nixos/modules/profiles/hardened.nix>
];
#boot.kernelPatches = [{
#name = "keep-ia32";
#patch = null;
#extraConfig = ''
#IA32_EMULATION y
#'';
#}];
imports = [
<nixpkgs/nixos/modules/profiles/hardened.nix>
];
boot.kernelPatches = [{
name = "keep-ia32";
patch = null;
extraConfig = ''
IA32_EMULATION y
'';
}];
security.allowUserNamespaces = true;


+ 36
- 26
common/xdg.nix View File

@ -1,43 +1,53 @@
# TODO: currently non compliant to XDG in default config are:
# * mozilla (in progress upstream hopefully)
# * nix old folders, yuuuuup, i should make a PR
# TODO: dbus esd_auth gets removed each time you start a new shell, should be done
# upon user login along with swaystart
# * steam: done BUT need to start through startsteam, might want to modify
# TODO: steam: done BUT need to start through startsteam, might want to modify
# that(ie modify desktop file)
# java: need to make a system wrapper like steam up above
{ config, pkgs, ... }: {
# ssh devs don't want to make ssh XDG compliant? well let's roll our own
# compliance!
nixpkgs.config.packageOverrides = pkgs: {
openssh = pkgs.openssh.overrideAttrs (oldAttrs: rec {
postPatch = oldAttrs.postPatch + ''
sed -i 's/\.ssh/\.config\/ssh/' $(grep -Rl '"\.ssh"')
'';
});
nixpkgs.config = {
packageOverrides = super: let self = super.pkgs; in {
openssh = super.openssh.overrideAttrs (oldAttrs: rec {
postPatch = oldAttrs.postPatch + ''
sed -i 's/"\.ssh"/"\.config\/ssh"/' $(grep -Rl '"\.ssh"')
'';
});
# https://github.com/google/mozc/issues/474
# hopefully temporary
ibus-mozc = pkgs.ibus-mozc.overrideAttrs (oldAttrs: rec {
postPatch = oldAttrs.postPatch + ''
sed -i 's/\.mozc/\.config\/mozc/' $(grep -Rl '"\.mozc"')
'';
});
#ibus-mozc = pkgs.ibus-mozc.overrideAttrs (oldAttrs: rec {
#postPatch = oldAttrs.postPatch + ''
#sed -i 's/\.mozc/\.config\/mozc/' $(grep -Rl '"\.mozc"')
#'';
#});
# rarely created on my setup, seems to be x11 related? either way here we go
dbus = pkgs.dbus.overrideAttrs (oldAttrs: rec {
postPatch = oldAttrs.postPatch + ''
sed -i 's/\.dbus/\.config\/dbus/' $(grep -Rl '"\.dbus"')
'';
});
## rarely created on my setup, seems to be x11 related? either way here we go
#dbus = pkgs.dbus.overrideAttrs (oldAttrs: rec {
#postPatch = oldAttrs.postPatch + ''
#sed -i 's/\.dbus/\.config\/dbus/' $(grep -Rl '"\.dbus"')
#'';
#});
pulseaudio = pkgs.pulseaudio.overrideAttrs (oldAttrs: rec {
postPatch = oldAttrs.postPatch + ''
sed -i 's/\.esd_auth/\.config\/esd_auth/' $(grep -Rl '"\.esd_auth"')
'';
});
## eh, it's just a forgotten pulseaudio module everyone forgot about. easier
## to patch than to submit a PR.
#pulseaudio = pkgs.pulseaudio.overrideAttrs (oldAttrs: rec {
#postPatch = ''
#sed -i 's/\.esd_auth/\.config\/esd_auth/' $(grep -Rl '"\.esd_auth"')
#'';
#});
## a PR is in development but knowing the entire thing has been in the work
## since 15 years ago I'd assume it's going to take a _little_ bit longer
## https://phabricator.services.mozilla.com/D6995
#firefox-wayland = pkgs.firefox-wayland.overrideAttrs (oldAttrs: rec {
#postPatch = ''
#sed -i 's/\.mozilla/\.local\/share\/mozilla/' $(grep -Rl '"\.mozilla"')
#'';
#});
};
};
environment.variables = {


+ 3
- 0
dotfiles/sway/config View File

@ -34,6 +34,9 @@ exec swaymsg "workspace 1; exec ibus-daemon -dr"
exec swaymsg "workspace 2; exec termite -e tmux"
default_border pixel 1
bindsym $mod+i exec /etc/sway/locale.sh
#
#default_border none
#gaps outer 10


+ 8
- 0
dotfiles/sway/locale.sh View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
engine=$(ibus engine)
if [ "${engine}" == "mozc-jp" ] || [ "${engine}" == "xkb:jp::jpn" ]
then
ibus engine xkb:us::eng
else
ibus engine mozc-jp
fi

Loading…
Cancel
Save