Use my forks of river/home-manager & add fcitx5

This commit is contained in:
2024-07-11 23:40:19 +07:00
parent 234d806984
commit 8d6ca4fed7
9 changed files with 167 additions and 57 deletions
+3
View File
@@ -3,6 +3,9 @@
../../modules/wm
];
# this is called manually in the river init script.
services.xserver.desktopManager.runXdgAutostartIfNone = true;
services.greetd = {
enable = true;
settings = {
+12 -41
View File
@@ -72,11 +72,10 @@ in {
};
};
border-color-focused = "0x94e2d5";
border-color-unfocused = "0x00000000";
border-color-urgent = "0xcba6f7";
border-width = 2;
border-color-focused = "0x94e2d5";
border-color-unfocused = "0x00000000";
border-color-urgent = "0xcba6f7";
border-width = 2;
rule-add = {
"-app-id" = {
@@ -129,7 +128,7 @@ in {
// common_binds;
locked = common_binds;
passthrough = {
"Super+Shift Backslash" = "enter-mode normal";
"Super+Shift Backslash" = "enter-mode normal";
};
};
map-pointer = {
@@ -143,58 +142,30 @@ in {
for i in $(seq 1 9)
do
tags=$((1 << (i - 1)))
riverctl map normal Super "$i" set-focused-tags $tags
riverctl map normal Super "$i" set-focused-tags -alternate $tags
riverctl map normal Super+Shift "$i" set-view-tags $tags
riverctl map normal Super+Control "$i" toggle-focused-tags $tags
riverctl map normal Super+Shift+Control "$i" toggle-view-tags $tags
done
all_tags=$(((1 << 32) - 1))
riverctl map normal Super 0 set-focused-tags "$all_tags"
riverctl map normal Super 0 set-focused-tags -alternate "$all_tags"
riverctl map normal Super+Shift 0 set-view-tags "$all_tags"
hyprlock --immediate
'';
systemd = {
# Only import env vars, do not use their systemctl --user start river-session.target that we override below.
enable = true;
runInService = true;
extraCommands = [
"systemd-notify --ready"
"hyprlock --immediate"
"${pkgs.systemd}/bin/systemctl --user start xdg-autostart-if-no-desktop-manager.target"
];
};
};
# Run river in systemd directly and not by hand. Failing to do so will make graphical-session.target never stop.
# So a big wait time when shutting down & graphical services are not restarted when starting river again.
systemd.user.targets.river-session = {
Unit = {
Description = "river compositor session";
Documentation = ["man:systemd.special(7)"];
BindsTo = ["graphical-session.target"];
Before = ["graphical-session.target"];
Wants = ["graphical-session-pre.target"];
After = ["graphical-session-pre.target"];
RefuseManualStart = "yes";
StopWhenUnneeded = "yes";
};
};
systemd.user.services.river = {
Unit = {
Description = "River compositor";
Documentation = "man:river(1)";
BindsTo = ["river-session.target"];
Before = ["river-session.target"];
};
Service = {
Type = "notify";
# used to get env/session vars (and path).
ExecStart = "/bin/sh -lc ${pkgs.river}/bin/river";
TimeoutStopSec = 10;
NotifyAccess = "all";
ExecStopPost = "${pkgs.systemd}/bin/systemctl --user unset-environment ${builtins.concatStringsSep " " config.wayland.windowManager.river.systemd.variables}";
};
};
home.packages = with pkgs; [
gnome-control-center
Generated
+27 -10
View File
@@ -335,17 +335,17 @@
]
},
"locked": {
"lastModified": 1720045378,
"narHash": "sha256-lmE7B+QXw7lWdBu5GQlUABSpzPk3YBb9VbV+IYK5djk=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "0a30138c694ab3b048ac300794c2eb599dc40266",
"type": "github"
"lastModified": 1720601689,
"narHash": "sha256-G6MgCUWjJAonm9vgd1zR0rOF7A0YxN83gcXyEs/tWzY=",
"ref": "refs/heads/master",
"rev": "04216763901f904e7e59afe23d30bb814d6c5d14",
"revCount": 3642,
"type": "git",
"url": "file:///home/zoriya/projects/home-manager"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
"type": "git",
"url": "file:///home/zoriya/projects/home-manager"
}
},
"impermanence": {
@@ -521,6 +521,22 @@
"type": "github"
}
},
"river-src": {
"flake": false,
"locked": {
"lastModified": 1720674112,
"narHash": "sha256-DIgE19Vo8c6clz2BDHCWkQyu4XegYAh/f6/arLYuVxk=",
"owner": "zoriya",
"repo": "river",
"rev": "7b9b4b6cd6401f7f094dcc19be61069d87fdca5b",
"type": "github"
},
"original": {
"owner": "zoriya",
"repo": "river",
"type": "github"
}
},
"root": {
"inputs": {
"astal-river": "astal-river",
@@ -532,7 +548,8 @@
"nix-index-database": "nix-index-database",
"nixos-hardware": "nixos-hardware",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"river-src": "river-src"
}
},
"systems": {
+8 -2
View File
@@ -4,7 +4,8 @@
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
# url = "github:zoriya/home-manager";
url = "/home/zoriya/projects/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence.url = "github:nix-community/impermanence";
@@ -32,6 +33,10 @@
url = "github:zoriya/astal-river";
inputs.nixpkgs.follows = "nixpkgs";
};
river-src = {
url = "github:zoriya/river";
flake = false;
};
};
outputs = {
@@ -41,6 +46,7 @@
nixpkgs,
ghostty,
flood,
river-src,
impermanence,
nixos-hardware,
nix-index-database,
@@ -58,7 +64,7 @@
(./environments + "/${de}")
{
nixpkgs.overlays = [
(import ./overlays {inherit flood;})
(import ./overlays {inherit flood river-src;})
neovim-nightly.overlays.default
];
}
+16 -2
View File
@@ -1,8 +1,13 @@
{lib, inputs, config,...}: {
{
lib,
inputs,
config,
...
}: {
nix = {
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
@@ -12,6 +17,15 @@
auto-optimise-store = true;
warn-dirty = false;
experimental-features = ["nix-command" "flakes"];
use-xdg-base-directories = true;
substituters = [
"https://nix-community.cachix.org"
"https://ghostty.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns="
];
};
gc = {
automatic = true;
+2
View File
@@ -113,3 +113,5 @@ vim.api.nvim_create_autocmd('TextYankPost', {
})
end,
})
vim.g.zig_fmt_autosave = 0
+55 -1
View File
@@ -88,9 +88,63 @@ in {
];
};
};
systemd.user.services.hypridle = {
systemd.user.services.polkit-gnome-authentication-agent-1 = {
Unit = {
Description = "polkit-gnome-authentication-agent-1";
WantedBy = ["graphical-session.target"];
Wants = ["graphical-session.target"];
After = ["graphical-session.target"];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5 = {
addons = with pkgs; [
fcitx5-mozc
fcitx5-gtk
];
};
};
xdg.configFile."fcitx5/config" = {
force = true;
text = ''
[Hotkey/TriggerKeys]
0=Super+space
[Behavior]
ShowInputMethodInformation=False
CompactInputMethodInformation=False
ShowFirstInputMethodInformation=False
'';
};
xdg.configFile."fcitx5/profile" = {
force = true;
text = ''
[Groups/0]
Name=Default
Default Layout=us
DefaultIM=mozc
[Groups/0/Items/0]
Name=keyboard-us
Layout=
[Groups/0/Items/1]
Name=mozc
Layout=
[GroupOrder]
0=Default
'';
};
}
+9 -1
View File
@@ -1,4 +1,7 @@
{flood}: self: super: let
{
flood,
river-src,
}: self: super: let
wrapProgram = drv: bins: wrapProgramFlags:
super.symlinkJoin {
name = drv.name;
@@ -37,6 +40,11 @@ in {
};
};
river = super.river.overrideAttrs {
src = river-src;
deps = self.callPackage ./river.build.zig.zon.nix { };
};
# Gnome-control-center can only be launched if XDG_CURRENT_DESKTOP is GNOME.
gnome-control-center = wrapProgram super.gnome.gnome-control-center ["gnome-control-center"] "--set XDG_CURRENT_DESKTOP GNOME";
+35
View File
@@ -0,0 +1,35 @@
# generated by zon2nix (https://github.com/nix-community/zon2nix)
{ linkFarm, fetchzip }:
linkFarm "zig-packages" [
{
name = "1220687c8c47a48ba285d26a05600f8700d37fc637e223ced3aa8324f3650bf52242";
path = fetchzip {
url = "https://codeberg.org/ifreund/zig-wayland/archive/v0.2.0.tar.gz";
hash = "sha256-dvit+yvc0MnipqWjxJdfIsA6fJaJZOaIpx4w4woCxbE=";
};
}
{
name = "12208383c1cf42e9b932b90f68cd4f378582cf966355a6377fd8f913852e7bc2d7c6";
path = fetchzip {
url = "https://codeberg.org/ifreund/zig-wlroots/archive/084736cd92364b5fa7d8161611d085ce272fa707.tar.gz";
hash = "sha256-Pf2kiOwavmw4dcXZyRtdp3knhkb9dSbkvBVcQxCP1uo=";
};
}
{
name = "12209db20ce873af176138b76632931def33a10539387cba745db72933c43d274d56";
path = fetchzip {
url = "https://codeberg.org/ifreund/zig-pixman/archive/v0.2.0.tar.gz";
hash = "sha256-zcfZEMnipWDPuptl9UN0PoaJDjy2EHc7Wwi4GQq3hkY=";
};
}
{
name = "1220c90b2228d65fd8427a837d31b0add83e9fade1dcfa539bb56fd06f1f8461605f";
path = fetchzip {
url = "https://codeberg.org/ifreund/zig-xkbcommon/archive/v0.2.0.tar.gz";
hash = "sha256-T+EZiStBfmxFUjaX05WhYkFJ8tRok/UQtpc9QY9NxZk=";
};
}
]