mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 04:19:19 -08:00
style: nix fmt
This commit is contained in:
parent
7913481b66
commit
6e0cc170eb
112 changed files with 1977 additions and 1739 deletions
|
|
@ -10,7 +10,7 @@
|
|||
};
|
||||
systems.url = "github:nix-systems/default";
|
||||
# TODO: https://github.com/catppuccin/nix/issues/601
|
||||
catppuccin.url = "github:catppuccin/nix";#/194881dd2ad6303bc2d49f9ce484d127372d7465";
|
||||
catppuccin.url = "github:catppuccin/nix"; #/194881dd2ad6303bc2d49f9ce484d127372d7465";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
# to allow non-nix 2.4 evaluation
|
||||
flake-compat = {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
inputs.flake-utils.lib.eachDefaultSystem (system: let
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (config.catppuccin) sources;
|
||||
inherit (lib) mkBefore;
|
||||
in {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }: {
|
||||
{pkgs, ...}: {
|
||||
home.pointerCursor = {
|
||||
enable = true;
|
||||
package = pkgs.graphite-cursors;
|
||||
|
|
|
|||
|
|
@ -27,19 +27,19 @@ in {
|
|||
services.swww.enable = true;
|
||||
wayland.windowManager.hyprland = let
|
||||
import-gsettings = pkgs.writeShellScriptBin "import-gsettings" ''
|
||||
# usage: import-gsettings
|
||||
config="''${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini"
|
||||
if [ ! -f "$config" ]; then exit 1; fi
|
||||
# usage: import-gsettings
|
||||
config="''${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini"
|
||||
if [ ! -f "$config" ]; then exit 1; fi
|
||||
|
||||
gnome_schema="org.gnome.desktop.interface"
|
||||
gtk_theme="$(grep 'gtk-theme-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
icon_theme="$(grep 'gtk-icon-theme-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
cursor_theme="$(grep 'gtk-cursor-theme-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
font_name="$(grep 'gtk-font-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
${pkgs.glib}/bin/gsettings set "$gnome_schema" gtk-theme "$gtk_theme"
|
||||
${pkgs.glib}/bin/gsettings set "$gnome_schema" icon-theme "$icon_theme"
|
||||
${pkgs.glib}/bin/gsettings set "$gnome_schema" cursor-theme "$cursor_theme"
|
||||
${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
|
||||
gnome_schema="org.gnome.desktop.interface"
|
||||
gtk_theme="$(grep 'gtk-theme-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
icon_theme="$(grep 'gtk-icon-theme-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
cursor_theme="$(grep 'gtk-cursor-theme-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
font_name="$(grep 'gtk-font-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
${pkgs.glib}/bin/gsettings set "$gnome_schema" gtk-theme "$gtk_theme"
|
||||
${pkgs.glib}/bin/gsettings set "$gnome_schema" icon-theme "$icon_theme"
|
||||
${pkgs.glib}/bin/gsettings set "$gnome_schema" cursor-theme "$cursor_theme"
|
||||
${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
|
||||
'';
|
||||
in {
|
||||
enable = true;
|
||||
|
|
@ -56,12 +56,11 @@ ${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
|
|||
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
|
||||
settings = {
|
||||
# TODO: break it up
|
||||
windowrule = let
|
||||
in [
|
||||
windowrule = [
|
||||
"suppressevent fullscreen, class:steam_app_default"
|
||||
"workspace 2, class:steam_app_default"
|
||||
"suppressevent maximize, class:.*"
|
||||
|
||||
|
||||
"tile, class:battle\.net\.exe"
|
||||
|
||||
"renderunfocused, class:discord, initialTitle:Discord"
|
||||
|
|
@ -87,21 +86,23 @@ ${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
|
|||
++ (list.map (
|
||||
workspace: "${toString workspace},monitor:DP-1${commonOptions}"
|
||||
) (list.range 2 10))
|
||||
++ [ "11,monitor:DP-2,default:true"] ++ (list.map (
|
||||
++ ["11,monitor:DP-2,default:true"]
|
||||
++ (list.map (
|
||||
workspace: "${toString workspace},monitor:DP-2${commonOptions}"
|
||||
) (list.range 12 20));
|
||||
/*list.concat (list.generate (
|
||||
x: let
|
||||
ws = let
|
||||
c = (x + 1) / 10;
|
||||
in
|
||||
builtins.toString (x + 1 - (c * 10));
|
||||
in [
|
||||
"${toString x},monitor:DP-1"
|
||||
"${toString (x + 10)},monitor:DP-2${commonOptions}"
|
||||
]
|
||||
)
|
||||
10);
|
||||
/*
|
||||
list.concat (list.generate (
|
||||
x: let
|
||||
ws = let
|
||||
c = (x + 1) / 10;
|
||||
in
|
||||
builtins.toString (x + 1 - (c * 10));
|
||||
in [
|
||||
"${toString x},monitor:DP-1"
|
||||
"${toString (x + 10)},monitor:DP-2${commonOptions}"
|
||||
]
|
||||
)
|
||||
10);
|
||||
*/
|
||||
env = [
|
||||
"MOZ_ENABLE_WAYLAND,1"
|
||||
|
|
@ -141,9 +142,9 @@ ${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
|
|||
"$mod ALT, mouse:272, resizewindow"
|
||||
];
|
||||
bindl = [
|
||||
", XF86AudioPlay, exec, playerctl play-pause"
|
||||
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
", XF86AudioPlay, exec, playerctl play-pause"
|
||||
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
];
|
||||
binde = [
|
||||
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
|
||||
|
|
@ -155,7 +156,8 @@ ${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
|
|||
uwsmCmd = lib.optionalString parent.programs.uwsm.enable "uwsm app -- ";
|
||||
uwsmApp = cmd: uwsmCmd + cmd;
|
||||
uwsmSingleApp = cmd: "pgrep ${cmd} || ${uwsmCmd + cmd}";
|
||||
in [
|
||||
in
|
||||
[
|
||||
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause"
|
||||
", XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next"
|
||||
|
|
@ -226,9 +228,17 @@ ${pkgs.glib}/bin/gsettings set "$gnome_schema" font-name "$font_name"
|
|||
in [
|
||||
"$mod, ${ws}, workspace, ${toString (x + 1)}"
|
||||
"$mod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}"
|
||||
"$mod, F${if ws == "0" then "10" else ws}, workspace, ${toString (x + 11)}"
|
||||
"$mod SHIFT, F${if ws == "0" then "10" else ws}, movetoworkspacesilent, ${toString (x + 11)}"
|
||||
|
||||
"$mod, F${
|
||||
if ws == "0"
|
||||
then "10"
|
||||
else ws
|
||||
}, workspace, ${toString (x + 11)}"
|
||||
"$mod SHIFT, F${
|
||||
if ws == "0"
|
||||
then "10"
|
||||
else ws
|
||||
}, movetoworkspacesilent, ${toString (x + 11)}"
|
||||
|
||||
"$mod ALT, ${ws}, split-workspace, ${toString (x + 1)}"
|
||||
]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
{ inputs, pkgs, ... }: {
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
package = inputs.hyprlock.packages.${pkgs.system}.hyprlock;
|
||||
|
|
|
|||
|
|
@ -3,136 +3,136 @@ _: {
|
|||
enable = true;
|
||||
systemd.enable = true;
|
||||
style = ''
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: Monaspace Krypton, monospace;
|
||||
font-size: 13px;
|
||||
min-height: 0;
|
||||
}
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: Monaspace Krypton, monospace;
|
||||
font-size: 13px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
all:unset;
|
||||
}
|
||||
window#waybar {
|
||||
all:unset;
|
||||
}
|
||||
|
||||
|
||||
.modules-left, .modules-right, .modules-center {
|
||||
background: alpha(@base, 0.9);
|
||||
box-shadow: 0px 0px 2px rgba(0,0,0,0.6);
|
||||
color: @text;
|
||||
padding: 5px;
|
||||
margin: 2px 4px;
|
||||
border: 1px solid @lavender;
|
||||
}
|
||||
.modules-left, .modules-right, .modules-center {
|
||||
background: alpha(@base, 0.9);
|
||||
box-shadow: 0px 0px 2px rgba(0,0,0,0.6);
|
||||
color: @text;
|
||||
padding: 5px;
|
||||
margin: 2px 4px;
|
||||
border: 1px solid @lavender;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
background: rgba(43, 48, 59, 0.5);
|
||||
border: 1px solid rgba(100, 114, 125, 0.5);
|
||||
}
|
||||
tooltip label {
|
||||
color: white;
|
||||
}
|
||||
tooltip {
|
||||
background: rgba(43, 48, 59, 0.5);
|
||||
border: 1px solid rgba(100, 114, 125, 0.5);
|
||||
}
|
||||
tooltip label {
|
||||
color: white;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
border-right: 1px solid @surface2;
|
||||
}
|
||||
#workspaces {
|
||||
border-right: 1px solid @surface2;
|
||||
}
|
||||
|
||||
|
||||
#workspaces button.persistent {
|
||||
background: @theme_unfocused_bg_color;
|
||||
color: @subtext1;
|
||||
}
|
||||
#workspaces button.persistent {
|
||||
background: @theme_unfocused_bg_color;
|
||||
color: @subtext1;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 2px 5px;
|
||||
background: @surface0;
|
||||
border-bottom: 3px solid transparent;
|
||||
}
|
||||
#workspaces button {
|
||||
padding: 2px 5px;
|
||||
background: @surface0;
|
||||
border-bottom: 3px solid transparent;
|
||||
}
|
||||
|
||||
#workspaces button.empty {
|
||||
background: @crust;
|
||||
color: @subtext1;
|
||||
}
|
||||
#workspaces button.empty {
|
||||
background: @crust;
|
||||
color: @subtext1;
|
||||
}
|
||||
|
||||
#workspaces button.visible {
|
||||
background: @pink;
|
||||
color: @theme_selected_fg_color;
|
||||
border-bottom: 3px solid @rosewater;
|
||||
}
|
||||
#workspaces button.visible {
|
||||
background: @pink;
|
||||
color: @theme_selected_fg_color;
|
||||
border-bottom: 3px solid @rosewater;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background: @red;
|
||||
color: @theme_selected_fg_color;
|
||||
}
|
||||
#workspaces button.urgent {
|
||||
background: @red;
|
||||
color: @theme_selected_fg_color;
|
||||
}
|
||||
|
||||
#workspaces button.active, #workspaces button.focused {
|
||||
background: @theme_selected_bg_color;
|
||||
color: @theme_selected_fg_color;
|
||||
border-bottom: 3px solid white;
|
||||
}
|
||||
#workspaces button.active, #workspaces button.focused {
|
||||
background: @theme_selected_bg_color;
|
||||
color: @theme_selected_fg_color;
|
||||
border-bottom: 3px solid white;
|
||||
}
|
||||
|
||||
#window {
|
||||
padding: 0 10px;
|
||||
}
|
||||
#window {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
window#waybar.empty #window {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
window#waybar.empty #window {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#mode, #clock, #battery, #idle_inhibitor, #tray, #wireplumber, #bluetooth, #backlight, #mpris {
|
||||
padding: 0 5px;
|
||||
margin: 0 5px;
|
||||
}
|
||||
#mode, #clock, #battery, #idle_inhibitor, #tray, #wireplumber, #bluetooth, #backlight, #mpris {
|
||||
padding: 0 5px;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
#mpris {
|
||||
color: @mantle;
|
||||
}
|
||||
#mpris {
|
||||
color: @mantle;
|
||||
}
|
||||
|
||||
#mpris.playing {
|
||||
background-color: @lavender;
|
||||
}
|
||||
#mpris.playing {
|
||||
background-color: @lavender;
|
||||
}
|
||||
|
||||
#mpris.paused {
|
||||
background-color: @mauve;
|
||||
}
|
||||
#mpris.paused {
|
||||
background-color: @mauve;
|
||||
}
|
||||
|
||||
#mpris.stopped {
|
||||
background-color: @rosewater;
|
||||
}
|
||||
#mpris.stopped {
|
||||
background-color: @rosewater;
|
||||
}
|
||||
|
||||
#mode {
|
||||
background: #64727D;
|
||||
border-bottom: 3px solid white;
|
||||
}
|
||||
#mode {
|
||||
background: #64727D;
|
||||
border-bottom: 3px solid white;
|
||||
}
|
||||
|
||||
#clock {
|
||||
}
|
||||
#clock {
|
||||
}
|
||||
|
||||
#battery {
|
||||
}
|
||||
#battery {
|
||||
}
|
||||
|
||||
#battery.charging {
|
||||
color: white;
|
||||
background-color: #26A65B;
|
||||
}
|
||||
#battery.charging {
|
||||
color: white;
|
||||
background-color: #26A65B;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #ffffff;
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #ffffff;
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
|
||||
#battery.warning:not(.charging) {
|
||||
background: #f53c3c;
|
||||
color: white;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: steps(12);
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
#battery.warning:not(.charging) {
|
||||
background: #f53c3c;
|
||||
color: white;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: steps(12);
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
'';
|
||||
settings.main = {
|
||||
layer = "top";
|
||||
|
|
@ -150,7 +150,6 @@ window#waybar.empty #window {
|
|||
"mpris"
|
||||
];
|
||||
|
||||
|
||||
modules-right = [
|
||||
"privacy"
|
||||
"bluetooth"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
{ config, lib, ... }: let
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (config.catppuccin) sources;
|
||||
inherit (lib) mkBefore;
|
||||
cfg = config.catppuccin.sway;
|
||||
theme = "${sources.sway}/catppuccin-${cfg.flavor}";
|
||||
in {
|
||||
xsession.windowManager.i3.extraConfigEarly = ''
|
||||
xsession.windowManager.i3.extraConfigEarly = ''
|
||||
${builtins.readFile theme}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
std,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
pkgs,
|
||||
lib,
|
||||
std,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (std) list;
|
||||
inherit (lib.modules) mkMerge;
|
||||
inherit (lib) mkOptionDefault mkDefault mapAttrs;
|
||||
inherit (lib) mkDefault mapAttrs;
|
||||
in {
|
||||
home.packages = with pkgs; [
|
||||
maim
|
||||
|
|
@ -18,42 +17,46 @@ in {
|
|||
];
|
||||
services.i3gopher.enable = true;
|
||||
xsession.windowManager.i3 = let
|
||||
modifier = "Mod4";
|
||||
other_modifier = "Mod1";
|
||||
mod = modifier;
|
||||
mod2 = other_modifier;
|
||||
runCommand = "${config.programs.rofi.finalPackage}/bin/rofi -show combi -modes combi";
|
||||
workspaceNames = {
|
||||
"1" = " Term";
|
||||
"2" = " GW2";
|
||||
"3" = " GW1";
|
||||
"4" = " Web";
|
||||
"11" = " IM";
|
||||
"12" = " Web";
|
||||
"13" = " Media";
|
||||
"14" = " Music";
|
||||
};
|
||||
workspaceNamer = num: let
|
||||
numStr = builtins.toString num;
|
||||
in if workspaceNames ? ${numStr} then "${numStr}:${workspaceNames.${numStr}}" else "${numStr}:${numStr}";
|
||||
modifier = "Mod4";
|
||||
other_modifier = "Mod1";
|
||||
mod = modifier;
|
||||
mod2 = other_modifier;
|
||||
runCommand = "${config.programs.rofi.finalPackage}/bin/rofi -show combi -modes combi";
|
||||
workspaceNames = {
|
||||
"1" = " Term";
|
||||
"2" = " GW2";
|
||||
"3" = " GW1";
|
||||
"4" = " Web";
|
||||
"11" = " IM";
|
||||
"12" = " Web";
|
||||
"13" = " Media";
|
||||
"14" = " Music";
|
||||
};
|
||||
workspaceNamer = num: let
|
||||
numStr = builtins.toString num;
|
||||
in
|
||||
if workspaceNames ? ${numStr}
|
||||
then "${numStr}:${workspaceNames.${numStr}}"
|
||||
else "${numStr}:${numStr}";
|
||||
|
||||
lockCommand = "sh -c '${pkgs.i3lock-fancy-rapid}/bin/i3lock 5 3 & sleep 5 && xset dpms force off'";
|
||||
lockCommand = "sh -c '${pkgs.i3lock-fancy-rapid}/bin/i3lock 5 3 & sleep 5 && xset dpms force off'";
|
||||
|
||||
actionMode = "(l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown";
|
||||
gapsMode = "Gaps: (o) outer, (i) inner";
|
||||
gapsOuterMode = "Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)";
|
||||
gapsInnerMode = "Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)";
|
||||
in {
|
||||
actionMode = "(l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown";
|
||||
gapsMode = "Gaps: (o) outer, (i) inner";
|
||||
gapsOuterMode = "Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)";
|
||||
gapsInnerMode = "Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)";
|
||||
in {
|
||||
enable = true;
|
||||
extraConfig = let
|
||||
displayWorkspace = display: workspace: ''
|
||||
workspace "${workspaceNamer (builtins.toString workspace)}" output ${display}
|
||||
'';
|
||||
displayBindings = list.map (v: displayWorkspace "DP-2" v) (list.range 1 9)
|
||||
++ [ (displayWorkspace "DP-2" 10) ]
|
||||
++ list.map (v: displayWorkspace "HDMI-0" (11+v)) (list.range 1 12);
|
||||
displayBindingsStr = lib.concatLines displayBindings;
|
||||
in ''
|
||||
displayWorkspace = display: workspace: ''
|
||||
workspace "${workspaceNamer (builtins.toString workspace)}" output ${display}
|
||||
'';
|
||||
displayBindings =
|
||||
list.map (v: displayWorkspace "DP-2" v) (list.range 1 9)
|
||||
++ [(displayWorkspace "DP-2" 10)]
|
||||
++ list.map (v: displayWorkspace "HDMI-0" (11 + v)) (list.range 1 12);
|
||||
displayBindingsStr = lib.concatLines displayBindings;
|
||||
in ''
|
||||
${displayBindingsStr}
|
||||
for_window [class="^steam_app_default$"] floating enable, fullscreen disable, resize set width 3840 px height 2132 px, move position center, border pixel 1
|
||||
'';
|
||||
|
|
@ -70,8 +73,14 @@ in {
|
|||
};
|
||||
|
||||
startup = [
|
||||
{ command = "~/.screenlayout/main.sh"; notification = false; }
|
||||
{ command = "blueman-applet"; notification = false; }
|
||||
{
|
||||
command = "~/.screenlayout/main.sh";
|
||||
notification = false;
|
||||
}
|
||||
{
|
||||
command = "blueman-applet";
|
||||
notification = false;
|
||||
}
|
||||
];
|
||||
|
||||
keybindings = let
|
||||
|
|
@ -107,7 +116,8 @@ in {
|
|||
"${mod}+Shift+g" = ''mode "${gapsMode}"'';
|
||||
"${mod}+Delete" = ''mode "${actionMode}"'';
|
||||
};
|
||||
in mkMerge (map mapDefaultAttrs ([ normalBindings ] ++ workspaceBindings));
|
||||
in
|
||||
mkMerge (map mapDefaultAttrs ([normalBindings] ++ workspaceBindings));
|
||||
|
||||
assigns = {
|
||||
${workspaceNamer 2} = [
|
||||
|
|
@ -255,7 +265,7 @@ in {
|
|||
focusedStatusline = "$text";
|
||||
focusedSeparator = "$base";
|
||||
focusedWorkspace = {
|
||||
border ="$base";
|
||||
border = "$base";
|
||||
background = "$mauve";
|
||||
text = "$crust";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }: {
|
||||
{pkgs, ...}: {
|
||||
programs.i3status-rust = {
|
||||
enable = true;
|
||||
bars = {
|
||||
|
|
@ -13,61 +13,61 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
blocks = [
|
||||
{
|
||||
block = "cpu";
|
||||
interval = 1;
|
||||
}
|
||||
{
|
||||
block = "load";
|
||||
interval = 1;
|
||||
format = " $icon $1m ";
|
||||
}
|
||||
{
|
||||
block = "memory";
|
||||
format = " $icon $mem_used_percents.eng(w:2) $zram_comp_ratio ";
|
||||
}
|
||||
{
|
||||
block = "memory";
|
||||
format = " $icon_swap $swap_used_percents.eng(w:2) ";
|
||||
}
|
||||
{
|
||||
block = "nvidia_gpu";
|
||||
format = " $icon $utilization $memory $temperature ";
|
||||
}
|
||||
{
|
||||
block = "hueshift";
|
||||
}
|
||||
{
|
||||
block = "music";
|
||||
format = " $icon {$combo.str(max_w:60) $play |}";
|
||||
}
|
||||
{
|
||||
block = "sound";
|
||||
format = " $icon {$volume.eng(w:2) |}";
|
||||
}
|
||||
{
|
||||
block = "notify";
|
||||
format = " $icon {($notification_count.eng(w:1)) |}";
|
||||
}
|
||||
{
|
||||
block = "toggle";
|
||||
command_on = "${pkgs.xorg.xset}/bin/xset -dpms";
|
||||
command_off = "${pkgs.xorg.xset}/bin/xset +dpms";
|
||||
format = " $icon DPMS ";
|
||||
command_state = ''${pkgs.xorg.xset}/bin/xset q | ${pkgs.gnugrep}/bin/grep -F "DPMS is Disabled"'';
|
||||
icon_on = "caffeine_on";
|
||||
icon_off = "caffeine_off";
|
||||
state_on = "info";
|
||||
}
|
||||
{
|
||||
block = "time";
|
||||
interval = 1;
|
||||
format = " $icon $timestamp.datetime(f:'%F %T %Z') ";
|
||||
}
|
||||
];
|
||||
blocks = [
|
||||
{
|
||||
block = "cpu";
|
||||
interval = 1;
|
||||
}
|
||||
{
|
||||
block = "load";
|
||||
interval = 1;
|
||||
format = " $icon $1m ";
|
||||
}
|
||||
{
|
||||
block = "memory";
|
||||
format = " $icon $mem_used_percents.eng(w:2) $zram_comp_ratio ";
|
||||
}
|
||||
{
|
||||
block = "memory";
|
||||
format = " $icon_swap $swap_used_percents.eng(w:2) ";
|
||||
}
|
||||
{
|
||||
block = "nvidia_gpu";
|
||||
format = " $icon $utilization $memory $temperature ";
|
||||
}
|
||||
{
|
||||
block = "hueshift";
|
||||
}
|
||||
{
|
||||
block = "music";
|
||||
format = " $icon {$combo.str(max_w:60) $play |}";
|
||||
}
|
||||
{
|
||||
block = "sound";
|
||||
format = " $icon {$volume.eng(w:2) |}";
|
||||
}
|
||||
{
|
||||
block = "notify";
|
||||
format = " $icon {($notification_count.eng(w:1)) |}";
|
||||
}
|
||||
{
|
||||
block = "toggle";
|
||||
command_on = "${pkgs.xorg.xset}/bin/xset -dpms";
|
||||
command_off = "${pkgs.xorg.xset}/bin/xset +dpms";
|
||||
format = " $icon DPMS ";
|
||||
command_state = ''${pkgs.xorg.xset}/bin/xset q | ${pkgs.gnugrep}/bin/grep -F "DPMS is Disabled"'';
|
||||
icon_on = "caffeine_on";
|
||||
icon_off = "caffeine_off";
|
||||
state_on = "info";
|
||||
}
|
||||
{
|
||||
block = "time";
|
||||
interval = 1;
|
||||
format = " $icon $timestamp.datetime(f:'%F %T %Z') ";
|
||||
}
|
||||
];
|
||||
theme = "ctp-latte";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
{ pkgs, config, ... }: {
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
home.packages = [
|
||||
config.programs.rofi.finalPackage
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
{pkgs, ...}: {
|
||||
_: {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
libksysguard
|
||||
systemsettings
|
||||
kcmutils
|
||||
pkgs.plasma-applet-commandoutput
|
||||
pkgs.plasma-applet-commandoutput
|
||||
];
|
||||
programs.plasma = {
|
||||
configFile = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{ pkgs, config, ... }: {
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.niri.settings.spawn-at-startup = let
|
||||
import-gsettings = pkgs.writeShellScriptBin "import-gsettings" ''
|
||||
# usage: import-gsettings
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ config, ... }: {
|
||||
{config, ...}: {
|
||||
services.avizo = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
|
|||
|
|
@ -1,145 +1,155 @@
|
|||
{ config, pkgs, lib, std, ... }: let
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
std,
|
||||
...
|
||||
}: let
|
||||
inherit (std) list;
|
||||
inherit (lib.modules) mkMerge;
|
||||
in {
|
||||
programs.niri.settings.binds = let
|
||||
bindWorkspace = key: workspace: {
|
||||
"Mod+${key}".action.focus-workspace = workspace;
|
||||
"Mod+Ctrl+${key}".action.move-column-to-workspace = workspace;
|
||||
};
|
||||
workspaceBindings =
|
||||
list.map (v: bindWorkspace (builtins.toString v) v) (list.range 1 9)
|
||||
++ [
|
||||
(
|
||||
bindWorkspace "0" 10
|
||||
)
|
||||
];
|
||||
in mkMerge (workspaceBindings ++ [{
|
||||
# Transcribed: https://github.com/sodiboo/niri-flake/issues/483
|
||||
# thank you Pacman99 you chad :3
|
||||
"Mod+Q".action.close-window = {};
|
||||
"Mod+O".action.toggle-overview = {};
|
||||
bindWorkspace = key: workspace: {
|
||||
"Mod+${key}".action.focus-workspace = workspace;
|
||||
"Mod+Ctrl+${key}".action.move-column-to-workspace = workspace;
|
||||
};
|
||||
workspaceBindings =
|
||||
list.map (v: bindWorkspace (builtins.toString v) v) (list.range 1 9)
|
||||
++ [
|
||||
(
|
||||
bindWorkspace "0" 10
|
||||
)
|
||||
];
|
||||
in
|
||||
mkMerge (workspaceBindings
|
||||
++ [
|
||||
{
|
||||
# Transcribed: https://github.com/sodiboo/niri-flake/issues/483
|
||||
# thank you Pacman99 you chad :3
|
||||
"Mod+Q".action.close-window = {};
|
||||
"Mod+O".action.toggle-overview = {};
|
||||
|
||||
"Mod+Left".action.focus-column-left = {};
|
||||
"Mod+Down".action.focus-window-down = {};
|
||||
"Mod+Up".action.focus-window-up = {};
|
||||
"Mod+Right".action.focus-column-right = {};
|
||||
"Mod+H".action.focus-column-left = {};
|
||||
"Mod+J".action.focus-window-down = {};
|
||||
"Mod+K".action.focus-window-up = {};
|
||||
"Mod+L".action.focus-column-right = {};
|
||||
"Mod+Left".action.focus-column-left = {};
|
||||
"Mod+Down".action.focus-window-down = {};
|
||||
"Mod+Up".action.focus-window-up = {};
|
||||
"Mod+Right".action.focus-column-right = {};
|
||||
"Mod+H".action.focus-column-left = {};
|
||||
"Mod+J".action.focus-window-down = {};
|
||||
"Mod+K".action.focus-window-up = {};
|
||||
"Mod+L".action.focus-column-right = {};
|
||||
|
||||
"Mod+Ctrl+Left".action.move-column-left = {};
|
||||
"Mod+Ctrl+Down".action.move-window-down = {};
|
||||
"Mod+Ctrl+Up".action.move-window-up = {};
|
||||
"Mod+Ctrl+Right".action.move-column-right = {};
|
||||
"Mod+Ctrl+H".action.move-column-left = {};
|
||||
"Mod+Ctrl+J".action.move-window-down = {};
|
||||
"Mod+Ctrl+K".action.move-window-up = {};
|
||||
"Mod+Ctrl+L".action.move-column-right = {};
|
||||
"Mod+Ctrl+Left".action.move-column-left = {};
|
||||
"Mod+Ctrl+Down".action.move-window-down = {};
|
||||
"Mod+Ctrl+Up".action.move-window-up = {};
|
||||
"Mod+Ctrl+Right".action.move-column-right = {};
|
||||
"Mod+Ctrl+H".action.move-column-left = {};
|
||||
"Mod+Ctrl+J".action.move-window-down = {};
|
||||
"Mod+Ctrl+K".action.move-window-up = {};
|
||||
"Mod+Ctrl+L".action.move-column-right = {};
|
||||
|
||||
"Mod+Home".action.focus-column-first = {};
|
||||
"Mod+End".action.focus-column-last = {};
|
||||
"Mod+Ctrl+Home".action.move-column-to-first = {};
|
||||
"Mod+Ctrl+End".action.move-column-to-last = {};
|
||||
"Mod+Home".action.focus-column-first = {};
|
||||
"Mod+End".action.focus-column-last = {};
|
||||
"Mod+Ctrl+Home".action.move-column-to-first = {};
|
||||
"Mod+Ctrl+End".action.move-column-to-last = {};
|
||||
|
||||
"Mod+Shift+Left".action.focus-monitor-left = {};
|
||||
"Mod+Shift+Down".action.focus-monitor-down = {};
|
||||
"Mod+Shift+Up".action.focus-monitor-up = {};
|
||||
"Mod+Shift+Right".action.focus-monitor-right = {};
|
||||
"Mod+Shift+H".action.focus-monitor-left = {};
|
||||
"Mod+Shift+J".action.focus-monitor-down = {};
|
||||
"Mod+Shift+K".action.focus-monitor-up = {};
|
||||
"Mod+Shift+L".action.focus-monitor-right = {};
|
||||
"Mod+Shift+Left".action.focus-monitor-left = {};
|
||||
"Mod+Shift+Down".action.focus-monitor-down = {};
|
||||
"Mod+Shift+Up".action.focus-monitor-up = {};
|
||||
"Mod+Shift+Right".action.focus-monitor-right = {};
|
||||
"Mod+Shift+H".action.focus-monitor-left = {};
|
||||
"Mod+Shift+J".action.focus-monitor-down = {};
|
||||
"Mod+Shift+K".action.focus-monitor-up = {};
|
||||
"Mod+Shift+L".action.focus-monitor-right = {};
|
||||
|
||||
"Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = {};
|
||||
"Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = {};
|
||||
"Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = {};
|
||||
"Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = {};
|
||||
"Mod+Shift+Ctrl+H".action.move-column-to-monitor-left = {};
|
||||
"Mod+Shift+Ctrl+J".action.move-column-to-monitor-down = {};
|
||||
"Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = {};
|
||||
"Mod+Shift+Ctrl+L".action.move-column-to-monitor-right = {};
|
||||
"Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = {};
|
||||
"Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = {};
|
||||
"Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = {};
|
||||
"Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = {};
|
||||
"Mod+Shift+Ctrl+H".action.move-column-to-monitor-left = {};
|
||||
"Mod+Shift+Ctrl+J".action.move-column-to-monitor-down = {};
|
||||
"Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = {};
|
||||
"Mod+Shift+Ctrl+L".action.move-column-to-monitor-right = {};
|
||||
|
||||
"Mod+Page_Down".action.focus-workspace-down = {};
|
||||
"Mod+Page_Up".action.focus-workspace-up = {};
|
||||
"Mod+U".action.focus-workspace-down = {};
|
||||
"Mod+I".action.focus-workspace-up = {};
|
||||
"Mod+Ctrl+Page_Down".action.move-column-to-workspace-down = {};
|
||||
"Mod+Ctrl+Page_Up".action.move-column-to-workspace-up = {};
|
||||
"Mod+Ctrl+U".action.move-column-to-workspace-down = {};
|
||||
"Mod+Ctrl+I".action.move-column-to-workspace-up = {};
|
||||
"Mod+Page_Down".action.focus-workspace-down = {};
|
||||
"Mod+Page_Up".action.focus-workspace-up = {};
|
||||
"Mod+U".action.focus-workspace-down = {};
|
||||
"Mod+I".action.focus-workspace-up = {};
|
||||
"Mod+Ctrl+Page_Down".action.move-column-to-workspace-down = {};
|
||||
"Mod+Ctrl+Page_Up".action.move-column-to-workspace-up = {};
|
||||
"Mod+Ctrl+U".action.move-column-to-workspace-down = {};
|
||||
"Mod+Ctrl+I".action.move-column-to-workspace-up = {};
|
||||
|
||||
"Mod+Shift+Page_Down".action.move-workspace-down = {};
|
||||
"Mod+Shift+Page_Up".action.move-workspace-up = {};
|
||||
"Mod+Shift+U".action.move-workspace-down = {};
|
||||
"Mod+Shift+I".action.move-workspace-up = {};
|
||||
"Mod+Shift+Page_Down".action.move-workspace-down = {};
|
||||
"Mod+Shift+Page_Up".action.move-workspace-up = {};
|
||||
"Mod+Shift+U".action.move-workspace-down = {};
|
||||
"Mod+Shift+I".action.move-workspace-up = {};
|
||||
|
||||
"Mod+WheelScrollDown" = {
|
||||
cooldown-ms = 150;
|
||||
action.focus-workspace-down = {};
|
||||
};
|
||||
"Mod+WheelScrollUp" = {
|
||||
cooldown-ms = 150;
|
||||
action.focus-workspace-up = {};
|
||||
};
|
||||
"Mod+Ctrl+WheelScrollDown" = {
|
||||
cooldown-ms = 150;
|
||||
action.move-column-to-workspace-down = {};
|
||||
};
|
||||
"Mod+Ctrl+WheelScrollUp" = {
|
||||
cooldown-ms = 150;
|
||||
action.move-column-to-workspace-up = {};
|
||||
};
|
||||
"Mod+WheelScrollDown" = {
|
||||
cooldown-ms = 150;
|
||||
action.focus-workspace-down = {};
|
||||
};
|
||||
"Mod+WheelScrollUp" = {
|
||||
cooldown-ms = 150;
|
||||
action.focus-workspace-up = {};
|
||||
};
|
||||
"Mod+Ctrl+WheelScrollDown" = {
|
||||
cooldown-ms = 150;
|
||||
action.move-column-to-workspace-down = {};
|
||||
};
|
||||
"Mod+Ctrl+WheelScrollUp" = {
|
||||
cooldown-ms = 150;
|
||||
action.move-column-to-workspace-up = {};
|
||||
};
|
||||
|
||||
"Mod+WheelScrollRight".action.focus-column-right = {};
|
||||
"Mod+WheelScrollLeft".action.focus-column-left = {};
|
||||
"Mod+Ctrl+WheelScrollRight".action.move-column-right = {};
|
||||
"Mod+Ctrl+WheelScrollLeft".action.move-column-left = {};
|
||||
"Mod+WheelScrollRight".action.focus-column-right = {};
|
||||
"Mod+WheelScrollLeft".action.focus-column-left = {};
|
||||
"Mod+Ctrl+WheelScrollRight".action.move-column-right = {};
|
||||
"Mod+Ctrl+WheelScrollLeft".action.move-column-left = {};
|
||||
|
||||
"Mod+Shift+WheelScrollDown".action.focus-column-right = {};
|
||||
"Mod+Shift+WheelScrollUp".action.focus-column-left = {};
|
||||
"Mod+Ctrl+Shift+WheelScrollDown".action.move-column-right = {};
|
||||
"Mod+Ctrl+Shift+WheelScrollUp".action.move-column-left = {};
|
||||
"Mod+Shift+WheelScrollDown".action.focus-column-right = {};
|
||||
"Mod+Shift+WheelScrollUp".action.focus-column-left = {};
|
||||
"Mod+Ctrl+Shift+WheelScrollDown".action.move-column-right = {};
|
||||
"Mod+Ctrl+Shift+WheelScrollUp".action.move-column-left = {};
|
||||
|
||||
"Mod+Comma".action.consume-window-into-column = {};
|
||||
"Mod+Period".action.expel-window-from-column = {};
|
||||
"Mod+Comma".action.consume-window-into-column = {};
|
||||
"Mod+Period".action.expel-window-from-column = {};
|
||||
|
||||
"Mod+R".action.switch-preset-column-width = {};
|
||||
"Mod+Shift+R".action.reset-window-height = {};
|
||||
"Mod+F".action.maximize-column = {};
|
||||
"Mod+Shift+F".action.fullscreen-window = {};
|
||||
"Mod+C".action.center-column = {};
|
||||
"Mod+R".action.switch-preset-column-width = {};
|
||||
"Mod+Shift+R".action.reset-window-height = {};
|
||||
"Mod+F".action.maximize-column = {};
|
||||
"Mod+Shift+F".action.fullscreen-window = {};
|
||||
"Mod+C".action.center-column = {};
|
||||
|
||||
"Mod+Minus".action.set-column-width = "-10%";
|
||||
"Mod+Equal".action.set-column-width = "+10%";
|
||||
"Mod+Minus".action.set-column-width = "-10%";
|
||||
"Mod+Equal".action.set-column-width = "+10%";
|
||||
|
||||
"Mod+Shift+Minus".action.set-window-height = "-10%";
|
||||
"Mod+Shift+Equal".action.set-window-height = "+10%";
|
||||
"Mod+Shift+Minus".action.set-window-height = "-10%";
|
||||
"Mod+Shift+Equal".action.set-window-height = "+10%";
|
||||
|
||||
"Print".action.screenshot = {};
|
||||
"Ctrl+Print".action.screenshot-screen = {};
|
||||
"Alt+Print".action.screenshot-window = {};
|
||||
"Print".action.screenshot = {};
|
||||
"Ctrl+Print".action.screenshot-screen = {};
|
||||
"Alt+Print".action.screenshot-window = {};
|
||||
|
||||
# The quit action will show a confirmation dialog to avoid accidental exits.
|
||||
"Mod+Shift+E".action.quit = {};
|
||||
# The quit action will show a confirmation dialog to avoid accidental exits.
|
||||
"Mod+Shift+E".action.quit = {};
|
||||
|
||||
# Powers off the monitors. To turn them back on, do any input like
|
||||
# moving the mouse or pressing any other key.
|
||||
"Mod+Shift+P".action.power-off-monitors = {};
|
||||
# Powers off the monitors. To turn them back on, do any input like
|
||||
# moving the mouse or pressing any other key.
|
||||
"Mod+Shift+P".action.power-off-monitors = {};
|
||||
|
||||
# Kat
|
||||
"XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"];
|
||||
"XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"];
|
||||
"XF86AudioMute".action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"];
|
||||
"XF86AudioPlay".action.spawn = ["${pkgs.playerctl}/bin/playerctl" "play-pause"];
|
||||
"XF86AudioNext".action.spawn = ["${pkgs.playerctl}/bin/playerctl" "next"];
|
||||
"XF86AudioPrev".action.spawn = ["${pkgs.playerctl}/bin/playerctl" "prev"];
|
||||
"Mod+T".action.spawn = ["${config.programs.wezterm.package}/bin/wezterm"];
|
||||
"Mod+D".action.spawn = ["${config.programs.wofi.package}/bin/wofi" "-t" "wezterm" "-IS" "drun"];
|
||||
"Mod+Shift+D".action.spawn = ["${config.programs.wofi.package}/bin/wofi" "-t" "wezterm" "-IS" "run"];
|
||||
"Mod+Escape".action.spawn = ["${config.programs.wlogout.package}/bin/wlogout" "-p" "layer-shell"];
|
||||
"Mod+Shift+Escape".action.spawn = ["${config.programs.swaylock.package}/bin/swaylock" "-f"];
|
||||
#"Print".action.spawn = ["${pkgs.grimblast}/bin/grimblast" "copy" "area"];
|
||||
}]);
|
||||
# Kat
|
||||
"XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"];
|
||||
"XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"];
|
||||
"XF86AudioMute".action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"];
|
||||
"XF86AudioPlay".action.spawn = ["${pkgs.playerctl}/bin/playerctl" "play-pause"];
|
||||
"XF86AudioNext".action.spawn = ["${pkgs.playerctl}/bin/playerctl" "next"];
|
||||
"XF86AudioPrev".action.spawn = ["${pkgs.playerctl}/bin/playerctl" "prev"];
|
||||
"Mod+T".action.spawn = ["${config.programs.wezterm.package}/bin/wezterm"];
|
||||
"Mod+D".action.spawn = ["${config.programs.wofi.package}/bin/wofi" "-t" "wezterm" "-IS" "drun"];
|
||||
"Mod+Shift+D".action.spawn = ["${config.programs.wofi.package}/bin/wofi" "-t" "wezterm" "-IS" "run"];
|
||||
"Mod+Escape".action.spawn = ["${config.programs.wlogout.package}/bin/wlogout" "-p" "layer-shell"];
|
||||
"Mod+Shift+Escape".action.spawn = ["${config.programs.swaylock.package}/bin/swaylock" "-f"];
|
||||
#"Print".action.spawn = ["${pkgs.grimblast}/bin/grimblast" "copy" "area"];
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{ config, pkgs, ... }: {
|
||||
{
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
catppuccin.cursors.enable = true;
|
||||
home.pointerCursor = {
|
||||
dotIcons.enable = true;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
...
|
||||
}: let
|
||||
inherit (config.base16) palette;
|
||||
inherit (lib.modules) mkForce;
|
||||
in {
|
||||
systemd.user.services = {
|
||||
mako = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
{ config, pkgs, lib, ... }: let
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
in {
|
||||
home.packages = with pkgs; [
|
||||
|
|
@ -35,15 +40,15 @@ in {
|
|||
};
|
||||
focus-follows-mouse.enable = true;
|
||||
};
|
||||
layout = {
|
||||
layout = {
|
||||
background-color = config.palette.base.hex;
|
||||
gaps = 10;
|
||||
always-center-single-column = true;
|
||||
preset-column-widths = [
|
||||
{ proportion = 0.33333; }
|
||||
{ proportion = 0.5; }
|
||||
{ proportion = 0.66667; }
|
||||
{ proportion = 1.0; }
|
||||
{proportion = 0.33333;}
|
||||
{proportion = 0.5;}
|
||||
{proportion = 0.66667;}
|
||||
{proportion = 1.0;}
|
||||
];
|
||||
default-column-width = {
|
||||
proportion = 1.0;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
{ pkgs, config, ... }: {
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
services.swayidle = {
|
||||
enable = true;
|
||||
timeouts = [
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }: {
|
||||
{pkgs, ...}: {
|
||||
programs.swaylock = {
|
||||
enable = true;
|
||||
package = pkgs.swaylock-effects;
|
||||
|
|
|
|||
|
|
@ -3,136 +3,136 @@ _: {
|
|||
enable = true;
|
||||
systemd.enable = true;
|
||||
style = ''
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: Monaspace Krypton, monospace;
|
||||
font-size: 13px;
|
||||
min-height: 0;
|
||||
}
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: Monaspace Krypton, monospace;
|
||||
font-size: 13px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
all:unset;
|
||||
}
|
||||
window#waybar {
|
||||
all:unset;
|
||||
}
|
||||
|
||||
|
||||
.modules-left, .modules-right, .modules-center {
|
||||
background: alpha(@base, 0.9);
|
||||
box-shadow: 0px 0px 2px rgba(0,0,0,0.6);
|
||||
color: @text;
|
||||
padding: 5px;
|
||||
margin: 2px 4px;
|
||||
border: 1px solid @lavender;
|
||||
}
|
||||
.modules-left, .modules-right, .modules-center {
|
||||
background: alpha(@base, 0.9);
|
||||
box-shadow: 0px 0px 2px rgba(0,0,0,0.6);
|
||||
color: @text;
|
||||
padding: 5px;
|
||||
margin: 2px 4px;
|
||||
border: 1px solid @lavender;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
background: rgba(43, 48, 59, 0.5);
|
||||
border: 1px solid rgba(100, 114, 125, 0.5);
|
||||
}
|
||||
tooltip label {
|
||||
color: white;
|
||||
}
|
||||
tooltip {
|
||||
background: rgba(43, 48, 59, 0.5);
|
||||
border: 1px solid rgba(100, 114, 125, 0.5);
|
||||
}
|
||||
tooltip label {
|
||||
color: white;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
border-right: 1px solid @surface2;
|
||||
}
|
||||
#workspaces {
|
||||
border-right: 1px solid @surface2;
|
||||
}
|
||||
|
||||
|
||||
#workspaces button.persistent {
|
||||
background: @theme_unfocused_bg_color;
|
||||
color: @subtext1;
|
||||
}
|
||||
#workspaces button.persistent {
|
||||
background: @theme_unfocused_bg_color;
|
||||
color: @subtext1;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 2px 5px;
|
||||
background: @surface0;
|
||||
border-bottom: 3px solid transparent;
|
||||
}
|
||||
#workspaces button {
|
||||
padding: 2px 5px;
|
||||
background: @surface0;
|
||||
border-bottom: 3px solid transparent;
|
||||
}
|
||||
|
||||
#workspaces button.empty {
|
||||
background: @crust;
|
||||
color: @subtext1;
|
||||
}
|
||||
#workspaces button.empty {
|
||||
background: @crust;
|
||||
color: @subtext1;
|
||||
}
|
||||
|
||||
#workspaces button.visible {
|
||||
background: @pink;
|
||||
color: @theme_selected_fg_color;
|
||||
border-bottom: 3px solid @rosewater;
|
||||
}
|
||||
#workspaces button.visible {
|
||||
background: @pink;
|
||||
color: @theme_selected_fg_color;
|
||||
border-bottom: 3px solid @rosewater;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background: @red;
|
||||
color: @theme_selected_fg_color;
|
||||
}
|
||||
#workspaces button.urgent {
|
||||
background: @red;
|
||||
color: @theme_selected_fg_color;
|
||||
}
|
||||
|
||||
#workspaces button.active, #workspaces button.focused {
|
||||
background: @theme_selected_bg_color;
|
||||
color: @theme_selected_fg_color;
|
||||
border-bottom: 3px solid white;
|
||||
}
|
||||
#workspaces button.active, #workspaces button.focused {
|
||||
background: @theme_selected_bg_color;
|
||||
color: @theme_selected_fg_color;
|
||||
border-bottom: 3px solid white;
|
||||
}
|
||||
|
||||
#window {
|
||||
padding: 0 10px;
|
||||
}
|
||||
#window {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
window#waybar.empty #window {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
window#waybar.empty #window {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#mode, #clock, #battery, #idle_inhibitor, #tray, #wireplumber, #bluetooth, #backlight, #mpris {
|
||||
padding: 0 5px;
|
||||
margin: 0 5px;
|
||||
}
|
||||
#mode, #clock, #battery, #idle_inhibitor, #tray, #wireplumber, #bluetooth, #backlight, #mpris {
|
||||
padding: 0 5px;
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
#mpris {
|
||||
color: @mantle;
|
||||
}
|
||||
#mpris {
|
||||
color: @mantle;
|
||||
}
|
||||
|
||||
#mpris.playing {
|
||||
background-color: @lavender;
|
||||
}
|
||||
#mpris.playing {
|
||||
background-color: @lavender;
|
||||
}
|
||||
|
||||
#mpris.paused {
|
||||
background-color: @mauve;
|
||||
}
|
||||
#mpris.paused {
|
||||
background-color: @mauve;
|
||||
}
|
||||
|
||||
#mpris.stopped {
|
||||
background-color: @rosewater;
|
||||
}
|
||||
#mpris.stopped {
|
||||
background-color: @rosewater;
|
||||
}
|
||||
|
||||
#mode {
|
||||
background: #64727D;
|
||||
border-bottom: 3px solid white;
|
||||
}
|
||||
#mode {
|
||||
background: #64727D;
|
||||
border-bottom: 3px solid white;
|
||||
}
|
||||
|
||||
#clock {
|
||||
}
|
||||
#clock {
|
||||
}
|
||||
|
||||
#battery {
|
||||
}
|
||||
#battery {
|
||||
}
|
||||
|
||||
#battery.charging {
|
||||
color: white;
|
||||
background-color: #26A65B;
|
||||
}
|
||||
#battery.charging {
|
||||
color: white;
|
||||
background-color: #26A65B;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #ffffff;
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #ffffff;
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
|
||||
#battery.warning:not(.charging) {
|
||||
background: #f53c3c;
|
||||
color: white;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: steps(12);
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
#battery.warning:not(.charging) {
|
||||
background: #f53c3c;
|
||||
color: white;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: steps(12);
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
'';
|
||||
settings.main = {
|
||||
layer = "top";
|
||||
|
|
@ -149,7 +149,6 @@ window#waybar.empty #window {
|
|||
"mpris"
|
||||
];
|
||||
|
||||
|
||||
modules-right = [
|
||||
"privacy"
|
||||
"bluetooth"
|
||||
|
|
|
|||
|
|
@ -3,36 +3,34 @@ _: {
|
|||
{
|
||||
draw-border-with-background = false;
|
||||
clip-to-geometry = true;
|
||||
geometry-corner-radius =
|
||||
let
|
||||
r = 5.0;
|
||||
in
|
||||
{
|
||||
bottom-left = r;
|
||||
bottom-right = r;
|
||||
top-left = r;
|
||||
top-right = r;
|
||||
};
|
||||
geometry-corner-radius = let
|
||||
r = 5.0;
|
||||
in {
|
||||
bottom-left = r;
|
||||
bottom-right = r;
|
||||
top-left = r;
|
||||
top-right = r;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
matches = [ { app-id = "^firefox$"; } ];
|
||||
matches = [{app-id = "^firefox$";}];
|
||||
open-on-workspace = "browser";
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{ app-id = "^vesktop$"; }
|
||||
{ app-id = "^discord$"; }
|
||||
{ app-id = "^org.telegram.desktop$"; }
|
||||
{app-id = "^vesktop$";}
|
||||
{app-id = "^discord$";}
|
||||
{app-id = "^org.telegram.desktop$";}
|
||||
];
|
||||
open-on-workspace = "chat";
|
||||
}
|
||||
{
|
||||
matches = [ { app-id = "^steam_app_default$"; } ];
|
||||
matches = [{app-id = "^steam_app_default$";}];
|
||||
open-on-workspace = "vidya";
|
||||
}
|
||||
{
|
||||
matches = [ { app-id = "^spotify$"; } ];
|
||||
matches = [{app-id = "^spotify$";}];
|
||||
open-on-workspace = "media";
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
{ lib, pkgs, inputs, ... }: let
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkForce;
|
||||
qtct = ''
|
||||
[Appearance]
|
||||
|
|
@ -176,7 +181,7 @@ in {
|
|||
gnomeShellTheme = mkForce false;
|
||||
};
|
||||
};
|
||||
dconf.settings = mkForce { };
|
||||
dconf.settings = mkForce {};
|
||||
gtk.enable = true;
|
||||
# https://git.gay/olivia/fur/src/branch/main/modules/home/theming/qt/default.nix
|
||||
qt = {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
_: {
|
||||
disabledModules = [
|
||||
"services/window-managers/i3-sway/i3.nix"
|
||||
];
|
||||
disabledModules = [
|
||||
"services/window-managers/i3-sway/i3.nix"
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{ pkgs, ... }: {
|
||||
home.packages = [
|
||||
pkgs.magic-wormhole
|
||||
];
|
||||
{pkgs, ...}: {
|
||||
home.packages = [
|
||||
pkgs.magic-wormhole
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.generators) toJSON;
|
||||
in {
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
(discord-krisp.override {
|
||||
withOpenASAR = true;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }: {
|
||||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
calibre
|
||||
pkgs.kdePackages.okular
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ config, lib, ... }: let
|
||||
inherit (lib.attrsets) listToAttrs nameValuePair;
|
||||
inherit (lib.modules) mkMerge;
|
||||
in {
|
||||
{
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.firefox.profiles.main = {
|
||||
containersForce = true;
|
||||
containers = {
|
||||
|
|
@ -31,4 +31,3 @@ in {
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
{pkgs, nur, ...}: let
|
||||
{
|
||||
pkgs,
|
||||
nur,
|
||||
...
|
||||
}: let
|
||||
defaultFont = "Monaspace Krypton";
|
||||
in {
|
||||
home.sessionVariables = {
|
||||
BROWSER = "firefox";
|
||||
};
|
||||
|
||||
home.packages = [ pkgs.ff2mpv-rust ];
|
||||
home.packages = [pkgs.ff2mpv-rust];
|
||||
programs.firefox = {
|
||||
nativeMessagingHosts = [
|
||||
pkgs.ff2mpv-rust
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ nur, ... }: {
|
||||
{nur, ...}: {
|
||||
programs.firefox.profiles.main.extensions = {
|
||||
packages = with nur.repos.rycee.firefox-addons; [
|
||||
mtab
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
userDefinedCols = null;
|
||||
};
|
||||
extras = {
|
||||
snow = { enabled = "off"; };
|
||||
snow = {enabled = "off";};
|
||||
};
|
||||
hotkeys = {
|
||||
activationKey = " ";
|
||||
|
|
@ -46,9 +46,9 @@
|
|||
textColor = "#ffffff";
|
||||
textSize = 3.75;
|
||||
type = "afternoon-morning";
|
||||
weather = { unitsType = "f"; };
|
||||
weather = {unitsType = "f";};
|
||||
};
|
||||
options = { showOptionsButton = true; };
|
||||
options = {showOptionsButton = true;};
|
||||
search = {
|
||||
assist = {
|
||||
conversions = true;
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
};
|
||||
title = {
|
||||
defaultTitle = "Mew Tab";
|
||||
dynamic = { enabled = true; };
|
||||
dynamic = {enabled = true;};
|
||||
faviconType = "default";
|
||||
};
|
||||
ui = {
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
highlightColor = "#ffffff20";
|
||||
style = "glass";
|
||||
};
|
||||
user = { name = "kat"; };
|
||||
user = {name = "kat";};
|
||||
wallpaper = {
|
||||
enabled = false;
|
||||
filters = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ nur, ... }: {
|
||||
{nur, ...}: {
|
||||
programs.firefox.profiles.main = {
|
||||
extensions = {
|
||||
packages = with nur.repos.rycee.firefox-addons; [
|
||||
|
|
@ -27,18 +27,18 @@
|
|||
};
|
||||
};
|
||||
userChrome = ''
|
||||
/* Hide horizontal tabs at the top of the window */
|
||||
#main-window[tabsintitlebar="true"]:not([extradragspace="true"]) #TabsToolbar {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
#main-window #TabsToolbar {
|
||||
visibility: collapse !important;
|
||||
}
|
||||
/* Hide the "Tree Style Tab" header at the top of the sidebar */
|
||||
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
|
||||
display: none;
|
||||
}
|
||||
/* Hide horizontal tabs at the top of the window */
|
||||
#main-window[tabsintitlebar="true"]:not([extradragspace="true"]) #TabsToolbar {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
#main-window #TabsToolbar {
|
||||
visibility: collapse !important;
|
||||
}
|
||||
/* Hide the "Tree Style Tab" header at the top of the sidebar */
|
||||
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
|
||||
display: none;
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ nur, ... }: {
|
||||
{nur, ...}: {
|
||||
programs.firefox.profiles.main.extensions = {
|
||||
packages = with nur.repos.rycee.firefox-addons; [
|
||||
ublock-origin
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.attrsets) mapAttrsToList;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
{pkgs, inputs, ... }: let
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.system};
|
||||
in {
|
||||
programs.spicetify = {
|
||||
|
|
@ -11,12 +15,14 @@ in {
|
|||
experimentalFeatures = true;
|
||||
windowManagerPatch = true;
|
||||
colorScheme = "CatppuccinMocha";
|
||||
theme = spicePkgs.themes.text // {
|
||||
theme =
|
||||
spicePkgs.themes.text
|
||||
// {
|
||||
additionalCss = ''
|
||||
:root {
|
||||
--font-family: 'Monaspace Krypton', monospace;
|
||||
}
|
||||
'';
|
||||
};
|
||||
:root {
|
||||
--font-family: 'Monaspace Krypton', monospace;
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ pkgs, ... }: {
|
||||
{pkgs, ...}: {
|
||||
programs.taskwarrior = {
|
||||
enable = true;
|
||||
package = pkgs.taskwarrior3;
|
||||
};
|
||||
home.packages = [ pkgs.taskwarrior-tui ];
|
||||
home.packages = [pkgs.taskwarrior-tui];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,28 +7,28 @@
|
|||
enable = true;
|
||||
package = inputs.wezterm.outputs.packages.${pkgs.system}.default;
|
||||
extraConfig = ''
|
||||
local wezterm = require 'wezterm';
|
||||
local config = {}
|
||||
config.font = wezterm.font_with_fallback({
|
||||
"Monaspace Krypton",
|
||||
"JetBrains Mono",
|
||||
"Noto Color Emoji",
|
||||
"Symbols Nerd Font Mono",
|
||||
})
|
||||
config.window_padding = {
|
||||
left = 8,
|
||||
right = 8,
|
||||
top = 8,
|
||||
bottom = 8,
|
||||
}
|
||||
config.use_fancy_tab_bar = true
|
||||
config.tab_bar_at_bottom = true
|
||||
config.hide_mouse_cursor_when_typing = false
|
||||
config.window_decorations = "TITLE | RESIZE"
|
||||
config.warn_about_missing_glyphs = false
|
||||
config.font_size = 12.0
|
||||
config.check_for_updates = false
|
||||
return config
|
||||
local wezterm = require 'wezterm';
|
||||
local config = {}
|
||||
config.font = wezterm.font_with_fallback({
|
||||
"Monaspace Krypton",
|
||||
"JetBrains Mono",
|
||||
"Noto Color Emoji",
|
||||
"Symbols Nerd Font Mono",
|
||||
})
|
||||
config.window_padding = {
|
||||
left = 8,
|
||||
right = 8,
|
||||
top = 8,
|
||||
bottom = 8,
|
||||
}
|
||||
config.use_fancy_tab_bar = true
|
||||
config.tab_bar_at_bottom = true
|
||||
config.hide_mouse_cursor_when_typing = false
|
||||
config.window_decorations = "TITLE | RESIZE"
|
||||
config.warn_about_missing_glyphs = false
|
||||
config.font_size = 12.0
|
||||
config.check_for_updates = false
|
||||
return config
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@
|
|||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (std) string set;
|
||||
initLua = (pkgs.replaceVars ./init.lua ({
|
||||
initLua = pkgs.replaceVars ./init.lua ({
|
||||
base16ShellPath = config.base16.shell.package;
|
||||
catppuccin_flavour = config.catppuccin.flavor;
|
||||
inherit (config.base16) defaultSchemeName;
|
||||
defaultSchemeSlug = config.base16.defaultScheme.slug;
|
||||
}
|
||||
// set.map (_: col: string.justifyRight 2 "0" (builtins.toString col.ansiIndex))
|
||||
(set.filter (var: _: string.hasInfix "base" var) config.base16.defaultScheme)));
|
||||
(set.filter (var: _: string.hasInfix "base" var) config.base16.defaultScheme));
|
||||
in {
|
||||
home.sessionVariables = mkIf config.programs.neovim.enable {EDITOR = "nvim";};
|
||||
programs.neovim = {
|
||||
|
|
|
|||
|
|
@ -98,24 +98,24 @@ in {
|
|||
"sidequest"
|
||||
"ungoogled-chromium"
|
||||
];
|
||||
flake = self;
|
||||
makeAliasForBin = package: nameValuePair package "nix run kat#${package}";
|
||||
packages' = builtins.listToAttrs (map makeAliasForBin packages);
|
||||
in mkMerge [
|
||||
packages'
|
||||
{
|
||||
nixdirfmt = "nixpkgs-fmt $(fd -e nix)";
|
||||
dmesg = "dmesg -HP";
|
||||
hg = "history 0 | rg";
|
||||
}
|
||||
(mkIf pkgs.hostPlatform.isLinux {
|
||||
sys = "systemctl";
|
||||
sysu = "systemctl --user";
|
||||
logu = "journalctl --user";
|
||||
log = "journalctl";
|
||||
lg = "log --no-pager | rg";
|
||||
})
|
||||
];
|
||||
in
|
||||
mkMerge [
|
||||
packages'
|
||||
{
|
||||
nixdirfmt = "nixpkgs-fmt $(fd -e nix)";
|
||||
dmesg = "dmesg -HP";
|
||||
hg = "history 0 | rg";
|
||||
}
|
||||
(mkIf pkgs.hostPlatform.isLinux {
|
||||
sys = "systemctl";
|
||||
sysu = "systemctl --user";
|
||||
logu = "journalctl --user";
|
||||
log = "journalctl";
|
||||
lg = "log --no-pager | rg";
|
||||
})
|
||||
];
|
||||
localVariables = {
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=3,bold";
|
||||
ZSH_AUTOSUGGEST_USE_ASYNC = 1;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.xsession.windowManager.i3;
|
||||
|
||||
commonOptions = import ./i3/options.nix {
|
||||
|
|
@ -14,10 +14,26 @@ let
|
|||
|
||||
configModule = types.submodule {
|
||||
options = {
|
||||
inherit (commonOptions)
|
||||
fonts window floating focus assigns modifier workspaceLayout
|
||||
workspaceAutoBackAndForth keycodebindings colors bars startup gaps menu
|
||||
terminal defaultWorkspace workspaceOutputAssign;
|
||||
inherit
|
||||
(commonOptions)
|
||||
fonts
|
||||
window
|
||||
floating
|
||||
focus
|
||||
assigns
|
||||
modifier
|
||||
workspaceLayout
|
||||
workspaceAutoBackAndForth
|
||||
keycodebindings
|
||||
colors
|
||||
bars
|
||||
startup
|
||||
gaps
|
||||
menu
|
||||
terminal
|
||||
defaultWorkspace
|
||||
workspaceOutputAssign
|
||||
;
|
||||
|
||||
keybindings = mkOption {
|
||||
type = types.attrsOf (types.nullOr types.str);
|
||||
|
|
@ -68,82 +84,118 @@ let
|
|||
moduleName = "i3";
|
||||
};
|
||||
|
||||
inherit (commonFunctions)
|
||||
keybindingsStr keycodebindingsStr modeStr assignStr barStr gapsStr
|
||||
floatingCriteriaStr windowCommandsStr colorSetStr windowBorderString
|
||||
fontConfigStr keybindingDefaultWorkspace keybindingsRest workspaceOutputStr;
|
||||
inherit
|
||||
(commonFunctions)
|
||||
keybindingsStr
|
||||
keycodebindingsStr
|
||||
modeStr
|
||||
assignStr
|
||||
barStr
|
||||
gapsStr
|
||||
floatingCriteriaStr
|
||||
windowCommandsStr
|
||||
colorSetStr
|
||||
windowBorderString
|
||||
fontConfigStr
|
||||
keybindingDefaultWorkspace
|
||||
keybindingsRest
|
||||
workspaceOutputStr
|
||||
;
|
||||
|
||||
startupEntryStr = { command, always, notification, workspace, ... }:
|
||||
startupEntryStr = {
|
||||
command,
|
||||
always,
|
||||
notification,
|
||||
workspace,
|
||||
...
|
||||
}:
|
||||
concatStringsSep " " [
|
||||
(if always then "exec_always" else "exec")
|
||||
(if (notification && workspace == null) then "" else "--no-startup-id")
|
||||
(if (workspace == null) then
|
||||
command
|
||||
else
|
||||
"i3-msg 'workspace ${workspace}; exec ${command}'")
|
||||
(
|
||||
if always
|
||||
then "exec_always"
|
||||
else "exec"
|
||||
)
|
||||
(
|
||||
if (notification && workspace == null)
|
||||
then ""
|
||||
else "--no-startup-id"
|
||||
)
|
||||
(
|
||||
if (workspace == null)
|
||||
then command
|
||||
else "i3-msg 'workspace ${workspace}; exec ${command}'"
|
||||
)
|
||||
];
|
||||
|
||||
configFile = pkgs.writeText "i3.conf" (concatStringsSep "\n"
|
||||
((if cfg.config != null then
|
||||
with cfg.config;
|
||||
([ cfg.extraConfigEarly] ++ [
|
||||
(fontConfigStr fonts)
|
||||
"floating_modifier ${floating.modifier}"
|
||||
(windowBorderString window floating)
|
||||
"hide_edge_borders ${window.hideEdgeBorders}"
|
||||
"focus_wrapping ${focus.wrapping}"
|
||||
"focus_follows_mouse ${lib.hm.booleans.yesNo focus.followMouse}"
|
||||
"focus_on_window_activation ${focus.newWindow}"
|
||||
"mouse_warping ${if focus.mouseWarping then "output" else "none"}"
|
||||
"workspace_layout ${workspaceLayout}"
|
||||
"workspace_auto_back_and_forth ${
|
||||
lib.hm.booleans.yesNo workspaceAutoBackAndForth
|
||||
}"
|
||||
"client.focused ${colorSetStr colors.focused}"
|
||||
"client.focused_inactive ${colorSetStr colors.focusedInactive}"
|
||||
"client.unfocused ${colorSetStr colors.unfocused}"
|
||||
"client.urgent ${colorSetStr colors.urgent}"
|
||||
"client.placeholder ${colorSetStr colors.placeholder}"
|
||||
"client.background ${colors.background}"
|
||||
(keybindingsStr { keybindings = keybindingDefaultWorkspace; })
|
||||
(keybindingsStr { keybindings = keybindingsRest; })
|
||||
(keycodebindingsStr keycodebindings)
|
||||
] ++ mapAttrsToList (modeStr false) modes
|
||||
++ mapAttrsToList assignStr assigns ++ map barStr bars
|
||||
++ optional (gaps != null) gapsStr
|
||||
++ map floatingCriteriaStr floating.criteria
|
||||
++ map windowCommandsStr window.commands ++ map startupEntryStr startup
|
||||
++ map workspaceOutputStr workspaceOutputAssign)
|
||||
else
|
||||
[ ]) ++ [ cfg.extraConfig ]));
|
||||
((
|
||||
if cfg.config != null
|
||||
then
|
||||
with cfg.config; ([cfg.extraConfigEarly]
|
||||
++ [
|
||||
(fontConfigStr fonts)
|
||||
"floating_modifier ${floating.modifier}"
|
||||
(windowBorderString window floating)
|
||||
"hide_edge_borders ${window.hideEdgeBorders}"
|
||||
"focus_wrapping ${focus.wrapping}"
|
||||
"focus_follows_mouse ${lib.hm.booleans.yesNo focus.followMouse}"
|
||||
"focus_on_window_activation ${focus.newWindow}"
|
||||
"mouse_warping ${
|
||||
if focus.mouseWarping
|
||||
then "output"
|
||||
else "none"
|
||||
}"
|
||||
"workspace_layout ${workspaceLayout}"
|
||||
"workspace_auto_back_and_forth ${
|
||||
lib.hm.booleans.yesNo workspaceAutoBackAndForth
|
||||
}"
|
||||
"client.focused ${colorSetStr colors.focused}"
|
||||
"client.focused_inactive ${colorSetStr colors.focusedInactive}"
|
||||
"client.unfocused ${colorSetStr colors.unfocused}"
|
||||
"client.urgent ${colorSetStr colors.urgent}"
|
||||
"client.placeholder ${colorSetStr colors.placeholder}"
|
||||
"client.background ${colors.background}"
|
||||
(keybindingsStr {keybindings = keybindingDefaultWorkspace;})
|
||||
(keybindingsStr {keybindings = keybindingsRest;})
|
||||
(keycodebindingsStr keycodebindings)
|
||||
]
|
||||
++ mapAttrsToList (modeStr false) modes
|
||||
++ mapAttrsToList assignStr assigns
|
||||
++ map barStr bars
|
||||
++ optional (gaps != null) gapsStr
|
||||
++ map floatingCriteriaStr floating.criteria
|
||||
++ map windowCommandsStr window.commands
|
||||
++ map startupEntryStr startup
|
||||
++ map workspaceOutputStr workspaceOutputAssign)
|
||||
else []
|
||||
)
|
||||
++ [cfg.extraConfig]));
|
||||
|
||||
# Validates the i3 configuration
|
||||
checkI3Config =
|
||||
pkgs.runCommandLocal "i3-config" { buildInputs = [ cfg.package ]; } ''
|
||||
# We have to make sure the wrapper does not start a dbus session
|
||||
export DBUS_SESSION_BUS_ADDRESS=1
|
||||
|
||||
# A zero exit code means i3 successfully validated the configuration
|
||||
i3 -c ${configFile} -C -d all || {
|
||||
echo "i3 configuration validation failed"
|
||||
echo "For a verbose log of the failure, run 'i3 -c ${configFile} -C -d all'"
|
||||
exit 1
|
||||
};
|
||||
cp ${configFile} $out
|
||||
'';
|
||||
checkI3Config = pkgs.runCommandLocal "i3-config" {buildInputs = [cfg.package];} ''
|
||||
# We have to make sure the wrapper does not start a dbus session
|
||||
export DBUS_SESSION_BUS_ADDRESS=1
|
||||
|
||||
# A zero exit code means i3 successfully validated the configuration
|
||||
i3 -c ${configFile} -C -d all || {
|
||||
echo "i3 configuration validation failed"
|
||||
echo "For a verbose log of the failure, run 'i3 -c ${configFile} -C -d all'"
|
||||
exit 1
|
||||
};
|
||||
cp ${configFile} $out
|
||||
'';
|
||||
in {
|
||||
meta.maintainers = with maintainers; [ sumnerevans ];
|
||||
meta.maintainers = with maintainers; [sumnerevans];
|
||||
|
||||
options = {
|
||||
xsession.windowManager.i3 = {
|
||||
enable = mkEnableOption "i3 window manager";
|
||||
|
||||
package = mkPackageOption pkgs "i3" { };
|
||||
package = mkPackageOption pkgs "i3" {};
|
||||
|
||||
config = mkOption {
|
||||
type = types.nullOr configModule;
|
||||
default = { };
|
||||
default = {};
|
||||
description = "i3 configuration options.";
|
||||
};
|
||||
|
||||
|
|
@ -155,43 +207,45 @@ in {
|
|||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description =
|
||||
"Extra configuration lines to add to ~/.config/i3/config.";
|
||||
description = "Extra configuration lines to add to ~/.config/i3/config.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkMerge [ (mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "xsession.windowManager.i3" pkgs
|
||||
platforms.linux)
|
||||
];
|
||||
config = mkMerge [
|
||||
(mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "xsession.windowManager.i3" pkgs
|
||||
platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
home.packages = [cfg.package];
|
||||
|
||||
xsession.windowManager.command = "${cfg.package}/bin/i3";
|
||||
xsession.windowManager.command = "${cfg.package}/bin/i3";
|
||||
|
||||
xdg.configFile."i3/config" = {
|
||||
source = checkI3Config;
|
||||
onChange = ''
|
||||
# There may be several sockets after log out/log in, but the old ones
|
||||
# will fail with "Connection refused".
|
||||
for i3Socket in ''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*; do
|
||||
if [[ -S $i3Socket ]]; then
|
||||
${cfg.package}/bin/i3-msg -s $i3Socket reload >/dev/null |& grep -v "Connection refused" || true
|
||||
fi
|
||||
done
|
||||
'';
|
||||
};
|
||||
}
|
||||
(mkIf (cfg.config != null) {
|
||||
warnings = (optional (isList cfg.config.fonts)
|
||||
"Specifying i3.config.fonts as a list is deprecated. Use the attrset version instead.")
|
||||
++ flatten (map (b:
|
||||
optional (isList b.fonts)
|
||||
"Specifying i3.config.bars[].fonts as a list is deprecated. Use the attrset version instead.")
|
||||
cfg.config.bars) ++ [
|
||||
xdg.configFile."i3/config" = {
|
||||
source = checkI3Config;
|
||||
onChange = ''
|
||||
# There may be several sockets after log out/log in, but the old ones
|
||||
# will fail with "Connection refused".
|
||||
for i3Socket in ''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*; do
|
||||
if [[ -S $i3Socket ]]; then
|
||||
${cfg.package}/bin/i3-msg -s $i3Socket reload >/dev/null |& grep -v "Connection refused" || true
|
||||
fi
|
||||
done
|
||||
'';
|
||||
};
|
||||
}
|
||||
(mkIf (cfg.config != null) {
|
||||
warnings =
|
||||
(optional (isList cfg.config.fonts)
|
||||
"Specifying i3.config.fonts as a list is deprecated. Use the attrset version instead.")
|
||||
++ flatten (map (b:
|
||||
optional (isList b.fonts)
|
||||
"Specifying i3.config.bars[].fonts as a list is deprecated. Use the attrset version instead.")
|
||||
cfg.config.bars)
|
||||
++ [
|
||||
(mkIf (any (s: s.workspace != null) cfg.config.startup)
|
||||
("'xsession.windowManager.i3.config.startup.*.workspace' is deprecated, "
|
||||
+ "use 'xsession.windowManager.i3.config.assigns' instead."
|
||||
|
|
@ -200,46 +254,46 @@ in {
|
|||
("'xsession.windowManager.i3.config.focus.forceWrapping' is deprecated, "
|
||||
+ "use 'xsession.windowManager.i3.config.focus.wrapping' instead."))
|
||||
];
|
||||
})
|
||||
]))
|
||||
{xsession.windowManager.i3.config.keybindings = mapAttrs (n: mkOptionDefault) {
|
||||
"${cfg.config.modifier}+Return" = "exec ${cfg.config.terminal}";
|
||||
"${cfg.config.modifier}+Shift+q" = "kill";
|
||||
"${cfg.config.modifier}+d" = "exec ${cfg.config.menu}";
|
||||
})
|
||||
]))
|
||||
{
|
||||
xsession.windowManager.i3.config.keybindings = mapAttrs (_n: mkOptionDefault) {
|
||||
"${cfg.config.modifier}+Return" = "exec ${cfg.config.terminal}";
|
||||
"${cfg.config.modifier}+Shift+q" = "kill";
|
||||
"${cfg.config.modifier}+d" = "exec ${cfg.config.menu}";
|
||||
|
||||
"${cfg.config.modifier}+Left" = "focus left";
|
||||
"${cfg.config.modifier}+Down" = "focus down";
|
||||
"${cfg.config.modifier}+Up" = "focus up";
|
||||
"${cfg.config.modifier}+Right" = "focus right";
|
||||
"${cfg.config.modifier}+Left" = "focus left";
|
||||
"${cfg.config.modifier}+Down" = "focus down";
|
||||
"${cfg.config.modifier}+Up" = "focus up";
|
||||
"${cfg.config.modifier}+Right" = "focus right";
|
||||
|
||||
"${cfg.config.modifier}+Shift+Left" = "move left";
|
||||
"${cfg.config.modifier}+Shift+Down" = "move down";
|
||||
"${cfg.config.modifier}+Shift+Up" = "move up";
|
||||
"${cfg.config.modifier}+Shift+Right" = "move right";
|
||||
"${cfg.config.modifier}+Shift+Left" = "move left";
|
||||
"${cfg.config.modifier}+Shift+Down" = "move down";
|
||||
"${cfg.config.modifier}+Shift+Up" = "move up";
|
||||
"${cfg.config.modifier}+Shift+Right" = "move right";
|
||||
|
||||
"${cfg.config.modifier}+h" = "split h";
|
||||
"${cfg.config.modifier}+v" = "split v";
|
||||
"${cfg.config.modifier}+f" = "fullscreen toggle";
|
||||
"${cfg.config.modifier}+h" = "split h";
|
||||
"${cfg.config.modifier}+v" = "split v";
|
||||
"${cfg.config.modifier}+f" = "fullscreen toggle";
|
||||
|
||||
"${cfg.config.modifier}+s" = "layout stacking";
|
||||
"${cfg.config.modifier}+w" = "layout tabbed";
|
||||
"${cfg.config.modifier}+e" = "layout toggle split";
|
||||
"${cfg.config.modifier}+s" = "layout stacking";
|
||||
"${cfg.config.modifier}+w" = "layout tabbed";
|
||||
"${cfg.config.modifier}+e" = "layout toggle split";
|
||||
|
||||
"${cfg.config.modifier}+Shift+space" = "floating toggle";
|
||||
"${cfg.config.modifier}+space" = "focus mode_toggle";
|
||||
"${cfg.config.modifier}+Shift+space" = "floating toggle";
|
||||
"${cfg.config.modifier}+space" = "focus mode_toggle";
|
||||
|
||||
"${cfg.config.modifier}+a" = "focus parent";
|
||||
"${cfg.config.modifier}+a" = "focus parent";
|
||||
|
||||
"${cfg.config.modifier}+Shift+minus" = "move scratchpad";
|
||||
"${cfg.config.modifier}+minus" = "scratchpad show";
|
||||
"${cfg.config.modifier}+Shift+minus" = "move scratchpad";
|
||||
"${cfg.config.modifier}+minus" = "scratchpad show";
|
||||
|
||||
"${cfg.config.modifier}+Shift+c" = "reload";
|
||||
"${cfg.config.modifier}+Shift+r" = "restart";
|
||||
"${cfg.config.modifier}+Shift+e" =
|
||||
"exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
|
||||
"${cfg.config.modifier}+Shift+c" = "reload";
|
||||
"${cfg.config.modifier}+Shift+r" = "restart";
|
||||
"${cfg.config.modifier}+Shift+e" = "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
|
||||
|
||||
"${cfg.config.modifier}+r" = "mode resize";
|
||||
};
|
||||
"${cfg.config.modifier}+r" = "mode resize";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +1,45 @@
|
|||
{
|
||||
cfg,
|
||||
config,
|
||||
lib,
|
||||
moduleName,
|
||||
}:
|
||||
with lib; rec {
|
||||
criteriaStr = criteria: let
|
||||
toCriteria = k: v:
|
||||
if builtins.isBool v
|
||||
then
|
||||
(
|
||||
if v
|
||||
then "${k}"
|
||||
else ""
|
||||
)
|
||||
else ''${k}="${v}"'';
|
||||
in "[${concatStringsSep " " (mapAttrsToList toCriteria criteria)}]";
|
||||
|
||||
{ cfg, config, lib, moduleName }:
|
||||
|
||||
with lib;
|
||||
|
||||
rec {
|
||||
criteriaStr = criteria:
|
||||
let
|
||||
toCriteria = k: v:
|
||||
if builtins.isBool v then
|
||||
(if v then "${k}" else "")
|
||||
else
|
||||
''${k}="${v}"'';
|
||||
in "[${concatStringsSep " " (mapAttrsToList toCriteria criteria)}]";
|
||||
|
||||
keybindingDefaultWorkspace = filterAttrs (n: v:
|
||||
keybindingDefaultWorkspace = filterAttrs (_n: v:
|
||||
cfg.config.defaultWorkspace != null && v == cfg.config.defaultWorkspace)
|
||||
cfg.config.keybindings;
|
||||
cfg.config.keybindings;
|
||||
|
||||
keybindingsRest = filterAttrs (n: v:
|
||||
keybindingsRest = filterAttrs (_n: v:
|
||||
cfg.config.defaultWorkspace == null || v != cfg.config.defaultWorkspace)
|
||||
cfg.config.keybindings;
|
||||
cfg.config.keybindings;
|
||||
|
||||
keybindingsStr = { keybindings, bindsymArgs ? "", indent ? "" }:
|
||||
keybindingsStr = {
|
||||
keybindings,
|
||||
bindsymArgs ? "",
|
||||
indent ? "",
|
||||
}:
|
||||
concatStringsSep "\n" (mapAttrsToList (keycomb: action:
|
||||
optionalString (action != null) "${indent}bindsym ${
|
||||
lib.optionalString (bindsymArgs != "") "${bindsymArgs} "
|
||||
}${keycomb} ${action}") keybindings);
|
||||
}${keycomb} ${action}")
|
||||
keybindings);
|
||||
|
||||
keycodebindingsStr = keycodebindings:
|
||||
concatStringsSep "\n" (mapAttrsToList (keycomb: action:
|
||||
optionalString (action != null) "bindcode ${keycomb} ${action}")
|
||||
keycodebindings);
|
||||
keycodebindings);
|
||||
|
||||
colorSetStr = c:
|
||||
concatStringsSep " " [
|
||||
|
|
@ -40,7 +49,7 @@ rec {
|
|||
c.indicator
|
||||
c.childBorder
|
||||
];
|
||||
barColorSetStr = c: concatStringsSep " " [ c.border c.background c.text ];
|
||||
barColorSetStr = c: concatStringsSep " " [c.border c.background c.text];
|
||||
|
||||
modeStr = bindkeysToCode: name: keybindings: ''
|
||||
mode "${name}" {
|
||||
|
|
@ -57,23 +66,42 @@ rec {
|
|||
(map (c: "assign ${criteriaStr c} ${workspace}") criteria);
|
||||
|
||||
fontConfigStr = let
|
||||
toFontStr = { names, style ? "", size ? "" }:
|
||||
optionalString (names != [ ]) concatStringsSep " "
|
||||
(remove "" [ "font" "pango:${concatStringsSep ", " names}" style size ]);
|
||||
in fontCfg:
|
||||
if isList fontCfg then
|
||||
toFontStr { names = fontCfg; }
|
||||
else
|
||||
toFontStr {
|
||||
inherit (fontCfg) names style;
|
||||
size = toString fontCfg.size;
|
||||
};
|
||||
toFontStr = {
|
||||
names,
|
||||
style ? "",
|
||||
size ? "",
|
||||
}:
|
||||
optionalString (names != []) concatStringsSep " "
|
||||
(remove "" ["font" "pango:${concatStringsSep ", " names}" style size]);
|
||||
in
|
||||
fontCfg:
|
||||
if isList fontCfg
|
||||
then toFontStr {names = fontCfg;}
|
||||
else
|
||||
toFontStr {
|
||||
inherit (fontCfg) names style;
|
||||
size = toString fontCfg.size;
|
||||
};
|
||||
|
||||
barStr = { id, fonts, mode, hiddenState, position, workspaceButtons
|
||||
, workspaceNumbers, command, statusCommand, colors, trayOutput, trayPadding
|
||||
, extraConfig, ... }:
|
||||
let colorsNotNull = lib.filterAttrs (n: v: v != null) colors != { };
|
||||
in concatMapStrings (x: x + "\n") (indent (lists.subtractLists [ "" null ]
|
||||
barStr = {
|
||||
id,
|
||||
fonts,
|
||||
mode,
|
||||
hiddenState,
|
||||
position,
|
||||
workspaceButtons,
|
||||
workspaceNumbers,
|
||||
command,
|
||||
statusCommand,
|
||||
colors,
|
||||
trayOutput,
|
||||
trayPadding,
|
||||
extraConfig,
|
||||
...
|
||||
}: let
|
||||
colorsNotNull = lib.filterAttrs (_n: v: v != null) colors != {};
|
||||
in
|
||||
concatMapStrings (x: x + "\n") (indent (lists.subtractLists ["" null]
|
||||
(flatten [
|
||||
"bar {"
|
||||
(optionalString (id != null) "id ${id}")
|
||||
|
|
@ -87,12 +115,12 @@ rec {
|
|||
(optionalString (workspaceButtons != null)
|
||||
"workspace_buttons ${lib.hm.booleans.yesNo workspaceButtons}")
|
||||
(optionalString (workspaceNumbers != null) "strip_workspace_numbers ${
|
||||
lib.hm.booleans.yesNo (!workspaceNumbers)
|
||||
}")
|
||||
lib.hm.booleans.yesNo (!workspaceNumbers)
|
||||
}")
|
||||
(optionalString (trayOutput != null) "tray_output ${trayOutput}")
|
||||
(optionalString (trayPadding != null)
|
||||
"tray_padding ${toString trayPadding}")
|
||||
(optionals colorsNotNull (indent (lists.subtractLists [ "" null ] [
|
||||
(optionals colorsNotNull (indent (lists.subtractLists ["" null] [
|
||||
"colors {"
|
||||
(optionalString (colors.background != null)
|
||||
"background ${colors.background}")
|
||||
|
|
@ -117,13 +145,13 @@ rec {
|
|||
(optionalString (colors.bindingMode != null)
|
||||
"binding_mode ${barColorSetStr colors.bindingMode}")
|
||||
"}"
|
||||
]) { }))
|
||||
]) {}))
|
||||
extraConfig
|
||||
"}"
|
||||
])) { });
|
||||
])) {});
|
||||
|
||||
gapsStr = with cfg.config.gaps;
|
||||
concatStringsSep "\n" (lists.subtractLists [ "" null ] [
|
||||
concatStringsSep "\n" (lists.subtractLists ["" null] [
|
||||
(optionalString (inner != null) "gaps inner ${toString inner}")
|
||||
(optionalString (outer != null) "gaps outer ${toString outer}")
|
||||
(optionalString (horizontal != null)
|
||||
|
|
@ -137,30 +165,41 @@ rec {
|
|||
(optionalString (smartBorders != "off") "smart_borders ${smartBorders}")
|
||||
]);
|
||||
|
||||
windowBorderString = window: floating:
|
||||
let
|
||||
titlebarString = { titlebar, border, ... }:
|
||||
"${if titlebar then "normal" else "pixel"} ${toString border}";
|
||||
in concatStringsSep "\n" [
|
||||
windowBorderString = window: floating: let
|
||||
titlebarString = {
|
||||
titlebar,
|
||||
border,
|
||||
...
|
||||
}: "${
|
||||
if titlebar
|
||||
then "normal"
|
||||
else "pixel"
|
||||
} ${toString border}";
|
||||
in
|
||||
concatStringsSep "\n" [
|
||||
"default_border ${titlebarString window}"
|
||||
"default_floating_border ${titlebarString floating}"
|
||||
];
|
||||
|
||||
floatingCriteriaStr = criteria:
|
||||
"for_window ${criteriaStr criteria} floating enable";
|
||||
windowCommandsStr = { command, criteria, ... }:
|
||||
"for_window ${criteriaStr criteria} ${command}";
|
||||
workspaceOutputStr = item:
|
||||
let outputs = concatMapStringsSep " " strings.escapeNixString item.output;
|
||||
in ''workspace "${item.workspace}" output ${outputs}'';
|
||||
floatingCriteriaStr = criteria: "for_window ${criteriaStr criteria} floating enable";
|
||||
windowCommandsStr = {
|
||||
command,
|
||||
criteria,
|
||||
...
|
||||
}: "for_window ${criteriaStr criteria} ${command}";
|
||||
workspaceOutputStr = item: let
|
||||
outputs = concatMapStringsSep " " strings.escapeNixString item.output;
|
||||
in ''workspace "${item.workspace}" output ${outputs}'';
|
||||
|
||||
indent = list:
|
||||
{ includesWrapper ? true, level ? 1 }:
|
||||
let prefix = concatStringsSep "" (lib.genList (x: " ") (level * 2));
|
||||
|
||||
in (lib.imap1 (i: v:
|
||||
"${if includesWrapper && (i == 1 || i == (lib.length list)) then
|
||||
v
|
||||
else
|
||||
"${prefix}${v}"}") list);
|
||||
indent = list: {
|
||||
includesWrapper ? true,
|
||||
level ? 1,
|
||||
}: let
|
||||
prefix = concatStringsSep "" (lib.genList (_x: " ") (level * 2));
|
||||
in lib.imap1 (i: v: "${
|
||||
if includesWrapper && (i == 1 || i == (lib.length list))
|
||||
then v
|
||||
else "${prefix}${v}"
|
||||
}")
|
||||
list;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
{ config, lib, moduleName, cfg, pkgs, capitalModuleName ? moduleName }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
moduleName,
|
||||
cfg,
|
||||
pkgs,
|
||||
capitalModuleName ? moduleName,
|
||||
}:
|
||||
with lib; let
|
||||
isI3 = moduleName == "i3";
|
||||
isSway = !isI3;
|
||||
|
||||
|
|
@ -12,7 +16,7 @@ let
|
|||
options = {
|
||||
names = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ "monospace" ];
|
||||
default = ["monospace"];
|
||||
defaultText = literalExpression ''[ "monospace" ]'';
|
||||
description = ''
|
||||
List of font names list used for window titles. Only FreeType fonts are supported.
|
||||
|
|
@ -42,56 +46,65 @@ let
|
|||
};
|
||||
|
||||
startupModule = types.submodule {
|
||||
options = {
|
||||
command = mkOption {
|
||||
type = types.str;
|
||||
description = "Command that will be executed on startup.";
|
||||
};
|
||||
options =
|
||||
{
|
||||
command = mkOption {
|
||||
type = types.str;
|
||||
description = "Command that will be executed on startup.";
|
||||
};
|
||||
|
||||
always = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether to run command on each ${moduleName} restart.";
|
||||
};
|
||||
} // optionalAttrs isI3 {
|
||||
notification = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to enable startup-notification support for the command.
|
||||
See {option}`--no-startup-id` option description in the i3 user guide.
|
||||
'';
|
||||
};
|
||||
always = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether to run command on each ${moduleName} restart.";
|
||||
};
|
||||
}
|
||||
// optionalAttrs isI3 {
|
||||
notification = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to enable startup-notification support for the command.
|
||||
See {option}`--no-startup-id` option description in the i3 user guide.
|
||||
'';
|
||||
};
|
||||
|
||||
workspace = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
Launch application on a particular workspace. DEPRECATED:
|
||||
Use [](#opt-xsession.windowManager.i3.config.assigns)
|
||||
instead. See <https://github.com/nix-community/home-manager/issues/265>.
|
||||
'';
|
||||
workspace = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
Launch application on a particular workspace. DEPRECATED:
|
||||
Use [](#opt-xsession.windowManager.i3.config.assigns)
|
||||
instead. See <https://github.com/nix-community/home-manager/issues/265>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
barModule = types.submodule {
|
||||
options = let
|
||||
versionAtLeast2009 = versionAtLeast stateVersion "20.09";
|
||||
mkNullableOption = { type, default, ... }@args:
|
||||
mkOption (args // {
|
||||
type = types.nullOr type;
|
||||
default = if versionAtLeast2009 then null else default;
|
||||
defaultText = literalExpression ''
|
||||
null for state version ≥ 20.09, as example otherwise
|
||||
'';
|
||||
example = default;
|
||||
});
|
||||
mkNullableOption = {
|
||||
type,
|
||||
default,
|
||||
...
|
||||
} @ args:
|
||||
mkOption (args
|
||||
// {
|
||||
type = types.nullOr type;
|
||||
default =
|
||||
if versionAtLeast2009
|
||||
then null
|
||||
else default;
|
||||
defaultText = literalExpression ''
|
||||
null for state version ≥ 20.09, as example otherwise
|
||||
'';
|
||||
example = default;
|
||||
});
|
||||
in {
|
||||
fonts = mkOption {
|
||||
type = with types; either (listOf str) fontOptions;
|
||||
default = { };
|
||||
default = {};
|
||||
example = literalExpression ''
|
||||
{
|
||||
names = [ "DejaVu Sans Mono" "FontAwesome5Free" ];
|
||||
|
|
@ -119,19 +132,19 @@ let
|
|||
};
|
||||
|
||||
mode = mkNullableOption {
|
||||
type = types.enum [ "dock" "hide" "invisible" ];
|
||||
type = types.enum ["dock" "hide" "invisible"];
|
||||
default = "dock";
|
||||
description = "Bar visibility mode.";
|
||||
};
|
||||
|
||||
hiddenState = mkNullableOption {
|
||||
type = types.enum [ "hide" "show" ];
|
||||
type = types.enum ["hide" "show"];
|
||||
default = "hide";
|
||||
description = "The default bar mode when 'bar.mode' == 'hide'.";
|
||||
};
|
||||
|
||||
position = mkNullableOption {
|
||||
type = types.enum [ "top" "bottom" ];
|
||||
type = types.enum ["top" "bottom"];
|
||||
default = "bottom";
|
||||
description = "The edge of the screen ${moduleName}bar should show up.";
|
||||
};
|
||||
|
|
@ -145,8 +158,7 @@ let
|
|||
workspaceNumbers = mkNullableOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description =
|
||||
"Whether workspace numbers should be displayed within the workspace buttons.";
|
||||
description = "Whether workspace numbers should be displayed within the workspace buttons.";
|
||||
};
|
||||
|
||||
command = mkOption {
|
||||
|
|
@ -154,14 +166,17 @@ let
|
|||
default = let
|
||||
# If the user uses the "system" Sway (i.e. cfg.package == null) then the bar has
|
||||
# to come from a different package
|
||||
pkg = if isSway && isNull cfg.package then pkgs.sway else cfg.package;
|
||||
pkg =
|
||||
if isSway && (cfg.package == null)
|
||||
then pkgs.sway
|
||||
else cfg.package;
|
||||
in "${pkg}/bin/${moduleName}bar";
|
||||
defaultText = "i3bar";
|
||||
description = "Command that will be used to start a bar.";
|
||||
example = if isI3 then
|
||||
"\${pkgs.i3}/bin/i3bar -t"
|
||||
else
|
||||
"\${pkgs.waybar}/bin/waybar";
|
||||
example =
|
||||
if isI3
|
||||
then "\${pkgs.i3}/bin/i3bar -t"
|
||||
else "\${pkgs.waybar}/bin/waybar";
|
||||
};
|
||||
|
||||
statusCommand = mkNullableOption {
|
||||
|
|
@ -194,24 +209,21 @@ let
|
|||
focusedBackground = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description =
|
||||
"Background color of the bar on the currently focused monitor output.";
|
||||
description = "Background color of the bar on the currently focused monitor output.";
|
||||
example = "#000000";
|
||||
};
|
||||
|
||||
focusedStatusline = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description =
|
||||
"Text color to be used for the statusline on the currently focused monitor output.";
|
||||
description = "Text color to be used for the statusline on the currently focused monitor output.";
|
||||
example = "#ffffff";
|
||||
};
|
||||
|
||||
focusedSeparator = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description =
|
||||
"Text color to be used for the separator on the currently focused monitor output.";
|
||||
description = "Text color to be used for the separator on the currently focused monitor output.";
|
||||
example = "#666666";
|
||||
};
|
||||
|
||||
|
|
@ -272,12 +284,11 @@ let
|
|||
background = "#900000";
|
||||
text = "#ffffff";
|
||||
};
|
||||
description =
|
||||
"Border, background and text color for the binding mode indicator";
|
||||
description = "Border, background and text color for the binding mode indicator";
|
||||
};
|
||||
};
|
||||
};
|
||||
default = { };
|
||||
default = {};
|
||||
description = ''
|
||||
Bar color settings. All color classes can be specified using submodules
|
||||
with 'border', 'background', 'text', fields and RGB color hex-codes as values.
|
||||
|
|
@ -291,7 +302,10 @@ let
|
|||
trayOutput = mkNullableOption {
|
||||
type = types.str;
|
||||
# Sway/Wayland doesn't have the concept of a primary output. The default for sway is to show it on all outputs
|
||||
default = if isI3 then "primary" else "*";
|
||||
default =
|
||||
if isI3
|
||||
then "primary"
|
||||
else "*";
|
||||
description = "Where to output tray.";
|
||||
};
|
||||
|
||||
|
|
@ -384,7 +398,7 @@ let
|
|||
in {
|
||||
fonts = mkOption {
|
||||
type = with types; either (listOf str) fontOptions;
|
||||
default = { };
|
||||
default = {};
|
||||
example = literalExpression ''
|
||||
{
|
||||
names = [ "DejaVu Sans Mono" "FontAwesome5Free" ];
|
||||
|
|
@ -400,17 +414,20 @@ in {
|
|||
options = {
|
||||
titlebar = mkOption {
|
||||
type = types.bool;
|
||||
default = if versionOlder stateVersion "23.05" then
|
||||
(isI3 && (cfg.config.gaps == null))
|
||||
else
|
||||
true;
|
||||
defaultText = if isI3 then ''
|
||||
true for state version ≥ 23.05
|
||||
config.gaps == null for state version < 23.05
|
||||
'' else ''
|
||||
true for state version ≥ 23.05
|
||||
false for state version < 23.05
|
||||
'';
|
||||
default =
|
||||
if versionOlder stateVersion "23.05"
|
||||
then (isI3 && (cfg.config.gaps == null))
|
||||
else true;
|
||||
defaultText =
|
||||
if isI3
|
||||
then ''
|
||||
true for state version ≥ 23.05
|
||||
config.gaps == null for state version < 23.05
|
||||
''
|
||||
else ''
|
||||
true for state version ≥ 23.05
|
||||
false for state version < 23.05
|
||||
'';
|
||||
description = "Whether to show window titlebars.";
|
||||
};
|
||||
|
||||
|
|
@ -422,31 +439,33 @@ in {
|
|||
|
||||
hideEdgeBorders = mkOption {
|
||||
type = let
|
||||
i3Options = [ "none" "vertical" "horizontal" "both" "smart" ];
|
||||
swayOptions = i3Options ++ [ "smart_no_gaps" ];
|
||||
in if isI3 then
|
||||
types.enum i3Options
|
||||
else
|
||||
types.enum (swayOptions ++ (map (e: "--i3 ${e}") swayOptions));
|
||||
i3Options = ["none" "vertical" "horizontal" "both" "smart"];
|
||||
swayOptions = i3Options ++ ["smart_no_gaps"];
|
||||
in
|
||||
if isI3
|
||||
then types.enum i3Options
|
||||
else types.enum (swayOptions ++ (map (e: "--i3 ${e}") swayOptions));
|
||||
default = "none";
|
||||
description = "Hide window borders adjacent to the screen edges.";
|
||||
};
|
||||
|
||||
commands = mkOption {
|
||||
type = types.listOf windowCommandModule;
|
||||
default = [ ];
|
||||
default = [];
|
||||
description = ''
|
||||
List of commands that should be executed on specific windows.
|
||||
See {option}`for_window` ${moduleName}wm option documentation.
|
||||
'';
|
||||
example = [{
|
||||
command = "border pixel 1";
|
||||
criteria = { class = "XTerm"; };
|
||||
}];
|
||||
example = [
|
||||
{
|
||||
command = "border pixel 1";
|
||||
criteria = {class = "XTerm";};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
default = { };
|
||||
default = {};
|
||||
description = "Window titlebar and border settings.";
|
||||
};
|
||||
|
||||
|
|
@ -455,17 +474,20 @@ in {
|
|||
options = {
|
||||
titlebar = mkOption {
|
||||
type = types.bool;
|
||||
default = if versionOlder stateVersion "23.05" then
|
||||
(isI3 && (cfg.config.gaps == null))
|
||||
else
|
||||
true;
|
||||
defaultText = if isI3 then ''
|
||||
true for state version ≥ 23.05
|
||||
config.gaps == null for state version < 23.05
|
||||
'' else ''
|
||||
true for state version ≥ 23.05
|
||||
false for state version < 23.05
|
||||
'';
|
||||
default =
|
||||
if versionOlder stateVersion "23.05"
|
||||
then (isI3 && (cfg.config.gaps == null))
|
||||
else true;
|
||||
defaultText =
|
||||
if isI3
|
||||
then ''
|
||||
true for state version ≥ 23.05
|
||||
config.gaps == null for state version < 23.05
|
||||
''
|
||||
else ''
|
||||
true for state version ≥ 23.05
|
||||
false for state version < 23.05
|
||||
'';
|
||||
description = "Whether to show floating window titlebars.";
|
||||
};
|
||||
|
||||
|
|
@ -479,24 +501,22 @@ in {
|
|||
type = types.str;
|
||||
default = cfg.config.modifier;
|
||||
defaultText = "${moduleName}.config.modifier";
|
||||
description =
|
||||
"Modifier key or keys that can be used to drag floating windows.";
|
||||
description = "Modifier key or keys that can be used to drag floating windows.";
|
||||
example = "Mod4";
|
||||
};
|
||||
|
||||
criteria = mkOption {
|
||||
type = types.listOf criteriaModule;
|
||||
default = [ ];
|
||||
description =
|
||||
"List of criteria for windows that should be opened in a floating mode.";
|
||||
default = [];
|
||||
description = "List of criteria for windows that should be opened in a floating mode.";
|
||||
example = [
|
||||
{ "title" = "Steam - Update News"; }
|
||||
{ "class" = "Pavucontrol"; }
|
||||
{"title" = "Steam - Update News";}
|
||||
{"class" = "Pavucontrol";}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
default = { };
|
||||
default = {};
|
||||
description = "Floating window settings.";
|
||||
};
|
||||
|
||||
|
|
@ -504,7 +524,7 @@ in {
|
|||
type = types.submodule {
|
||||
options = {
|
||||
newWindow = mkOption {
|
||||
type = types.enum [ "smart" "urgent" "focus" "none" ];
|
||||
type = types.enum ["smart" "urgent" "focus" "none"];
|
||||
default = "smart";
|
||||
description = ''
|
||||
This option modifies focus behavior on new window activation.
|
||||
|
|
@ -515,24 +535,38 @@ in {
|
|||
};
|
||||
|
||||
followMouse = mkOption {
|
||||
type = if isSway then
|
||||
types.either (types.enum [ "yes" "no" "always" ]) types.bool
|
||||
else
|
||||
types.bool;
|
||||
default = if isSway then "yes" else true;
|
||||
type =
|
||||
if isSway
|
||||
then types.either (types.enum ["yes" "no" "always"]) types.bool
|
||||
else types.bool;
|
||||
default =
|
||||
if isSway
|
||||
then "yes"
|
||||
else true;
|
||||
description = "Whether focus should follow the mouse.";
|
||||
apply = val:
|
||||
if (isSway && isBool val) then (lib.hm.booleans.yesNo val) else val;
|
||||
if (isSway && isBool val)
|
||||
then (lib.hm.booleans.yesNo val)
|
||||
else val;
|
||||
};
|
||||
|
||||
wrapping = mkOption {
|
||||
type = types.enum [ "yes" "no" "force" "workspace" ];
|
||||
default = {
|
||||
i3 = if cfg.config.focus.forceWrapping then "force" else "yes";
|
||||
# the sway module's logic was inverted and incorrect,
|
||||
# so preserve it for backwards compatibility purposes
|
||||
sway = if cfg.config.focus.forceWrapping then "yes" else "no";
|
||||
}.${moduleName};
|
||||
type = types.enum ["yes" "no" "force" "workspace"];
|
||||
default =
|
||||
{
|
||||
i3 =
|
||||
if cfg.config.focus.forceWrapping
|
||||
then "force"
|
||||
else "yes";
|
||||
# the sway module's logic was inverted and incorrect,
|
||||
# so preserve it for backwards compatibility purposes
|
||||
sway =
|
||||
if cfg.config.focus.forceWrapping
|
||||
then "yes"
|
||||
else "no";
|
||||
}.${
|
||||
moduleName
|
||||
};
|
||||
description = ''
|
||||
Whether the window focus commands automatically wrap around the edge of containers.
|
||||
|
||||
|
|
@ -551,10 +585,10 @@ in {
|
|||
};
|
||||
|
||||
mouseWarping = mkOption {
|
||||
type = if isSway then
|
||||
types.oneOf [ types.bool (types.enum [ "container" "output" ]) ]
|
||||
else
|
||||
types.bool;
|
||||
type =
|
||||
if isSway
|
||||
then types.oneOf [types.bool (types.enum ["container" "output"])]
|
||||
else types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether mouse cursor should be warped to the center of the window when switching focus
|
||||
|
|
@ -563,13 +597,13 @@ in {
|
|||
};
|
||||
};
|
||||
};
|
||||
default = { };
|
||||
default = {};
|
||||
description = "Focus related settings.";
|
||||
};
|
||||
|
||||
assigns = mkOption {
|
||||
type = types.attrsOf (types.listOf criteriaModule);
|
||||
default = { };
|
||||
default = {};
|
||||
description = ''
|
||||
An attribute set that assigns applications to workspaces based
|
||||
on criteria.
|
||||
|
|
@ -583,14 +617,14 @@ in {
|
|||
};
|
||||
|
||||
modifier = mkOption {
|
||||
type = types.enum [ "Shift" "Control" "Mod1" "Mod2" "Mod3" "Mod4" "Mod5" ];
|
||||
type = types.enum ["Shift" "Control" "Mod1" "Mod2" "Mod3" "Mod4" "Mod5"];
|
||||
default = "Mod1";
|
||||
description = "Modifier key that is used for all default keybindings.";
|
||||
example = "Mod4";
|
||||
};
|
||||
|
||||
workspaceLayout = mkOption {
|
||||
type = types.enum [ "default" "stacking" "tabbed" ];
|
||||
type = types.enum ["default" "stacking" "tabbed"];
|
||||
default = "default";
|
||||
example = "tabbed";
|
||||
description = ''
|
||||
|
|
@ -613,12 +647,12 @@ in {
|
|||
|
||||
keycodebindings = mkOption {
|
||||
type = types.attrsOf (types.nullOr types.str);
|
||||
default = { };
|
||||
default = {};
|
||||
description = ''
|
||||
An attribute set that assigns keypress to an action using key code.
|
||||
See <https://i3wm.org/docs/userguide.html#keybindings>.
|
||||
'';
|
||||
example = { "214" = "exec /bin/script.sh"; };
|
||||
example = {"214" = "exec /bin/script.sh";};
|
||||
};
|
||||
|
||||
colors = mkOption {
|
||||
|
|
@ -700,7 +734,7 @@ in {
|
|||
};
|
||||
};
|
||||
};
|
||||
default = { };
|
||||
default = {};
|
||||
description = ''
|
||||
Color settings. All color classes can be specified using submodules
|
||||
with 'border', 'background', 'text', 'indicator' and 'childBorder' fields
|
||||
|
|
@ -713,50 +747,54 @@ in {
|
|||
|
||||
bars = mkOption {
|
||||
type = types.listOf barModule;
|
||||
default = if versionAtLeast stateVersion "20.09" then [{
|
||||
mode = "dock";
|
||||
hiddenState = "hide";
|
||||
position = "bottom";
|
||||
workspaceButtons = true;
|
||||
workspaceNumbers = true;
|
||||
statusCommand = "${pkgs.i3status}/bin/i3status";
|
||||
fonts = {
|
||||
names = [ "monospace" ];
|
||||
size = 8.0;
|
||||
};
|
||||
trayOutput = "primary";
|
||||
colors = {
|
||||
background = "#000000";
|
||||
statusline = "#ffffff";
|
||||
separator = "#666666";
|
||||
focusedWorkspace = {
|
||||
border = "#4c7899";
|
||||
background = "#285577";
|
||||
text = "#ffffff";
|
||||
};
|
||||
activeWorkspace = {
|
||||
border = "#333333";
|
||||
background = "#5f676a";
|
||||
text = "#ffffff";
|
||||
};
|
||||
inactiveWorkspace = {
|
||||
border = "#333333";
|
||||
background = "#222222";
|
||||
text = "#888888";
|
||||
};
|
||||
urgentWorkspace = {
|
||||
border = "#2f343a";
|
||||
background = "#900000";
|
||||
text = "#ffffff";
|
||||
};
|
||||
bindingMode = {
|
||||
border = "#2f343a";
|
||||
background = "#900000";
|
||||
text = "#ffffff";
|
||||
};
|
||||
};
|
||||
}] else
|
||||
[ { } ];
|
||||
default =
|
||||
if versionAtLeast stateVersion "20.09"
|
||||
then [
|
||||
{
|
||||
mode = "dock";
|
||||
hiddenState = "hide";
|
||||
position = "bottom";
|
||||
workspaceButtons = true;
|
||||
workspaceNumbers = true;
|
||||
statusCommand = "${pkgs.i3status}/bin/i3status";
|
||||
fonts = {
|
||||
names = ["monospace"];
|
||||
size = 8.0;
|
||||
};
|
||||
trayOutput = "primary";
|
||||
colors = {
|
||||
background = "#000000";
|
||||
statusline = "#ffffff";
|
||||
separator = "#666666";
|
||||
focusedWorkspace = {
|
||||
border = "#4c7899";
|
||||
background = "#285577";
|
||||
text = "#ffffff";
|
||||
};
|
||||
activeWorkspace = {
|
||||
border = "#333333";
|
||||
background = "#5f676a";
|
||||
text = "#ffffff";
|
||||
};
|
||||
inactiveWorkspace = {
|
||||
border = "#333333";
|
||||
background = "#222222";
|
||||
text = "#888888";
|
||||
};
|
||||
urgentWorkspace = {
|
||||
border = "#2f343a";
|
||||
background = "#900000";
|
||||
text = "#ffffff";
|
||||
};
|
||||
bindingMode = {
|
||||
border = "#2f343a";
|
||||
background = "#900000";
|
||||
text = "#ffffff";
|
||||
};
|
||||
};
|
||||
}
|
||||
]
|
||||
else [{}];
|
||||
defaultText = literalExpression "see code";
|
||||
description = ''
|
||||
${capitalModuleName} bars settings blocks. Set to empty list to remove bars completely.
|
||||
|
|
@ -765,28 +803,30 @@ in {
|
|||
|
||||
startup = mkOption {
|
||||
type = types.listOf startupModule;
|
||||
default = [ ];
|
||||
default = [];
|
||||
description = ''
|
||||
Commands that should be executed at startup.
|
||||
|
||||
See <https://i3wm.org/docs/userguide.html#_automatically_starting_applications_on_i3_startup>.
|
||||
'';
|
||||
example = if isI3 then
|
||||
literalExpression ''
|
||||
[
|
||||
{ command = "systemctl --user restart polybar"; always = true; notification = false; }
|
||||
{ command = "dropbox start"; notification = false; }
|
||||
{ command = "firefox"; }
|
||||
];
|
||||
''
|
||||
else
|
||||
literalExpression ''
|
||||
[
|
||||
{ command = "systemctl --user restart waybar"; always = true; }
|
||||
{ command = "dropbox start"; }
|
||||
{ command = "firefox"; }
|
||||
]
|
||||
'';
|
||||
example =
|
||||
if isI3
|
||||
then
|
||||
literalExpression ''
|
||||
[
|
||||
{ command = "systemctl --user restart polybar"; always = true; notification = false; }
|
||||
{ command = "dropbox start"; notification = false; }
|
||||
{ command = "firefox"; }
|
||||
];
|
||||
''
|
||||
else
|
||||
literalExpression ''
|
||||
[
|
||||
{ command = "systemctl --user restart waybar"; always = true; }
|
||||
{ command = "dropbox start"; }
|
||||
{ command = "firefox"; }
|
||||
]
|
||||
'';
|
||||
};
|
||||
|
||||
gaps = mkOption {
|
||||
|
|
@ -859,7 +899,7 @@ in {
|
|||
};
|
||||
|
||||
smartBorders = mkOption {
|
||||
type = types.enum [ "on" "off" "no_gaps" ];
|
||||
type = types.enum ["on" "off" "no_gaps"];
|
||||
default = "off";
|
||||
description = ''
|
||||
This option controls whether to disable container borders on
|
||||
|
|
@ -876,17 +916,20 @@ in {
|
|||
|
||||
terminal = mkOption {
|
||||
type = types.str;
|
||||
default = if isI3 then "i3-sensible-terminal" else "${pkgs.foot}/bin/foot";
|
||||
default =
|
||||
if isI3
|
||||
then "i3-sensible-terminal"
|
||||
else "${pkgs.foot}/bin/foot";
|
||||
description = "Default terminal to run.";
|
||||
example = "alacritty";
|
||||
};
|
||||
|
||||
menu = mkOption {
|
||||
type = types.str;
|
||||
default = if isSway then
|
||||
"${pkgs.dmenu}/bin/dmenu_path | ${pkgs.dmenu}/bin/dmenu | ${pkgs.findutils}/bin/xargs swaymsg exec --"
|
||||
else
|
||||
"${pkgs.dmenu}/bin/dmenu_run";
|
||||
default =
|
||||
if isSway
|
||||
then "${pkgs.dmenu}/bin/dmenu_path | ${pkgs.dmenu}/bin/dmenu | ${pkgs.findutils}/bin/xargs swaymsg exec --"
|
||||
else "${pkgs.dmenu}/bin/dmenu_run";
|
||||
description = "Default launcher to use.";
|
||||
example = "bemenu-run";
|
||||
};
|
||||
|
|
@ -896,7 +939,9 @@ in {
|
|||
default = null;
|
||||
description = ''
|
||||
The default workspace to show when ${
|
||||
if isSway then "sway" else "i3"
|
||||
if isSway
|
||||
then "sway"
|
||||
else "i3"
|
||||
} is launched.
|
||||
This must to correspond to the value of the keybinding of the default workspace.
|
||||
'';
|
||||
|
|
@ -904,35 +949,38 @@ in {
|
|||
};
|
||||
|
||||
workspaceOutputAssign = mkOption {
|
||||
type = with types;
|
||||
let
|
||||
workspaceOutputOpts = submodule {
|
||||
options = {
|
||||
workspace = mkOption {
|
||||
type = str;
|
||||
default = "";
|
||||
example = "Web";
|
||||
description = ''
|
||||
Name of the workspace to assign.
|
||||
'';
|
||||
};
|
||||
type = with types; let
|
||||
workspaceOutputOpts = submodule {
|
||||
options = {
|
||||
workspace = mkOption {
|
||||
type = str;
|
||||
default = "";
|
||||
example = "Web";
|
||||
description = ''
|
||||
Name of the workspace to assign.
|
||||
'';
|
||||
};
|
||||
|
||||
output = mkOption {
|
||||
type = with types; either str (listOf str);
|
||||
default = "";
|
||||
apply = lists.toList;
|
||||
example = "eDP";
|
||||
description = ''
|
||||
Name(s) of the output(s) from {command}`
|
||||
${if isSway then "swaymsg" else "i3-msg"} -t get_outputs
|
||||
`.
|
||||
'';
|
||||
};
|
||||
output = mkOption {
|
||||
type = with types; either str (listOf str);
|
||||
default = "";
|
||||
apply = lists.toList;
|
||||
example = "eDP";
|
||||
description = ''
|
||||
Name(s) of the output(s) from {command}`
|
||||
${
|
||||
if isSway
|
||||
then "swaymsg"
|
||||
else "i3-msg"
|
||||
} -t get_outputs
|
||||
`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
in listOf workspaceOutputOpts;
|
||||
default = [ ];
|
||||
};
|
||||
in
|
||||
listOf workspaceOutputOpts;
|
||||
default = [];
|
||||
description = "Assign workspaces to outputs.";
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,18 +4,14 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
}: let
|
||||
inherit (lib) mkOption types;
|
||||
palette =
|
||||
(pkgs.lib.importJSON (config.catppuccin.sources.palette + "/palette.json"))
|
||||
.${config.catppuccin.flavor}.colors;
|
||||
in
|
||||
{
|
||||
options.palette = mkOption { type = types.attrsOf types.raw; };
|
||||
in {
|
||||
options.palette = mkOption {type = types.attrsOf types.raw;};
|
||||
config = {
|
||||
inherit palette;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, ... }: {
|
||||
{lib, ...}: {
|
||||
programs.zsh.initContent = lib.mkBefore ''
|
||||
source /etc/static/zshrc
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -66,7 +66,9 @@ in {
|
|||
linux = "linux";
|
||||
home = "linux";
|
||||
}
|
||||
.${string.toLower config.type};
|
||||
.${
|
||||
string.toLower config.type
|
||||
};
|
||||
in "${config.arch}-${kernel}";
|
||||
folder =
|
||||
{
|
||||
|
|
@ -77,7 +79,9 @@ in {
|
|||
windows = "windows";
|
||||
home = "home";
|
||||
}
|
||||
.${string.toLower config.type};
|
||||
.${
|
||||
string.toLower config.type
|
||||
};
|
||||
modules = mkMerge [
|
||||
(mkIf (config.folder != "linux") [
|
||||
# per-OS modules
|
||||
|
|
@ -107,7 +111,7 @@ in {
|
|||
}
|
||||
// args);
|
||||
in
|
||||
args: sys args;
|
||||
sys;
|
||||
home = args: let
|
||||
renamedArgs = set.rename "specialArgs" "extraSpecialArgs" args;
|
||||
renamedArgsWithPkgs =
|
||||
|
|
@ -123,7 +127,9 @@ in {
|
|||
darwin = inputs.darwin.lib.darwinSystem;
|
||||
macos = inputs.darwin.lib.darwinSystem;
|
||||
}
|
||||
.${string.toLower config.type}
|
||||
.${
|
||||
string.toLower config.type
|
||||
}
|
||||
or null;
|
||||
built = mkOptionDefault (mapNullable (builder:
|
||||
builder {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
{ pkgs, inputs, ... }: {
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
package = inputs.nh.packages.${pkgs.system}.nh;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ...}: {
|
||||
{pkgs, ...}: {
|
||||
nix = {
|
||||
gc = {
|
||||
automatic = true;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{ pkgs, ... }: {
|
||||
environment.systemPackages = [
|
||||
pkgs.magic-wormhole
|
||||
];
|
||||
}
|
||||
{pkgs, ...}: {
|
||||
environment.systemPackages = [
|
||||
pkgs.magic-wormhole
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
|
|
@ -30,7 +29,8 @@ in {
|
|||
sops.secrets.tailscale-key = mkIf cfg.enable {
|
||||
sopsFile = ./secrets.yaml;
|
||||
};
|
||||
/* systemd.services.tailscale-autoconnect = mkIf cfg.enable rec {
|
||||
/*
|
||||
systemd.services.tailscale-autoconnect = mkIf cfg.enable rec {
|
||||
description = "Automatic connection to Tailscale";
|
||||
|
||||
# make sure tailscale is running before trying to connect to tailscale
|
||||
|
|
@ -72,6 +72,7 @@ in {
|
|||
# otherwise authenticate with tailscale
|
||||
${getExe tailscale} up ${advertiseExitNode} -authkey $(cat ${config.sops.secrets.tailscale-key.path})
|
||||
'';
|
||||
};*/
|
||||
};
|
||||
*/
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
{ pkgs, inputs, ... }: {
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
withUWSM = true;
|
||||
package = inputs.hyprland.packages."${pkgs.system}".hyprland;
|
||||
portalPackage = inputs.hyprland.packages."${pkgs.system}".xdg-desktop-portal-hyprland;
|
||||
};
|
||||
|
|
@ -14,9 +18,11 @@
|
|||
'';
|
||||
|
||||
services.clipboard-sync.enable = true;
|
||||
/*services.displayManager.sddm = {
|
||||
/*
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
package = pkgs.kdePackages.sddm;
|
||||
wayland.enable = true;
|
||||
};*/
|
||||
};
|
||||
*/
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,4 +9,3 @@
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }: {
|
||||
{pkgs, ...}: {
|
||||
programs.niri = {
|
||||
enable = true;
|
||||
package = pkgs.niri-unstable;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.types) submodule loaOf;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
hardware.graphics = {
|
||||
|
|
@ -9,7 +8,7 @@
|
|||
driversi686Linux.mesa
|
||||
];
|
||||
};
|
||||
programs.gamescope = {
|
||||
programs.gamescope = {
|
||||
enable = true;
|
||||
package = pkgs.gamescope;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, inputs, ... }: {
|
||||
_: {
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
{pkgs, ... }: {
|
||||
{pkgs, ...}: {
|
||||
programs.envision = {
|
||||
enable = true;
|
||||
openFirewall = true; # This is set true by default
|
||||
};
|
||||
|
||||
/*services.wivrn = {
|
||||
/*
|
||||
services.wivrn = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
package = pkgs.wivrn.override { cudaSupport = true; };
|
||||
|
|
@ -30,7 +31,8 @@
|
|||
#];
|
||||
};
|
||||
};
|
||||
};*/
|
||||
};
|
||||
*/
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
wlx-overlay-s
|
||||
|
|
@ -39,7 +41,7 @@
|
|||
];
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 9757 ];
|
||||
allowedUDPPorts = [ 9757 ];
|
||||
allowedTCPPorts = [9757];
|
||||
allowedUDPPorts = [9757];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,38 +1,44 @@
|
|||
{ config, lib, ... }: let
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkDefault;
|
||||
in {
|
||||
gensokyo-zone = {
|
||||
access = {
|
||||
tail.enable = mkDefault true;
|
||||
local.enable = mkDefault (config.networking.hostName == "goliath");
|
||||
};
|
||||
nix = {
|
||||
access = {
|
||||
tail.enable = mkDefault true;
|
||||
local.enable = mkDefault (config.networking.hostName == "goliath");
|
||||
};
|
||||
nix = {
|
||||
# enable = true;
|
||||
#cache.infrastructure.enable = true;
|
||||
# builder.enable = true;
|
||||
};
|
||||
kyuuto = {
|
||||
};
|
||||
kyuuto = {
|
||||
enable = mkDefault true;
|
||||
shared.enable = mkDefault true;
|
||||
#domain = mkIf config.gensokyo-zone.access.local.enable "local.${domain}";
|
||||
};
|
||||
/*
|
||||
krb5 = {
|
||||
enable = mkDefault true;
|
||||
sssd = {
|
||||
enable = mkDefault true;
|
||||
shared.enable = mkDefault true;
|
||||
#domain = mkIf config.gensokyo-zone.access.local.enable "local.${domain}";
|
||||
};
|
||||
/*krb5 = {
|
||||
enable = mkDefault true;
|
||||
sssd = {
|
||||
enable = mkDefault true;
|
||||
# TODO: sssd ldap backend config is currently broken for unknown reasons
|
||||
# EDIT: wait ifp was disabled maybe it's actually just fine and I'm dumb?
|
||||
backend = "ipa";
|
||||
};
|
||||
nfs.enable = mkDefault true;
|
||||
#nfs.debug.enable = true;
|
||||
ipa.enable = mkDefault true;
|
||||
};*/
|
||||
dns = {
|
||||
enable = mkDefault true;
|
||||
};
|
||||
monitoring = {
|
||||
enable = mkIf config.gensokyo-zone.access.local.enable (mkDefault true);
|
||||
# TODO: sssd ldap backend config is currently broken for unknown reasons
|
||||
# EDIT: wait ifp was disabled maybe it's actually just fine and I'm dumb?
|
||||
backend = "ipa";
|
||||
};
|
||||
nfs.enable = mkDefault true;
|
||||
#nfs.debug.enable = true;
|
||||
ipa.enable = mkDefault true;
|
||||
};
|
||||
*/
|
||||
dns = {
|
||||
enable = mkDefault true;
|
||||
};
|
||||
monitoring = {
|
||||
enable = mkIf config.gensokyo-zone.access.local.enable (mkDefault true);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }: {
|
||||
{pkgs, ...}: {
|
||||
boot.zfs.package = pkgs.zfs_cachyos;
|
||||
boot.kernelPackages = pkgs.linuxPackages_cachyos;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
_: {
|
||||
services.mullvad-vpn.enable = true;
|
||||
}
|
||||
services.mullvad-vpn.enable = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
"context.properties" = [
|
||||
{
|
||||
name = "libpipewire-module-protocol-pulse";
|
||||
args = { };
|
||||
args = {};
|
||||
}
|
||||
];
|
||||
"pulse.properties" = {
|
||||
|
|
@ -33,11 +33,11 @@
|
|||
services.pipewire.extraConfig.pipewire-pulse."91-discord-latency" = {
|
||||
pulse.rules = [
|
||||
{
|
||||
matches = [ { "application.process.binary" = "Discord"; } ];
|
||||
matches = [{"application.process.binary" = "Discord";}];
|
||||
actions = {
|
||||
update-props = {
|
||||
"pulse.min.quantum" = "1024/48000";
|
||||
};
|
||||
update-props = {
|
||||
"pulse.min.quantum" = "1024/48000";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
_: {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ _: {
|
|||
};
|
||||
consoleLogLevel = 0;
|
||||
kernelParams = ["quiet"];
|
||||
initrd = {
|
||||
verbose = false;
|
||||
systemd.enable = true;
|
||||
};
|
||||
initrd = {
|
||||
verbose = false;
|
||||
systemd.enable = true;
|
||||
};
|
||||
};
|
||||
catppuccin.plymouth.enable = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
_: {
|
||||
services.rustdesk-server = {
|
||||
enable = true;
|
||||
relayHosts = [ "100.89.32.57" ];
|
||||
relayHosts = ["100.89.32.57"];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ in
|
|||
legacyPackages = pkgs;
|
||||
packages = set.merge [pkgs wrappers.packages];
|
||||
checks = checks // formatting.checks;
|
||||
formatter = formatting.formatter;
|
||||
inherit (formatting) formatter;
|
||||
}
|
||||
// systems
|
||||
// shells
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
inputs.neorg-overlay.overlays.default
|
||||
inputs.niri.overlays.niri
|
||||
(import tree.packages.default {inherit inputs tree;})
|
||||
(final: prev: {
|
||||
wivrn = prev.wivrn.override { cudaSupport = true; };
|
||||
(_final: prev: {
|
||||
wivrn = prev.wivrn.override {cudaSupport = true;};
|
||||
})
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
{ lib, stdenv, fetchFromGitLab, glib, gettext, substituteAll, gnome-menus }:
|
||||
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitLab,
|
||||
glib,
|
||||
gettext,
|
||||
substituteAll,
|
||||
gnome-menus,
|
||||
}:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gnome-shell-extension-arcmenu";
|
||||
version = "63";
|
||||
|
|
@ -19,10 +26,11 @@ stdenv.mkDerivation rec {
|
|||
];
|
||||
|
||||
buildInputs = [
|
||||
glib gettext
|
||||
glib
|
||||
gettext
|
||||
];
|
||||
|
||||
makeFlags = [ "INSTALLBASE=${placeholder "out"}/share/gnome-shell/extensions" ];
|
||||
makeFlags = ["INSTALLBASE=${placeholder "out"}/share/gnome-shell/extensions"];
|
||||
|
||||
passthru = {
|
||||
extensionUuid = "arcmenu@arcmenu.com";
|
||||
|
|
@ -32,7 +40,7 @@ stdenv.mkDerivation rec {
|
|||
meta = with lib; {
|
||||
description = "Application menu for GNOME Shell, designed to provide a more traditional user experience and workflow";
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = with maintainers; [ dkabot ];
|
||||
maintainers = with maintainers; [dkabot];
|
||||
homepage = "https://gitlab.com/arcmenu/ArcMenu";
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
stdenvNoCC,
|
||||
fetchgit,
|
||||
openssh,
|
||||
findutils,
|
||||
...
|
||||
}:
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,6 @@
|
|||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
pkg-config,
|
||||
cmake,
|
||||
setuptools,
|
||||
python,
|
||||
}: let
|
||||
cppyy = python.buildPythonPackage rec {
|
||||
|
|
@ -26,4 +22,5 @@
|
|||
license = licenses.bsd3Lbnl;
|
||||
};
|
||||
};
|
||||
in cppyy
|
||||
in
|
||||
cppyy
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@
|
|||
webkitgtk_4_1,
|
||||
cargo-tauri,
|
||||
desktop-file-utils,
|
||||
}:
|
||||
|
||||
let
|
||||
}: let
|
||||
webkitgtk_4_1' = webkitgtk_4_1.override {
|
||||
enableExperimental = true;
|
||||
};
|
||||
|
|
@ -30,165 +28,163 @@ let
|
|||
hash = "sha256-d9vaKLrl8RYNcHnE1iGN49ov6U/Y+9XpEsio+c1Sguc=";
|
||||
meta = {
|
||||
homepage = "https://github.com/uwu/shelter";
|
||||
sourceProvenance = [ lib.sourceTypes.binaryBytecode ]; # actually, minified JS
|
||||
sourceProvenance = [lib.sourceTypes.binaryBytecode]; # actually, minified JS
|
||||
license = lib.licenses.cc0;
|
||||
};
|
||||
};
|
||||
in
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "dorion";
|
||||
version = "6.7.1";
|
||||
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "dorion";
|
||||
version = "6.7.1";
|
||||
src = fetchFromGitHub {
|
||||
owner = "SpikeHD";
|
||||
repo = "Dorion";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-d4G3royqhz+te5wPWVLNqqG/w0qOvTd7dKcWSzxUMUo=";
|
||||
};
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "SpikeHD";
|
||||
repo = "Dorion";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-d4G3royqhz+te5wPWVLNqqG/w0qOvTd7dKcWSzxUMUo=";
|
||||
};
|
||||
cargoPatches = [
|
||||
./no-cargo-patch.patch
|
||||
];
|
||||
|
||||
cargoPatches = [
|
||||
./no-cargo-patch.patch
|
||||
];
|
||||
cargoRoot = "src-tauri";
|
||||
buildAndTestSubdir = finalAttrs.cargoRoot;
|
||||
|
||||
cargoRoot = "src-tauri";
|
||||
buildAndTestSubdir = finalAttrs.cargoRoot;
|
||||
useFetchCargoVendor = true;
|
||||
cargoHash = "sha256-1xpAJkS31DjrZCY5WJ4/Z1t1ALED5gz7xYLhVR1Qzww=";
|
||||
|
||||
useFetchCargoVendor = true;
|
||||
cargoHash = "sha256-1xpAJkS31DjrZCY5WJ4/Z1t1ALED5gz7xYLhVR1Qzww=";
|
||||
pnpmDeps = pnpm_9.fetchDeps {
|
||||
inherit (finalAttrs) pname version src;
|
||||
hash = "sha256-xBonUzA4+1zbViEsKap6CaG6ZRldW1LjNYIB+FmVRFs=";
|
||||
};
|
||||
|
||||
pnpmDeps = pnpm_9.fetchDeps {
|
||||
inherit (finalAttrs) pname version src;
|
||||
hash = "sha256-xBonUzA4+1zbViEsKap6CaG6ZRldW1LjNYIB+FmVRFs=";
|
||||
};
|
||||
# CMake (webkit extension)
|
||||
cmakeDir = ".";
|
||||
cmakeBuildDir = "src-tauri/extension_webkit";
|
||||
dontUseCmakeConfigure = true;
|
||||
dontUseNinjaBuild = true;
|
||||
dontUseNinjaCheck = true;
|
||||
dontUseNinjaInstall = true;
|
||||
# cmake's supposed to set this automatically
|
||||
# ... but the detection is based on the presence of ninja build hook
|
||||
cmakeFlags = [
|
||||
"-GNinja"
|
||||
];
|
||||
|
||||
# CMake (webkit extension)
|
||||
cmakeDir = ".";
|
||||
cmakeBuildDir = "src-tauri/extension_webkit";
|
||||
dontUseCmakeConfigure = true;
|
||||
dontUseNinjaBuild = true;
|
||||
dontUseNinjaCheck = true;
|
||||
dontUseNinjaInstall = true;
|
||||
# cmake's supposed to set this automatically
|
||||
# ... but the detection is based on the presence of ninja build hook
|
||||
cmakeFlags = [
|
||||
"-GNinja"
|
||||
];
|
||||
nativeBuildInputs = [
|
||||
pnpm_9.configHook
|
||||
cargo-tauri.hook
|
||||
nodejs
|
||||
pkg-config
|
||||
wrapGAppsHook4
|
||||
yq-go
|
||||
desktop-file-utils
|
||||
cmake
|
||||
ninja
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
pnpm_9.configHook
|
||||
cargo-tauri.hook
|
||||
nodejs
|
||||
pkg-config
|
||||
wrapGAppsHook4
|
||||
yq-go
|
||||
desktop-file-utils
|
||||
cmake
|
||||
ninja
|
||||
];
|
||||
buildInputs = [
|
||||
openssl
|
||||
webkitgtk_4_1'
|
||||
gst_all_1.gst-plugins-base
|
||||
gst_all_1.gst-plugins-bad
|
||||
gst_all_1.gst-plugins-good
|
||||
gst_all_1.gst-plugins-rs
|
||||
glib-networking
|
||||
libsysprof-capture
|
||||
libayatana-appindicator
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
openssl
|
||||
webkitgtk_4_1'
|
||||
gst_all_1.gst-plugins-base
|
||||
gst_all_1.gst-plugins-bad
|
||||
gst_all_1.gst-plugins-good
|
||||
gst_all_1.gst-plugins-rs
|
||||
glib-networking
|
||||
libsysprof-capture
|
||||
libayatana-appindicator
|
||||
];
|
||||
postPatch = ''
|
||||
# remove updater
|
||||
rm -rf updater
|
||||
|
||||
postPatch = ''
|
||||
# remove updater
|
||||
rm -rf updater
|
||||
# patch cargo-deps
|
||||
pushd $cargoDepsCopy/tauri-plugin-shell-*
|
||||
patch -p1 < /build/source/src-tauri/patches/tauri-plugin-shell+*.patch
|
||||
popd
|
||||
|
||||
# patch cargo-deps
|
||||
pushd $cargoDepsCopy/tauri-plugin-shell-*
|
||||
patch -p1 < /build/source/src-tauri/patches/tauri-plugin-shell+*.patch
|
||||
popd
|
||||
substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \
|
||||
--replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
|
||||
|
||||
substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \
|
||||
--replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
|
||||
# disable pre-build script and disable auto-updater
|
||||
yq -iPo=json '
|
||||
.bundle.resources = (.bundle.resources | map(select(. != "updater*")))
|
||||
' src-tauri/tauri.conf.json
|
||||
|
||||
# disable pre-build script and disable auto-updater
|
||||
yq -iPo=json '
|
||||
.bundle.resources = (.bundle.resources | map(select(. != "updater*")))
|
||||
' src-tauri/tauri.conf.json
|
||||
# link shelter injection
|
||||
ln -s ${shelter} src-tauri/injection/shelter.js
|
||||
|
||||
# link shelter injection
|
||||
ln -s ${shelter} src-tauri/injection/shelter.js
|
||||
|
||||
# link html/frontend data
|
||||
ln -s /build/source/src /build/source/src-tauri/html
|
||||
'';
|
||||
|
||||
configurePhase = ''
|
||||
cmakeConfigurePhase
|
||||
pnpmConfigHook
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
ninjaBuildPhase
|
||||
cd /build/source
|
||||
tauriBuildHook
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
# Set up the resource directories
|
||||
mkdir -p $out/lib/Dorion
|
||||
ln -s $out/lib/Dorion $out/lib/dorion
|
||||
rm -rf $out/lib/Dorion/injection
|
||||
cp -r src-tauri/injection $out/lib/Dorion
|
||||
cp -r src $out/lib/Dorion
|
||||
|
||||
# Modify the desktop file
|
||||
desktop-file-edit \
|
||||
--set-comment "Tiny alternative Discord client" \
|
||||
--set-key="Exec" --set-value="Dorion %U" \
|
||||
--set-key="TryExec" --set-value="Dorion" \
|
||||
--set-key="StartupWMClass" --set-value="Dorion" \
|
||||
--set-key="StartupNotify" --set-value="true" \
|
||||
--set-key="Categories" --set-value="Network;InstantMessaging;Chat;" \
|
||||
--set-key="Keywords" --set-value="dorion;discord;vencord;chat;im;vc;ds;dc;dsc;tauri;" \
|
||||
--set-key="Terminal" --set-value="false" \
|
||||
--set-key="MimeType" --set-value="x-scheme-handler/discord" \
|
||||
$out/share/applications/Dorion.desktop
|
||||
'';
|
||||
|
||||
# error: failed to run custom build command for `Dorion v6.5.3 (/build/source/src-tauri)`
|
||||
# Permission denied (os error 13)
|
||||
doCheck = false;
|
||||
|
||||
env = {
|
||||
TAURI_RESOURCE_DIR = "${placeholder "out"}/lib";
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = "https://spikehd.github.io/projects/dorion/";
|
||||
description = "Tiny alternative Discord client";
|
||||
longDescription = ''
|
||||
Dorion is an alternative Discord client aimed towards lower-spec or
|
||||
storage-sensitive PCs that supports themes, plugins, and more!
|
||||
# link html/frontend data
|
||||
ln -s /build/source/src /build/source/src-tauri/html
|
||||
'';
|
||||
changelog = "https://github.com/SpikeHD/Dorion/releases/tag/v${finalAttrs.version}";
|
||||
downloadPage = "https://github.com/SpikeHD/Dorion/releases/tag/v${finalAttrs.version}";
|
||||
license = with lib.licenses; [
|
||||
gpl3Only
|
||||
cc0 # Shelter
|
||||
];
|
||||
mainProgram = "Dorion";
|
||||
maintainers = with lib.maintainers; [
|
||||
nyabinary
|
||||
aleksana
|
||||
griffi-gh
|
||||
getchoo
|
||||
];
|
||||
platforms = lib.platforms.linux;
|
||||
sourceProvenance = [
|
||||
lib.sourceTypes.binaryBytecode # actually, minified JS
|
||||
lib.sourceTypes.fromSource
|
||||
];
|
||||
};
|
||||
})
|
||||
|
||||
configurePhase = ''
|
||||
cmakeConfigurePhase
|
||||
pnpmConfigHook
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
ninjaBuildPhase
|
||||
cd /build/source
|
||||
tauriBuildHook
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
# Set up the resource directories
|
||||
mkdir -p $out/lib/Dorion
|
||||
ln -s $out/lib/Dorion $out/lib/dorion
|
||||
rm -rf $out/lib/Dorion/injection
|
||||
cp -r src-tauri/injection $out/lib/Dorion
|
||||
cp -r src $out/lib/Dorion
|
||||
|
||||
# Modify the desktop file
|
||||
desktop-file-edit \
|
||||
--set-comment "Tiny alternative Discord client" \
|
||||
--set-key="Exec" --set-value="Dorion %U" \
|
||||
--set-key="TryExec" --set-value="Dorion" \
|
||||
--set-key="StartupWMClass" --set-value="Dorion" \
|
||||
--set-key="StartupNotify" --set-value="true" \
|
||||
--set-key="Categories" --set-value="Network;InstantMessaging;Chat;" \
|
||||
--set-key="Keywords" --set-value="dorion;discord;vencord;chat;im;vc;ds;dc;dsc;tauri;" \
|
||||
--set-key="Terminal" --set-value="false" \
|
||||
--set-key="MimeType" --set-value="x-scheme-handler/discord" \
|
||||
$out/share/applications/Dorion.desktop
|
||||
'';
|
||||
|
||||
# error: failed to run custom build command for `Dorion v6.5.3 (/build/source/src-tauri)`
|
||||
# Permission denied (os error 13)
|
||||
doCheck = false;
|
||||
|
||||
env = {
|
||||
TAURI_RESOURCE_DIR = "${placeholder "out"}/lib";
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = "https://spikehd.github.io/projects/dorion/";
|
||||
description = "Tiny alternative Discord client";
|
||||
longDescription = ''
|
||||
Dorion is an alternative Discord client aimed towards lower-spec or
|
||||
storage-sensitive PCs that supports themes, plugins, and more!
|
||||
'';
|
||||
changelog = "https://github.com/SpikeHD/Dorion/releases/tag/v${finalAttrs.version}";
|
||||
downloadPage = "https://github.com/SpikeHD/Dorion/releases/tag/v${finalAttrs.version}";
|
||||
license = with lib.licenses; [
|
||||
gpl3Only
|
||||
cc0 # Shelter
|
||||
];
|
||||
mainProgram = "Dorion";
|
||||
maintainers = with lib.maintainers; [
|
||||
nyabinary
|
||||
aleksana
|
||||
griffi-gh
|
||||
getchoo
|
||||
];
|
||||
platforms = lib.platforms.linux;
|
||||
sourceProvenance = [
|
||||
lib.sourceTypes.binaryBytecode # actually, minified JS
|
||||
lib.sourceTypes.fromSource
|
||||
];
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
extra-cmake-modules,
|
||||
|
|
|
|||
|
|
@ -8,73 +8,73 @@ SYSTEM_TYPE=${3:-""}
|
|||
|
||||
# Helper functions
|
||||
send_discord_message() {
|
||||
local message="$1"
|
||||
if [[ -n "$DISCORD_WEBHOOK_LINK" ]]; then
|
||||
local escaped_message=$(printf '%s' "$message" | jq -R -s '.')
|
||||
curl -s -H "Accept: application/json" -H "Content-Type: application/json" \
|
||||
-X POST --data "{\"content\": $escaped_message}" "$DISCORD_WEBHOOK_LINK"
|
||||
else
|
||||
echo "Discord message (not sent): $message"
|
||||
fi
|
||||
local message="$1"
|
||||
if [[ -n "$DISCORD_WEBHOOK_LINK" ]]; then
|
||||
local escaped_message=$(printf '%s' "$message" | jq -R -s '.')
|
||||
curl -s -H "Accept: application/json" -H "Content-Type: application/json" \
|
||||
-X POST --data "{\"content\": $escaped_message}" "$DISCORD_WEBHOOK_LINK"
|
||||
else
|
||||
echo "Discord message (not sent): $message"
|
||||
fi
|
||||
}
|
||||
|
||||
init_nfargs() {
|
||||
local nflinksuffix="-L"
|
||||
local nflinksuffix="-L"
|
||||
|
||||
nfargs=(
|
||||
"${NIX_BUILD_ARGS[@]}"
|
||||
nfargs=(
|
||||
"${NIX_BUILD_ARGS[@]}"
|
||||
)
|
||||
|
||||
if [[ -n "${NF_ACTIONS_TEST_OUTLINK-}" || -n "${NF_UPDATE_CACHIX_PUSH-}" ]]; then
|
||||
nfargs+=(
|
||||
-o "${NF_ACTIONS_TEST_OUTLINK-result}" "$nflinksuffix"
|
||||
)
|
||||
|
||||
if [[ -n "${NF_ACTIONS_TEST_OUTLINK-}" || -n "${NF_UPDATE_CACHIX_PUSH-}" ]]; then
|
||||
nfargs+=(
|
||||
-o "${NF_ACTIONS_TEST_OUTLINK-result}" "$nflinksuffix"
|
||||
)
|
||||
else
|
||||
nfargs+=(
|
||||
--no-link
|
||||
)
|
||||
fi
|
||||
else
|
||||
nfargs+=(
|
||||
--no-link
|
||||
)
|
||||
fi
|
||||
}
|
||||
|
||||
perform_cachix_push() {
|
||||
local nflinksuffix="-L"
|
||||
if [[ -n ${NF_UPDATE_CACHIX_PUSH-} ]]; then
|
||||
send_discord_message "Cachix pushing ${SYSTEM_TYPE} system build for ${ALIAS}"
|
||||
cachix push kittywitch "./${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"*/
|
||||
fi
|
||||
local nflinksuffix="-L"
|
||||
if [[ -n ${NF_UPDATE_CACHIX_PUSH-} ]]; then
|
||||
send_discord_message "Cachix pushing ${SYSTEM_TYPE} system build for ${ALIAS}"
|
||||
cachix push kittywitch "./${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"*/
|
||||
fi
|
||||
}
|
||||
|
||||
perform_garbage_collection() {
|
||||
if [[ -n ${NF_ACTIONS_TEST_GC-} ]]; then
|
||||
nix-collect-garbage -d
|
||||
fi
|
||||
if [[ -n ${NF_ACTIONS_TEST_GC-} ]]; then
|
||||
nix-collect-garbage -d
|
||||
fi
|
||||
}
|
||||
|
||||
# Main script
|
||||
if [[ -z "$SYSTEM_LINK" || -z "$ALIAS" || -z "$SYSTEM_TYPE" ]]; then
|
||||
echo "Usage: $0 <SYSTEM_LINK> <ALIAS> <SYSTEM_TYPE>" >&2
|
||||
exit 1
|
||||
echo "Usage: $0 <SYSTEM_LINK> <ALIAS> <SYSTEM_TYPE>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
send_discord_message "Starting ${SYSTEM_TYPE} system build for ${ALIAS}"
|
||||
|
||||
if [[ -n ${CACHIX_AUTH_TOKEN-} ]]; then
|
||||
export NF_UPDATE_CACHIX_PUSH=1
|
||||
export NF_UPDATE_CACHIX_PUSH=1
|
||||
fi
|
||||
|
||||
cd "$NF_CONFIG_ROOT"
|
||||
|
||||
if [[ -n ${NF_UPDATE_CACHIX_PUSH-} ]]; then
|
||||
export NF_ACTIONS_TEST_OUTLINK=${NF_ACTIONS_TEST_OUTLINK-result}
|
||||
export NF_ACTIONS_TEST_OUTLINK=${NF_ACTIONS_TEST_OUTLINK-result}
|
||||
fi
|
||||
|
||||
if [[ ${GITHUB_ACTIONS-} = true && ${RUNNER_NAME-} = "Github Actions"* ]]; then
|
||||
echo "Enabled GC between builds due to restricted disk space..." >&2
|
||||
export NF_ACTIONS_TEST_GC=1
|
||||
echo "Enabled GC between builds due to restricted disk space..." >&2
|
||||
export NF_ACTIONS_TEST_GC=1
|
||||
fi
|
||||
|
||||
NIX_BUILD_ARGS=(
|
||||
--show-trace
|
||||
--show-trace
|
||||
)
|
||||
NIX_BUILD_ARGS_ASYNC=()
|
||||
|
||||
|
|
@ -84,37 +84,37 @@ init_nfargs
|
|||
|
||||
nfwarn=
|
||||
if [[ -n "${NF_NIX_SYSTEMS_WARN-}" && " ${NF_NIX_SYSTEMS_WARN[*]} " = *" $nfsystem "* ]]; then
|
||||
nfwarn=1
|
||||
nfwarn=1
|
||||
fi
|
||||
|
||||
if [[ -n ${NF_ACTIONS_TEST_ASYNC-} && -z $nfwarn ]]; then
|
||||
NIX_BUILD_ARGS_ASYNC+=("$nfinstallable")
|
||||
NIX_BUILD_ARGS_ASYNC+=("$nfinstallable")
|
||||
else
|
||||
echo "Building ${nfsystem}..." >&2
|
||||
echo >&2
|
||||
echo "Building ${nfsystem}..." >&2
|
||||
echo >&2
|
||||
|
||||
if ! nix build "$nfinstallable" "${nfargs[@]}"; then
|
||||
if [[ -n $nfwarn ]]; then
|
||||
send_discord_message "Build failure allowed for ${nfsystem}, ignoring..."
|
||||
echo "Build failure allowed for ${nfsystem}, ignoring..." >&2
|
||||
else
|
||||
send_discord_message "Build failure for ${nfsystem}, problem!"
|
||||
exit 1
|
||||
fi
|
||||
if ! nix build "$nfinstallable" "${nfargs[@]}"; then
|
||||
if [[ -n $nfwarn ]]; then
|
||||
send_discord_message "Build failure allowed for ${nfsystem}, ignoring..."
|
||||
echo "Build failure allowed for ${nfsystem}, ignoring..." >&2
|
||||
else
|
||||
send_discord_message "${SYSTEM_TYPE} system build of ${ALIAS} succeeded!"
|
||||
perform_cachix_push
|
||||
perform_garbage_collection
|
||||
send_discord_message "Build failure for ${nfsystem}, problem!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
send_discord_message "${SYSTEM_TYPE} system build of ${ALIAS} succeeded!"
|
||||
perform_cachix_push
|
||||
perform_garbage_collection
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -n ${NF_ACTIONS_TEST_ASYNC-} ]]; then
|
||||
init_nfargs
|
||||
if nix build "${nfargs[@]}" "${NIX_BUILD_ARGS_ASYNC[@]}"; then
|
||||
perform_cachix_push
|
||||
perform_garbage_collection
|
||||
else
|
||||
send_discord_message "Async build failure for ${nfsystem}, problem!"
|
||||
exit 1
|
||||
fi
|
||||
init_nfargs
|
||||
if nix build "${nfargs[@]}" "${NIX_BUILD_ARGS_ASYNC[@]}"; then
|
||||
perform_cachix_push
|
||||
perform_garbage_collection
|
||||
else
|
||||
send_discord_message "Async build failure for ${nfsystem}, problem!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@
|
|||
cachix,
|
||||
jq,
|
||||
nix,
|
||||
curl
|
||||
curl,
|
||||
}: let
|
||||
inherit (lib) makeBinPath;
|
||||
in writeShellScriptBin "nf-build-system" ''
|
||||
in
|
||||
writeShellScriptBin "nf-build-system" ''
|
||||
export PATH="$PATH:${lib.makeBinPath [
|
||||
git
|
||||
cachix
|
||||
|
|
@ -17,4 +18,4 @@ in writeShellScriptBin "nf-build-system" ''
|
|||
curl
|
||||
]}"
|
||||
exec ${./build-system.sh} "$@"
|
||||
''
|
||||
''
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@
|
|||
cachix,
|
||||
jq,
|
||||
nix,
|
||||
curl
|
||||
curl,
|
||||
}: let
|
||||
inherit (lib) makeBinPath;
|
||||
in writeShellScriptBin "nf-update" ''
|
||||
in
|
||||
writeShellScriptBin "nf-update" ''
|
||||
export PATH="$PATH:${lib.makeBinPath [
|
||||
git
|
||||
cachix
|
||||
|
|
@ -17,4 +18,4 @@ in writeShellScriptBin "nf-update" ''
|
|||
curl
|
||||
]}"
|
||||
exec ${./update.sh} "$@"
|
||||
''
|
||||
''
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ DISCORD_WEBHOOK_LINK=${DISCORD_WEBHOOK_LINK:-""}
|
|||
|
||||
# Helper functions
|
||||
send_discord_message() {
|
||||
local message="$1"
|
||||
local escaped_message=$(printf '%s' "$message" | jq -R -s '.')
|
||||
curl -s -H "Accept: application/json" -H "Content-Type: application/json" \
|
||||
-X POST --data "{\"content\": $escaped_message}" "$DISCORD_WEBHOOK_LINK"
|
||||
local message="$1"
|
||||
local escaped_message=$(printf '%s' "$message" | jq -R -s '.')
|
||||
curl -s -H "Accept: application/json" -H "Content-Type: application/json" \
|
||||
-X POST --data "{\"content\": $escaped_message}" "$DISCORD_WEBHOOK_LINK"
|
||||
}
|
||||
|
||||
if [[ -n ${CACHIX_AUTH_TOKEN-} ]]; then
|
||||
export NF_UPDATE_CACHIX_PUSH=1
|
||||
export NF_UPDATE_CACHIX_PUSH=1
|
||||
fi
|
||||
|
||||
cd "$NF_CONFIG_ROOT"
|
||||
|
|
@ -22,48 +22,48 @@ send_discord_message "Beginning flake update cron job"
|
|||
nix flake update "$@"
|
||||
|
||||
if [[ -n $(git status --porcelain ./flake.lock) ]]; then
|
||||
git -P diff ./flake.lock
|
||||
git -P diff ./flake.lock
|
||||
else
|
||||
echo "no source changes" >&2
|
||||
exit
|
||||
echo "no source changes" >&2
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "checking that nodes still build..." >&2
|
||||
if [[ -n ${NF_UPDATE_CACHIX_PUSH-} ]]; then
|
||||
export NF_ACTIONS_TEST_OUTLINK=${NF_ACTIONS_TEST_OUTLINK-result}
|
||||
export NF_ACTIONS_TEST_OUTLINK=${NF_ACTIONS_TEST_OUTLINK-result}
|
||||
fi
|
||||
if [[ -z ${NF_UPDATE_SKIP-} ]]; then
|
||||
send_discord_message "checking that nodes still build..."
|
||||
if [[ -n ${NF_UPDATE_CACHIX_PUSH-} ]]; then
|
||||
export NF_ACTIONS_TEST_OUTLINK=${NF_ACTIONS_TEST_OUTLINK-result}
|
||||
fi
|
||||
send_discord_message "checking that nodes still build..."
|
||||
if [[ -n ${NF_UPDATE_CACHIX_PUSH-} ]]; then
|
||||
export NF_ACTIONS_TEST_OUTLINK=${NF_ACTIONS_TEST_OUTLINK-result}
|
||||
fi
|
||||
nix run .#nf-actions-test -- -L
|
||||
fi
|
||||
|
||||
if [[ -n ${NF_UPDATE_CACHIX_PUSH-} && -v NF_ACTIONS_TEST_OUTLINK ]]; then
|
||||
send_discord_message "Cachix pushing"
|
||||
cachix push kittywitch "./${NF_ACTIONS_TEST_OUTLINK}"*/ &
|
||||
CACHIX_PUSH=$!
|
||||
cachix push kittywitch "./${NF_ACTIONS_TEST_OUTLINK}"*/ &
|
||||
CACHIX_PUSH=$!
|
||||
fi
|
||||
|
||||
if [[ -z ${NF_UPDATE_GIT_COMMIT-} ]]; then
|
||||
wait ${CACHIX_PUSH-}
|
||||
exit
|
||||
wait ${CACHIX_PUSH-}
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ -n $(git diff --staged) ]]; then
|
||||
echo "git working tree dirty, refusing to commit..." >&2
|
||||
exit 1
|
||||
echo "git working tree dirty, refusing to commit..." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git add flake.lock
|
||||
env \
|
||||
GIT_{COMMITTER,AUTHOR}_EMAIL=github@kittywit.ch \
|
||||
GIT_{COMMITTER,AUTHOR}_NAME="flake cron job" \
|
||||
git commit --message="chore(ci): flake update"
|
||||
GIT_{COMMITTER,AUTHOR}_EMAIL=github@kittywit.ch \
|
||||
GIT_{COMMITTER,AUTHOR}_NAME="flake cron job" \
|
||||
git commit --message="chore(ci): flake update"
|
||||
|
||||
if [[ ${GITHUB_REF-} = refs/heads/${NF_UPDATE_BRANCH-main} ]]; then
|
||||
git push origin HEAD:${NF_UPDATE_BRANCH-main}
|
||||
git push origin HEAD:${NF_UPDATE_BRANCH-main}
|
||||
send_discord_message "Pushed a new commit!"
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -10,89 +10,89 @@ MONTHS_TO_KEEP=1
|
|||
|
||||
# Helper functions
|
||||
send_discord_message() {
|
||||
local message="$1"
|
||||
echo "$message"
|
||||
local escaped_message=$(printf '%s' "$message" | jq -R -s '.')
|
||||
curl -s -H "Accept: application/json" -H "Content-Type: application/json" \
|
||||
-X POST --data "{\"content\": $escaped_message}" "$DISCORD_WEBHOOK_LINK"
|
||||
local message="$1"
|
||||
echo "$message"
|
||||
local escaped_message=$(printf '%s' "$message" | jq -R -s '.')
|
||||
curl -s -H "Accept: application/json" -H "Content-Type: application/json" \
|
||||
-X POST --data "{\"content\": $escaped_message}" "$DISCORD_WEBHOOK_LINK"
|
||||
}
|
||||
|
||||
get_db_size() {
|
||||
sudo -u postgres psql matrix-synapse -t -c \
|
||||
"SELECT pg_size_pretty(pg_database_size('matrix-synapse'));" | tr -d ' '
|
||||
sudo -u postgres psql matrix-synapse -t -c \
|
||||
"SELECT pg_size_pretty(pg_database_size('matrix-synapse'));" | tr -d ' '
|
||||
}
|
||||
|
||||
get_media_store_size() {
|
||||
sudo du /var/lib/matrix-synapse/media_store -hd 0 | awk '{print $1}'
|
||||
sudo du /var/lib/matrix-synapse/media_store -hd 0 | awk '{print $1}'
|
||||
}
|
||||
|
||||
get_filesystem_usage() {
|
||||
df -h / | awk 'NR==2 {print $5 " (" $3 ")"}' | tr -d '\n'
|
||||
df -h / | awk 'NR==2 {print $5 " (" $3 ")"}' | tr -d '\n'
|
||||
}
|
||||
|
||||
calculate_ratio() {
|
||||
local before="$1"
|
||||
local after="$2"
|
||||
awk "BEGIN {printf \"%.2f\", ($after / $before) * 100}"
|
||||
local before="$1"
|
||||
local after="$2"
|
||||
awk "BEGIN {printf \"%.2f\", ($after / $before) * 100}"
|
||||
}
|
||||
|
||||
# Main script
|
||||
main() {
|
||||
# Check for required variables
|
||||
if [[ -z "$HOMESERVER" || -z "$API_ID" || -z "$DISCORD_WEBHOOK_LINK" ]]; then
|
||||
send_discord_message "Error: HOMESERVER, API_ID, and DISCORD_WEBHOOK_LINK must be set."
|
||||
exit 1
|
||||
# Check for required variables
|
||||
if [[ -z "$HOMESERVER" || -z "$API_ID" || -z "$DISCORD_WEBHOOK_LINK" ]]; then
|
||||
send_discord_message "Error: HOMESERVER, API_ID, and DISCORD_WEBHOOK_LINK must be set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Initial sizes and usage
|
||||
local db_before_size=$(get_db_size)
|
||||
local media_before_size=$(get_media_store_size)
|
||||
local fs_before_usage=$(get_filesystem_usage)
|
||||
|
||||
send_discord_message "Beginning matrix-synapse optimization process - Database before size: ${db_before_size}, Media store before size: ${media_before_size}, Filesystem usage before: ${fs_before_usage}"
|
||||
|
||||
send_discord_message "Starting synapse"
|
||||
systemctl start matrix-synapse
|
||||
sleep 5
|
||||
|
||||
send_discord_message "Collecting required room data"
|
||||
curl --header "Authorization: Bearer ${API_ID}" \
|
||||
"https://${HOMESERVER}/_synapse/admin/v1/rooms?limit=500" > "${TEMPDIR}/roomlist.json"
|
||||
|
||||
jq '.rooms[] | select(.joined_local_members == 0) | .room_id' < "${TEMPDIR}/roomlist.json" > "${TEMPDIR}/to_purge.txt"
|
||||
jq -c '.rooms[] | select(.joined_local_members != 0) | .room_id' < "${TEMPDIR}/roomlist.json" > "${TEMPDIR}/history_purge.txt"
|
||||
|
||||
local ts=$(( $(date --date="${MONTHS_TO_KEEP} month ago" +%s)*1000 ))
|
||||
|
||||
send_discord_message "Cleaning up media store"
|
||||
curl --header "Authorization: Bearer ${API_ID}" -X POST \
|
||||
"https://${HOMESERVER}/_synapse/admin/v1/media/delete?before_ts=${ts}&include_local=true"
|
||||
|
||||
send_discord_message "Deleting empty rooms"
|
||||
while read -r room_id; do
|
||||
if [ -n "${room_id}" ]; then
|
||||
curl --header "Authorization: Bearer ${API_ID}" -X DELETE \
|
||||
-H "Content-Type: application/json" -d "{}" \
|
||||
"https://${HOMESERVER}/_synapse/admin/v2/rooms/${room_id}"
|
||||
fi
|
||||
done < "${TEMPDIR}/to_purge.txt"
|
||||
|
||||
# Initial sizes and usage
|
||||
local db_before_size=$(get_db_size)
|
||||
local media_before_size=$(get_media_store_size)
|
||||
local fs_before_usage=$(get_filesystem_usage)
|
||||
send_discord_message "Deleting unnecessary room history"
|
||||
while read -r room_id; do
|
||||
room_id=$(echo "$room_id" | tr -d '"') # Remove quotes if present
|
||||
if [ -n "${room_id}" ]; then
|
||||
curl --header "Authorization: Bearer ${API_ID}" -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{ \"delete_local_events\": true, \"purge_up_to_ts\": ${ts} }" \
|
||||
"https://${HOMESERVER}/_synapse/admin/v1/purge_history/${room_id}"
|
||||
fi
|
||||
done < "${TEMPDIR}/history_purge.txt"
|
||||
|
||||
send_discord_message "Beginning matrix-synapse optimization process - Database before size: ${db_before_size}, Media store before size: ${media_before_size}, Filesystem usage before: ${fs_before_usage}"
|
||||
|
||||
send_discord_message "Starting synapse"
|
||||
systemctl start matrix-synapse
|
||||
sleep 5
|
||||
|
||||
send_discord_message "Collecting required room data"
|
||||
curl --header "Authorization: Bearer ${API_ID}" \
|
||||
"https://${HOMESERVER}/_synapse/admin/v1/rooms?limit=500" > "${TEMPDIR}/roomlist.json"
|
||||
|
||||
jq '.rooms[] | select(.joined_local_members == 0) | .room_id' < "${TEMPDIR}/roomlist.json" > "${TEMPDIR}/to_purge.txt"
|
||||
jq -c '.rooms[] | select(.joined_local_members != 0) | .room_id' < "${TEMPDIR}/roomlist.json" > "${TEMPDIR}/history_purge.txt"
|
||||
|
||||
local ts=$(( $(date --date="${MONTHS_TO_KEEP} month ago" +%s)*1000 ))
|
||||
|
||||
send_discord_message "Cleaning up media store"
|
||||
curl --header "Authorization: Bearer ${API_ID}" -X POST \
|
||||
"https://${HOMESERVER}/_synapse/admin/v1/media/delete?before_ts=${ts}&include_local=true"
|
||||
|
||||
send_discord_message "Deleting empty rooms"
|
||||
while read -r room_id; do
|
||||
if [ -n "${room_id}" ]; then
|
||||
curl --header "Authorization: Bearer ${API_ID}" -X DELETE \
|
||||
-H "Content-Type: application/json" -d "{}" \
|
||||
"https://${HOMESERVER}/_synapse/admin/v2/rooms/${room_id}"
|
||||
fi
|
||||
done < "${TEMPDIR}/to_purge.txt"
|
||||
|
||||
send_discord_message "Deleting unnecessary room history"
|
||||
while read -r room_id; do
|
||||
room_id=$(echo "$room_id" | tr -d '"') # Remove quotes if present
|
||||
if [ -n "${room_id}" ]; then
|
||||
curl --header "Authorization: Bearer ${API_ID}" -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{ \"delete_local_events\": true, \"purge_up_to_ts\": ${ts} }" \
|
||||
"https://${HOMESERVER}/_synapse/admin/v1/purge_history/${room_id}"
|
||||
fi
|
||||
done < "${TEMPDIR}/history_purge.txt"
|
||||
|
||||
send_discord_message "Performing database optimization"
|
||||
systemctl stop matrix-synapse
|
||||
export PGHOST=/var/run/postgresql/
|
||||
export PGDATABASE=matrix-synapse
|
||||
export PGUSER=matrix-synapse
|
||||
send_discord_message "Performing database optimization"
|
||||
systemctl stop matrix-synapse
|
||||
export PGHOST=/var/run/postgresql/
|
||||
export PGDATABASE=matrix-synapse
|
||||
export PGUSER=matrix-synapse
|
||||
|
||||
sudo -u postgres psql matrix-synapse <<_EOF
|
||||
BEGIN;
|
||||
|
|
@ -125,33 +125,33 @@ WHERE NOT EXISTS
|
|||
COMMIT;
|
||||
_EOF
|
||||
|
||||
send_discord_message "Running synapse_auto_compressor"
|
||||
sudo -u matrix-synapse synapse_auto_compressor \
|
||||
-p "postgresql://matrix-synapse?user=matrix-synapse&host=/var/run/postgresql/" \
|
||||
-c 500 -n 100
|
||||
send_discord_message "Running synapse_auto_compressor"
|
||||
sudo -u matrix-synapse synapse_auto_compressor \
|
||||
-p "postgresql://matrix-synapse?user=matrix-synapse&host=/var/run/postgresql/" \
|
||||
-c 500 -n 100
|
||||
|
||||
send_discord_message "Reindexing database"
|
||||
sudo -u postgres psql matrix-synapse -c "REINDEX (VERBOSE) DATABASE \"matrix-synapse\";"
|
||||
send_discord_message "Reindexing database"
|
||||
sudo -u postgres psql matrix-synapse -c "REINDEX (VERBOSE) DATABASE \"matrix-synapse\";"
|
||||
|
||||
send_discord_message "Vacuuming database"
|
||||
sudo -u postgres psql matrix-synapse -c "VACUUM FULL VERBOSE;"
|
||||
send_discord_message "Vacuuming database"
|
||||
sudo -u postgres psql matrix-synapse -c "VACUUM FULL VERBOSE;"
|
||||
|
||||
rm -rf "${TEMPDIR}"
|
||||
rm -rf "${TEMPDIR}"
|
||||
|
||||
send_discord_message "Synapse cleanup performed, booting up"
|
||||
systemctl start matrix-synapse
|
||||
send_discord_message "Synapse cleanup performed, booting up"
|
||||
systemctl start matrix-synapse
|
||||
|
||||
# Final sizes, usage, and ratios
|
||||
local db_after_size=$(get_db_size)
|
||||
local media_after_size=$(get_media_store_size)
|
||||
local fs_after_usage=$(get_filesystem_usage)
|
||||
local db_ratio=$(calculate_ratio "${db_before_size//[A-Za-z]/}" "${db_after_size//[A-Za-z]/}")
|
||||
local media_ratio=$(calculate_ratio "${media_before_size//[A-Za-z]/}" "${media_after_size//[A-Za-z]/}")
|
||||
# Final sizes, usage, and ratios
|
||||
local db_after_size=$(get_db_size)
|
||||
local media_after_size=$(get_media_store_size)
|
||||
local fs_after_usage=$(get_filesystem_usage)
|
||||
local db_ratio=$(calculate_ratio "${db_before_size//[A-Za-z]/}" "${db_after_size//[A-Za-z]/}")
|
||||
local media_ratio=$(calculate_ratio "${media_before_size//[A-Za-z]/}" "${media_after_size//[A-Za-z]/}")
|
||||
|
||||
send_discord_message "Matrix-synapse optimization process finished -
|
||||
send_discord_message "Matrix-synapse optimization process finished -
|
||||
Database: ${db_before_size} -> ${db_after_size} (${db_ratio}%),
|
||||
Media store: ${media_before_size} -> ${media_after_size} (${media_ratio}%),
|
||||
Filesystem usage: ${fs_before_usage} -> ${fs_after_usage}"
|
||||
Filesystem usage: ${fs_before_usage} -> ${fs_after_usage}"
|
||||
}
|
||||
|
||||
# Run the main function
|
||||
|
|
|
|||
|
|
@ -7,20 +7,24 @@ _: let
|
|||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.lists) singleton;
|
||||
inherit (lib.attrsets) nameValuePair listToAttrs;
|
||||
datasets = [
|
||||
datasets = [
|
||||
"root"
|
||||
"nix"
|
||||
"games"
|
||||
"home"
|
||||
"var"
|
||||
];
|
||||
datasetEntry = dataset: nameValuePair (if dataset == "root" then "/" else "/${dataset}") {
|
||||
device = "zpool/${dataset}";
|
||||
fsType = "zfs";
|
||||
options = [ "zfsutil" ];
|
||||
};
|
||||
datasetEntry = dataset:
|
||||
nameValuePair (
|
||||
if dataset == "root"
|
||||
then "/"
|
||||
else "/${dataset}"
|
||||
) {
|
||||
device = "zpool/${dataset}";
|
||||
fsType = "zfs";
|
||||
options = ["zfsutil"];
|
||||
};
|
||||
datasetEntries = listToAttrs (map datasetEntry datasets);
|
||||
|
||||
drives = {
|
||||
|
|
@ -40,15 +44,17 @@ _: let
|
|||
};
|
||||
};
|
||||
in {
|
||||
imports = (with tree.nixos.profiles; [
|
||||
imports =
|
||||
(with tree.nixos.profiles; [
|
||||
graphical
|
||||
wireless
|
||||
gaming
|
||||
])
|
||||
++ (with tree.nixos.environments; [
|
||||
#hyprland
|
||||
niri
|
||||
]) ++ (with inputs.nixos-hardware.outputs.nixosModules; [
|
||||
#hyprland
|
||||
niri
|
||||
])
|
||||
++ (with inputs.nixos-hardware.outputs.nixosModules; [
|
||||
common-pc
|
||||
common-pc-ssd
|
||||
common-cpu-amd
|
||||
|
|
@ -62,17 +68,17 @@ _: let
|
|||
graphical
|
||||
])
|
||||
++ (with tree.home.environments; [
|
||||
#hyprland
|
||||
niri
|
||||
#hyprland
|
||||
niri
|
||||
]);
|
||||
|
||||
networking.hostId = "c3b94e85";
|
||||
|
||||
home-manager.users.kat.programs.niri.settings = {
|
||||
outputs = {
|
||||
"LG Electronics LG Ultra HD 0x0001AC91" = {
|
||||
scale = 1.25;
|
||||
};
|
||||
"LG Electronics LG Ultra HD 0x0001AC91" = {
|
||||
scale = 1.25;
|
||||
};
|
||||
};
|
||||
environment = {
|
||||
NVD_BACKEND = "direct";
|
||||
|
|
@ -83,29 +89,29 @@ _: let
|
|||
};
|
||||
};
|
||||
|
||||
programs.ssh.extraConfig = ''
|
||||
Host daiyousei-build
|
||||
HostName 140.238.156.121
|
||||
User root
|
||||
IdentityAgent /run/user/1000/gnupg/S.gpg-agent.ssh
|
||||
programs.ssh.extraConfig = ''
|
||||
Host daiyousei-build
|
||||
HostName 140.238.156.121
|
||||
User root
|
||||
IdentityAgent /run/user/1000/gnupg/S.gpg-agent.ssh
|
||||
'';
|
||||
nix = {
|
||||
buildMachines = [
|
||||
{
|
||||
hostName = "daiyousei-build";
|
||||
system = "aarch64-linux";
|
||||
protocol = "ssh-ng";
|
||||
maxJobs = 100;
|
||||
speedFactor = 1;
|
||||
supportedFeatures = ["benchmark" "big-parallel" "kvm"];
|
||||
mandatoryFeatures = [];
|
||||
}
|
||||
];
|
||||
distributedBuilds = true;
|
||||
extraOptions = ''
|
||||
builders-use-substitutes = true
|
||||
'';
|
||||
nix = {
|
||||
buildMachines = [
|
||||
{
|
||||
hostName = "daiyousei-build";
|
||||
system = "aarch64-linux";
|
||||
protocol = "ssh-ng";
|
||||
maxJobs = 100;
|
||||
speedFactor = 1;
|
||||
supportedFeatures = ["benchmark" "big-parallel" "kvm"];
|
||||
mandatoryFeatures = [];
|
||||
}
|
||||
];
|
||||
distributedBuilds = true;
|
||||
extraOptions = ''
|
||||
builders-use-substitutes = true
|
||||
'';
|
||||
};
|
||||
};
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
hardware.nvidia = {
|
||||
|
|
@ -134,16 +140,18 @@ _: let
|
|||
availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
|
||||
};
|
||||
kernelModules = ["nct6775" "kvm-amd"];
|
||||
extraModulePackages = [config.boot.kernelPackages.v4l2loopback.out];
|
||||
extraModulePackages = [config.boot.kernelPackages.v4l2loopback.out];
|
||||
supportedFilesystems = ["ntfs" "zfs"];
|
||||
};
|
||||
|
||||
fileSystems = datasetEntries // {
|
||||
"/boot" = drives.boot.result;
|
||||
};
|
||||
fileSystems =
|
||||
datasetEntries
|
||||
// {
|
||||
"/boot" = drives.boot.result;
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
drives.swap.result
|
||||
drives.swap.result
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
|
|
|||
|
|
@ -6,20 +6,24 @@ _: let
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.lists) singleton;
|
||||
inherit (lib.attrsets) nameValuePair listToAttrs;
|
||||
datasets = [
|
||||
datasets = [
|
||||
"root"
|
||||
"nix"
|
||||
"games"
|
||||
"home"
|
||||
"var"
|
||||
];
|
||||
datasetEntry = dataset: nameValuePair (if dataset == "root" then "/" else "/${dataset}") {
|
||||
device = "zpool/${dataset}";
|
||||
fsType = "zfs";
|
||||
options = [ "zfsutil" ];
|
||||
};
|
||||
datasetEntry = dataset:
|
||||
nameValuePair (
|
||||
if dataset == "root"
|
||||
then "/"
|
||||
else "/${dataset}"
|
||||
) {
|
||||
device = "zpool/${dataset}";
|
||||
fsType = "zfs";
|
||||
options = ["zfsutil"];
|
||||
};
|
||||
datasetEntries = listToAttrs (map datasetEntry datasets);
|
||||
|
||||
drives = {
|
||||
|
|
@ -48,30 +52,32 @@ _: let
|
|||
quiet-boot
|
||||
wireless
|
||||
laptop
|
||||
gaming
|
||||
sdr
|
||||
#virtualisation
|
||||
#secureboot
|
||||
gaming
|
||||
sdr
|
||||
#virtualisation
|
||||
#secureboot
|
||||
])
|
||||
++ (with tree.nixos.environments; [
|
||||
niri
|
||||
niri
|
||||
]);
|
||||
config = {
|
||||
home-manager.users.kat.imports =
|
||||
(with tree.home.profiles; [
|
||||
graphical
|
||||
graphical
|
||||
])
|
||||
++ (with tree.home.environments; [
|
||||
niri
|
||||
niri
|
||||
]);
|
||||
|
||||
fileSystems = datasetEntries // {
|
||||
"/boot" = drives.boot.result;
|
||||
};
|
||||
fileSystems =
|
||||
datasetEntries
|
||||
// {
|
||||
"/boot" = drives.boot.result;
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
swapDevices = [
|
||||
drives.swap.result
|
||||
];
|
||||
];
|
||||
|
||||
home-manager.users.kat = {
|
||||
wayland.windowManager.hyprland.settings.monitor = [
|
||||
|
|
@ -87,20 +93,20 @@ _: let
|
|||
extraModulePackages = [config.boot.kernelPackages.v4l2loopback.out];
|
||||
};
|
||||
|
||||
services.scx = {
|
||||
enable = true;
|
||||
package = pkgs.scx_git.full;
|
||||
scheduler = "scx_lavd";
|
||||
};
|
||||
services.scx = {
|
||||
enable = true;
|
||||
package = pkgs.scx_git.full;
|
||||
scheduler = "scx_lavd";
|
||||
};
|
||||
|
||||
virtualisation.virtualbox.host = {
|
||||
enable = true;
|
||||
enableExtensionPack = true;
|
||||
enableKvm = true;
|
||||
addNetworkInterface = false;
|
||||
};
|
||||
virtualisation.virtualbox.host = {
|
||||
enable = true;
|
||||
enableExtensionPack = true;
|
||||
enableKvm = true;
|
||||
addNetworkInterface = false;
|
||||
};
|
||||
|
||||
zramSwap.enable = true;
|
||||
zramSwap.enable = true;
|
||||
|
||||
programs.ssh.extraConfig = ''
|
||||
Host daiyousei-build
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
locals {
|
||||
account_id = "0467b993b65d8fd4a53fe24ed2fbb2a1"
|
||||
zones = {
|
||||
dork = "dork.dev"
|
||||
inskip = "inskip.me"
|
||||
dork = "dork.dev"
|
||||
inskip = "inskip.me"
|
||||
kittywitch = "kittywit.ch"
|
||||
}
|
||||
zone_ids = {
|
||||
dork = cloudflare_zone.dork_zone.id
|
||||
inskip = cloudflare_zone.inskip_zone.id
|
||||
dork = cloudflare_zone.dork_zone.id
|
||||
inskip = cloudflare_zone.inskip_zone.id
|
||||
kittywitch = cloudflare_zone.kittywitch_zone.id
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
variable "cloudflare_api_key" {
|
||||
sensitive = true
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
provider "cloudflare" {
|
||||
email = "kat@inskip.me"
|
||||
api_key = var.cloudflare_api_key
|
||||
email = "kat@inskip.me"
|
||||
api_key = var.cloudflare_api_key
|
||||
}
|
||||
|
|
@ -1,22 +1,22 @@
|
|||
resource "cloudflare_pages_project" "dorkdev" {
|
||||
account_id = local.account_id
|
||||
name = "dorkdev"
|
||||
account_id = local.account_id
|
||||
name = "dorkdev"
|
||||
production_branch = "main"
|
||||
|
||||
source {
|
||||
type = "github"
|
||||
config {
|
||||
owner = "kittywitch"
|
||||
repo_name = "dork.dev"
|
||||
production_branch = "main"
|
||||
deployments_enabled = true
|
||||
pr_comments_enabled = false
|
||||
production_deployment_enabled = true
|
||||
owner = "kittywitch"
|
||||
repo_name = "dork.dev"
|
||||
production_branch = "main"
|
||||
deployments_enabled = true
|
||||
pr_comments_enabled = false
|
||||
production_deployment_enabled = true
|
||||
|
||||
}
|
||||
}
|
||||
build_config {
|
||||
build_command = "zola build"
|
||||
build_command = "zola build"
|
||||
destination_dir = "public"
|
||||
#root_dir = "/"
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ resource "cloudflare_pages_project" "dorkdev" {
|
|||
production {
|
||||
environment_variables = {
|
||||
UNSTABLE_PRE_BUILD = "asdf plugin add zola https://github.com/salasrod/asdf-zola && asdf install zola 0.20.0 && asdf global zola 0.20.0"
|
||||
ZOLA_VERSION = "0.20.0"
|
||||
ZOLA_VERSION = "0.20.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -39,9 +39,9 @@ resource "cloudflare_pages_project" "dorkdev" {
|
|||
}
|
||||
|
||||
resource "cloudflare_pages_domain" "dorkdev_root" {
|
||||
account_id = local.account_id
|
||||
project_name = "dorkdev"
|
||||
domain = local.zones.dork
|
||||
account_id = local.account_id
|
||||
project_name = "dorkdev"
|
||||
domain = local.zones.dork
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
40
tf/gmail.tf
40
tf/gmail.tf
|
|
@ -1,29 +1,29 @@
|
|||
locals {
|
||||
dkims = {
|
||||
inskip = "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkxag/EmXQ89XQmLrBDPpPtZ7EtEJT0hgvWf/+AFiOfBOm902tq9NbTTvRJ2dLeBLPaV+hNvq2Alc7UfkKUDlLTWQjeuiC6aOnRKQQg3LZ2W25U3AlIj0jd2IPiUhg9JGV4c66XiqQ5ylTBniShfUUyeAXxbPhYFBCkBg62LZcO/tFpFsdKWtZzLjgac5vTJID+M4F8duHpkA/ZCNNUEmtt7RNQB/LLI1Gr5yR4GdQl9z7NmwtOTo9pghbZuvljr8phYjdDrwZeFTMKQnvR1l2Eh/dZ8I0C4nP5Bk4QEfmLq666P1HzOxwT6iCU6Tc+P/pkWbrx0HJh39E1aKGyLJMQIDAQAB"
|
||||
dork = "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAziwoHJbM1rmeUiIXOgg0cujTL5BFW9PQOksUhKza1XpDP2rpzTlQr21NFYMJMc08xiE3AbvScMTX0jX3gc7+XoIYLD1VigRRvkyTubVfRmatqj+Pk41Fle1jWXHv5vNIYjjcsUTrpnrXYKoYrz34TtsmYHnu0G9MgmmcQGmbRU+WY+1R/ukhavlgXasfEW6r4tjLgVxQnser1Zjr80AUcu23od/+o+m6C9rDGMMnv6NIc2DOT7Ei6o60458f2Iwcpg38te22dy46A8AeGynbpB9+jF33Se0m22eKk5qZN5mfju/wxWMsl7ifCY/eqLZXRxJaEd5bMI8px5KvZp1TWwIDAQAB"
|
||||
kittywitch = "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApdmyA2+/si8UV3bodFZhtv5y68QnYr/kk9wnDHnk3JfJKusbrctXfETVu/9GXQ/U8tRquesF7aXKYHM/K3O6H58gAgIFm8JVnr9EUFh5PWBTKJxHgDo/6pprhpdAJg8k4f4p5yvqE0nUI6TC0UpN+ZmQMimgxvGGwQ6mpl7qmc7JxmTOiJbO1yz6eokU27S0NHfpdiE3TGG93i2r/LwAnHuhT/4weGO+vcXwKRTFGFFjvMo0XgjL2JnP01nk6dpDFwkkt5I26J4DkuNMkLefgDiGOoxDmG5EgPu0YwAm7Vk2/kX0W6rLe16lHGDkB0/atQ/IB9uch31GQrLP9etmdwIDAQAB"
|
||||
}
|
||||
dkims = {
|
||||
inskip = "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkxag/EmXQ89XQmLrBDPpPtZ7EtEJT0hgvWf/+AFiOfBOm902tq9NbTTvRJ2dLeBLPaV+hNvq2Alc7UfkKUDlLTWQjeuiC6aOnRKQQg3LZ2W25U3AlIj0jd2IPiUhg9JGV4c66XiqQ5ylTBniShfUUyeAXxbPhYFBCkBg62LZcO/tFpFsdKWtZzLjgac5vTJID+M4F8duHpkA/ZCNNUEmtt7RNQB/LLI1Gr5yR4GdQl9z7NmwtOTo9pghbZuvljr8phYjdDrwZeFTMKQnvR1l2Eh/dZ8I0C4nP5Bk4QEfmLq666P1HzOxwT6iCU6Tc+P/pkWbrx0HJh39E1aKGyLJMQIDAQAB"
|
||||
dork = "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAziwoHJbM1rmeUiIXOgg0cujTL5BFW9PQOksUhKza1XpDP2rpzTlQr21NFYMJMc08xiE3AbvScMTX0jX3gc7+XoIYLD1VigRRvkyTubVfRmatqj+Pk41Fle1jWXHv5vNIYjjcsUTrpnrXYKoYrz34TtsmYHnu0G9MgmmcQGmbRU+WY+1R/ukhavlgXasfEW6r4tjLgVxQnser1Zjr80AUcu23od/+o+m6C9rDGMMnv6NIc2DOT7Ei6o60458f2Iwcpg38te22dy46A8AeGynbpB9+jF33Se0m22eKk5qZN5mfju/wxWMsl7ifCY/eqLZXRxJaEd5bMI8px5KvZp1TWwIDAQAB"
|
||||
kittywitch = "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApdmyA2+/si8UV3bodFZhtv5y68QnYr/kk9wnDHnk3JfJKusbrctXfETVu/9GXQ/U8tRquesF7aXKYHM/K3O6H58gAgIFm8JVnr9EUFh5PWBTKJxHgDo/6pprhpdAJg8k4f4p5yvqE0nUI6TC0UpN+ZmQMimgxvGGwQ6mpl7qmc7JxmTOiJbO1yz6eokU27S0NHfpdiE3TGG93i2r/LwAnHuhT/4weGO+vcXwKRTFGFFjvMo0XgjL2JnP01nk6dpDFwkkt5I26J4DkuNMkLefgDiGOoxDmG5EgPu0YwAm7Vk2/kX0W6rLe16lHGDkB0/atQ/IB9uch31GQrLP9etmdwIDAQAB"
|
||||
}
|
||||
}
|
||||
|
||||
module "inskip-gmail" {
|
||||
source = "./gmail_dns"
|
||||
cloudflare_api_key = var.cloudflare_api_key
|
||||
zone_id = local.zone_ids.inskip
|
||||
zone_name = local.zones.inskip
|
||||
dkim = local.dkims.inskip
|
||||
source = "./gmail_dns"
|
||||
cloudflare_api_key = var.cloudflare_api_key
|
||||
zone_id = local.zone_ids.inskip
|
||||
zone_name = local.zones.inskip
|
||||
dkim = local.dkims.inskip
|
||||
}
|
||||
module "dork-gmail" {
|
||||
source = "./gmail_dns"
|
||||
cloudflare_api_key = var.cloudflare_api_key
|
||||
zone_id = local.zone_ids.dork
|
||||
zone_name = local.zones.dork
|
||||
dkim = local.dkims.dork
|
||||
source = "./gmail_dns"
|
||||
cloudflare_api_key = var.cloudflare_api_key
|
||||
zone_id = local.zone_ids.dork
|
||||
zone_name = local.zones.dork
|
||||
dkim = local.dkims.dork
|
||||
}
|
||||
module "kittywitch-gmail" {
|
||||
source = "./gmail_dns"
|
||||
cloudflare_api_key = var.cloudflare_api_key
|
||||
zone_id = local.zone_ids.kittywitch
|
||||
zone_name = local.zones.kittywitch
|
||||
dkim = local.dkims.kittywitch
|
||||
source = "./gmail_dns"
|
||||
cloudflare_api_key = var.cloudflare_api_key
|
||||
zone_id = local.zone_ids.kittywitch
|
||||
zone_name = local.zones.kittywitch
|
||||
dkim = local.dkims.kittywitch
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
cloudflare = {
|
||||
source = "cloudflare/cloudflare"
|
||||
version = "4.4.0"
|
||||
}
|
||||
required_providers {
|
||||
cloudflare = {
|
||||
source = "cloudflare/cloudflare"
|
||||
version = "4.4.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "cloudflare" {
|
||||
email = "kat@inskip.me"
|
||||
api_key = var.cloudflare_api_key
|
||||
email = "kat@inskip.me"
|
||||
api_key = var.cloudflare_api_key
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
resource "cloudflare_record" "gmail_mx_1_aspmx" {
|
||||
name = var.zone_name
|
||||
name = var.zone_name
|
||||
priority = 1
|
||||
proxied = false
|
||||
ttl = 3600
|
||||
|
|
@ -9,7 +9,7 @@ resource "cloudflare_record" "gmail_mx_1_aspmx" {
|
|||
}
|
||||
|
||||
resource "cloudflare_record" "gmail_mx_5_alt1" {
|
||||
name = var.zone_name
|
||||
name = var.zone_name
|
||||
priority = 5
|
||||
proxied = false
|
||||
ttl = 3600
|
||||
|
|
@ -19,7 +19,7 @@ resource "cloudflare_record" "gmail_mx_5_alt1" {
|
|||
}
|
||||
|
||||
resource "cloudflare_record" "gmail_mx_5_alt2" {
|
||||
name = var.zone_name
|
||||
name = var.zone_name
|
||||
priority = 5
|
||||
proxied = false
|
||||
ttl = 3600
|
||||
|
|
@ -29,7 +29,7 @@ resource "cloudflare_record" "gmail_mx_5_alt2" {
|
|||
}
|
||||
|
||||
resource "cloudflare_record" "gmail_mx_10_alt3" {
|
||||
name = var.zone_name
|
||||
name = var.zone_name
|
||||
priority = 10
|
||||
proxied = false
|
||||
ttl = 3600
|
||||
|
|
@ -38,7 +38,7 @@ resource "cloudflare_record" "gmail_mx_10_alt3" {
|
|||
zone_id = var.zone_id
|
||||
}
|
||||
resource "cloudflare_record" "gmail_mx_10_alt4" {
|
||||
name = var.zone_name
|
||||
name = var.zone_name
|
||||
priority = 10
|
||||
proxied = false
|
||||
ttl = 3600
|
||||
|
|
@ -53,7 +53,7 @@ resource "cloudflare_record" "gmail_dkim" {
|
|||
ttl = 3600
|
||||
type = "TXT"
|
||||
value = var.dkim
|
||||
zone_id = var.zone_id
|
||||
zone_id = var.zone_id
|
||||
}
|
||||
|
||||
resource "cloudflare_record" "gmail_spf" {
|
||||
|
|
@ -62,5 +62,5 @@ resource "cloudflare_record" "gmail_spf" {
|
|||
ttl = 3600
|
||||
type = "TXT"
|
||||
value = "v=spf1 include:_spf.google.com -all"
|
||||
zone_id = var.zone_id
|
||||
zone_id = var.zone_id
|
||||
}
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
variable "cloudflare_api_key" {
|
||||
sensitive = true
|
||||
sensitive = true
|
||||
}
|
||||
variable "zone_id" {
|
||||
type = string
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "dkim" {
|
||||
type = string
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "zone_name" {
|
||||
type = string
|
||||
type = string
|
||||
}
|
||||
|
|
@ -1,23 +1,23 @@
|
|||
resource "cloudflare_pages_project" "inskip_root" {
|
||||
account_id = local.account_id
|
||||
name = "inskip-root"
|
||||
account_id = local.account_id
|
||||
name = "inskip-root"
|
||||
production_branch = "main"
|
||||
|
||||
source {
|
||||
type = "github"
|
||||
config {
|
||||
owner = "kittywitch"
|
||||
repo_name = "inskip.me"
|
||||
production_branch = "main"
|
||||
deployments_enabled = true
|
||||
pr_comments_enabled = false
|
||||
production_deployment_enabled = true
|
||||
owner = "kittywitch"
|
||||
repo_name = "inskip.me"
|
||||
production_branch = "main"
|
||||
deployments_enabled = true
|
||||
pr_comments_enabled = false
|
||||
production_deployment_enabled = true
|
||||
}
|
||||
}
|
||||
build_config {
|
||||
build_command = "hugo"
|
||||
build_command = "hugo"
|
||||
destination_dir = "public"
|
||||
root_dir = "/"
|
||||
root_dir = "/"
|
||||
}
|
||||
lifecycle {
|
||||
ignore_changes = [
|
||||
|
|
@ -28,9 +28,9 @@ resource "cloudflare_pages_project" "inskip_root" {
|
|||
}
|
||||
|
||||
resource "cloudflare_pages_domain" "inskip_root" {
|
||||
account_id = local.account_id
|
||||
project_name = "inskip-root"
|
||||
domain = local.zones.inskip
|
||||
account_id = local.account_id
|
||||
project_name = "inskip-root"
|
||||
domain = local.zones.inskip
|
||||
}
|
||||
|
||||
resource "cloudflare_record" "inskip_root_pages" {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
resource "cloudflare_pages_project" "kittywitch" {
|
||||
account_id = local.account_id
|
||||
name = "kittywitch"
|
||||
account_id = local.account_id
|
||||
name = "kittywitch"
|
||||
production_branch = "main"
|
||||
|
||||
source {
|
||||
type = "github"
|
||||
config {
|
||||
owner = "kittywitch"
|
||||
repo_name = "kittywit.ch"
|
||||
production_branch = "main"
|
||||
deployments_enabled = true
|
||||
pr_comments_enabled = false
|
||||
production_deployment_enabled = true
|
||||
owner = "kittywitch"
|
||||
repo_name = "kittywit.ch"
|
||||
production_branch = "main"
|
||||
deployments_enabled = true
|
||||
pr_comments_enabled = false
|
||||
production_deployment_enabled = true
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -24,9 +24,9 @@ resource "cloudflare_pages_project" "kittywitch" {
|
|||
}
|
||||
|
||||
resource "cloudflare_pages_domain" "kittywitch_root" {
|
||||
account_id = local.account_id
|
||||
project_name = "kittywitch"
|
||||
domain = local.zones.kittywitch
|
||||
account_id = local.account_id
|
||||
project_name = "kittywitch"
|
||||
domain = local.zones.kittywitch
|
||||
}
|
||||
|
||||
resource "cloudflare_record" "kittywitch_root_pages" {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
module "oci_common_private_network" {
|
||||
source = "./oci_common_private_network"
|
||||
|
||||
cidr_blocks = [
|
||||
cidr_blocks = [
|
||||
"10.25.0.0/16"
|
||||
]
|
||||
|
||||
display_name = "CoreNetwork"
|
||||
dns_label = "core"
|
||||
tenancy_ocid = module.oci_compartment_bootstrap.child_compartment_id
|
||||
display_name = "CoreNetwork"
|
||||
dns_label = "core"
|
||||
tenancy_ocid = module.oci_compartment_bootstrap.child_compartment_id
|
||||
|
||||
providers = {
|
||||
oci = oci.oci_compartment
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ resource "oci_core_default_security_list" "this" {
|
|||
dynamic "ingress_security_rules" {
|
||||
for_each = [
|
||||
{ from = 60000
|
||||
to = 61000 }
|
||||
to = 61000 }
|
||||
]
|
||||
iterator = port
|
||||
content {
|
||||
protocol = local.protocol_number.udp
|
||||
source = "0.0.0.0/0"
|
||||
source = "0.0.0.0/0"
|
||||
|
||||
description = "Mosh traffic from any origin"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
resource "oci_core_internet_gateway" "this" {
|
||||
display_name = "internet"
|
||||
display_name = "internet"
|
||||
compartment_id = var.tenancy_ocid
|
||||
vcn_id = local.vcn.id
|
||||
vcn_id = local.vcn.id
|
||||
}
|
||||
|
||||
locals {
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ terraform {
|
|||
required_providers {
|
||||
# Vendor: Hashicorp
|
||||
tls = {
|
||||
source = "hashicorp/tls"
|
||||
source = "hashicorp/tls"
|
||||
version = "4.0.5"
|
||||
}
|
||||
# Vendor: Oracle
|
||||
oci = {
|
||||
source = "oracle/oci"
|
||||
source = "oracle/oci"
|
||||
version = "5.45.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ variable "dns_label" {
|
|||
resource "oci_core_vcn" "this" {
|
||||
compartment_id = var.tenancy_ocid
|
||||
|
||||
cidr_blocks = var.cidr_blocks
|
||||
cidr_blocks = var.cidr_blocks
|
||||
display_name = var.display_name
|
||||
dns_label = var.dns_label
|
||||
dns_label = var.dns_label
|
||||
|
||||
is_ipv6enabled = true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,20 +27,20 @@ variable "oci_compartment_bootstrap_user_email" {
|
|||
# https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformgettingstarted.htm
|
||||
# https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
|
||||
provider "oci" {
|
||||
alias = "oci_root"
|
||||
private_key = var.oci_compartment_bootstrap_private_key
|
||||
region = var.oci_compartment_bootstrap_region
|
||||
tenancy_ocid = var.oci_compartment_bootstrap_tenancy_ocid
|
||||
user_ocid = var.oci_compartment_bootstrap_user_ocid
|
||||
fingerprint = var.oci_compartment_bootstrap_fingerprint
|
||||
alias = "oci_root"
|
||||
private_key = var.oci_compartment_bootstrap_private_key
|
||||
region = var.oci_compartment_bootstrap_region
|
||||
tenancy_ocid = var.oci_compartment_bootstrap_tenancy_ocid
|
||||
user_ocid = var.oci_compartment_bootstrap_user_ocid
|
||||
fingerprint = var.oci_compartment_bootstrap_fingerprint
|
||||
}
|
||||
|
||||
# OCI Compartment Bootstrap
|
||||
module "oci_compartment_bootstrap" {
|
||||
source = "./oci_compartment_bootstrap"
|
||||
|
||||
tenancy_ocid = var.oci_compartment_bootstrap_tenancy_ocid
|
||||
user_email = var.oci_compartment_bootstrap_user_email
|
||||
tenancy_ocid = var.oci_compartment_bootstrap_tenancy_ocid
|
||||
user_email = var.oci_compartment_bootstrap_user_email
|
||||
|
||||
providers = {
|
||||
oci = oci.oci_root
|
||||
|
|
@ -48,42 +48,42 @@ module "oci_compartment_bootstrap" {
|
|||
}
|
||||
|
||||
output "oci_compartment_bootstrap_child_user_id" {
|
||||
value = module.oci_compartment_bootstrap.child_user_id
|
||||
value = module.oci_compartment_bootstrap.child_user_id
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
output "oci_compartment_bootstrap_child_compartment_id" {
|
||||
value = module.oci_compartment_bootstrap.child_compartment_id
|
||||
value = module.oci_compartment_bootstrap.child_compartment_id
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
output "oci_compartment_bootstrap_child_compartment_key_id" {
|
||||
value = module.oci_compartment_bootstrap.child_compartment_key_id
|
||||
value = module.oci_compartment_bootstrap.child_compartment_key_id
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
output "oci_compartment_bootstrap_child_compartment_key_fingerprint" {
|
||||
value = module.oci_compartment_bootstrap.child_compartment_key_fingerprint
|
||||
value = module.oci_compartment_bootstrap.child_compartment_key_fingerprint
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
output "oci_compartment_bootstrap_child_compartment_key_value" {
|
||||
value = module.oci_compartment_bootstrap.child_compartment_key_value
|
||||
value = module.oci_compartment_bootstrap.child_compartment_key_value
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
output "oci_compartment_bootstrap_child_compartment_key_state" {
|
||||
value = module.oci_compartment_bootstrap.child_compartment_key_state
|
||||
value = module.oci_compartment_bootstrap.child_compartment_key_state
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
# https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformgettingstarted.htm
|
||||
# https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm
|
||||
provider "oci" {
|
||||
alias = "oci_compartment"
|
||||
private_key = module.oci_compartment_bootstrap.child_compartment_private_key
|
||||
region = var.oci_compartment_bootstrap_region
|
||||
tenancy_ocid = module.oci_compartment_bootstrap.child_compartment_id
|
||||
user_ocid = module.oci_compartment_bootstrap.child_user_id
|
||||
fingerprint = module.oci_compartment_bootstrap.child_compartment_key_fingerprint
|
||||
alias = "oci_compartment"
|
||||
private_key = module.oci_compartment_bootstrap.child_compartment_private_key
|
||||
region = var.oci_compartment_bootstrap_region
|
||||
tenancy_ocid = module.oci_compartment_bootstrap.child_compartment_id
|
||||
user_ocid = module.oci_compartment_bootstrap.child_user_id
|
||||
fingerprint = module.oci_compartment_bootstrap.child_compartment_key_fingerprint
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
resource "oci_identity_api_key" "this" {
|
||||
key_value = local.child_compartment_public_key
|
||||
user_id = local.child_compartment_user
|
||||
user_id = local.child_compartment_user
|
||||
}
|
||||
|
||||
locals {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ variable "tenancy_ocid" {
|
|||
resource "oci_identity_compartment" "this" {
|
||||
# Compartment ID is Tenancy ID for this case
|
||||
compartment_id = var.tenancy_ocid
|
||||
description = "Compartment for Terraform usage"
|
||||
name = "kittywitch-tf"
|
||||
description = "Compartment for Terraform usage"
|
||||
name = "kittywitch-tf"
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
resource "oci_identity_group" "this" {
|
||||
compartment_id = var.tenancy_ocid
|
||||
|
||||
name = "terraform"
|
||||
name = "terraform"
|
||||
description = "terraform"
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
resource "oci_identity_user_group_membership" "this" {
|
||||
user_id = oci_identity_user.this.id
|
||||
user_id = oci_identity_user.this.id
|
||||
group_id = oci_identity_group.this.id
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@ ANY { request.operation = 'CreateNetworkSecurityGroup', request.operation = 'Del
|
|||
resource "oci_identity_policy" "terraform-admin" {
|
||||
compartment_id = var.tenancy_ocid
|
||||
|
||||
name = "terraform-admin"
|
||||
name = "terraform-admin"
|
||||
description = "terraform-admin"
|
||||
|
||||
statements = [
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ terraform {
|
|||
required_providers {
|
||||
# Vendor: Hashicorp
|
||||
tls = {
|
||||
source = "hashicorp/tls"
|
||||
source = "hashicorp/tls"
|
||||
version = "4.0.5"
|
||||
}
|
||||
# Vendor: Oracle
|
||||
oci = {
|
||||
source = "oracle/oci"
|
||||
source = "oracle/oci"
|
||||
version = "5.45.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ resource "tls_private_key" "this" {
|
|||
# https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/identity_api_key#key_value
|
||||
# "The public key. Must be an RSA key in PEM format."
|
||||
algorithm = "RSA"
|
||||
rsa_bits = 4096
|
||||
rsa_bits = 4096
|
||||
}
|
||||
|
||||
locals {
|
||||
child_compartment_private_key = tls_private_key.this.private_key_pem
|
||||
child_compartment_public_key = tls_private_key.this.public_key_pem
|
||||
child_compartment_public_key = tls_private_key.this.public_key_pem
|
||||
}
|
||||
|
||||
output "child_compartment_private_key" {
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ variable "user_email" {
|
|||
|
||||
resource "oci_identity_user" "this" {
|
||||
compartment_id = local.child_compartment_id
|
||||
description = "The user for Terraform to use"
|
||||
name = "terraform"
|
||||
email = var.user_email
|
||||
description = "The user for Terraform to use"
|
||||
name = "terraform"
|
||||
email = var.user_email
|
||||
}
|
||||
|
||||
locals {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue