mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat: clean up the repo
This commit is contained in:
parent
bc9c310c77
commit
f6ec9f37eb
249 changed files with 804 additions and 13048 deletions
174
1
174
1
|
|
@ -1,174 +0,0 @@
|
|||
{ config, lib, pkgs, nixfiles, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."waybar/style.css" = { inherit (nixfiles.sassTemplate { name = "waybar-style"; src = ./waybar.sass; }) source; };
|
||||
|
||||
#systemd.user.services.waybar.Service.Environment = lib.singleton "NOTMUCH_CONFIG=${config.home.sessionVariables.NOTMUCH_CONFIG}";
|
||||
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
settings = [{
|
||||
height = 10;
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/mode"
|
||||
"sway/window"
|
||||
];
|
||||
modules-center = [
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio#icon"
|
||||
"pulseaudio"
|
||||
"custom/headset-icon"
|
||||
"custom/headset"
|
||||
"custom/cpu-icon"
|
||||
"cpu"
|
||||
"custom/memory-icon"
|
||||
"memory"
|
||||
"temperature#icon"
|
||||
"temperature"
|
||||
"battery#icon"
|
||||
"battery"
|
||||
"backlight#icon"
|
||||
"backlight"
|
||||
"network#icon"
|
||||
"network"
|
||||
"idle_inhibitor"
|
||||
"custom/konawall"
|
||||
"custom/gpg-status"
|
||||
"custom/clock"
|
||||
"tray"
|
||||
];
|
||||
|
||||
modules = {
|
||||
"sway/workspaces" = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
"1" = "1:";
|
||||
"2" = "2:";
|
||||
"3" = "3:";
|
||||
};
|
||||
};
|
||||
"sway/window" = {
|
||||
icon = true;
|
||||
icon-size = 12;
|
||||
format = "{}";
|
||||
};
|
||||
tray = {
|
||||
icon-size = 12;
|
||||
spacing = 2;
|
||||
};
|
||||
"backlight#icon" = {
|
||||
format = "{icon}";
|
||||
format-icons = ["" ""];
|
||||
};
|
||||
backlight = {
|
||||
format = "{percent}%";
|
||||
};
|
||||
"custom/gpg-status" = {
|
||||
format = "{text} {alt}";
|
||||
interval = 300;
|
||||
return-type = "json";
|
||||
exec = "${pkgs.waybar-gpg}/bin/kat-gpg-status";
|
||||
};
|
||||
"custom/headset-icon" = {
|
||||
format = "";
|
||||
interval = 60;
|
||||
exec-if = "${pkgs.headsetcontrol}/bin/headsetcontrol -c";
|
||||
exec = "echo 'mew'";
|
||||
};
|
||||
"custom/headset" = {
|
||||
format = "{}";
|
||||
interval = 60;
|
||||
exec-if = "${pkgs.headsetcontrol}/bin/headsetcontrol -c";
|
||||
exec = "${pkgs.headsetcontrol}/bin/headsetcontrol -b | ${pkgs.gnugrep}/bin/grep Battery | ${pkgs.coreutils}/bin/cut -d ' ' -f2";
|
||||
};
|
||||
"custom/konawall" = {
|
||||
format = "{}";
|
||||
interval = "once";
|
||||
return-type = "json";
|
||||
exec = "${pkgs.waybar-konawall}/bin/konawall-status";
|
||||
on-click = "${pkgs.waybar-konawall}/bin/konawall-toggle";
|
||||
on-click-right = "systemctl --user restart konawall";
|
||||
signal = 8;
|
||||
};
|
||||
"custom/cpu-icon".format = "";
|
||||
cpu.format = "{usage}%";
|
||||
"custom/memory-icon".format = "";
|
||||
memory.format = "{percentage}%";
|
||||
"temperature#icon" = {
|
||||
format = "{icon}";
|
||||
format-icons = ["" "" ""];
|
||||
critical-threshold = 80;
|
||||
};
|
||||
temperature = {
|
||||
format = "{temperatureC}°C";
|
||||
critical-threshold = 80;
|
||||
};
|
||||
idle_inhibitor = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
activated = "";
|
||||
deactivated = "";
|
||||
};
|
||||
};
|
||||
"battery#icon" = {
|
||||
states = {
|
||||
good = 90;
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{icon}";
|
||||
format-charging = "";
|
||||
format-plugged = "";
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
};
|
||||
battery = {
|
||||
states = {
|
||||
good = 90;
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{capacity}%";
|
||||
format-charging = "{capacity}%";
|
||||
format-plugged = "{capacity}%";
|
||||
format-alt = "{time}";
|
||||
};
|
||||
"pulseaudio#icon" = {
|
||||
format = "{icon}";
|
||||
format-muted = "婢";
|
||||
on-click = "foot pulsemixer";
|
||||
format-icons = {
|
||||
default = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
};
|
||||
pulseaudio = {
|
||||
format = "{volume}%";
|
||||
on-click = "foot pulsemixer";
|
||||
};
|
||||
"network#icon" = {
|
||||
format-wifi = "直";
|
||||
format-ethernet = "";
|
||||
format-linked = " ";
|
||||
format-disconnected = "";
|
||||
};
|
||||
network = {
|
||||
format-wifi = "{essid} ({signalStrength}%)";
|
||||
format-ethernet = "{ipaddr}/{cidr}";
|
||||
format-linked = "No IP";
|
||||
format-disconnected = "Disconnected";
|
||||
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
||||
};
|
||||
"custom/clock" = {
|
||||
exec = ''${pkgs.coreutils}/bin/date +"%a, %F %T %Z"'';
|
||||
interval = 1;
|
||||
};
|
||||
};
|
||||
}];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,4 +1,9 @@
|
|||
{ lib, channels, config, ... }:
|
||||
{
|
||||
lib,
|
||||
channels,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
gitBranch = "arc";
|
||||
in {
|
||||
|
|
@ -14,27 +19,25 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
|
||||
gh-actions.env.CACHIX_SIGNING_KEY = "\${{ secrets.CACHIX_SIGNING_KEY }}";
|
||||
|
||||
|
||||
nix.config = {
|
||||
extra-platforms = [ "aarch64-linux" "armv6l-linux" "armv7l-linux" ];
|
||||
extra-platforms = ["aarch64-linux" "armv6l-linux" "armv7l-linux"];
|
||||
#extra-sandbox-paths = with channels.cipkgs; map (package: builtins.unsafeDiscardStringContext "${package}?") [bash qemu "/run/binfmt"];
|
||||
};
|
||||
|
||||
environment.bootstrap = {
|
||||
archbinfmt =
|
||||
let
|
||||
makeQemuWrapper = name: ''
|
||||
mkdir -p /run/binfmt
|
||||
rm -f /run/binfmt/${name}-linux
|
||||
cat > /run/binfmt/${name}-linux << 'EOF'
|
||||
#!${channels.cipkgs.bash}/bin/sh
|
||||
exec -- ${channels.cipkgs.qemu}/bin/qemu-${name} "$@"
|
||||
EOF
|
||||
chmod +x /run/binfmt/${name}-linux
|
||||
''; in
|
||||
archbinfmt = let
|
||||
makeQemuWrapper = name: ''
|
||||
mkdir -p /run/binfmt
|
||||
rm -f /run/binfmt/${name}-linux
|
||||
cat > /run/binfmt/${name}-linux << 'EOF'
|
||||
#!${channels.cipkgs.bash}/bin/sh
|
||||
exec -- ${channels.cipkgs.qemu}/bin/qemu-${name} "$@"
|
||||
EOF
|
||||
chmod +x /run/binfmt/${name}-linux
|
||||
'';
|
||||
in
|
||||
channels.cipkgs.writeShellScriptBin "archbinfmt" ''
|
||||
${makeQemuWrapper "aarch64"}
|
||||
${makeQemuWrapper "arm"}
|
||||
|
|
@ -46,25 +49,25 @@ in {
|
|||
};
|
||||
|
||||
gh-actions = {
|
||||
on =
|
||||
let
|
||||
paths = [
|
||||
"default.nix" # sourceCache
|
||||
"ci/flake-cron.nix"
|
||||
config.ci.gh-actions.path
|
||||
];
|
||||
in
|
||||
{
|
||||
push = {
|
||||
inherit paths;
|
||||
};
|
||||
pull_request = {
|
||||
inherit paths;
|
||||
};
|
||||
schedule = [{
|
||||
cron = "0 0 * * *";
|
||||
}];
|
||||
on = let
|
||||
paths = [
|
||||
"default.nix" # sourceCache
|
||||
"ci/flake-cron.nix"
|
||||
config.ci.gh-actions.path
|
||||
];
|
||||
in {
|
||||
push = {
|
||||
inherit paths;
|
||||
};
|
||||
pull_request = {
|
||||
inherit paths;
|
||||
};
|
||||
schedule = [
|
||||
{
|
||||
cron = "0 0 * * *";
|
||||
}
|
||||
];
|
||||
};
|
||||
jobs = mkIf (config.id != "ci") {
|
||||
${config.id}.step.architectures = {
|
||||
order = 201;
|
||||
|
|
@ -90,38 +93,36 @@ in {
|
|||
enable = false;
|
||||
};
|
||||
displayName = "flake update build";
|
||||
environment = [ "CACHIX_SIGNING_KEY" "GITHUB_REF" ];
|
||||
command =
|
||||
let
|
||||
filteredHosts = [ "tewi" ];
|
||||
nodeBuildString = concatMapStringsSep " && " (node: "nix build -Lf . network.nodes.nixos.${node}.deploy.system -o result-${node} && nix-collect-garbage -d") filteredHosts;
|
||||
in
|
||||
''
|
||||
# ${toString builtins.currentTime}
|
||||
nix flake update
|
||||
environment = ["CACHIX_SIGNING_KEY" "GITHUB_REF"];
|
||||
command = let
|
||||
filteredHosts = ["tewi"];
|
||||
nodeBuildString = concatMapStringsSep " && " (node: "nix build -Lf . network.nodes.${node}.deploy.system -o result-${node} && nix-collect-garbage -d") filteredHosts;
|
||||
in ''
|
||||
# ${toString builtins.currentTime}
|
||||
nix flake update
|
||||
|
||||
if git status --porcelain | grep -qF flake.lock; then
|
||||
git -P diff flake.lock
|
||||
echo "checking that network.nodes.still build..." >&2
|
||||
if ${nodeBuildString}; then
|
||||
if [[ -n $CACHIX_SIGNING_KEY ]]; then
|
||||
cachix push kittywitch result*/ &
|
||||
CACHIX_PUSH=$!
|
||||
fi
|
||||
git add flake.lock
|
||||
export GIT_{COMMITTER,AUTHOR}_EMAIL=github@kittywit.ch
|
||||
export GIT_{COMMITTER,AUTHOR}_NAME="flake cron job"
|
||||
git commit --message="ci: flake update"
|
||||
if [[ $GITHUB_REF = refs/heads/${gitBranch} ]]; then
|
||||
git push origin HEAD:${gitBranch}
|
||||
fi
|
||||
|
||||
wait ''${CACHIX_PUSH-}
|
||||
if git status --porcelain | grep -qF flake.lock; then
|
||||
git -P diff flake.lock
|
||||
echo "checking that network.nodes.still build..." >&2
|
||||
if ${nodeBuildString}; then
|
||||
if [[ -n $CACHIX_SIGNING_KEY ]]; then
|
||||
cachix push kittywitch result*/ &
|
||||
CACHIX_PUSH=$!
|
||||
fi
|
||||
else
|
||||
echo "no source changes" >&2
|
||||
git add flake.lock
|
||||
export GIT_{COMMITTER,AUTHOR}_EMAIL=github@kittywit.ch
|
||||
export GIT_{COMMITTER,AUTHOR}_NAME="flake cron job"
|
||||
git commit --message="ci: flake update"
|
||||
if [[ $GITHUB_REF = refs/heads/${gitBranch} ]]; then
|
||||
git push origin HEAD:${gitBranch}
|
||||
fi
|
||||
|
||||
wait ''${CACHIX_PUSH-}
|
||||
fi
|
||||
'';
|
||||
else
|
||||
echo "no source changes" >&2
|
||||
fi
|
||||
'';
|
||||
impure = true;
|
||||
};
|
||||
};
|
||||
|
|
@ -139,8 +140,7 @@ in {
|
|||
};
|
||||
kittywitch = {
|
||||
enable = true;
|
||||
publicKey =
|
||||
"kittywitch.cachix.org-1:KIzX/G5cuPw5WgrXad6UnrRZ8UDr7jhXzRTK/lmqyK0=";
|
||||
publicKey = "kittywitch.cachix.org-1:KIzX/G5cuPw5WgrXad6UnrRZ8UDr7jhXzRTK/lmqyK0=";
|
||||
signingKey = "mewp";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
44
ci/nodes.nix
44
ci/nodes.nix
|
|
@ -1,4 +1,11 @@
|
|||
{ lib, config, channels, env, ... }: with lib; {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
channels,
|
||||
env,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
name = "nodes";
|
||||
|
||||
nixpkgs.args.localSystem = "x86_64-linux";
|
||||
|
|
@ -13,7 +20,7 @@
|
|||
channels.nixfiles.path = ../.;
|
||||
|
||||
nix.config = {
|
||||
extra-platforms = [ "aarch64-linux" "armv6l-linux" "armv7l-linux" ];
|
||||
extra-platforms = ["aarch64-linux" "armv6l-linux" "armv7l-linux"];
|
||||
#extra-sandbox-paths = with channels.cipkgs; map (package: builtins.unsafeDiscardStringContext "${package}?") [bash qemu "/run/binfmt"];
|
||||
};
|
||||
|
||||
|
|
@ -30,17 +37,17 @@
|
|||
};
|
||||
|
||||
environment.bootstrap = {
|
||||
archbinfmt =
|
||||
let
|
||||
makeQemuWrapper = name: ''
|
||||
mkdir -p /run/binfmt
|
||||
rm -f /run/binfmt/${name}-linux
|
||||
cat > /run/binfmt/${name}-linux << 'EOF'
|
||||
#!${channels.cipkgs.bash}/bin/sh
|
||||
exec -- ${channels.cipkgs.qemu}/bin/qemu-${name} "$@"
|
||||
EOF
|
||||
chmod +x /run/binfmt/${name}-linux
|
||||
''; in
|
||||
archbinfmt = let
|
||||
makeQemuWrapper = name: ''
|
||||
mkdir -p /run/binfmt
|
||||
rm -f /run/binfmt/${name}-linux
|
||||
cat > /run/binfmt/${name}-linux << 'EOF'
|
||||
#!${channels.cipkgs.bash}/bin/sh
|
||||
exec -- ${channels.cipkgs.qemu}/bin/qemu-${name} "$@"
|
||||
EOF
|
||||
chmod +x /run/binfmt/${name}-linux
|
||||
'';
|
||||
in
|
||||
channels.cipkgs.writeShellScriptBin "archbinfmt" ''
|
||||
${makeQemuWrapper "aarch64"}
|
||||
${makeQemuWrapper "arm"}
|
||||
|
|
@ -51,13 +58,12 @@
|
|||
'';
|
||||
};
|
||||
|
||||
jobs =
|
||||
let
|
||||
main = (import ../.);
|
||||
enabledHosts = [ "tewi" ];
|
||||
in
|
||||
jobs = let
|
||||
main = import ../.;
|
||||
enabledHosts = ["tewi"];
|
||||
in
|
||||
mapAttrs' (k: nameValuePair "${k}") (genAttrs enabledHosts (host: {
|
||||
tasks.${host}.inputs = channels.nixfiles.network.nodes.nixos.${host}.deploy.system;
|
||||
tasks.${host}.inputs = channels.nixfiles.network.nodes.${host}.deploy.system;
|
||||
}));
|
||||
|
||||
ci.gh-actions.checkoutOptions.submodules = false;
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
{ meta, config, ... }: {
|
||||
imports = with meta; [
|
||||
home.base
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
{ config, ... }: {
|
||||
documentation = {
|
||||
enable = false;
|
||||
man.enable = false;
|
||||
info.enable = false;
|
||||
doc.enable = false;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{ config, ... }: {
|
||||
fonts = {
|
||||
fontDir.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{ config, ... }: {
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
{ config, ... }: {
|
||||
homebrew = {
|
||||
enable = true;
|
||||
onActivation.upgrade = true;
|
||||
cleanup = "zap";
|
||||
brews = [
|
||||
"mas"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
{ config, pkgs, inputs, ... }: {
|
||||
services.nix-daemon.enable = true;
|
||||
nix = {
|
||||
registry = {
|
||||
nixpkgs.flake = inputs.nixpkgs;
|
||||
nur.flake = inputs.nur;
|
||||
arc.flake = inputs.arcexprs;
|
||||
ci.flake = inputs.ci;
|
||||
};
|
||||
package = pkgs.nixUnstable;
|
||||
binaryCaches = [ "https://arc.cachix.org" "https://kittywitch.cachix.org" "https://nix-community.cachix.org" ];
|
||||
binaryCachePublicKeys =
|
||||
[ "arc.cachix.org-1:DZmhclLkB6UO0rc0rBzNpwFbbaeLfyn+fYccuAy7YVY=" "kittywitch.cachix.org-1:KIzX/G5cuPw5WgrXad6UnrRZ8UDr7jhXzRTK/lmqyK0=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=" ];
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
keep-derivations = true
|
||||
keep-outputs = true
|
||||
extra-platforms = x86_64-darwin aarch64-darwin
|
||||
builders-use-substitutes = true
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{ config, ... }: {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
{ config, ... }: {
|
||||
services.activate-system.enable = true;
|
||||
|
||||
system = {
|
||||
defaults = {
|
||||
SoftwareUpdate.AutomaticallyInstallMacOSUpdates = true;
|
||||
NSGlobalDomain = {
|
||||
AppleInterfaceStyleSwitchesAutomatically = true;
|
||||
AppleShowAllFiles = true;
|
||||
AppleShowAllExtensions = true;
|
||||
};
|
||||
dock = {
|
||||
autohide = true;
|
||||
orientation = "left";
|
||||
tilesize = 32;
|
||||
wvous-tl-corner = 1;
|
||||
wvous-tr-corner = 10;
|
||||
wvous-bl-corner = 4;
|
||||
wvous-br-corner = 14;
|
||||
};
|
||||
finder = {
|
||||
CreateDesktop = false;
|
||||
ShowPathbar = true;
|
||||
ShowStatusBar = true;
|
||||
AppleShowAllFiles = true;
|
||||
AppleShowAllExtensions = true;
|
||||
};
|
||||
loginwindow = {
|
||||
GuestEnabled = false;
|
||||
};
|
||||
};
|
||||
keyboard = {
|
||||
enableKeyMapping = true;
|
||||
remapCapsLockToControl = true;
|
||||
userKeyMapping = [
|
||||
{
|
||||
HIDKeyboardModifierMappingSrc = 30064771129;
|
||||
HIDKeyboardModifierMappingDst = 30064771299;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
119
darwin/gui.nix
119
darwin/gui.nix
|
|
@ -1,119 +0,0 @@
|
|||
{ config, pkgs, lib, ... }: with lib; {
|
||||
services = {
|
||||
yabai = {
|
||||
enable = true;
|
||||
enableScriptingAddition = true;
|
||||
config = {
|
||||
layout = "bsp";
|
||||
auto_balance = "on";
|
||||
split_ratio = "0.50";
|
||||
window_placement = "second_child";
|
||||
window_gap = 18;
|
||||
top_padding = 36;
|
||||
bottom_padding = 18;
|
||||
left_padding = 18;
|
||||
right_padding = 18;
|
||||
window_shadow = "on";
|
||||
window_border = "off";
|
||||
window_border_width = 3;
|
||||
window_opacity = "on";
|
||||
window_opacity_duration = "0.1";
|
||||
active_window_opacity = "1.0";
|
||||
normal_window_opacity = "1.0";
|
||||
mouse_modifier = "cmd";
|
||||
mouse_action1 = "move";
|
||||
mouse_action2 = "resize";
|
||||
mouse_drop_action = "swap";
|
||||
};
|
||||
extraConfig = ''
|
||||
yabai -m rule --add app='Firefox' manage=on
|
||||
yabai -m rule --add app='System Preferences' manage=off
|
||||
yabai -m rule --add app='Activity Monitor' manage=off
|
||||
'';
|
||||
};
|
||||
spacebar = {
|
||||
enable = true;
|
||||
package = pkgs.spacebar;
|
||||
config = {
|
||||
position = "top";
|
||||
height = 28;
|
||||
title = "off";
|
||||
spaces = "on";
|
||||
power = "on";
|
||||
clock = "on";
|
||||
right_shell = "on";
|
||||
padding_left = 20;
|
||||
padding_right = 20;
|
||||
spacing_left = 25;
|
||||
spacing_right = 25;
|
||||
text_font = ''"Menlo:16.0"'';
|
||||
icon_font = ''"Menlo:16.0"'';
|
||||
background_color = "0xff161616";
|
||||
foreground_color = "0xffFFFFFF";
|
||||
space_icon_color = "0xff3ddbd9";
|
||||
power_icon_strip = " ";
|
||||
space_icon_strip = "一 二 三 四 五 六 七 八 九 十";
|
||||
spaces_for_all_displays = "on";
|
||||
display_separator = "on";
|
||||
display_separator_icon = "|";
|
||||
clock_format = ''"%d/%m/%y %R"'';
|
||||
right_shell_icon = " ";
|
||||
right_shell_command = "whoami";
|
||||
};
|
||||
};
|
||||
skhd = {
|
||||
enable = true;
|
||||
package = pkgs.skhd;
|
||||
skhdConfig = ''
|
||||
# open terminal
|
||||
cmd - return : wezterm
|
||||
|
||||
# focus window
|
||||
lalt - h : yabai -m window --focus west
|
||||
lalt - j : yabai -m window --focus south
|
||||
lalt - k : yabai -m window --focus north
|
||||
lalt - l : yabai -m window --focus east
|
||||
|
||||
# swap managed window
|
||||
shift + lalt - h : yabai -m window --swap west
|
||||
shift + lalt - l : yabai -m window --swap east
|
||||
shift + lalt - j : yabai -m window --swap south
|
||||
shift + lalt - k : yabai -m window --swap north
|
||||
|
||||
# focus spaces
|
||||
alt - x : yabai -m space --focus recent
|
||||
alt - 1 : yabai -m space --focus 1
|
||||
alt - 2 : yabai -m space --focus 2
|
||||
alt - 3 : yabai -m space --focus 3
|
||||
alt - 4 : yabai -m space --focus 4
|
||||
alt - 5 : yabai -m space --focus 5
|
||||
alt - 6 : yabai -m space --focus 6
|
||||
alt - 7 : yabai -m space --focus 7
|
||||
alt - 8 : yabai -m space --focus 8
|
||||
|
||||
# focus on next/prev space
|
||||
alt + ctrl - q : yabai -m space --focus prev
|
||||
alt + ctrl - e : yabai -m space --focus next
|
||||
|
||||
# send window to desktop
|
||||
shift + alt - x : yabai -m window --space recent
|
||||
shift + alt - 1 : yabai -m window --space 1
|
||||
shift + alt - 2 : yabai -m window --space 2
|
||||
shift + alt - 3 : yabai -m window --space 3
|
||||
shift + alt - 4 : yabai -m window --space 4
|
||||
shift + alt - 5 : yabai -m window --space 5
|
||||
shift + alt - 6 : yabai -m window --space 6
|
||||
shift + alt - 7 : yabai -m window --space 7
|
||||
shift + alt - 8 : yabai -m window --space 8
|
||||
|
||||
# float / unfloat window and center on screen
|
||||
lalt - t : yabai -m window --toggle float;\
|
||||
yabai -m window --grid 4:4:1:1:2:2
|
||||
|
||||
# toggle window zoom
|
||||
lalt - d : yabai -m window --toggle zoom-parent
|
||||
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
{ config, pkgs, ... }: {
|
||||
users.users.kat = {
|
||||
name = "kat";
|
||||
home = "/Users/kat";
|
||||
shell = pkgs.zsh;
|
||||
uid = 501;
|
||||
};
|
||||
users.knownUsers = [
|
||||
"kat"
|
||||
];
|
||||
home-manager.users.kat.programs.zsh.initExtraFirst = ''
|
||||
source /etc/static/zshrc
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
{ config, pkgs, lib, inputs, meta, ... }: {
|
||||
imports = with meta; [
|
||||
hardware.aarch64-darwin
|
||||
darwin.base
|
||||
darwin.kat
|
||||
home.work
|
||||
];
|
||||
|
||||
security.pam.enableSudoTouchIdAuth = true;
|
||||
|
||||
home-manager.users.root.programs.ssh = {
|
||||
enable = true;
|
||||
matchBlocks = {
|
||||
"daiyousei-build" = {
|
||||
hostname = "daiyousei.kittywit.ch";
|
||||
port = 62954;
|
||||
user = "root";
|
||||
};
|
||||
"renko-build" = {
|
||||
hostname = "192.168.64.3";
|
||||
port = 62954;
|
||||
user = "root";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nix = {
|
||||
envVars = {
|
||||
"SSH_AUTH_SOCK" = "/Users/kat/.gnupg/S.gpg-agent.ssh";
|
||||
};
|
||||
buildMachines = [
|
||||
{
|
||||
hostName = "renko-build";
|
||||
sshUser = "root";
|
||||
system = "x86_64-linux";
|
||||
maxJobs = 100;
|
||||
speedFactor = 1;
|
||||
supportedFeatures = [ "benchmark" "big-parallel" "kvm" ];
|
||||
mandatoryFeatures = [ ];
|
||||
}
|
||||
{
|
||||
hostName = "daiyousei-build";
|
||||
sshUser = "root";
|
||||
system = "aarch64-linux";
|
||||
maxJobs = 100;
|
||||
speedFactor = 1;
|
||||
supportedFeatures = [ "benchmark" "big-parallel" "kvm" ];
|
||||
mandatoryFeatures = [ ];
|
||||
}
|
||||
];
|
||||
distributedBuilds = true;
|
||||
};
|
||||
|
||||
homebrew = {
|
||||
brewPrefix = "/opt/homebrew/bin";
|
||||
brews = [
|
||||
"gnupg"
|
||||
"pinentry"
|
||||
];
|
||||
casks = [
|
||||
"utm"
|
||||
"mullvadvpn"
|
||||
"android-studio"
|
||||
"bitwarden"
|
||||
"deluge"
|
||||
"alt-tab"
|
||||
"spotify"
|
||||
"brave-browser"
|
||||
"disk-inventory-x"
|
||||
"dozer"
|
||||
"firefox"
|
||||
"devtoys"
|
||||
"cyberduck"
|
||||
"docker"
|
||||
"pycharm-ce"
|
||||
"slack"
|
||||
];
|
||||
masApps = {
|
||||
Tailscale = 1475387142;
|
||||
Dato = 1470584107;
|
||||
Lungo = 1263070803;
|
||||
"Battery Indicator" = 1206020918;
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = 4;
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
{ config, ... }: {
|
||||
api = {
|
||||
password = "!secret api_password";
|
||||
};
|
||||
ota = {
|
||||
safe_mode = true;
|
||||
password = "!secret ota_password";
|
||||
};
|
||||
wifi = {
|
||||
ssid = "Gensokyo";
|
||||
password = "!secret wifi_password";
|
||||
};
|
||||
logger = {
|
||||
level = "DEBUG";
|
||||
};
|
||||
secrets = {
|
||||
ota_password = "gensokyo/esphome#ota";
|
||||
api_password = "gensokyo/esphome#api";
|
||||
wifi_password = "gensokyo/esphome#wifi";
|
||||
};
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
{ config, target, ... }: {
|
||||
esphome = {
|
||||
platform = "esp8266";
|
||||
board = "d1_mini";
|
||||
};
|
||||
i2c = {
|
||||
sda = "D2";
|
||||
scl = "D1";
|
||||
scan = true;
|
||||
};
|
||||
sensor = [
|
||||
{
|
||||
platform = "dht";
|
||||
model = "DHT22";
|
||||
update_interval = "60s";
|
||||
pin = "D0";
|
||||
temperature = {
|
||||
name = "Bedroom Temperature";
|
||||
id = "bedtemp";
|
||||
};
|
||||
humidity = {
|
||||
name = "Bedroom Humidity";
|
||||
id = "bedhum";
|
||||
};
|
||||
}
|
||||
{
|
||||
platform = "ccs811";
|
||||
update_interval = "60s";
|
||||
address = "0x5A";
|
||||
temperature = "bedtemp";
|
||||
humidity = "bedhum";
|
||||
baseline = "0x2BBB";
|
||||
eco2 = {
|
||||
name = "Bedroom eCO2";
|
||||
};
|
||||
tvoc = {
|
||||
name = "Bedroom TVOC";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
60
flake.nix
60
flake.nix
|
|
@ -14,19 +14,6 @@
|
|||
url = "github:nix-community/home-manager/master";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
darwin = {
|
||||
url = "github:lnl7/nix-darwin/master";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nix-dns = {
|
||||
url = "github:kirelagin/nix-dns/master";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
};
|
||||
tf-nix = {
|
||||
url = "github:arcnmx/tf-nix/master";
|
||||
flake = false;
|
||||
};
|
||||
trusted = {
|
||||
url = "github:input-output-hk/empty-flake";
|
||||
};
|
||||
|
|
@ -34,13 +21,6 @@
|
|||
url = "github:edolstra/flake-compat";
|
||||
flake = false;
|
||||
};
|
||||
nix-doom-emacs = {
|
||||
url = "github:nix-community/nix-doom-emacs";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
flake-utils.follows = "flake-utils";
|
||||
};
|
||||
};
|
||||
nur.url = "github:nix-community/nur/master";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
sops-nix = {
|
||||
|
|
@ -55,22 +35,26 @@
|
|||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, ... }@inputs: let
|
||||
providedSystems = flake-utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
rec {
|
||||
devShells.default = import ./devShell.nix { inherit system inputs; };
|
||||
legacyPackages = import ./meta.nix { inherit system inputs; };
|
||||
});
|
||||
in providedSystems // {
|
||||
nixosConfigurations = builtins.mapAttrs (_: config: config // {
|
||||
inherit config;
|
||||
}) self.legacyPackages.x86_64-linux.network.nodes.nixos;
|
||||
darwinConfigurations = builtins.mapAttrs (_: config: {
|
||||
inherit (config.deploy) pkgs;
|
||||
inherit config;
|
||||
|
||||
system = config.system.build.toplevel;
|
||||
}) self.legacyPackages.aarch64-darwin.network.nodes.darwin;
|
||||
};
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
...
|
||||
} @ inputs: let
|
||||
providedSystems =
|
||||
flake-utils.lib.eachDefaultSystem
|
||||
(system: rec {
|
||||
devShells.default = import ./devShell.nix {inherit system inputs;};
|
||||
legacyPackages = import ./meta.nix {inherit system inputs;};
|
||||
});
|
||||
in
|
||||
providedSystems
|
||||
// {
|
||||
nixosConfigurations = builtins.mapAttrs (_: config:
|
||||
config
|
||||
// {
|
||||
inherit config;
|
||||
})
|
||||
self.legacyPackages.x86_64-linux.network.nodes;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
{ config, lib, ... }: with lib; {
|
||||
nixpkgs.system = "aarch64-darwin";
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{ config, lib, ... }: with lib; {
|
||||
nixpkgs.localSystem = systems.examples.aarch64-multiplatform // {
|
||||
system = "aarch64-linux";
|
||||
};
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
boot.initrd.availableKernelModules = [ "amdgpu" ];
|
||||
hardware.opengl.extraPackages = with pkgs; [ libvdpau-va-gl vaapiVdpau ];
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
{ config, lib, ... }: with lib; {
|
||||
options = {
|
||||
hardware.bamboo.display = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
home-manager.users = let
|
||||
userBambooExtend = { config, nixos, ... }: {
|
||||
config = mkIf config.wayland.windowManager.sway.enable {
|
||||
wayland.windowManager.sway.config.input = {
|
||||
"1386:215:Wacom_BambooPT_2FG_Small_Pen" = {
|
||||
map_to_output = nixos.hardware.bamboo.display;
|
||||
};
|
||||
"1386:215:Wacom_BambooPT_2FG_Small_Finger" = {
|
||||
natural_scroll = "enabled";
|
||||
middle_emulation = "enabled";
|
||||
tap = "enabled";
|
||||
dwt = "enabled";
|
||||
accel_profile = "flat";
|
||||
pointer_accel = "0.05";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
in mkOption {
|
||||
type = types.attrsOf (types.submoduleWith {
|
||||
modules = singleton userBambooExtend;
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
{ lib, tree, ... }: let
|
||||
profiles = tree.prev;
|
||||
appendedProfiles = with profiles; {
|
||||
ms-7b86 = {
|
||||
imports = [
|
||||
ms-7b86
|
||||
ryzen
|
||||
amdgpu
|
||||
];
|
||||
};
|
||||
rm-310 = {
|
||||
imports = [
|
||||
rm-310
|
||||
intel
|
||||
];
|
||||
};
|
||||
v330-14arr = {
|
||||
imports = [
|
||||
v330-14arr
|
||||
ryzen
|
||||
amdgpu
|
||||
laptop
|
||||
networkmanager
|
||||
];
|
||||
};
|
||||
x270 = {
|
||||
imports = [
|
||||
x270
|
||||
intel
|
||||
laptop
|
||||
networkmanager
|
||||
intel-gpu
|
||||
];
|
||||
};
|
||||
eeepc-1015pem = {
|
||||
imports = [
|
||||
eeepc-1015pem
|
||||
intel
|
||||
laptop
|
||||
];
|
||||
};
|
||||
};
|
||||
in
|
||||
profiles // appendedProfiles
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
boot = {
|
||||
initrd = {
|
||||
availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "usb_storage" "sd_mod" ];
|
||||
kernelModules = [ ];
|
||||
};
|
||||
kernelModules = [ ];
|
||||
extraModulePackages = [ ];
|
||||
kernelParams = [
|
||||
"usbcore.autosuspend=-1"
|
||||
"acpi_osi=Linux"
|
||||
"acpi_enforce_resources=lax"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{ config, pkgs, ... }: {
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
intel-media-driver
|
||||
vaapiIntel
|
||||
vaapiVdpau
|
||||
libvdpau-va-gl
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
{ config, ... }:
|
||||
|
||||
/*
|
||||
This hardware profile corresponds to any machine which has an Intel processor.
|
||||
*/
|
||||
|
||||
{
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
|
||||
boot = {
|
||||
kernelModules = [ "kvm-intel" ];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.light.enable = true;
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
{ config, lib, ... }: {
|
||||
deploy.tf.resources.${config.networking.hostName} = {
|
||||
provider = "null";
|
||||
type = "resource";
|
||||
connection = {
|
||||
port = lib.head config.services.openssh.ports;
|
||||
host = if config.networks.gensokyo.interfaces != [] then config.networks.gensokyo.ipv4 else config.networks.chitei.ipv4;
|
||||
};
|
||||
};
|
||||
|
||||
services.udev.extraRules = ''
|
||||
SUBSYSTEM=="tty", GROUP="input", MODE="0660"
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{ config, lib, ... }: {
|
||||
deploy.tf = {
|
||||
resources.${config.networking.hostName} = {
|
||||
provider = "null";
|
||||
type = "resource";
|
||||
connection = {
|
||||
port = lib.head config.services.openssh.ports;
|
||||
host = config.networks.internet.ipv4;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
/*
|
||||
This hardware profile corresponds to the MSI B450-A PRO MAX system.
|
||||
*/
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ];
|
||||
boot.kernelModules = [ "nct6775" ];
|
||||
}
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
{ config, lib, pkgs, ... }: {
|
||||
options = {
|
||||
home-manager.users = let
|
||||
applets = { config, nixos, ... }: {
|
||||
xsession.preferStatusNotifierItems = true;
|
||||
services = {
|
||||
network-manager-applet.enable = true;
|
||||
blueman-applet.enable = true;
|
||||
};
|
||||
};
|
||||
in lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submoduleWith {
|
||||
modules = lib.singleton applets;
|
||||
});
|
||||
};
|
||||
};
|
||||
config = {
|
||||
systemd.services.NetworkManager-wait-online = {
|
||||
serviceConfig.ExecStart = [ "" "${pkgs.networkmanager}/bin/nm-online -q" ];
|
||||
};
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
package = pkgs.bluez5-experimental;
|
||||
settings = {
|
||||
General = {
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
};
|
||||
};
|
||||
};
|
||||
services.blueman.enable = true;
|
||||
services.pipewire.media-session.config.bluez-monitor = {
|
||||
properties = { };
|
||||
rules = [
|
||||
{
|
||||
actions = {
|
||||
update-props = {
|
||||
"bluez5.a2dp-source-role" = "input";
|
||||
"bluez5.auto-connect" = [ "hfp_hf" "hsp_hs" "a2dp_sink" "a2dp_source" "hsp_ag" "hfp_ag" ];
|
||||
};
|
||||
};
|
||||
matches = [ { "device.name" = "~bluez_card.*"; } ];
|
||||
}
|
||||
{
|
||||
actions = {
|
||||
update-props = { "node.pause-on-idle" = false; };
|
||||
};
|
||||
matches = [ { "node.name" = "~bluez_input.*"; } { "node.name" = "~bluez_output.*"; } ];
|
||||
}
|
||||
];
|
||||
};
|
||||
networking = {
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
connectionConfig = {
|
||||
"ipv6.ip6-privacy" = lib.mkForce 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,294 +0,0 @@
|
|||
{ config, tf, meta, kw, pkgs, lib, inputs, ... }: let
|
||||
oci-root = meta.deploy.targets.oci-root.tf;
|
||||
cfg = config.nixfiles.oci;
|
||||
in
|
||||
{
|
||||
options.nixfiles.oci = {
|
||||
base = lib.mkOption {
|
||||
description = ''
|
||||
Canonical Ubuntu provides an EXT4 root filesystem.
|
||||
Oracle Linux provides an XFS root filesystem.
|
||||
'';
|
||||
type = lib.types.enum [
|
||||
"Canonical Ubuntu"
|
||||
"Oracle Linux"
|
||||
];
|
||||
default = "Canonical Ubuntu";
|
||||
};
|
||||
specs = {
|
||||
shape = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
cores = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = null;
|
||||
};
|
||||
ram = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = null;
|
||||
};
|
||||
space = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
network = {
|
||||
privateV4 = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = null;
|
||||
};
|
||||
publicV6 = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
ad = lib.mkOption {
|
||||
description = ''
|
||||
Availability Domain.
|
||||
Important because, for example: EPYC instances can only be provisioned on AD2 in London.
|
||||
'';
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
imports = with import (inputs.tf-nix + "/modules"); [
|
||||
nixos.oracle
|
||||
];
|
||||
config =
|
||||
let
|
||||
interface = lib.attrByPath [ cfg.specs.shape ] (throw "Unsupported shape") {
|
||||
"VM.Standard.A1.Flex" = "enp0s3";
|
||||
"VM.Standard.E2.1.Micro" = "ens3";
|
||||
};
|
||||
in
|
||||
{
|
||||
networking.interfaces =
|
||||
{
|
||||
${interface} = {
|
||||
useDHCP = true;
|
||||
ipv6 = {
|
||||
addresses = lib.mkIf (config.networks.internet.ipv6_defined) [{
|
||||
address = config.networks.internet.ipv6;
|
||||
prefixLength = 64;
|
||||
}];
|
||||
routes = [{
|
||||
address = "::";
|
||||
prefixLength = 0;
|
||||
}];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networks = {
|
||||
internet = lib.mkMerge [
|
||||
(lib.mkIf tf.state.enable {
|
||||
interfaces = lib.singleton interface;
|
||||
ipv4 = lib.mkOrder 1000 (tf.resources.${config.networking.hostName}.getAttr "public_ip");
|
||||
ipv6 = let
|
||||
prefix = lib.head (lib.splitString "/" (oci-root.resources.oci_kw_subnet.importAttr "ipv6cidr_block"));
|
||||
in assert lib.hasSuffix "::" prefix; prefix + toString config.nixfiles.oci.network.publicV6;
|
||||
ip = hostname: class: if hostname != config.networking.hostName then
|
||||
if class == 6 then let
|
||||
prefix = lib.head (lib.splitString "/" (oci-root.resources.oci_kw_subnet.importAttr "ipv6cidr_block"));
|
||||
in assert lib.hasSuffix "::" prefix; prefix + toString config.nixfiles.oci.network.publicV6
|
||||
else if class == 4 then
|
||||
tf.resources.${config.networking.hostName}.importAttr "public_ip"
|
||||
else throw "${config.networking.hostName}: IP for ${hostname} of ${toString class} is invalid."
|
||||
else
|
||||
if class == 6 then let
|
||||
prefix = lib.head (lib.splitString "/" (oci-root.resources.oci_kw_subnet.importAttr "ipv6cidr_block"));
|
||||
in assert lib.hasSuffix "::" prefix; prefix + toString config.nixfiles.oci.network.publicV6
|
||||
else if class == 4 then
|
||||
tf.resources.${config.networking.hostName}.getAttr "public_ip"
|
||||
else throw "${config.networking.hostName}: IP for ${hostname} of ${toString class} is invalid.";
|
||||
})
|
||||
(lib.mkIf (!tf.state.enable) {
|
||||
interfaces = lib.singleton "whee";
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
services.cockroachdb.locality = lib.mkIf (tf.state.enable) "provider=oracle,region=${tf.providers.oci.inputs.region},ad=${toString cfg.ad},host=${config.networking.hostName}";
|
||||
|
||||
deploy.tf =
|
||||
let
|
||||
compartment_id = oci-root.resources.oci_kw_compartment.importAttr "id";
|
||||
inherit (tf.lib.tf) terraformExpr;
|
||||
in
|
||||
{
|
||||
deploy.systems."${config.networking.hostName}" = {
|
||||
lustrate = {
|
||||
enable = true;
|
||||
connection = tf.resources."${config.networking.hostName}".connection.set;
|
||||
};
|
||||
connection = {
|
||||
port = lib.head config.services.openssh.ports;
|
||||
};
|
||||
};
|
||||
providers.oci = {
|
||||
inputs = {
|
||||
tenancy_ocid = oci-root.outputs.oci_tenancy.import;
|
||||
user_ocid = oci-root.resources.oci_kw_user.importAttr "id";
|
||||
fingerprint = oci-root.resources.oci_kw_apikey.importAttr "fingerprint";
|
||||
region = oci-root.outputs.oci_region.import;
|
||||
private_key_path = oci-root.resources.oci_kw_key_file.importAttr "filename";
|
||||
};
|
||||
};
|
||||
resources = lib.mkMerge [{
|
||||
cloudinit = {
|
||||
provider = "cloudinit";
|
||||
type = "config";
|
||||
dataSource = true;
|
||||
inputs = {
|
||||
part = lib.singleton {
|
||||
content_type = "text/cloud-config";
|
||||
content = "#cloud-config\n" + builtins.toJSON {
|
||||
disable_root = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
availability_domain = {
|
||||
provider = "oci";
|
||||
type = "identity_availability_domain";
|
||||
dataSource = true;
|
||||
inputs = {
|
||||
inherit compartment_id;
|
||||
ad_number = cfg.ad;
|
||||
};
|
||||
};
|
||||
generic_image = {
|
||||
provider = "oci";
|
||||
type = "core_images";
|
||||
dataSource = true;
|
||||
inputs = {
|
||||
inherit compartment_id;
|
||||
inherit (tf.resources."${config.networking.hostName}".inputs) shape;
|
||||
operating_system = cfg.base;
|
||||
sort_by = "TIMECREATED";
|
||||
sort_order = "DESC";
|
||||
};
|
||||
};
|
||||
"${config.networking.hostName}_vnic" = {
|
||||
provider = "oci";
|
||||
type = "core_vnic_attachments";
|
||||
dataSource = true;
|
||||
inputs = {
|
||||
inherit compartment_id;
|
||||
instance_id = tf.resources."${config.networking.hostName}".refAttr "id";
|
||||
};
|
||||
};
|
||||
"${config.networking.hostName}_ipv6" = {
|
||||
provider = "oci";
|
||||
type = "core_ipv6";
|
||||
inputs = {
|
||||
vnic_id = tf.resources."${config.networking.hostName}_vnic".refAttr "vnic_attachments[0].vnic_id";
|
||||
display_name = config.networking.hostName;
|
||||
ip_address = terraformExpr ''cidrhost("${oci-root.resources.oci_kw_subnet.importAttr "ipv6cidr_block"}", ${toString cfg.network.publicV6})'';
|
||||
};
|
||||
};
|
||||
"${config.networking.hostName}" = {
|
||||
provider = "oci";
|
||||
type = "core_instance";
|
||||
inputs = {
|
||||
inherit compartment_id;
|
||||
extended_metadata = { };
|
||||
metadata = {
|
||||
ssh_authorized_keys = lib.concatStringsSep "\n" config.users.users.root.openssh.authorizedKeys.keys;
|
||||
user_data = tf.resources.cloudinit.refAttr "rendered";
|
||||
};
|
||||
shape = cfg.specs.shape;
|
||||
shape_config = {
|
||||
ocpus = cfg.specs.cores;
|
||||
memory_in_gbs = cfg.specs.ram;
|
||||
};
|
||||
source_details = {
|
||||
source_type = "image";
|
||||
source_id = tf.resources.generic_image.refAttr "images[0].id";
|
||||
boot_volume_size_in_gbs = cfg.specs.space; # min 50GB, up to 200GB free
|
||||
};
|
||||
create_vnic_details = [
|
||||
{
|
||||
assign_public_ip = true;
|
||||
subnet_id = oci-root.resources.oci_kw_subnet.importAttr "id";
|
||||
private_ip = terraformExpr ''cidrhost("${oci-root.resources.oci_kw_subnet.importAttr "cidr_block"}", ${toString cfg.network.privateV4})'';
|
||||
nsg_ids = [
|
||||
(tf.resources.firewall_group.refAttr "id")
|
||||
];
|
||||
}
|
||||
];
|
||||
availability_domain = tf.resources.availability_domain.refAttr "name";
|
||||
};
|
||||
lifecycle.ignoreChanges = [
|
||||
"source_details[0].source_id"
|
||||
"create_vnic_details[0].defined_tags"
|
||||
"defined_tags"
|
||||
"metadata"
|
||||
];
|
||||
connection = {
|
||||
type = "ssh";
|
||||
user = "root";
|
||||
host = tf.lib.tf.terraformSelf "public_ip";
|
||||
timeout = "5m";
|
||||
};
|
||||
};
|
||||
firewall_group = {
|
||||
provider = "oci";
|
||||
type = "core_network_security_group";
|
||||
inputs = {
|
||||
display_name = "${config.networking.hostName} firewall group";
|
||||
inherit compartment_id;
|
||||
vcn_id = oci-root.resources.oci_vcn.importAttr "id";
|
||||
};
|
||||
};
|
||||
}
|
||||
(
|
||||
let
|
||||
protoValues = {
|
||||
TCP = 6;
|
||||
UDP = 17;
|
||||
};
|
||||
inherit (config.networking) firewall;
|
||||
ipv4 = "0.0.0.0/0";
|
||||
ipv6 = "::/0";
|
||||
mapPort = source: protocol: port: {
|
||||
provider = "oci";
|
||||
type = "core_network_security_group_security_rule";
|
||||
inputs = {
|
||||
network_security_group_id = tf.resources.firewall_group.refAttr "id";
|
||||
inherit protocol source;
|
||||
direction = "INGRESS";
|
||||
${if protocol == protoValues.TCP then "tcp_options" else "udp_options"} = {
|
||||
destination_port_range =
|
||||
if lib.isAttrs port then {
|
||||
min = port.from;
|
||||
max = port.to;
|
||||
} else {
|
||||
min = port;
|
||||
max = port;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
sourceProtos = lib.cartesianProductOfSets {
|
||||
source = [ ipv4 ipv6 ];
|
||||
protocol = [ protoValues.TCP protoValues.UDP ];
|
||||
};
|
||||
mapPortswheeee = port: map ({ source, protocol }: mapPort source protocol port) sourceProtos;
|
||||
rules = mapPortswheeee { from = 1; to = 65535; };
|
||||
/*mapAll = protocol: port: [ (mapPort ipv4 protocol port) (mapPort ipv6 protocol port) ];
|
||||
mapAllForInterface =
|
||||
let
|
||||
protos = [ "TCP" "UDP" ];
|
||||
types = [ "Ports" "PortRanges" ];
|
||||
in
|
||||
interface: concatMap (type: concatMap (proto: (concatMap (port: (mapAll protoValues.${proto}) port) interface."allowed${proto}${type}")) protos) types;
|
||||
rules = concatMap mapAllForInterface ([ firewall ] ++ map (interface: firewall.interfaces.${interface}) config.network.firewall.public.interfaces);*/
|
||||
# TODO: use `count` and index into a fancy json or something?
|
||||
in
|
||||
lib.listToAttrs (lib.imap0 (i: rule: lib.nameValuePair "firewall${toString i}" rule) rules)
|
||||
)];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
{ inputs, tree, ... }: let
|
||||
profiles = tree.prev;
|
||||
appendedProfiles = with profiles; {
|
||||
ubuntu = { config, ... }: {
|
||||
nixfiles.oci.base = "Canonical Ubuntu";
|
||||
imports = with import (inputs.tf-nix + "/modules"); [
|
||||
nixos.ubuntu-linux
|
||||
common
|
||||
];
|
||||
};
|
||||
oracle = { config, ... }: {
|
||||
nixfiles.oci.base = "Oracle Linux";
|
||||
imports = with import (inputs.tf-nix + "/modules"); [
|
||||
nixos.oracle-linux
|
||||
common
|
||||
];
|
||||
};
|
||||
};
|
||||
in
|
||||
profiles // appendedProfiles
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
{ config, lib, ... }: with lib; {
|
||||
options = {
|
||||
home-manager.users = let
|
||||
userRazerExtend = { config, nixos, ... }: {
|
||||
config = mkIf (config.wayland.windowManager.sway.enable && nixos.hardware.openrazer.enable) {
|
||||
wayland.windowManager.sway.config.input = {
|
||||
"5426:103:Razer_Razer_Naga_Trinity" = {
|
||||
accel_profile = "adaptive";
|
||||
pointer_accel = "-0.5";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
in mkOption {
|
||||
type = types.attrsOf (types.submoduleWith {
|
||||
modules = singleton userRazerExtend;
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{ config, ... }:
|
||||
|
||||
/*
|
||||
This hardware profile corresponds with the RM DESKTOP 310 system, which is actually just an Intel DQ67OW motherboard.
|
||||
*/
|
||||
|
||||
{
|
||||
boot.initrd.availableKernelModules = [ "ata_generic" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
{ config, pkgs, lib, ... }: {
|
||||
/*
|
||||
This hardware profile corresponds to any machine which has an AMD Ryzen processor.
|
||||
*/
|
||||
|
||||
options.home-manager.users = let
|
||||
waybarExtend = { config, ... }: {
|
||||
options = {
|
||||
programs.waybar.settings = mkOption {
|
||||
type = lib.listOf (lib.submodule waybarExtend2);
|
||||
};
|
||||
};
|
||||
};
|
||||
waybarExtend2 = { config, ... }: {
|
||||
config = {
|
||||
modules."temperature#icon".hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp2_input";
|
||||
modules.temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp2_input";
|
||||
};
|
||||
};
|
||||
polybarExtend = { config, ... }: {
|
||||
services.polybar.settings."module/temp".hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp1_input";
|
||||
};
|
||||
/*
|
||||
polybarExtend2 = { config, ... }: {
|
||||
config = {
|
||||
modules."temperature#icon".hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp2_input";
|
||||
modules.temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp2_input";
|
||||
};
|
||||
};*/
|
||||
in mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submoduleWith {
|
||||
modules = [ waybarExtend polybarExtend ];
|
||||
});
|
||||
};
|
||||
|
||||
config = {
|
||||
boot = {
|
||||
kernelModules = [
|
||||
"msr"
|
||||
"ryzen_smu"
|
||||
"kvm-amd"
|
||||
];
|
||||
kernelParams = [ "amd_iommu=on" ];
|
||||
};
|
||||
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
lm_sensors
|
||||
ryzen-smu-monitor_cpu
|
||||
ryzen-monitor
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
{ config, tf, lib, ... }:
|
||||
|
||||
let
|
||||
inherit (lib.attrsets) mapListToAttrs nameValuePair;
|
||||
inherit (lib.modules) mkIf;
|
||||
in {
|
||||
secrets.variables = mapListToAttrs
|
||||
(field:
|
||||
nameValuePair "wireless-${field}" {
|
||||
path = "secrets/wifi";
|
||||
inherit field;
|
||||
}) [ "ssid" "psk" ];
|
||||
|
||||
deploy.tf.resources = {
|
||||
wireless-credentials = {
|
||||
provider = "null";
|
||||
type = "data_source";
|
||||
dataSource = true;
|
||||
inputs.inputs = {
|
||||
ssid = tf.variables.wireless-ssid.ref;
|
||||
psk = tf.variables.wireless-psk.ref;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.wireless = {
|
||||
enable = true;
|
||||
networks = mkIf (builtins.getEnv "TF_IN_AUTOMATION" != "" || tf.state.enable) {
|
||||
${builtins.unsafeDiscardStringContext (tf.resources.wireless-credentials.getAttr "outputs.ssid")} = {
|
||||
pskRaw = tf.resources.wireless-credentials.getAttr "outputs.psk";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
/*
|
||||
This hardware profile corresponds to the Lenovo Thinkpad x270.
|
||||
*/
|
||||
|
||||
let
|
||||
inherit (lib.options) mkOption;
|
||||
userTouchpadExtend = { config, nixos, ... }: {
|
||||
wayland.windowManager.sway.config.input."2:7:SynPS/2_Synaptics_TouchPad" = {
|
||||
dwt = "enabled";
|
||||
tap = "enabled";
|
||||
natural_scroll = "enabled";
|
||||
middle_emulation = "enabled";
|
||||
click_method = "clickfinger";
|
||||
};
|
||||
};
|
||||
waybarExtend = { config, ... }: {
|
||||
options = {
|
||||
programs.waybar.settings = mkOption {
|
||||
type = lib.types.either (lib.types.listOf (lib.types.submodule waybarExtend2)) (lib.types.attrsOf (lib.types.submodule waybarExtend2));
|
||||
};
|
||||
};
|
||||
};
|
||||
waybarExtend2 = { config, ... }: {
|
||||
config = {
|
||||
modules.temperature.hwmon-path = "/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon6/temp1_input";
|
||||
};
|
||||
};
|
||||
in {
|
||||
home-manager.sharedModules = [
|
||||
waybarExtend
|
||||
userTouchpadExtend
|
||||
];
|
||||
boot = {
|
||||
initrd.availableKernelModules =
|
||||
[ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sr_mod" "rtsx_usb_sdmmc" ];
|
||||
kernelModules = [ "kvm-intel" ];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
nixfiles.theme.enable = true;
|
||||
|
||||
base16 = {
|
||||
vim.enable = false;
|
||||
gtk = {
|
||||
settings.default = {
|
||||
icon_style = "numix";
|
||||
theme_style = "oomox";
|
||||
};
|
||||
};
|
||||
vim.template = data: let
|
||||
drv = pkgs.base16-templates.vim.withTemplateData data;
|
||||
in drv.overrideAttrs (old: {
|
||||
src = pkgs.fetchFromGitHub {
|
||||
repo = "base16-vim";
|
||||
owner = "fnune";
|
||||
rev = "52e4ce93a6234d112bc88e1ad25458904ffafe61";
|
||||
sha256 = "10y8z0ycmdjk47dpxf6r2pc85k0y19a29aww99vgnxp31wrkc17h";
|
||||
};
|
||||
patches = old.patches or [ ] ++ [
|
||||
(pkgs.fetchurl {
|
||||
# base16background=none
|
||||
url = "https://github.com/arcnmx/base16-vim/commit/fe16eaaa1de83b649e6867c61494276c1f35c3c3.patch";
|
||||
sha256 = "1c0n7mf6161mvxn5xlabhyxzha0m1c41csa6i43ng8zybbspipld";
|
||||
})
|
||||
(pkgs.fetchurl {
|
||||
# fix unreadable error highlights under cursor
|
||||
url = "https://github.com/arcnmx/base16-vim/commit/807e442d95c57740dd3610c9f9c07c9aae8e0995.patch";
|
||||
sha256 = "1l3qmk15v8d389363adkmfg8cpxppyhlk215yq3rdcasvw7r8bla";
|
||||
})
|
||||
];
|
||||
});
|
||||
shell.enable = true;
|
||||
schemes = lib.mkMerge [ {
|
||||
light = "atelier.atelier-cave-light";
|
||||
dark = "atelier.atelier-cave";
|
||||
} {
|
||||
dark.ansi.palette.background.alpha = "ee00";
|
||||
light.ansi.palette.background.alpha = "d000";
|
||||
} ];
|
||||
defaultSchemeName = "dark";
|
||||
};
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{ config, lib, ... }: {
|
||||
dconf.enable = lib.mkDefault false;
|
||||
}
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
{ lib, tree, ... }: let
|
||||
wrapImports = imports: lib.mapAttrs
|
||||
(_: paths: { config, ... }: {
|
||||
config.home-manager.users.kat = {
|
||||
imports = lib.singleton paths;
|
||||
};
|
||||
})
|
||||
imports;
|
||||
dirImports = wrapImports tree.prev;
|
||||
serviceImports = wrapImports tree.prev.services;
|
||||
in
|
||||
dirImports // {
|
||||
base = {
|
||||
imports = with dirImports; [
|
||||
base16
|
||||
shell
|
||||
vim
|
||||
secrets
|
||||
state
|
||||
dconf
|
||||
];
|
||||
};
|
||||
gui = {
|
||||
imports = with dirImports; [
|
||||
gui
|
||||
vscode
|
||||
wezterm
|
||||
firefox
|
||||
konawall
|
||||
ranger
|
||||
xkb
|
||||
gpg
|
||||
sway
|
||||
mako
|
||||
gammastep
|
||||
wofi
|
||||
waybar
|
||||
xdg
|
||||
fonts
|
||||
media
|
||||
obs
|
||||
mpv
|
||||
syncplay
|
||||
gtk
|
||||
qt
|
||||
];
|
||||
};
|
||||
work = {
|
||||
imports = with dirImports; [
|
||||
work
|
||||
wezterm
|
||||
];
|
||||
};
|
||||
|
||||
services = serviceImports;
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; Place your private configuration here! Remember, you do not need to run 'doom
|
||||
;; sync' after modifying this file!
|
||||
|
||||
|
||||
;; Some functionality uses this to identify you, e.g. GPG configuration, email
|
||||
;; clients, file templates and snippets.
|
||||
(setq user-full-name "Kat Inskip"
|
||||
user-mail-address "kat@inskip.me")
|
||||
|
||||
|
||||
;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
|
||||
;; are the three important ones:
|
||||
;;
|
||||
;; + `doom-font'
|
||||
;; + `doom-variable-pitch-font'
|
||||
;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
|
||||
;; presentations or streaming.
|
||||
;;
|
||||
;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
|
||||
;; font string. You generally only need these two:
|
||||
(setq doom-font (font-spec :family "Iosevka SS10" :size 13))
|
||||
;; doom-variable-pitch-font (font-spec :family "sans" :size 13))
|
||||
|
||||
;; There are two ways to load a theme. Both assume the theme is installed and
|
||||
;; available. You can either set `doom-theme' or manually load a theme with the
|
||||
;; `load-theme' function. This is the default:
|
||||
;;(setq doom-theme '${lib.elemAt (lib.splitString "." base16.alias.default) 1})
|
||||
|
||||
;; If you use `org' and don't want your org files in the default location below,
|
||||
;; change `org-directory'. It must be set before org loads!
|
||||
(setq org-directory "~/.org/")
|
||||
|
||||
;; This determines the style of line numbers in effect. If set to `nil', line
|
||||
;; numbers are disabled. For relative line numbers, set this to `relative'.
|
||||
(setq display-line-numbers-type t)
|
||||
|
||||
(use-package! protobuf-mode
|
||||
:mode "\\.proto\\'")
|
||||
|
||||
|
||||
;; Here are some additional functions/macros that could help you configure Doom:
|
||||
;;
|
||||
;; - `load!' for loading external *.el files relative to this one
|
||||
;; - `use-package!' for configuring packages
|
||||
;; - `after!' for running code after a package has loaded
|
||||
;; - `add-load-path!' for adding directories to the `load-path', relative to
|
||||
;; this file. Emacs searches the `load-path' when you load packages with
|
||||
;; `require' or `use-package'.
|
||||
;; - `map!' for binding new keys
|
||||
;;
|
||||
;; To get information about any of these functions/macros, move the cursor over
|
||||
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
|
||||
;; This will open documentation for it, including demos of how they are used.
|
||||
;;
|
||||
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
|
||||
;; they are implemented.
|
||||
|
||||
|
|
@ -1,187 +0,0 @@
|
|||
;;; init.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; This file controls what Doom modules are enabled and what order they load
|
||||
;; in. Remember to run 'doom sync' after modifying it!
|
||||
|
||||
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
|
||||
;; documentation. There you'll find a "Module Index" link where you'll find
|
||||
;; a comprehensive list of Doom's modules and what flags they support.
|
||||
|
||||
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
|
||||
;; 'C-c c k' for non-vim users) to view its documentation. This works on
|
||||
;; flags as well (those symbols that start with a plus).
|
||||
;;
|
||||
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
|
||||
;; directory (for easy access to its source code).
|
||||
|
||||
|
||||
(doom! :input
|
||||
;;chinese
|
||||
;;japanese
|
||||
|
||||
:completion
|
||||
company ; the ultimate code completion backend
|
||||
;;helm ; the *other* search engine for love and life
|
||||
;;ido ; the other *other* search engine...
|
||||
ivy ; a search engine for love and life
|
||||
|
||||
:ui
|
||||
;;deft ; notational velocity for Emacs
|
||||
doom ; what makes DOOM look the way it does
|
||||
doom-dashboard ; a nifty splash screen for Emacs
|
||||
doom-quit ; DOOM quit-message prompts when you quit Emacs
|
||||
;;fill-column ; a `fill-column' indicator
|
||||
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
|
||||
;;hydra
|
||||
indent-guides ; highlighted indent columns
|
||||
;;(ligatures +iosevka)
|
||||
minimap ; show a map of the code on the side
|
||||
modeline ; snazzy, Atom-inspired modeline, plus API
|
||||
;;nav-flash ; blink cursor line after big motions
|
||||
;;neotree ; a project drawer, like NERDTree for vim
|
||||
ophints ; highlight the region an operation acts on
|
||||
(popup +defaults) ; tame sudden yet inevitable temporary windows
|
||||
;;pretty-code ; ligatures or substitute text with pretty symbols
|
||||
;;tabs ; a tab bar for Emacs
|
||||
treemacs ; a project drawer, like neotree but cooler
|
||||
;;unicode ; extended unicode support for various languages
|
||||
vc-gutter ; vcs diff in the fringe
|
||||
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
||||
;;window-select ; visually switch windows
|
||||
workspaces ; tab emulation, persistence & separate workspaces
|
||||
;;zen ; distraction-free coding or writing
|
||||
|
||||
:editor
|
||||
(evil +everywhere); come to the dark side, we have cookies
|
||||
file-templates ; auto-snippets for empty files
|
||||
fold ; (nigh) universal code folding
|
||||
;;(format +onsave) ; automated prettiness
|
||||
;;god ; run Emacs commands without modifier keys
|
||||
;;lispy ; vim for lisp, for people who don't like vim
|
||||
;;multiple-cursors ; editing in many places at once
|
||||
;;objed ; text object editing for the innocent
|
||||
;;parinfer ; turn lisp into python, sort of
|
||||
;;rotate-text ; cycle region at point between text candidates
|
||||
snippets ; my elves. They type so I don't have to
|
||||
;;word-wrap ; soft wrapping with language-aware indent
|
||||
|
||||
:emacs
|
||||
dired ; making dired pretty [functional]
|
||||
electric ; smarter, keyword-based electric-indent
|
||||
;;ibuffer ; interactive buffer management
|
||||
(undo +tree) ; persistent, smarter undo for your inevitable mistakes
|
||||
vc ; version-control and Emacs, sitting in a tree
|
||||
|
||||
:term
|
||||
;;eshell ; the elisp shell that works everywhere
|
||||
;;shell ; simple shell REPL for Emacs
|
||||
;;term ; basic terminal emulator for Emacs
|
||||
vterm ; the best terminal emulation in Emacs
|
||||
|
||||
:checkers
|
||||
syntax ; tasing you for every semicolon you forget
|
||||
;;spell ; tasing you for misspelling mispelling
|
||||
;;grammar ; tasing grammar mistake every you make
|
||||
|
||||
:tools
|
||||
;;ansible
|
||||
;;debugger ; FIXME stepping through code, to help you add bugs
|
||||
;;direnv
|
||||
docker
|
||||
;;editorconfig ; let someone else argue about tabs vs spaces
|
||||
;;ein ; tame Jupyter notebooks with emacs
|
||||
(eval +overlay) ; run code, run (also, repls)
|
||||
;;gist ; interacting with github gists
|
||||
lookup ; navigate your code and its documentation
|
||||
(lsp +peek)
|
||||
macos ; MacOS-specific commands
|
||||
magit ; a git porcelain for Emacs
|
||||
;;make ; run make tasks from Emacs
|
||||
;;pass ; password manager for nerds
|
||||
pdf ; pdf enhancements
|
||||
;;prodigy ; FIXME managing external services & code builders
|
||||
;;rgb ; creating color strings
|
||||
;;taskrunner ; taskrunner for all your projects
|
||||
terraform ; infrastructure as code
|
||||
;;tmux ; an API for interacting with tmux
|
||||
;;upload ; map local to remote projects via ssh/ftp
|
||||
|
||||
:lang
|
||||
;;agda ; types of types of types of types...
|
||||
;;cc ; C/C++/Obj-C madness
|
||||
;;clojure ; java with a lisp
|
||||
;;common-lisp ; if you've seen one lisp, you've seen them all
|
||||
;;coq ; proofs-as-programs
|
||||
crystal ; ruby at the speed of c
|
||||
;;csharp ; unity, .NET, and mono shenanigans
|
||||
data ; config/data formats
|
||||
;;(dart +flutter) ; paint ui and not much else
|
||||
(elixir +lsp) ; erlang done right
|
||||
;;elm ; care for a cup of TEA?
|
||||
emacs-lisp ; drown in parentheses
|
||||
erlang ; an elegant language for a more civilized age
|
||||
;;ess ; emacs speaks statistics
|
||||
;;faust ; dsp, but you get to keep your soul
|
||||
;;fsharp ; ML stands for Microsoft's Language
|
||||
;;fstar ; (dependent) types and (monadic) effects and Z3
|
||||
;;gdscript ; the language you waited for
|
||||
;;(go +lsp) ; the hipster dialect
|
||||
;;(haskell +dante) ; a language that's lazier than I am
|
||||
;;hy ; readability of scheme w/ speed of python
|
||||
;;idris ;
|
||||
json ; At least it ain't XML
|
||||
;;(java +meghanada) ; the poster child for carpal tunnel syndrome
|
||||
javascript ; all(hope(abandon(ye(who(enter(here))))))
|
||||
;;julia ; a better, faster MATLAB
|
||||
;;kotlin ; a better, slicker Java(Script)
|
||||
;;latex ; writing papers in Emacs has never been so fun
|
||||
;;lean
|
||||
;;factor
|
||||
;;ledger ; an accounting system in Emacs
|
||||
;;lua ; one-based indices? one-based indices
|
||||
markdown ; writing docs for people to ignore
|
||||
;;nim ; python + lisp at the speed of c
|
||||
nix ; I hereby declare "nix geht mehr!"
|
||||
;;ocaml ; an objective camel
|
||||
(org
|
||||
+present
|
||||
+pretty) ; organize your plain life in plain text
|
||||
;;php ; perl's insecure younger brother
|
||||
;;plantuml ; diagrams for confusing people more
|
||||
;;purescript ; javascript, but functional
|
||||
python ; beautiful is better than ugly
|
||||
;;qt ; the 'cutest' gui framework ever
|
||||
;;racket ; a DSL for DSLs
|
||||
;;raku ; the artist formerly known as perl6
|
||||
;;rest ; Emacs as a REST client
|
||||
;;rst ; ReST in peace
|
||||
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
|
||||
(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
||||
;;scala ; java, but good
|
||||
;;scheme ; a fully conniving family of lisps
|
||||
sh ; she sells {ba,z,fi}sh shells on the C xor
|
||||
;;sml
|
||||
;;solidity ; do you need a blockchain? No.
|
||||
;;swift ; who asked for emoji variables?
|
||||
;;terra ; Earth and Moon in alignment for performance.
|
||||
;;web ; the tubes
|
||||
yaml ; JSON, but readable
|
||||
|
||||
:email
|
||||
;;(mu4e +gmail)
|
||||
notmuch
|
||||
;;(wanderlust +gmail)
|
||||
|
||||
:app
|
||||
;;calendar
|
||||
;;irc ; how neckbeards socialize
|
||||
;;(rss +org) ; emacs as an RSS reader
|
||||
;;twitter ; twitter client https://twitter.com/vnought
|
||||
|
||||
:os
|
||||
(tty +osc)
|
||||
|
||||
:config
|
||||
;;literate
|
||||
(default +bindings +smartparens))
|
||||
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; $DOOMDIR/packages.el
|
||||
|
||||
;; To install a package with Doom you must declare them here and run 'doom sync'
|
||||
;; on the command line, then restart Emacs for the changes to take effect -- or
|
||||
;; use 'M-x doom/reload'.
|
||||
|
||||
|
||||
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
|
||||
;(package! some-package)
|
||||
|
||||
;; To install a package directly from a remote git repo, you must specify a
|
||||
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
|
||||
;; https://github.com/raxod502/straight.el#the-recipe-format
|
||||
;(package! another-package
|
||||
; :recipe (:host github :repo "username/repo"))
|
||||
|
||||
;; If the package you are trying to install does not contain a PACKAGENAME.el
|
||||
;; file, or is located in a subdirectory of the repo, you'll need to specify
|
||||
;; `:files' in the `:recipe':
|
||||
;(package! this-package
|
||||
; :recipe (:host github :repo "username/repo"
|
||||
; :files ("some-file.el" "src/lisp/*.el")))
|
||||
|
||||
;; If you'd like to disable a package included with Doom, you can do so here
|
||||
;; with the `:disable' property:
|
||||
;(package! builtin-package :disable t)
|
||||
|
||||
;; You can override the recipe of a built in package without having to specify
|
||||
;; all the properties for `:recipe'. These will inherit the rest of its recipe
|
||||
;; from Doom or MELPA/ELPA/Emacsmirror:
|
||||
;(package! builtin-package :recipe (:nonrecursive t))
|
||||
;(package! builtin-package-2 :recipe (:repo "myfork/package"))
|
||||
|
||||
;; Specify a `:branch' to install a package from a particular branch or tag.
|
||||
;; This is required for some packages whose default branch isn't 'master' (which
|
||||
;; our package manager can't deal with; see raxod502/straight.el#279)
|
||||
;(package! builtin-package :recipe (:branch "develop"))
|
||||
|
||||
;; Use `:pin' to specify a particular commit to install.
|
||||
;(package! builtin-package :pin "1a2b3c4d5e")
|
||||
|
||||
|
||||
;; Doom's packages are pinned to a specific commit and updated from release to
|
||||
;; release. The `unpin!' macro allows you to unpin single packages...
|
||||
;(unpin! pinned-package)
|
||||
;; ...or multiple packages
|
||||
;(unpin! pinned-package another-pinned-package)
|
||||
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
|
||||
;(unpin! t)
|
||||
(package! base16-theme)
|
||||
(package! evil-easymotion)
|
||||
(package! protobuf-mode :recipe (:host github :repo "emacsmirror/protobuf-mode" :files (:defaults "*")))
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
{ config, pkgs, lib, ... }: let
|
||||
inherit (lib.strings) splitString;
|
||||
inherit (lib.lists) elemAt;
|
||||
in {
|
||||
programs.doom-emacs = {
|
||||
enable = true;
|
||||
doomPrivateDir = ./doom.d;
|
||||
emacsPackagesOverlay = self: super: {
|
||||
magit-delta = super.magit-delta.overrideAttrs (esuper: {
|
||||
buildInputs = esuper.buildInputs ++ [ pkgs.git ];
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
{ config, lib, pkgs, nixos, nixfiles, ... }:
|
||||
|
||||
let
|
||||
inherit (lib.strings) toLower;
|
||||
commonSettings = {
|
||||
"app.update.auto" = false;
|
||||
"identity.fxaccounts.account.device.name" = "${nixos.networking.hostName}-${toLower pkgs.hostPlatform.uname.system}";
|
||||
"browser.download.lastDir" = "/home/kat/downloads";
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||
"svg.context-properties.content.enabled" = true;
|
||||
"services.sync.engine.prefs" = false;
|
||||
"services.sync.engine.prefs.modified" = false;
|
||||
"services.sync.engine.passwords" = false;
|
||||
"services.sync.declinedEngines" = "passwords,adblockplus,prefs";
|
||||
"media.eme.enabled" = true; # whee drm
|
||||
"gfx.webrender.all.qualified" = true;
|
||||
"gfx.webrender.all" = true;
|
||||
"layers.acceleration.force-enabled" = true;
|
||||
"gfx.canvas.azure.accelerated" = true;
|
||||
"browser.ctrlTab.recentlyUsedOrder" = false;
|
||||
"privacy.resistFingerprinting.block_mozAddonManager" = true;
|
||||
"extensions.webextensions.restrictedDomains" = "";
|
||||
"tridactyl.unfixedamo" = true;
|
||||
"tridactyl.unfixedamo_removed" = true;
|
||||
"browser.shell.checkDefaultBrowser" = false;
|
||||
"spellchecker.dictionary" = "en-CA";
|
||||
"ui.context_menus.after_mouseup" = true;
|
||||
"browser.warnOnQuit" = false;
|
||||
"browser.quitShortcut.disabled" = true;
|
||||
"browser.startup.homepage" = "about:blank";
|
||||
"browser.contentblocking.category" = "strict";
|
||||
"browser.discovery.enabled" = false;
|
||||
"browser.tabs.multiselect" = true;
|
||||
"browser.tabs.unloadOnLowMemory" = true;
|
||||
"browser.newtab.privateAllowed" = true;
|
||||
"browser.newtabpage.enabled" = false;
|
||||
"browser.urlbar.placeholderName" = "";
|
||||
"extensions.privatebrowsing.notification" = false;
|
||||
"browser.startup.page" = 3;
|
||||
"devtools.chrome.enabled" = true;
|
||||
"devtools.inspector.showUserAgentStyles" = true;
|
||||
"services.sync.prefs.sync.privacy.donottrackheader.value" = false;
|
||||
"services.sync.prefs.sync.browser.safebrowsing.malware.enabled" = false;
|
||||
"services.sync.prefs.sync.browser.safebrowsing.phishing.enabled" = false;
|
||||
"app.shield.optoutstudies.enabled" = true;
|
||||
"datareporting.healthreport.uploadEnabled" = false;
|
||||
"datareporting.policy.dataSubmissionEnabled" = false;
|
||||
"datareporting.sessions.current.clean" = true;
|
||||
"devtools.onboarding.telemetry.logged" = false;
|
||||
"toolkit.telemetry.updatePing.enabled" = false;
|
||||
"browser.ping-centre.telemetry" = false;
|
||||
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false;
|
||||
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false;
|
||||
"toolkit.telemetry.bhrPing.enabled" = false;
|
||||
"toolkit.telemetry.enabled" = false;
|
||||
"toolkit.telemetry.firstShutdownPing.enabled" = false;
|
||||
"toolkit.telemetry.hybridContent.enabled" = false;
|
||||
"toolkit.telemetry.newProfilePing.enabled" = false;
|
||||
"toolkit.telemetry.reportingpolicy.firstRun" = false;
|
||||
"toolkit.telemetry.shutdownPingSender.enabled" = false;
|
||||
"toolkit.telemetry.unified" = false;
|
||||
"toolkit.telemetry.server" = "";
|
||||
"toolkit.telemetry.archive.enabled" = false;
|
||||
"browser.onboarding.enabled" = false;
|
||||
"experiments.enabled" = false;
|
||||
"network.allow-experiments" = false;
|
||||
"social.directories" = "";
|
||||
"social.remote-install.enabled" = false;
|
||||
"social.toast-notifications.enabled" = false;
|
||||
"social.whitelist" = "";
|
||||
"browser.safebrowsing.malware.enabled" = false;
|
||||
"browser.safebrowsing.blockedURIs.enabled" = false;
|
||||
"browser.safebrowsing.downloads.enabled" = false;
|
||||
"browser.safebrowsing.downloads.remote.enabled" = false;
|
||||
"browser.safebrowsing.phishing.enabled" = false;
|
||||
"dom.ipc.plugins.reportCrashURL" = false;
|
||||
"breakpad.reportURL" = "";
|
||||
"beacon.enabled" = false;
|
||||
"browser.search.geoip.url" = "";
|
||||
"browser.search.region" = "UK";
|
||||
"browser.search.suggest.enabled" = true;
|
||||
"browser.search.update" = false;
|
||||
"browser.selfsupport.url" = "";
|
||||
"extensions.getAddons.cache.enabled" = false;
|
||||
"extensions.pocket.enabled" = true;
|
||||
"geo.enabled" = false;
|
||||
"geo.wifi.uri" = false;
|
||||
"media.getusermedia.screensharing.enabled" = false;
|
||||
"media.video_stats.enabled" = false;
|
||||
"device.sensors.enabled" = false;
|
||||
"dom.battery.enabled" = false;
|
||||
"dom.enable_performance" = false;
|
||||
"network.dns.disablePrefetch" = false;
|
||||
"network.http.speculative-parallel-limit" = 8;
|
||||
"network.predictor.cleaned-up" = true;
|
||||
"network.predictor.enabled" = true;
|
||||
"network.prefetch-next" = true;
|
||||
"security.dialog_enable_delay" = 300;
|
||||
"dom.event.contextmenu.enabled" = false;
|
||||
"privacy.trackingprotection.enabled" = true;
|
||||
"privacy.trackingprotection.fingerprinting.enabled" = true;
|
||||
"privacy.trackingprotection.cryptomining.enabled" = true;
|
||||
"privacy.trackingprotection.introCount" = 20;
|
||||
"signon.rememberSignons" = false;
|
||||
"xpinstall.whitelist.required" = false;
|
||||
"xpinstall.signatures.required" = false;
|
||||
"general.warnOnAboutConfig" = false;
|
||||
};
|
||||
in
|
||||
{
|
||||
home.file.".mozilla/tst.css" = { inherit (nixfiles.sassTemplate { name = "tst"; src = ./tst.sass; }) source; };
|
||||
|
||||
programs.zsh.shellAliases = {
|
||||
ff-pm = "firefox --ProfileManager";
|
||||
ff-main = "firefox -P main";
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
XDG_CURRENT_DESKTOP = "sway";
|
||||
BROWSER = "firefox";
|
||||
};
|
||||
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
packageUnwrapped = pkgs.firefox-unwrapped;
|
||||
wrapperConfig = {
|
||||
extraPolicies = {
|
||||
DisableAppUpdate = true;
|
||||
};
|
||||
};
|
||||
profiles = {
|
||||
main = {
|
||||
id = 0;
|
||||
isDefault = true;
|
||||
settings = commonSettings;
|
||||
userChrome = (nixfiles.sassTemplate { name = "userChrome"; src = ./userChrome.sass; }).text;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
*
|
||||
font-family: $font !important
|
||||
font-size: $font_size !important
|
||||
|
||||
#tabbar
|
||||
margin-top: calc(var(--pinned-tabs-area-size) - .15em)
|
||||
position: absolute
|
||||
border: none !important
|
||||
overflow-y: scroll !important
|
||||
margin-left: -.5em
|
||||
background-color: $base00 !important
|
||||
border-right: 1px solid $base01
|
||||
box-shadow: none !important
|
||||
|
||||
#tabbar-container
|
||||
background-color: $base00 !important
|
||||
border-right: 1px solid $base01
|
||||
box-shadow: none !important
|
||||
|
||||
.tab
|
||||
background-color: $base01
|
||||
color: $base05 !important
|
||||
box-shadow: none !important
|
||||
margin: 0.125em
|
||||
border-radius: 0.125em
|
||||
|
||||
.twisty
|
||||
margin-left: -16px
|
||||
.highlighter::before
|
||||
display: none
|
||||
|
||||
&.pinned
|
||||
background-color: $base0E
|
||||
color: $base07 !important
|
||||
|
||||
.twisty
|
||||
margin-left: -16px
|
||||
|
||||
.label
|
||||
margin-left: 7px
|
||||
|
||||
.label
|
||||
margin-left: 7px
|
||||
margin: 0.25em
|
||||
|
||||
.closebox
|
||||
visibility: collapse
|
||||
|
||||
.favicon
|
||||
margin-left: 0.25em
|
||||
|
||||
&:hover
|
||||
background-color: $base0C !important
|
||||
color: $base07 !important
|
||||
|
||||
&.discarded
|
||||
background-color: $base00
|
||||
color: $base02 !important
|
||||
&:hover
|
||||
background-color: $base01 !important
|
||||
color: $base03 !important
|
||||
|
||||
&.active
|
||||
background-color: $base0D
|
||||
color: $base07 !important
|
||||
&:hover
|
||||
background-color: $base0D !important
|
||||
|
||||
&.muted
|
||||
opacity: 0.5
|
||||
|
||||
&.sound-playing .label
|
||||
background: linear-gradient(to right, #6666ff, #0099ff , #00ff00, #ff3399, #6666ff)
|
||||
background-clip: text
|
||||
color: transparent
|
||||
animation: rainbow_animation 3s linear infinite
|
||||
animation-direction: alternate-reverse
|
||||
background-size: 400% 100%
|
||||
|
||||
.sound-button::before
|
||||
display: none !important
|
||||
|
||||
.newtab-button
|
||||
display: none
|
||||
|
||||
@keyframes rainbow_animation
|
||||
0%
|
||||
background-position: 0 0
|
||||
|
||||
100%
|
||||
background-position: 100% 0
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
$animations: "toolbarbutton", ".toolbarbutton-icon", ".subviewbutton", "#urlbar-background", ".urlbar-icon", "#userContext-indicator", "#userContext-label", ".urlbar-input-box", "#identity-box", "#tracking-protection-icon-container", "[anonid=urlbar-go-button]", ".urlbar-icon-wrapper", "#tracking-protection-icon", "#identity-box image", "stack", "vbox", "tab:not(:active) .tab-background", "tab:not([beforeselected-visible])::after", "tab[visuallyselected] .tab-background::before", "tab[visuallyselected] .tab-background::before", ".tab-close-button"
|
||||
$base00_backgrounds: "#nav-bar", "toolbar-menubar", "#menubar-items", "#main-menubar"
|
||||
$extendables: ".urlbar-icon", "#userContext-indicator", "#userContext-label"
|
||||
|
||||
%extend_1
|
||||
fill: transparent !important
|
||||
background: transparent !important
|
||||
color: transparent !important
|
||||
|
||||
@each $selector in $extendables
|
||||
#{$selector}
|
||||
@extend %extend_1
|
||||
|
||||
\:root
|
||||
--animationSpeed: 0.15s
|
||||
|
||||
*
|
||||
font-family: $font !important
|
||||
font-size: $font_size !important
|
||||
|
||||
#TabsToolbar
|
||||
visibility: collapse
|
||||
|
||||
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"]
|
||||
#sidebar-header
|
||||
visibility: collapse
|
||||
|
||||
+ #sidebar-splitter
|
||||
display: none !important
|
||||
|
||||
#back-button
|
||||
display: none !important
|
||||
|
||||
#forward-button
|
||||
display: none !important
|
||||
|
||||
#urlbar-search-mode-indicator
|
||||
display: none !important
|
||||
|
||||
#urlbar
|
||||
text-align: center
|
||||
*|input::placeholder
|
||||
opacity: 0 !important
|
||||
|
||||
&:not(:hover):not([breakout][breakout-extend]) > #urlbar-background
|
||||
box-shadow: none !important
|
||||
background: $base01 !important
|
||||
|
||||
&:hover .urlbar-icon
|
||||
fill: var(--toolbar-color) !important
|
||||
|
||||
&:active .urlbar-icon
|
||||
fill: var(--toolbar-color) !important
|
||||
|
||||
@each $selector in $base00_backgrounds
|
||||
#{$selector}
|
||||
background: $base00 !important
|
||||
|
||||
#urlbar-background
|
||||
background: $base01 !important
|
||||
|
||||
#star-button
|
||||
display: none
|
||||
|
||||
#navigator-toolbox
|
||||
border: none !important
|
||||
|
||||
.titlebar-spacer
|
||||
display: none !important
|
||||
|
||||
@each $selector in $animations
|
||||
#{$selector}
|
||||
transition: var(--animationSpeed) !important
|
||||
|
||||
#nav-bar-customization-target > toolbarspring
|
||||
max-width: none !important
|
||||
|
||||
#urlbar[focused] .urlbar-icon
|
||||
fill: var(--toolbar-color) !important
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
{ config, pkgs, lib, ... }: {
|
||||
fonts.fontconfig.enable = true;
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
services.gammastep = {
|
||||
enable = true;
|
||||
tray = true;
|
||||
latitude = "43.6532";
|
||||
longitude = "79.3832";
|
||||
};
|
||||
}
|
||||
18
home/gpg.nix
18
home/gpg.nix
|
|
@ -1,18 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = lib.mkIf (config.services.gpg-agent.pinentryFlavor == "gtk2") (with pkgs; [ pinentry.gtk2 ]);
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
enableExtraSocket = true;
|
||||
enableSshSupport = false;
|
||||
pinentryFlavor = "gtk2";
|
||||
extraConfig = lib.mkMerge [
|
||||
"auto-expand-secmem 0x30000" # otherwise "gpg: public key decryption failed: Cannot allocate memory"
|
||||
"pinentry-timeout 30"
|
||||
"allow-loopback-pinentry"
|
||||
"enable-ssh-support"
|
||||
"no-allow-external-cache"
|
||||
];
|
||||
};
|
||||
}
|
||||
23
home/gtk.nix
23
home/gtk.nix
|
|
@ -1,23 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
gnome.adwaita-icon-theme
|
||||
];
|
||||
base16.gtk.enable = false;
|
||||
gtk = {
|
||||
enable = true;
|
||||
font = {
|
||||
name = "Iosevka Aile";
|
||||
size = 9;
|
||||
};
|
||||
iconTheme = {
|
||||
name = "Maia";
|
||||
package = pkgs.maia-icon-theme;
|
||||
};
|
||||
theme = {
|
||||
name = "Adapta";
|
||||
package = pkgs.adapta-gtk-theme;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{ config, ... }: {
|
||||
services = {
|
||||
nextcloud-client.enable = false;
|
||||
gnome-keyring.enable = false;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
btop
|
||||
bitwarden
|
||||
brave
|
||||
discord
|
||||
exiftool
|
||||
thunderbird
|
||||
mumble-develop
|
||||
dino
|
||||
tdesktop
|
||||
headsetcontrol
|
||||
transmission-remote-gtk
|
||||
lm_sensors
|
||||
p7zip
|
||||
zip
|
||||
unzip
|
||||
yubikey-manager
|
||||
jmtpfs
|
||||
google-chrome
|
||||
element-desktop
|
||||
cryptsetup
|
||||
signal-desktop
|
||||
nix-linter
|
||||
spotify
|
||||
esphome
|
||||
esptool
|
||||
];
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
wayland.windowManager.sway.extraSessionCommands = ''
|
||||
export KITTY_CACHE_DIRECTORY="/tmp/kitty";
|
||||
'';
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
font.name = config.nixfiles.theme.font.termName;
|
||||
settings = {
|
||||
font_size = "10.0";
|
||||
bold_font = "auto";
|
||||
italic_font = "auto";
|
||||
bold_italic_font = "auto";
|
||||
disable_ligatures = "cursor";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
{ config, pkgs, nixos, lib, ... }:
|
||||
|
||||
|
||||
{
|
||||
home.packages = [
|
||||
config.services.konawall.konashow
|
||||
];
|
||||
|
||||
services.konawall = {
|
||||
enable = true;
|
||||
interval = "30m";
|
||||
mode = "shuffle";
|
||||
commonTags = [ "width:>=1600" ];
|
||||
tagList = map (lib.toList) [
|
||||
(["score:>=50"
|
||||
"no_humans"
|
||||
"rating:s"])
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
default partial alphanumeric_keys
|
||||
xkb_symbols "basic" {
|
||||
include "us(altgr-intl)"
|
||||
name[Group1] = "English (US, international with pound sign)";
|
||||
key <AD03> { [ e, E, EuroSign, cent ] };
|
||||
key <AE03> { [ 3, numbersign, sterling] };
|
||||
};
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
{ config, pkgs, lib, witch, ... }:
|
||||
|
||||
let
|
||||
inherit (config.nixfiles.theme) base16;
|
||||
in
|
||||
{
|
||||
systemd.user.services = {
|
||||
mako = {
|
||||
Unit = {
|
||||
Description = "mako";
|
||||
X-Restart-Triggers =
|
||||
[ (toString config.xdg.configFile."mako/config".source) ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${pkgs.mako}/bin/mako";
|
||||
Restart = "always";
|
||||
};
|
||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||
};
|
||||
};
|
||||
|
||||
programs.mako = {
|
||||
enable = true;
|
||||
font = "${config.nixfiles.theme.font.name} ${toString config.nixfiles.theme.font.size}";
|
||||
defaultTimeout = 3000;
|
||||
borderColor = base16.base08;
|
||||
backgroundColor = "${base16.base00}BF";
|
||||
textColor = base16.base05;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
gst_all_1.gstreamer
|
||||
gst_all_1.gstreamer.out
|
||||
gst_all_1.gst-plugins-base
|
||||
gst_all_1.gst-plugins-good
|
||||
gst_all_1.gst-plugins-bad
|
||||
gst_all_1.gst-plugins-ugly
|
||||
imv
|
||||
ffmpeg-full
|
||||
yt-dlp
|
||||
mkchromecast
|
||||
v4l-utils
|
||||
gimp-with-plugins
|
||||
wf-recorder
|
||||
];
|
||||
}
|
||||
120
home/mpv.nix
120
home/mpv.nix
|
|
@ -1,120 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib.modules) mkMerge mkIf;
|
||||
inherit (lib.attrsets) mapAttrsToList;
|
||||
in {
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
scripts = [ pkgs.mpvScripts.sponsorblock pkgs.mpvScripts.paused ];
|
||||
bindings =
|
||||
let
|
||||
vim = {
|
||||
"l" = "seek 5";
|
||||
"h" = "seek -5";
|
||||
"k" = "seek 60";
|
||||
"j" = "seek -60";
|
||||
"Ctrl+l" = "seek 1 exact";
|
||||
"Ctrl+h" = "seek -1 exact";
|
||||
"Ctrl+L" = "sub-seek 1";
|
||||
"Ctrl+H" = "sub-seek -1";
|
||||
"Ctrl+k" = "add chapter 1";
|
||||
"Ctrl+j" = "add chapter -1";
|
||||
"Ctrl+K" = "playlist-next";
|
||||
"Ctrl+J" = "playlist-prev";
|
||||
"Alt+h" = "frame-back-step";
|
||||
"Alt+l" = "frame-step";
|
||||
"`" = "cycle mute";
|
||||
"MBTN_RIGHT" = "cycle pause";
|
||||
"w" = "screenshot";
|
||||
"W" = "screenshot video";
|
||||
"Ctrl+w" = "screenshot window";
|
||||
"Ctrl+W" = "screenshot each-frame";
|
||||
"o" = "show-progress";
|
||||
"O" = "script-message show_osc_dur 5";
|
||||
"F1" = "cycle sub";
|
||||
"F2" = "cycle audio";
|
||||
"Ctrl+p" = "cycle video";
|
||||
"L" = "add volume 2";
|
||||
"H" = "add volume -2";
|
||||
"Alt+H" = "add audio-delay -0.100";
|
||||
"Alt+L" = "add audio-delay 0.100";
|
||||
"1" = "set volume 10";
|
||||
"2" = "set volume 20";
|
||||
"3" = "set volume 30";
|
||||
"4" = "set volume 40";
|
||||
"5" = "set volume 50";
|
||||
"6" = "set volume 60";
|
||||
"7" = "set volume 70";
|
||||
"8" = "set volume 80";
|
||||
"9" = "set volume 90";
|
||||
")" = "set volume 150";
|
||||
"0" = "set volume 100";
|
||||
"m" = "cycle mute";
|
||||
"Ctrl+r" = "loadfile \${path}";
|
||||
"Ctrl+R" = "video-reload";
|
||||
"d" = "drop-buffers";
|
||||
"Ctrl+d" = "quit";
|
||||
};
|
||||
other = {
|
||||
"RIGHT" = vim."l";
|
||||
"LEFT" = vim."h";
|
||||
"UP" = vim."k";
|
||||
"DOWN" = vim."j";
|
||||
"Ctrl+0" = "set speed 1.0";
|
||||
"Ctrl+=" = "multiply speed 1.1";
|
||||
"Ctrl+-" = "multiply speed 1/1.1";
|
||||
"Shift+LEFT" = vim."H";
|
||||
"Shift+RIGHT" = vim."L";
|
||||
"Ctrl+RIGHT" = vim."Ctrl+l";
|
||||
"Ctrl+LEFT" = vim."Ctrl+h";
|
||||
"Ctrl+Shift+LEFT" = vim."Ctrl+H";
|
||||
"Ctrl+Shift+RIGHT" = vim."Ctrl+L";
|
||||
"Ctrl+UP" = vim."Ctrl+k";
|
||||
"Ctrl+DOWN" = vim."Ctrl+j";
|
||||
"Ctrl+Shift+UP" = vim."Ctrl+K";
|
||||
"Ctrl+Shift+DOWN" = vim."Ctrl+J";
|
||||
"Alt+LEFT" = vim."Alt+h";
|
||||
"Alt+RIGHT" = vim."Alt+l";
|
||||
"SPACE" = vim."MBTN_RIGHT";
|
||||
"m" = vim."`";
|
||||
"WHEEL_UP" = vim."L";
|
||||
"WHEEL_DOWN" = vim."H";
|
||||
};
|
||||
in
|
||||
vim // other;
|
||||
config = mkMerge [
|
||||
(mkIf config.wayland.windowManager.sway.enable {
|
||||
gpu-context = "wayland";
|
||||
})
|
||||
{
|
||||
no-input-default-bindings = "";
|
||||
profile = "gpu-hq";
|
||||
hwdec = "auto";
|
||||
vo = "gpu";
|
||||
volume-max = 200;
|
||||
keep-open = true;
|
||||
opengl-waitvsync = true;
|
||||
demuxer-max-bytes = "2000MiB";
|
||||
demuxer-max-back-bytes = "250MiB";
|
||||
osd-scale-by-window = false;
|
||||
osd-bar-h = 2.5; # 3.125 default
|
||||
osd-border-size = 2; # font border pixels, default 3
|
||||
term-osd-bar = true;
|
||||
script-opts = builtins.concatStringsSep ","
|
||||
(mapAttrsToList (k: v: "${k}=${toString v}") {
|
||||
ytdl_hook-ytdl_path = "${pkgs.yt-dlp}/bin/yt-dlp";
|
||||
osc-layout = "slimbox";
|
||||
osc-vidscale = "no";
|
||||
osc-deadzonesize = 0.75;
|
||||
osc-minmousemove = 4;
|
||||
osc-hidetimeout = 2000;
|
||||
osc-valign = 0.9;
|
||||
osc-timems = "yes";
|
||||
osc-seekbarstyle = "knob";
|
||||
osc-seekbarkeyframes = "no";
|
||||
osc-seekrangestyle = "slider";
|
||||
});
|
||||
}];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.obs-studio = {
|
||||
enable = true;
|
||||
package = pkgs.obs-studio;
|
||||
plugins = [ pkgs.obs-studio-plugins.wlrobs ];
|
||||
};
|
||||
}
|
||||
12
home/qt.nix
12
home/qt.nix
|
|
@ -1,12 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme = "gtk";
|
||||
style = {
|
||||
name = "adwaita-dark";
|
||||
package = pkgs.adwaita-qt;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
ranger
|
||||
];
|
||||
|
||||
xdg.configFile."ranger/rc.conf".text = ''
|
||||
set preview_images true
|
||||
set preview_images_method kitty
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.rustfmt = {
|
||||
enable = true;
|
||||
config = {
|
||||
hard_tabs = true;
|
||||
imports_granularity = "One";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
secrets = {
|
||||
persistentRoot = lib.mkDefault "${config.xdg.cacheHome}/kat/secrets";
|
||||
external = true;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
programs.beets = {
|
||||
enable = true;
|
||||
package = pkgs.beets;
|
||||
settings = {
|
||||
directory = "~/media-share/music";
|
||||
library = "~/.local/share/beets.db";
|
||||
plugins = lib.concatStringsSep " " [
|
||||
"mpdstats"
|
||||
"mpdupdate"
|
||||
"duplicates"
|
||||
"chroma"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./mpd.nix
|
||||
./beets.nix
|
||||
./ncmpcpp.nix
|
||||
];
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
network.firewall = {
|
||||
public.tcp.ports = [ 6600 32101 ];
|
||||
private.tcp.ports = [ 6600 32101 ];
|
||||
};
|
||||
|
||||
services.mpd = {
|
||||
enable = true;
|
||||
package = pkgs.mpd-youtube-dl;
|
||||
network = {
|
||||
startWhenNeeded = true;
|
||||
listenAddress = "[::]";
|
||||
};
|
||||
musicDirectory = "/home/kat/media-share/music";
|
||||
extraConfig = ''
|
||||
max_output_buffer_size "32768"
|
||||
|
||||
audio_output {
|
||||
type "fifo"
|
||||
name "my_fifo"
|
||||
path "/tmp/mpd.fifo"
|
||||
format "44100:16:2"
|
||||
}
|
||||
|
||||
audio_output {
|
||||
type "pulse"
|
||||
name "speaker"
|
||||
}
|
||||
|
||||
audio_output {
|
||||
bind_to_address "[::]"
|
||||
type "httpd"
|
||||
name "httpd-high"
|
||||
encoder "opus"
|
||||
bitrate "96000"
|
||||
port "32101"
|
||||
max_clients "4"
|
||||
format "48000:16:2"
|
||||
always_on "yes"
|
||||
tags "yes"
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.ncmpcpp = {
|
||||
enable = true;
|
||||
mpdMusicDir = "/home/kat/media-share/music";
|
||||
package = pkgs.ncmpcpp-kat;
|
||||
settings = {
|
||||
visualizer_data_source = "/tmp/mpd.fifo";
|
||||
visualizer_output_name = "my_fifo";
|
||||
visualizer_in_stereo = "yes";
|
||||
visualizer_type = "spectrum";
|
||||
visualizer_look = "+|";
|
||||
user_interface = "alternative";
|
||||
colors_enabled = "yes";
|
||||
discard_colors_if_item_is_selected = "no";
|
||||
header_window_color = "250";
|
||||
volume_color = "250";
|
||||
state_line_color = "cyan";
|
||||
state_flags_color = "cyan";
|
||||
alternative_ui_separator_color = "yellow";
|
||||
statusbar_color = "yellow";
|
||||
progressbar_color = "black";
|
||||
progressbar_elapsed_color = "blue";
|
||||
window_border_color = "yellow";
|
||||
playlist_display_mode = "classic";
|
||||
song_columns_list_format =
|
||||
"(3f)[cyan]{n} (40)[default]{t|f} (25)[red]{a} (30)[blue]{b} (4f)[cyan]{l}";
|
||||
now_playing_prefix = "$b";
|
||||
song_list_format =
|
||||
" $7%n$9 $8-$9 $6%a$9 $8-$9 $5%b$9 $R $8%t$9 ($4%l$9) ";
|
||||
song_library_format = "{%n > }{%t}|{%f}";
|
||||
song_status_format = "{%a - }{%t - }{%b}";
|
||||
titles_visibility = "no";
|
||||
header_visibility = "no";
|
||||
statusbar_visibility = "no";
|
||||
now_playing_suffix = "$/b";
|
||||
progressbar_look = "▄▄ ";
|
||||
media_library_primary_tag = "album_artist";
|
||||
search_engine_display_mode = "columns";
|
||||
};
|
||||
bindings = [
|
||||
{
|
||||
key = "+";
|
||||
command = "add";
|
||||
}
|
||||
{
|
||||
key = "-";
|
||||
command = "load";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
{ config, lib, nixos, pkgs, tf, ... }:
|
||||
|
||||
{
|
||||
secrets.variables = {
|
||||
matrix-pass = {
|
||||
path = "social/matrix";
|
||||
field = "password";
|
||||
};
|
||||
znc-pass = {
|
||||
path = "social/irc/znc";
|
||||
field = "password";
|
||||
};
|
||||
};
|
||||
|
||||
secrets.files.weechat-sec = {
|
||||
text = ''
|
||||
#
|
||||
# weechat -- sec.conf
|
||||
#
|
||||
# WARNING: It is NOT recommended to edit this file by hand,
|
||||
# especially if WeeChat is running.
|
||||
#
|
||||
# Use /set or similar command to change settings in WeeChat.
|
||||
#
|
||||
# For more info, see: https://weechat.org/doc/quickstart
|
||||
#
|
||||
|
||||
[crypt]
|
||||
cipher = aes256
|
||||
hash_algo = sha512
|
||||
salt = off
|
||||
|
||||
[data]
|
||||
__passphrase__ = off
|
||||
znc = "${tf.variables.znc-pass.ref}"
|
||||
matrix = "${tf.variables.matrix-pass.ref}"
|
||||
'';
|
||||
owner = "kat";
|
||||
group = "users";
|
||||
};
|
||||
|
||||
home.file = {
|
||||
".local/share/weechat/sec.conf".source = config.lib.file.mkOutOfStoreSymlink config.secrets.files.weechat-sec.path;
|
||||
};
|
||||
|
||||
services.weechat.enable = true;
|
||||
|
||||
programs.weechat = {
|
||||
enable = true;
|
||||
scripts = with pkgs.weechatScripts; [
|
||||
weechat-notify-send
|
||||
];
|
||||
config = {
|
||||
irc = {
|
||||
server = {
|
||||
softnet = {
|
||||
addresses = "znc.kittywit.ch/5001";
|
||||
password = "kat@${nixos.networking.hostName}/softnet:\${sec.data.znc}";
|
||||
ssl = true;
|
||||
ssl_verify = false;
|
||||
autoconnect = true;
|
||||
};
|
||||
liberachat = {
|
||||
addresses = "znc.kittywit.ch/5001";
|
||||
password = "kat@${nixos.networking.hostName}/liberachat:\${sec.data.znc}";
|
||||
ssl = true;
|
||||
ssl_verify = false;
|
||||
autoconnect = true;
|
||||
};
|
||||
espernet = {
|
||||
addresses = "znc.kittywit.ch/5001";
|
||||
password = "kat@${nixos.networking.hostName}/espernet:\${sec.data.znc}";
|
||||
ssl = true;
|
||||
ssl_verify = false;
|
||||
autoconnect = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
matrix = {
|
||||
server.kittywitch = {
|
||||
address = "kittywit.ch";
|
||||
device_name = "${nixos.networking.hostName}/weechat";
|
||||
username = "kat";
|
||||
password = "\${sec.data.matrix}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{ config, pkgs, meta, lib, ... }: {
|
||||
programs.rbw = {
|
||||
enable = true;
|
||||
package = lib.mkIf (meta.trusted ? secrets) (pkgs.writeShellScriptBin "bitw" ''${pkgs.rbw-bitw}/bin/bitw -p gpg://${config.secrets.repo.bitw.source} "$@"'');
|
||||
settings = {
|
||||
email = "kat@kittywit.ch";
|
||||
base_url = "https://vault.kittywit.ch";
|
||||
identity_url = null;
|
||||
lock_timeout = 3600;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{ config, ... }: {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{ config, pkgs, ... }: {
|
||||
home.packages = [ pkgs.exa ];
|
||||
|
||||
programs.zsh.shellAliases = {
|
||||
exa = "exa --time-style long-iso";
|
||||
ls = "exa -G";
|
||||
la = "exa -Ga";
|
||||
ll = "exa -l";
|
||||
lla = "exa -lga";
|
||||
};
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
{ config, pkgs, lib, ... }: {
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
programs.zsh.plugins = lib.optional (pkgs.hostPlatform == pkgs.buildPlatform) ({
|
||||
name = "fzf-tab";
|
||||
src = "${pkgs.zsh-fzf-tab}/share/fzf-tab";
|
||||
});
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
gitAndTools.git-remote-gcrypt
|
||||
git-crypt
|
||||
git-revise
|
||||
];
|
||||
|
||||
programs.git = {
|
||||
package = pkgs.gitAndTools.gitFull;
|
||||
enable = true;
|
||||
userName = "Kat Inskip";
|
||||
userEmail = "kat@inskip.me";
|
||||
extraConfig = {
|
||||
init = { defaultBranch = "main"; };
|
||||
protocol.gcrypt.allow = "always";
|
||||
annex = {
|
||||
autocommit = false;
|
||||
backend = "BLAKE2B512";
|
||||
synccontent = true;
|
||||
};
|
||||
};
|
||||
signing = {
|
||||
key = "0xE8DDE3ED1C90F3A0";
|
||||
signByDefault = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."inputrc".text = ''
|
||||
set editing-mode vi
|
||||
set keyseq-timeout 1
|
||||
set mark-symlinked-directories on
|
||||
set completion-prefix-display-length 8
|
||||
set show-all-if-ambiguous on
|
||||
set show-all-if-unmodified on
|
||||
set visible-stats on
|
||||
set colored-stats on
|
||||
set bell-style audible
|
||||
set meta-flag on
|
||||
set input-meta on
|
||||
set convert-meta off
|
||||
set output-meta on
|
||||
'';
|
||||
|
||||
home.sessionVariables.INPUTRC = "${config.xdg.configHome}/inputrc";
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
{ config, ... }: {
|
||||
home.language = let
|
||||
ca = "en_CA.UTF-8";
|
||||
dk = "en_DK.UTF-8";
|
||||
in {
|
||||
base = ca;
|
||||
ctype = ca;
|
||||
time = ca;
|
||||
numeric = ca;
|
||||
collate = ca;
|
||||
monetary = ca;
|
||||
messages = ca;
|
||||
paper = ca;
|
||||
name = ca;
|
||||
address = ca;
|
||||
telephone = ca;
|
||||
measurement = ca;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
{ config, pkgs, ... }: {
|
||||
home.packages = with pkgs; [
|
||||
# task managers
|
||||
htop
|
||||
btop
|
||||
# disk usage
|
||||
duc-cli
|
||||
# nix formatting
|
||||
nixpkgs-fmt
|
||||
# show type of files
|
||||
file
|
||||
# command monitoring
|
||||
pv
|
||||
# cat but better
|
||||
bat
|
||||
# ls replacement
|
||||
exa
|
||||
# sed replacement
|
||||
sd
|
||||
# find replacement
|
||||
fd
|
||||
# ripgrep / grep replacement
|
||||
ripgrep
|
||||
# remote tmux
|
||||
tmate
|
||||
# remote utilities
|
||||
socat
|
||||
rsync
|
||||
wget
|
||||
whois
|
||||
];
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
#rink-readline TODO: wait for fix
|
||||
rink
|
||||
];
|
||||
|
||||
xdg.configFile."rink/config.toml".text = lib.toTOML {
|
||||
colors = {
|
||||
enabled = true;
|
||||
theme = "my_theme";
|
||||
};
|
||||
currency = {
|
||||
cache_duration = "1h";
|
||||
enabled = true;
|
||||
endpoint = "https://rinkcalc.app/data/currency.json";
|
||||
timeout = "2s";
|
||||
};
|
||||
rink = {
|
||||
long_output = true;
|
||||
prompt = "> ";
|
||||
};
|
||||
themes = {
|
||||
my_theme = {
|
||||
date_time = "default";
|
||||
doc_string = "italic";
|
||||
error = "red";
|
||||
number = "default";
|
||||
plain = "default";
|
||||
pow = "default";
|
||||
prop_name = "cyan";
|
||||
quantity = "dimmed cyan";
|
||||
unit = "cyan";
|
||||
user_input = "bold";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
{ meta, config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
controlMaster = "auto";
|
||||
controlPersist = "10m";
|
||||
hashKnownHosts = true;
|
||||
compression = true;
|
||||
matchBlocks = lib.mapAttrs (host: data: {
|
||||
port = lib.head meta.networks.tailscale.member_configs.${host}.services.openssh.ports;
|
||||
hostname = data.ipv4;
|
||||
forwardAgent = true;
|
||||
extraOptions = {
|
||||
RemoteForward = (lib.concatStringsSep " " [
|
||||
"/run/user/1000/gnupg/S.gpg-agent"
|
||||
"/run/user/1000/gnupg/S.gpg-agent.extra"
|
||||
]);
|
||||
};
|
||||
}) meta.networks.tailscale.members;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{ config, ... }: {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.zsh.shellAliases = {
|
||||
tt = "tmux new -AD -s";
|
||||
};
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
terminal = "tmux-256color";
|
||||
keyMode = "vi";
|
||||
baseIndex = 1;
|
||||
extraConfig = with lib.mapAttrs (_: v: "colour${toString v}") pkgs.base16.shell.shell256; ''
|
||||
# proper title handling
|
||||
set -g set-titles on
|
||||
set -g set-titles-string "#T"
|
||||
set -ga terminal-overrides ",xterm-256color:Tc"
|
||||
|
||||
# modes
|
||||
setw -g clock-mode-colour colour8
|
||||
setw -g mode-style 'fg=${base07} bg=${base02} bold'
|
||||
|
||||
# panes
|
||||
set -g pane-border-style 'fg=${base06} bg=${base02}'
|
||||
set -g pane-active-border-style 'bg=${base0D} fg=${base07}'
|
||||
|
||||
# statusbar
|
||||
set -g status-position bottom
|
||||
set -g status-justify left
|
||||
set -g status-style 'bg=${base00} fg=${base06}'
|
||||
set -g status-left '#[fg=${base06} bg=${base01}] #S@#h '
|
||||
set -g status-right '#[fg=${base07},bg=${base01}] %F #[fg=${base07},bg=${base02}] %H:%M:%S %Z '
|
||||
set -g status-right-length 50
|
||||
set -g status-left-length 20
|
||||
|
||||
setw -g window-status-current-style 'fg=${base07} bg=${base0D} bold'
|
||||
setw -g window-status-current-format ' #I#[fg=${base07}]:#[fg=${base07}]#W#[fg=${base07}]#F '
|
||||
|
||||
setw -g window-status-style 'fg=${base06} bg=${base03}'
|
||||
setw -g window-status-format ' #I#[fg=${base07}]:#[fg=${base06}]#W#[${base06}]#F '
|
||||
|
||||
setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold'
|
||||
|
||||
# messages
|
||||
set -g message-style 'fg=colour232 bg=colour16 bold'
|
||||
|
||||
# mouse
|
||||
set -g mouse on
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
{ config, pkgs, ... }: {
|
||||
# ensure .local/share/z is created
|
||||
xdg.dataFile."z/.keep".text = "";
|
||||
|
||||
programs.zsh = {
|
||||
localVariables = {
|
||||
_Z_DATA = "${config.xdg.dataHome}/z/data";
|
||||
};
|
||||
plugins = (map (plugin: (with pkgs.${plugin}; {
|
||||
name = pname;
|
||||
inherit src;
|
||||
})) [
|
||||
"zsh-z"
|
||||
]);
|
||||
};
|
||||
}
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# programs.zsh.enableAutosuggestions only includes nix-zsh-autocompletions
|
||||
zsh-completions
|
||||
];
|
||||
|
||||
xdg.configFile."kattheme_immutable.json".text = builtins.toJSON rec {
|
||||
default = config.base16.defaultSchemeName;
|
||||
current = default;
|
||||
};
|
||||
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableSyntaxHighlighting = true;
|
||||
enableAutosuggestions = true;
|
||||
initExtra =
|
||||
let
|
||||
zshOpts = [
|
||||
"auto_pushd"
|
||||
"pushd_ignore_dups"
|
||||
"pushdminus"
|
||||
"rmstarsilent"
|
||||
"nonomatch"
|
||||
"long_list_jobs"
|
||||
"interactivecomments"
|
||||
"append_history"
|
||||
"hist_ignore_space"
|
||||
"hist_verify"
|
||||
"inc_append_history"
|
||||
"nosharehistory"
|
||||
"nomenu_complete"
|
||||
"auto_menu"
|
||||
"no_auto_remove_slash"
|
||||
"complete_in_word"
|
||||
"always_to_end"
|
||||
"nolistbeep"
|
||||
"autolist"
|
||||
"listrowsfirst"
|
||||
]; in
|
||||
''
|
||||
${if pkgs.hostPlatform.isLinux then ''
|
||||
eval $(dircolors -b | sd "\*#=00;90" "*\#=00;90")
|
||||
'' else ''
|
||||
''}
|
||||
PROMPT_EOL_MARK='''
|
||||
ZSH_TAB_TITLE_ADDITIONAL_TERMS='wezterm'
|
||||
ZSH_TAB_TITLE_ENABLE_FULL_COMMAND=true
|
||||
zmodload -i zsh/complist
|
||||
h=()
|
||||
if [[ -r ~/.ssh/config ]]; then
|
||||
h=($h ''${''${''${(@M)''${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
|
||||
fi
|
||||
if [[ $#h -gt 0 ]]; then
|
||||
zstyle ':completion:*:ssh:*' hosts $h
|
||||
zstyle ':completion:*:slogin:*' hosts $h
|
||||
fi
|
||||
unset h
|
||||
u=(root ${config.home.username})
|
||||
zstyle ':completion:*:ssh:*' users $u
|
||||
unset u
|
||||
zstyle ':completion:*:*:*:*:*' menu select
|
||||
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
|
||||
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
|
||||
zstyle ':completion:*:complete:pass:*:*' matcher 'r:|[./_-]=** r:|=*' 'l:|=* r:|=*'
|
||||
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
|
||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1lb --color=always $realpath'
|
||||
${lib.concatStringsSep "\n" (map (opt: "setopt ${opt}") zshOpts)}
|
||||
bindkey '^ ' autosuggest-accept
|
||||
${if pkgs.hostPlatform.isDarwin then ''
|
||||
export PATH="''${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
|
||||
'' else ""
|
||||
}
|
||||
'';
|
||||
shellAliases = lib.mkMerge [
|
||||
{
|
||||
nixdirfmt = "nixpkgs-fmt $(fd -e nix)";
|
||||
dmesg = "dmesg -HP";
|
||||
hg = "history 0 | rg";
|
||||
}
|
||||
(lib.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;
|
||||
};
|
||||
plugins = with pkgs.zsh-plugins; (map (plugin: plugin.zshPlugin) [
|
||||
tab-title
|
||||
vim-mode
|
||||
evil-registers
|
||||
]);
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
XDG_DATA_HOME = "${config.xdg.dataHome}";
|
||||
};
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{ config, ... }: {
|
||||
home.stateVersion = "20.09";
|
||||
manual = {
|
||||
manpages.enable = false;
|
||||
};
|
||||
}
|
||||
348
home/sway.nix
348
home/sway.nix
|
|
@ -1,348 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let lockCommand = config.programs.swaylock.script; in
|
||||
{
|
||||
home.sessionVariables = {
|
||||
XDG_CURRENT_DESKTOP = "Unity";
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
WLR_DRM_DEVICES = "/dev/dri/card0";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [ grim slurp swaylock-fancy wl-clipboard jq quintom-cursor-theme gsettings-desktop-schemas glib wofi wmctrl sway-scrot ];
|
||||
|
||||
services.i3gopher = { enable = true; };
|
||||
|
||||
nixfiles.theme.swaylock = true;
|
||||
|
||||
programs.zsh.profileExtra = ''
|
||||
# If running from tty1 start sway
|
||||
if [ "$(tty)" = "/dev/tty1" ]; then
|
||||
systemctl --user unset-environment \
|
||||
SWAYSOCK \
|
||||
I3SOCK \
|
||||
WAYLAND_DISPLAY \
|
||||
DISPLAY \
|
||||
IN_NIX_SHELL \
|
||||
__HM_SESS_VARS_SOURCED \
|
||||
GPG_TTY \
|
||||
NIX_PATH \
|
||||
SHLVL
|
||||
exec env --unset=SHLVL systemd-cat -t sway -- sway
|
||||
fi
|
||||
'';
|
||||
|
||||
wayland.windowManager.sway =
|
||||
let
|
||||
cfg = config.wayland.windowManager.sway.config;
|
||||
bindsym = k: v: "bindsym ${k} ${v}";
|
||||
bindWorkspace = key: workspace: {
|
||||
"${cfg.modifier}+${key}" = "workspace number ${workspace}";
|
||||
"${cfg.modifier}+shift+${key}" = "move container to workspace number ${workspace}";
|
||||
};
|
||||
workspaceBindings = map (v: bindWorkspace v "${v}:${v}") [
|
||||
"1"
|
||||
"2"
|
||||
"3"
|
||||
"4"
|
||||
"5"
|
||||
"6"
|
||||
"7"
|
||||
"8"
|
||||
"9"
|
||||
]
|
||||
++ [ (bindWorkspace "0" "10:10") ]
|
||||
++ lib.imap1 (i: v: bindWorkspace v "${toString (10 + i)}:${v}") [
|
||||
"F1"
|
||||
"F2"
|
||||
"F3"
|
||||
"F4"
|
||||
"F5"
|
||||
"F6"
|
||||
"F7"
|
||||
"F8"
|
||||
"F9"
|
||||
"F10"
|
||||
"F11"
|
||||
"F12"
|
||||
];
|
||||
workspaceBindings' = map (lib.mapAttrsToList bindsym) workspaceBindings;
|
||||
workspaceBindingsStr = lib.concatStringsSep "\n" (lib.flatten workspaceBindings');
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
config =
|
||||
let
|
||||
pactl = "${config.home.nixosConfig.hardware.pulseaudio.package or pkgs.pulseaudio}/bin/pactl";
|
||||
dmenu = "${pkgs.wofi}/bin/wofi -idbt ${pkgs.wezterm}/bin/wezterm -s ~/.config/wofi/wofi.css -p '' -W 25%";
|
||||
in
|
||||
{
|
||||
|
||||
modes = {
|
||||
"System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown" =
|
||||
{
|
||||
"l" = "exec ${lockCommand}, mode default";
|
||||
"e" = "exec swaymsg exit, mode default";
|
||||
"s" = "exec systemctl suspend, mode default";
|
||||
"h" = "exec systemctl hibernate, mode default";
|
||||
"r" = "exec systemctl reboot, mode default";
|
||||
"Shift+s" = "exec systemctl shutdown, mode default";
|
||||
"Return" = "mode default";
|
||||
"Escape" = "mode default";
|
||||
};
|
||||
};
|
||||
# bars = [{ command = "${pkgs.waybar}/bin/waybar"; }];
|
||||
bars = [];
|
||||
|
||||
input = {
|
||||
"*" = {
|
||||
xkb_layout = "us_gbp_map";
|
||||
xkb_options = "compose:rctrl,ctrl:nocaps";
|
||||
};
|
||||
};
|
||||
fonts = {
|
||||
names = [ config.nixfiles.theme.font.name ];
|
||||
style = "Regular";
|
||||
size = config.nixfiles.theme.font.size;
|
||||
};
|
||||
terminal = "${pkgs.wezterm}/bin/wezterm";
|
||||
menu = "${pkgs.j4-dmenu-desktop}/bin/j4-dmenu-desktop --no-generic --dmenu=\"${dmenu}\" --term='${pkgs.wezterm}/bin/wezterm'";
|
||||
modifier = "Mod4";
|
||||
|
||||
assigns = { "12:F2" = [{ class = "screenstub"; }]; };
|
||||
startup = [
|
||||
{
|
||||
command = "gsettings set org.gnome.desktop.interface cursor-theme 'Quintom_Snow'";
|
||||
}
|
||||
{
|
||||
command = "systemctl --user restart mako";
|
||||
always = true;
|
||||
}
|
||||
{
|
||||
command = "systemctl --user restart konawall.service";
|
||||
always = true;
|
||||
}
|
||||
];
|
||||
|
||||
modes.resize = {
|
||||
"a" = "resize shrink width 4 px or 4 ppt";
|
||||
"s" = "resize shrink height 4 px or 4 ppt";
|
||||
"w" = "resize grow height 4 px or 4 ppt";
|
||||
"d" = "resize grow width 4 px or 4 ppt";
|
||||
"Left" = "resize shrink width 4 px or 4 ppt";
|
||||
"Down" = "resize shrink height 4 px or 4 ppt";
|
||||
"Up" = "resize grow height 4 px or 4 ppt";
|
||||
"Right" = "resize grow width 4 px or 4 ppt";
|
||||
Return = ''mode "default"'';
|
||||
Escape = ''mode "default"'';
|
||||
"${cfg.modifier}+z" = ''mode "default"'';
|
||||
};
|
||||
window = {
|
||||
border = 1;
|
||||
titlebar = false;
|
||||
};
|
||||
|
||||
floating = {
|
||||
border = 1;
|
||||
titlebar = false;
|
||||
};
|
||||
|
||||
keybindings = {
|
||||
"${cfg.modifier}+Return" = "exec ${cfg.terminal}";
|
||||
"${cfg.modifier}+x" = "exec ${lockCommand}";
|
||||
|
||||
# focus windows - regular
|
||||
"${cfg.modifier}+Left" = "focus left";
|
||||
"${cfg.modifier}+Down" = "focus down";
|
||||
"${cfg.modifier}+Up" = "focus up";
|
||||
"${cfg.modifier}+Right" = "focus right";
|
||||
|
||||
# focus windows - wsad
|
||||
"${cfg.modifier}+a" = "focus left";
|
||||
"${cfg.modifier}+s" = "focus down";
|
||||
"${cfg.modifier}+w" = "focus up";
|
||||
"${cfg.modifier}+d" = "focus right";
|
||||
|
||||
# move window / container - regular
|
||||
"${cfg.modifier}+Shift+Left" = "move left";
|
||||
"${cfg.modifier}+Shift+Down" = "move down";
|
||||
"${cfg.modifier}+Shift+Up" = "move up";
|
||||
"${cfg.modifier}+Shift+Right" = "move right";
|
||||
|
||||
# move window / container - wsad
|
||||
"${cfg.modifier}+Shift+a" = "move left";
|
||||
"${cfg.modifier}+Shift+s" = "move down";
|
||||
"${cfg.modifier}+Shift+w" = "move up";
|
||||
"${cfg.modifier}+Shift+d" = "move right";
|
||||
|
||||
# focus output - regular
|
||||
"${cfg.modifier}+control+Left" = "focus output left";
|
||||
"${cfg.modifier}+control+Down" = "focus output down";
|
||||
"${cfg.modifier}+control+Up" = "focus output up";
|
||||
"${cfg.modifier}+control+Right" = "focus output right";
|
||||
|
||||
# focus output - wsad
|
||||
"${cfg.modifier}+control+a" = "focus output left";
|
||||
"${cfg.modifier}+control+s" = "focus output down";
|
||||
"${cfg.modifier}+control+w" = "focus output up";
|
||||
"${cfg.modifier}+control+d" = "foVcus output right";
|
||||
|
||||
# move container to output - regular
|
||||
"${cfg.modifier}+control+Shift+Left" = "move container to output left";
|
||||
"${cfg.modifier}+control+Shift+Down" = "move container to output down";
|
||||
"${cfg.modifier}+control+Shift+Up" = "move container to output up";
|
||||
"${cfg.modifier}+control+Shift+Right" = "move container to output right";
|
||||
|
||||
# move container to output - wsad
|
||||
"${cfg.modifier}+control+Shift+a" = "move container to output left";
|
||||
"${cfg.modifier}+control+Shift+s" = "move container to output down";
|
||||
"${cfg.modifier}+control+Shift+w" = "move container to output up";
|
||||
"${cfg.modifier}+control+Shift+d" = "move container to output right";
|
||||
|
||||
# move workspace to output - regular
|
||||
"${cfg.modifier}+control+Shift+Mod1+Left" = "move workspace to output left";
|
||||
"${cfg.modifier}+control+Shift+Mod1+Down" = "move workspace to output down";
|
||||
"${cfg.modifier}+control+Shift+Mod1+Up" = "move workspace to output up";
|
||||
"${cfg.modifier}+control+Shift+Mod1+Right" = "move workspace to output right";
|
||||
|
||||
# move workspace to output - wsad
|
||||
"${cfg.modifier}+control+Shift+Mod1+a" = "move workspace to output left";
|
||||
"${cfg.modifier}+control+Shift+Mod1+s" = "move workspace to output down";
|
||||
"${cfg.modifier}+control+Shift+Mod1+w" = "move workspace to output up";
|
||||
"${cfg.modifier}+control+Shift+Mod1+d" = "move workspace to output right";
|
||||
|
||||
# focus parent/child
|
||||
"${cfg.modifier}+q" = "focus parent";
|
||||
"${cfg.modifier}+e" = "focus child";
|
||||
|
||||
# floating
|
||||
"${cfg.modifier}+Shift+space" = "floating toggle";
|
||||
"${cfg.modifier}+space" = "focus mode_toggle";
|
||||
|
||||
# workspace history switching
|
||||
"${cfg.modifier}+Tab" = "workspace back_and_forth";
|
||||
"${cfg.modifier}+Shift+Tab" = "exec ${config.services.i3gopher.focus-last}";
|
||||
|
||||
# multimedia / laptop
|
||||
"XF86AudioPlay" = "exec --no-startup-id ${pkgs.playerctl}/bin/playerctl play-pause";
|
||||
"XF86AudioLowerVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ -5%";
|
||||
"XF86AudioRaiseVolume" = "exec --no-startup-id ${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
|
||||
"XF86AudioMute" = "exec --no-startup-id ${pactl} set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
"XF86AudioMute+Shift" = "exec --no-startup-id ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||
"XF86AudioMicMute" = "exec --no-startup-id ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||
"XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5";
|
||||
"XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5";
|
||||
|
||||
# dmenu
|
||||
"${cfg.modifier}+r" = "exec ${cfg.menu}";
|
||||
|
||||
# screenshots - upload
|
||||
"${cfg.modifier}+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify upload screen";
|
||||
"${cfg.modifier}+Shift+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify upload area";
|
||||
"${cfg.modifier}+Mod1+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify upload active";
|
||||
"${cfg.modifier}+Mod1+Control+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify upload window";
|
||||
"${cfg.modifier}+Control+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify upload output";
|
||||
|
||||
# screenshots - clipboard
|
||||
"Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify copys screen";
|
||||
"Shift+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify copys area";
|
||||
"Mod1+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify copys active";
|
||||
"Mod1+Control+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify copys window";
|
||||
"Control+Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify copys output";
|
||||
|
||||
# layout handling
|
||||
"${cfg.modifier}+b" = "splith";
|
||||
"${cfg.modifier}+v" = "splitv";
|
||||
"${cfg.modifier}+o" = "layout stacking";
|
||||
"${cfg.modifier}+i" = "layout tabbed";
|
||||
"${cfg.modifier}+h" = "layout toggle split";
|
||||
"${cfg.modifier}+f" = "fullscreen";
|
||||
|
||||
# sway specific
|
||||
"${cfg.modifier}+Shift+q" = "kill";
|
||||
"${cfg.modifier}+Shift+c" = "reload";
|
||||
|
||||
# mode triggers
|
||||
"${cfg.modifier}+Shift+r" = "mode resize";
|
||||
"${cfg.modifier}+Delete" = ''mode "System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown"'';
|
||||
};
|
||||
|
||||
colors = let inherit (config.nixfiles.theme) base16; in
|
||||
{
|
||||
focused = {
|
||||
border = base16.base01;
|
||||
background = base16.base0D;
|
||||
text = base16.base07;
|
||||
indicator = base16.base0D;
|
||||
childBorder = base16.base0D;
|
||||
};
|
||||
focusedInactive = {
|
||||
border = base16.base02;
|
||||
background = base16.base04;
|
||||
text = base16.base00;
|
||||
indicator = base16.base04;
|
||||
childBorder = base16.base04;
|
||||
};
|
||||
unfocused = {
|
||||
border = base16.base01;
|
||||
background = base16.base02;
|
||||
text = base16.base06;
|
||||
indicator = base16.base02;
|
||||
childBorder = base16.base02;
|
||||
};
|
||||
urgent = {
|
||||
border = base16.base03;
|
||||
background = base16.base08;
|
||||
text = base16.base00;
|
||||
indicator = base16.base08;
|
||||
childBorder = base16.base08;
|
||||
};
|
||||
};
|
||||
};
|
||||
wrapperFeatures.gtk = true;
|
||||
extraConfig = ''
|
||||
hide_edge_borders smart_no_gaps
|
||||
smart_borders no_gaps
|
||||
title_align center
|
||||
seat seat0 xcursor_theme Quintom_Snow 20
|
||||
workspace_auto_back_and_forth yes
|
||||
set $mode_gaps Gaps: (o) outer, (i) inner
|
||||
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
|
||||
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
|
||||
bindsym ${cfg.modifier}+Shift+g mode "$mode_gaps"
|
||||
|
||||
mode "$mode_gaps" {
|
||||
bindsym o mode "$mode_gaps_outer"
|
||||
bindsym i mode "$mode_gaps_inner"
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
mode "$mode_gaps_inner" {
|
||||
bindsym equal gaps inner current plus 5
|
||||
bindsym minus gaps inner current minus 5
|
||||
bindsym 0 gaps inner current set 0
|
||||
|
||||
bindsym plus gaps inner all plus 5
|
||||
bindsym Shift+minus gaps inner all minus 5
|
||||
bindsym Shift+0 gaps inner all set 0
|
||||
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
mode "$mode_gaps_outer" {
|
||||
bindsym equal gaps outer current plus 5
|
||||
bindsym minus gaps outer current minus 5
|
||||
bindsym 0 gaps outer current set 0
|
||||
|
||||
bindsym plus gaps outer all plus 5
|
||||
bindsym Shift+minus gaps outer all minus 5
|
||||
bindsym Shift+0 gaps outer all set 0
|
||||
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
${workspaceBindingsStr}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
{ config, lib, tf, ... }:
|
||||
|
||||
let
|
||||
inherit (lib.modules) mkForce;
|
||||
in {
|
||||
secrets.variables = {
|
||||
syncplay-pass = {
|
||||
path = "services/media/syncplay";
|
||||
field = "password";
|
||||
};
|
||||
};
|
||||
|
||||
programs.syncplay = {
|
||||
enable = true;
|
||||
username = "kat";
|
||||
defaultRoom = "lounge";
|
||||
server = {
|
||||
host = "sync.kittywit.ch";
|
||||
password = tf.variables.syncplay-pass.ref;
|
||||
};
|
||||
playerArgs = [
|
||||
"--ytdl-format=bestvideo[height<=1080]+bestaudio/best[height<=1080]/bestvideo+bestaudio/best"
|
||||
];
|
||||
# gui = false;
|
||||
config = {
|
||||
client_settings = {
|
||||
onlyswitchtotrusteddomains = false;
|
||||
autoplayrequiresamefiles = false;
|
||||
readyatstart = true;
|
||||
pauseonleave = false;
|
||||
rewindondesync = false;
|
||||
rewindthreshold = 6.0;
|
||||
fastforwardthreshold = 6.0;
|
||||
unpauseaction = "Always";
|
||||
};
|
||||
gui = {
|
||||
#autosavejoinstolist = false;
|
||||
showdurationnotification = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
secrets.files.syncplay-config = {
|
||||
text = config.programs.syncplay.configIni;
|
||||
};
|
||||
|
||||
xdg.configFile."syncplay.ini" = mkForce {
|
||||
source = config.lib.file.mkOutOfStoreSymlink config.secrets.files.syncplay-config.path;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
{ config, lib, pkgs, nixos, ... }:
|
||||
|
||||
let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.strings) concatStringsSep fixedWidthNumber hasInfix;
|
||||
inherit (lib.attrsets) mapAttrs filterAttrs;
|
||||
packDir = builtins.toString(pkgs.vimUtils.packDir config.programs.neovim.generatedConfigViml.configure.packages);
|
||||
initLua = pkgs.substituteAll ({
|
||||
name = "init.lua";
|
||||
src = ./init.lua;
|
||||
inherit packDir;
|
||||
base16ShellPath = config.base16.shell.package;
|
||||
defaultSchemeName = config.base16.defaultSchemeName;
|
||||
defaultSchemeSlug = config.base16.defaultScheme.slug;
|
||||
} // mapAttrs (_: col: fixedWidthNumber 2 col.ansiIndex)
|
||||
(filterAttrs (var: _: hasInfix "base" var) config.base16.defaultScheme));
|
||||
in {
|
||||
home.sessionVariables = mkIf config.programs.neovim.enable { EDITOR = "nvim"; };
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
vimAlias = true;
|
||||
viAlias = true;
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
# Libraries
|
||||
plenary-nvim
|
||||
# Disables and re-enables highlighting when searching
|
||||
vim-cool
|
||||
# Colour highlighting
|
||||
vim-hexokinase
|
||||
# Git porcelain
|
||||
vim-fugitive
|
||||
# Start screen
|
||||
vim-startify
|
||||
# Re-open with cursor at the same place
|
||||
vim-lastplace
|
||||
# Status Bar
|
||||
lualine-nvim
|
||||
# EasyMotion Equivalent
|
||||
hop-nvim
|
||||
# org-mode for vim
|
||||
# neorg
|
||||
# base16
|
||||
config.base16.vim.plugin
|
||||
# Fonts
|
||||
nvim-web-devicons
|
||||
# Completion
|
||||
nvim-cmp
|
||||
# Fuzzy Finder
|
||||
telescope-nvim
|
||||
# Buffers
|
||||
bufferline-nvim
|
||||
# Language Server
|
||||
nvim-lspconfig
|
||||
(pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: with pkgs.tree-sitter-grammars; [
|
||||
tree-sitter-c
|
||||
tree-sitter-lua
|
||||
tree-sitter-rust
|
||||
#tree-sitter-bash
|
||||
tree-sitter-css
|
||||
tree-sitter-dockerfile
|
||||
tree-sitter-go
|
||||
tree-sitter-hcl
|
||||
tree-sitter-html
|
||||
tree-sitter-javascript
|
||||
tree-sitter-markdown
|
||||
tree-sitter-nix
|
||||
tree-sitter-norg
|
||||
tree-sitter-python
|
||||
tree-sitter-regex
|
||||
tree-sitter-scss
|
||||
]))
|
||||
# Treesitter Plugins
|
||||
nvim-ts-rainbow
|
||||
nvim-treesitter-context
|
||||
twilight-nvim
|
||||
];
|
||||
extraPackages = with pkgs; [
|
||||
# For nvim-lspconfig, Terraform Language Server
|
||||
terraform-ls
|
||||
# For tree-sitter
|
||||
tree-sitter
|
||||
nodejs
|
||||
clang
|
||||
clangStdenv.cc
|
||||
];
|
||||
};
|
||||
xdg.configFile."nvim/init.lua".source = initLua;
|
||||
}
|
||||
|
|
@ -1,345 +0,0 @@
|
|||
-----------------------------------------------------------
|
||||
-- Variables
|
||||
-----------------------------------------------------------
|
||||
local g = vim.g -- Global variables
|
||||
local opt = vim.opt -- Set options (global/buffer/windows-scoped)
|
||||
local wo = vim.wo -- Window local variables
|
||||
local api = vim.api -- Lua API
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Nix Fuckery
|
||||
-----------------------------------------------------------
|
||||
opt.packpath:prepend{"@packDir@"}
|
||||
opt.runtimepath:prepend{"@packDir@"}
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Base16
|
||||
-----------------------------------------------------------
|
||||
vim.g.base16colorspace = 256
|
||||
vim.g.base16background = "@defaultSchemeName@"
|
||||
g.base16_shell_path = "@base16ShellPath@"
|
||||
vim.cmd("colorscheme base16-@defaultSchemeSlug@")
|
||||
g.colors_name = "@defaultSchemeSlug@"
|
||||
|
||||
local base16 = {
|
||||
base00 = "@base00@",
|
||||
base01 = "@base01@",
|
||||
base02 = "@base02@",
|
||||
base03 = "@base03@",
|
||||
base04 = "@base04@",
|
||||
base05 = "@base05@",
|
||||
base06 = "@base06@",
|
||||
base07 = "@base07@",
|
||||
base08 = "@base08@",
|
||||
base09 = "@base09@",
|
||||
base0A = "@base0A@",
|
||||
base0B = "@base0B@",
|
||||
base0C = "@base0C@",
|
||||
base0D = "@base0D@",
|
||||
base0E = "@base0E@",
|
||||
base0F = "@base0F@"
|
||||
}
|
||||
|
||||
api.nvim_create_autocmd("vimenter", {
|
||||
command = "highlight Normal guibg=NONE ctermbg=NONE"
|
||||
})
|
||||
api.nvim_create_autocmd("SourcePost", {
|
||||
command = "highlight Normal ctermbg=NONE guibg=NONE | " ..
|
||||
"highlight LineNr ctermbg=NONE guibg=NONE | " ..
|
||||
"highlight SignColumn ctermbg=NONE guibg=NONE"
|
||||
})
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- General
|
||||
-----------------------------------------------------------
|
||||
opt.mouse = 'a' -- Enable mouse support
|
||||
opt.clipboard = 'unnamedplus' -- Copy/paste to system clipboard
|
||||
opt.completeopt = 'longest,menuone' -- Autocomplete options
|
||||
opt.backup = false -- Disable backup
|
||||
opt.writebackup = false -- Disable backup
|
||||
opt.ttimeoutlen = 100 -- Mapping timeout
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Neovim UI
|
||||
-----------------------------------------------------------
|
||||
opt.number = true -- Show line number
|
||||
opt.relativenumber = true -- Relative line numbers
|
||||
opt.showmatch = true -- Highlight matching parenthesis
|
||||
opt.foldmethod = 'marker' -- Enable folding (default 'foldmarker')
|
||||
opt.colorcolumn = '80' -- Line length marker at 80 columns
|
||||
opt.splitright = true -- Vertical split to the right
|
||||
opt.splitbelow = true -- Horizontal split to the bottom
|
||||
opt.ignorecase = true -- Ignore case letters when search
|
||||
opt.smartcase = true -- Ignore lowercase for the whole pattern
|
||||
opt.wrap = true -- Wrap on word boundary
|
||||
opt.linebreak = true -- Wrap on word boundary
|
||||
opt.showbreak = " ↳" -- Character to use to display word boundary
|
||||
opt.termguicolors = false -- Enable 24-bit RGB colors
|
||||
opt.laststatus = 3 -- Set global statusline
|
||||
opt.cursorline = true -- Highlight cursor screenline
|
||||
opt.cmdheight = 1 -- Command entry line height
|
||||
opt.hlsearch = true -- Highlight matches with last search pattern
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Tabs, indent
|
||||
-----------------------------------------------------------
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.shiftwidth = 2 -- Shift 2 spaces when tab
|
||||
opt.tabstop = 2 -- 1 tab == 2 spaces
|
||||
opt.smartindent = true -- Autoindent new lines
|
||||
opt.list = true -- List chars
|
||||
opt.listchars = {
|
||||
tab = '» ',
|
||||
extends = '›',
|
||||
precedes= '‹',
|
||||
nbsp = '·',
|
||||
trail = '✖'
|
||||
}
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Memory, CPU
|
||||
-----------------------------------------------------------
|
||||
opt.hidden = true -- Enable background buffers
|
||||
opt.history = 100 -- Remember N lines in history
|
||||
opt.lazyredraw = true -- Faster scrolling
|
||||
opt.synmaxcol = 240 -- Max column for syntax highlight
|
||||
opt.updatetime = 700 -- ms to wait for trigger an event
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Plugins
|
||||
-----------------------------------------------------------
|
||||
|
||||
-- Remove perl
|
||||
g.loaded_perl_provider = 0
|
||||
|
||||
-- Hexokinaise
|
||||
g.Hexokinase_highlighters = {'virtual'}
|
||||
g.Hexokinase_optInPatterns = {
|
||||
'full_hex',
|
||||
'rgb',
|
||||
'rgba',
|
||||
'hsl',
|
||||
'hsla',
|
||||
'colour_names'
|
||||
}
|
||||
|
||||
-- Lastplace
|
||||
g.lastplace_ignore = 'gitcommit,gitrebase,svn,hgcommit'
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Startup
|
||||
-----------------------------------------------------------
|
||||
|
||||
-- Disable builtins plugins
|
||||
local disabled_built_ins = {
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"gzip",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"2html_plugin",
|
||||
"logipat",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"matchit"
|
||||
}
|
||||
|
||||
for _, plugin in pairs(disabled_built_ins) do
|
||||
g["loaded_" .. plugin] = 1
|
||||
end
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Plugins
|
||||
-----------------------------------------------------------
|
||||
|
||||
-- lualine
|
||||
require('lualine').setup{}
|
||||
|
||||
-- nvim-cmp
|
||||
local cmp = require('cmp')
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
},
|
||||
sources = {
|
||||
-- { name = 'neorg' },
|
||||
}
|
||||
})
|
||||
|
||||
-- lspconfig
|
||||
require('lspconfig').terraformls.setup{}
|
||||
|
||||
api.nvim_create_autocmd('BufWritePre', {
|
||||
pattern = '*.tf',
|
||||
command = 'lua vim.lsp.buf.formatting_sync()'
|
||||
})
|
||||
|
||||
--[[
|
||||
-- neorg
|
||||
require('neorg').setup {
|
||||
-- Tell Neorg what modules to load
|
||||
load = {
|
||||
['core.defaults'] = {}, -- Load all the default modules
|
||||
['core.norg.concealer'] = {}, -- Allows for use of icons
|
||||
['core.norg.dirman'] = { -- Manage your directories with Neorg
|
||||
config = {
|
||||
engine = 'nvim-cmp',
|
||||
workspaces = {
|
||||
home = '~/neorg'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}]]--
|
||||
|
||||
-- telescope
|
||||
local telescope = require('telescope.builtin')
|
||||
|
||||
vim.keymap.set("n", "<leader>ff", function()
|
||||
telescope.find_files()
|
||||
end, { silent = true })
|
||||
|
||||
vim.keymap.set("n", "<leader>fg", function()
|
||||
telescope.live_grep()
|
||||
end, { silent = true })
|
||||
|
||||
vim.keymap.set("n", "<leader>fb", function()
|
||||
telescope.buffers()
|
||||
end, { silent = true })
|
||||
|
||||
vim.keymap.set("n", "<leader>fh", function()
|
||||
telescope.help_tags()
|
||||
end, { silent = true })
|
||||
|
||||
-- treesitter
|
||||
require('nvim-treesitter.configs').setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
},
|
||||
|
||||
sync_install = false,
|
||||
auto_install = false,
|
||||
ignore_install = {},
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true
|
||||
},
|
||||
}
|
||||
|
||||
-- twilight
|
||||
require("twilight").setup {
|
||||
dimming = {
|
||||
alpha = 0.5,
|
||||
},
|
||||
context = 10,
|
||||
expand = {
|
||||
"function",
|
||||
"method",
|
||||
"table",
|
||||
"if_statement",
|
||||
},
|
||||
}
|
||||
|
||||
-- bufferline
|
||||
require('bufferline').setup {
|
||||
options = {
|
||||
mode = "buffers", -- set to "tabs" to only show tabpages instead
|
||||
numbers = "ordinal",
|
||||
close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
right_mouse_command = "bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
|
||||
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
|
||||
indicator = {
|
||||
icon = '▎',
|
||||
style = 'icon',
|
||||
},
|
||||
buffer_close_icon = '',
|
||||
modified_icon = '●',
|
||||
close_icon = '',
|
||||
left_trunc_marker = '',
|
||||
right_trunc_marker = '',
|
||||
name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr"
|
||||
-- remove extension from markdown files for example
|
||||
if buf.name:match('%.md') then
|
||||
return vim.fn.fnamemodify(buf.name, ':t:r')
|
||||
end
|
||||
end,
|
||||
max_name_length = 18,
|
||||
max_prefix_length = 15, -- prefix used when a buffer is de-duplicated
|
||||
tab_size = 18,
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_update_in_insert = false,
|
||||
color_icons = true,
|
||||
show_buffer_icons = true, -- disable filetype icons for buffers
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = false,
|
||||
show_tab_indicators = true,
|
||||
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
|
||||
separator_style = "slant",
|
||||
always_show_bufferline = true,
|
||||
}
|
||||
}
|
||||
|
||||
local barColor = base16.base00;
|
||||
|
||||
local highlightItems = {
|
||||
BufferLineFill = "bg",
|
||||
BufferLineBackground = "bg",
|
||||
BufferLineSeparator = "fg",
|
||||
BufferLineSeparatorSelected = "fg",
|
||||
BufferLineSeparatorVisible = "fg",
|
||||
}
|
||||
|
||||
local commandString = ""
|
||||
|
||||
for item, ground in pairs(highlightItems) do
|
||||
commandString = "highlight " .. item .. " cterm" .. ground .. "=" .. barColor .. " | " .. commandString
|
||||
end
|
||||
|
||||
api.nvim_create_autocmd("ColorScheme", {
|
||||
command = commandString;
|
||||
})
|
||||
|
||||
-- hop
|
||||
local hop = require('hop')
|
||||
local directions = require("hop.hint").HintDirection
|
||||
hop.setup()
|
||||
|
||||
vim.keymap.set("", "t", function()
|
||||
hop.hint_words()
|
||||
end, {})
|
||||
|
||||
vim.keymap.set("", "T", function()
|
||||
hop.hint_lines_skip_whitespace()
|
||||
end, {remap=true})
|
||||
|
||||
vim.keymap.set("", "f", function()
|
||||
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true })
|
||||
end, {remap=true})
|
||||
|
||||
vim.keymap.set("", "F", function()
|
||||
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true })
|
||||
end, {remap=true})
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{ config, lib, pkgs, ... }: {
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
jnoortheen.nix-ide
|
||||
];
|
||||
};
|
||||
home.packages = with pkgs; [
|
||||
rnix-lsp
|
||||
];
|
||||
}
|
||||
|
|
@ -1,174 +0,0 @@
|
|||
{ config, lib, pkgs, nixfiles, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."waybar/style.css" = { inherit (nixfiles.sassTemplate { name = "waybar-style"; src = ./waybar.sass; }) source; };
|
||||
|
||||
#systemd.user.services.waybar.Service.Environment = lib.singleton "NOTMUCH_CONFIG=${config.home.sessionVariables.NOTMUCH_CONFIG}";
|
||||
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
settings = [{
|
||||
height = 10;
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/mode"
|
||||
"sway/window"
|
||||
];
|
||||
modules-center = [
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio#icon"
|
||||
"pulseaudio"
|
||||
"custom/headset-icon"
|
||||
"custom/headset"
|
||||
"custom/cpu-icon"
|
||||
"cpu"
|
||||
"custom/memory-icon"
|
||||
"memory"
|
||||
"temperature#icon"
|
||||
"temperature"
|
||||
"battery#icon"
|
||||
"battery"
|
||||
"backlight#icon"
|
||||
"backlight"
|
||||
"network#icon"
|
||||
"network"
|
||||
"idle_inhibitor"
|
||||
"custom/konawall"
|
||||
"custom/gpg-status"
|
||||
"custom/clock"
|
||||
"tray"
|
||||
];
|
||||
|
||||
modules = {
|
||||
"sway/workspaces" = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
"1" = "1:";
|
||||
"2" = "2:";
|
||||
"3" = "3:";
|
||||
};
|
||||
};
|
||||
"sway/window" = {
|
||||
icon = true;
|
||||
icon-size = 12;
|
||||
format = "{}";
|
||||
};
|
||||
tray = {
|
||||
icon-size = 12;
|
||||
spacing = 2;
|
||||
};
|
||||
"backlight#icon" = {
|
||||
format = "{icon}";
|
||||
format-icons = ["" ""];
|
||||
};
|
||||
backlight = {
|
||||
format = "{percent}%";
|
||||
};
|
||||
"custom/gpg-status" = {
|
||||
format = "{}";
|
||||
interval = 300;
|
||||
return-type = "json";
|
||||
exec = "${pkgs.waybar-gpg}/bin/kat-gpg-status";
|
||||
};
|
||||
"custom/headset-icon" = {
|
||||
format = "";
|
||||
interval = 60;
|
||||
exec-if = "${pkgs.headsetcontrol}/bin/headsetcontrol -c";
|
||||
exec = "echo 'mew'";
|
||||
};
|
||||
"custom/headset" = {
|
||||
format = "{}";
|
||||
interval = 60;
|
||||
exec-if = "${pkgs.headsetcontrol}/bin/headsetcontrol -c";
|
||||
exec = "${pkgs.headsetcontrol}/bin/headsetcontrol -b | ${pkgs.gnugrep}/bin/grep Battery | ${pkgs.coreutils}/bin/cut -d ' ' -f2";
|
||||
};
|
||||
"custom/konawall" = {
|
||||
format = "{}";
|
||||
interval = "once";
|
||||
return-type = "json";
|
||||
exec = "${pkgs.waybar-konawall}/bin/konawall-status";
|
||||
on-click = "${pkgs.waybar-konawall}/bin/konawall-toggle";
|
||||
on-click-right = "systemctl --user restart konawall";
|
||||
signal = 8;
|
||||
};
|
||||
"custom/cpu-icon".format = "";
|
||||
cpu.format = "{usage}%";
|
||||
"custom/memory-icon".format = "";
|
||||
memory.format = "{percentage}%";
|
||||
"temperature#icon" = {
|
||||
format = "{icon}";
|
||||
format-icons = ["" "" ""];
|
||||
critical-threshold = 80;
|
||||
};
|
||||
temperature = {
|
||||
format = "{temperatureC}°C";
|
||||
critical-threshold = 80;
|
||||
};
|
||||
idle_inhibitor = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
activated = "";
|
||||
deactivated = "";
|
||||
};
|
||||
};
|
||||
"battery#icon" = {
|
||||
states = {
|
||||
good = 90;
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{icon}";
|
||||
format-charging = "";
|
||||
format-plugged = "";
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
};
|
||||
battery = {
|
||||
states = {
|
||||
good = 90;
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{capacity}%";
|
||||
format-charging = "{capacity}%";
|
||||
format-plugged = "{capacity}%";
|
||||
format-alt = "{time}";
|
||||
};
|
||||
"pulseaudio#icon" = {
|
||||
format = "{icon}";
|
||||
format-muted = "婢";
|
||||
on-click = "wezterm start pulsemixer";
|
||||
format-icons = {
|
||||
default = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
};
|
||||
pulseaudio = {
|
||||
format = "{volume}%";
|
||||
on-click = "${pkgs.wezterm}/bin/wezterm start ${pkgs.pulsemixer}/bin/pulsemixer";
|
||||
};
|
||||
"network#icon" = {
|
||||
format-wifi = "直";
|
||||
format-ethernet = "";
|
||||
format-linked = " ";
|
||||
format-disconnected = "";
|
||||
};
|
||||
network = {
|
||||
format-wifi = "{essid} ({signalStrength}%)";
|
||||
format-ethernet = "{ipaddr}/{cidr}";
|
||||
format-linked = "No IP";
|
||||
format-disconnected = "Disconnected";
|
||||
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
||||
};
|
||||
"custom/clock" = {
|
||||
exec = ''${pkgs.coreutils}/bin/date +"%a, %F %T %Z"'';
|
||||
interval = 1;
|
||||
};
|
||||
};
|
||||
}];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,172 +0,0 @@
|
|||
%extend_1
|
||||
padding: 0 8px
|
||||
transition: none
|
||||
color: $base00
|
||||
|
||||
*
|
||||
border: none
|
||||
border-radius: 0
|
||||
background: none
|
||||
font-family: "Iosevka SS10", "Font Awesome 6 Free", "Font Awesome 6 Brands"
|
||||
font-size: $font_size
|
||||
min-height: 8px
|
||||
text-shadow: none
|
||||
box-shadow: none
|
||||
|
||||
window#waybar
|
||||
background: $base00t
|
||||
|
||||
tooltip
|
||||
background: $base00t
|
||||
label
|
||||
color: $base07
|
||||
|
||||
#mode
|
||||
background: $base01
|
||||
color: $base06
|
||||
padding: 0 4px
|
||||
|
||||
#clock, #custom-clock
|
||||
@extend %extend_1
|
||||
background: $base01
|
||||
color: $base07
|
||||
|
||||
#cpu, #memory, #temperature, #pulseaudio, #backlight, #battery, #custom-mail, #custom-headset, #clock.arc, #clock.hex, #clock.miku, #network
|
||||
background: $base01
|
||||
color: $base07
|
||||
padding: 0 6px
|
||||
margin-right: 4px
|
||||
|
||||
#custom-gpg-status, #custom-konawall, #idle_inhibitor
|
||||
margin: 0 4px
|
||||
|
||||
#temperature.icon, #pulseaudio.icon, #battery.icon, #backlight.icon, #custom-cpu-icon, #custom-memory-icon, #custom-mail-icon, #custom-headset-icon, #custom-arc-h, #custom-hex-h, #custom-miku-h, #clock.original, #tray, #network.icon
|
||||
margin-left: 4px
|
||||
margin-right: 0px
|
||||
|
||||
#custom-headset-icon
|
||||
@extend %extend_1
|
||||
background: $base06
|
||||
|
||||
#custom-memory-icon
|
||||
@extend %extend_1
|
||||
background: $base09
|
||||
|
||||
#custom-cpu-icon
|
||||
@extend %extend_1
|
||||
background: $base08
|
||||
|
||||
#temperature.icon
|
||||
@extend %extend_1
|
||||
background: $base0B
|
||||
|
||||
#pulseaudio.icon
|
||||
@extend %extend_1
|
||||
background: $base06
|
||||
&.muted
|
||||
background: $base03
|
||||
|
||||
#network.icon
|
||||
@extend %extend_1
|
||||
background: $base0C
|
||||
|
||||
#mpd
|
||||
@extend %extend_1
|
||||
|
||||
#backlight.icon
|
||||
@extend %extend_1
|
||||
background: $base0D
|
||||
|
||||
#battery.icon
|
||||
@extend %extend_1
|
||||
background: $base0C
|
||||
|
||||
#custom-mail-icon
|
||||
@extend %extend_1
|
||||
background: $base0F
|
||||
|
||||
#custom-konawall
|
||||
@extend %extend_1
|
||||
&.enabled
|
||||
background: $base0E
|
||||
|
||||
&.disabled
|
||||
background: $base0D
|
||||
|
||||
#custom-gpg-status
|
||||
@extend %extend_1
|
||||
&.enabled
|
||||
background: $base0B
|
||||
|
||||
&.disabled
|
||||
background: $base08
|
||||
|
||||
#idle_inhibitor
|
||||
@extend %extend_1
|
||||
&.activated
|
||||
background: $base0E
|
||||
|
||||
&.deactivated
|
||||
background: $base0D
|
||||
|
||||
#tray
|
||||
@extend %extend_1
|
||||
background: $base01
|
||||
padding: 0 10px 0 8px
|
||||
menu
|
||||
background: $base00t
|
||||
color: $base07
|
||||
|
||||
|
||||
.modules-left
|
||||
margin: 0 4px
|
||||
image
|
||||
padding-left: 6px
|
||||
padding-right: 6px
|
||||
margin-left: 4px
|
||||
margin-right: 0px
|
||||
background: $base01
|
||||
#window
|
||||
margin-left: 0px
|
||||
margin-right: 0px
|
||||
widget
|
||||
label
|
||||
margin: 0
|
||||
|
||||
&:first-child
|
||||
margin-left: 0
|
||||
|
||||
&:last-child
|
||||
margin-right: 0
|
||||
|
||||
.modules-center
|
||||
margin: 0 4px
|
||||
|
||||
.modules-right
|
||||
margin: 0 4px
|
||||
|
||||
#workspaces
|
||||
background: $base01
|
||||
padding: 0
|
||||
margin-right: 8px
|
||||
button
|
||||
color: $base06
|
||||
&.focused
|
||||
color: $base07
|
||||
background: $base0D
|
||||
|
||||
&:hover
|
||||
transition: none
|
||||
box-shadow: inherit
|
||||
text-shadow: inherit
|
||||
background: $base06
|
||||
color: $base0C
|
||||
|
||||
#window
|
||||
background: $base01
|
||||
padding: 0 4px
|
||||
color: $base06
|
||||
border-bottom: 2px solid transparent
|
||||
|
||||
window#waybar.empty #window
|
||||
opacity: 0
|
||||
|
|
@ -1,188 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
programs.weechat = {
|
||||
init = lib.mkMerge [
|
||||
(lib.mkBefore ''
|
||||
/server add espernet znc.kittywit.ch/5001 -ssl -autoconnect
|
||||
/server add softnet znc.kittywit.ch/5001 -ssl -autoconnect
|
||||
/server add liberachat znc.kittywit.ch/5001 -ssl -autoconnect
|
||||
/matrix server add kittywitch kittywit.ch
|
||||
/key bind meta-g /go
|
||||
/key bind meta-v /input jump_last_buffer_displayed
|
||||
/key bind meta-c /buffer close
|
||||
/key bind meta-n /bar toggle nicklist
|
||||
/key bind meta-b /bar toggle buflist
|
||||
/relay add weechat 9000
|
||||
'')
|
||||
(lib.mkAfter ''
|
||||
/matrix connect kittywitch
|
||||
/window splith +10
|
||||
/window 2
|
||||
/buffer highmon
|
||||
/window 1
|
||||
'')
|
||||
];
|
||||
homeDirectory = "${config.xdg.dataHome}/weechat";
|
||||
plugins.python = {
|
||||
enable = true;
|
||||
packages = [ "weechat-matrix" ];
|
||||
};
|
||||
plugins.perl = {
|
||||
enable = true;
|
||||
};
|
||||
scripts = with pkgs.weechatScripts; [
|
||||
weechat-go
|
||||
auto_away
|
||||
weechat-autosort
|
||||
parse_relayed_msg
|
||||
colorize_nicks
|
||||
unread_buffer
|
||||
urlgrab
|
||||
vimode-develop
|
||||
weechat-matrix
|
||||
title
|
||||
highmon
|
||||
zncplayback
|
||||
];
|
||||
config = with lib.mapAttrs (_: toString) pkgs.base16.shell.shell256; {
|
||||
logger.level.irc = 0;
|
||||
logger.level.python.matrix = 0;
|
||||
logger.level.core.weechat = 0;
|
||||
buflist = {
|
||||
format = {
|
||||
indent = "\${if:\${merged}?\${if:\${buffer.prev_buffer.number}!=\${buffer.number}?│┌:\${if:\${buffer.next_buffer.number}==\${buffer.number}?│├:\${if:\${buffer.next_buffer.name}=~^server||\${buffer.next_buffer.number}<0?└┴:├┴}}}:\${if:\${buffer.active}>0?\${if:\${buffer.next_buffer.name}=~^server?└:\${if:\${buffer.next_buffer.number}>0?├:└}}:\${if:\${buffer.next_buffer.name}=~^server? :│}}}─";
|
||||
buffer_current = "\${color:,${base0D}}\${format_buffer}";
|
||||
hotlist = " \${color:${base0B}}(\${hotlist}\${color:${base0B}})";
|
||||
hotlist_highlight = "\${color:${base08}}";
|
||||
hotlist_low = "\${color:${base06}}";
|
||||
hotlist_message = "\${color:${base0C}}";
|
||||
hotlist_none = "\${color:${base06}}";
|
||||
hotlist_private = "\${color:${base09}}";
|
||||
hotlist_separator = "\${color:${base04}},";
|
||||
number = "\${color:${base07}}\${number}\${if:\${number_displayed}?.: }";
|
||||
};
|
||||
};
|
||||
weechat = {
|
||||
look = {
|
||||
mouse = true;
|
||||
separator_horizontal = "";
|
||||
read_marker_string = "─";
|
||||
prefix_same_nick = "↳";
|
||||
};
|
||||
color = {
|
||||
chat_nick_self = base0E;
|
||||
separator = base06;
|
||||
chat_read_marker = base0B;
|
||||
chat_read_marker_bg = base03;
|
||||
};
|
||||
bar = {
|
||||
buflist = {
|
||||
size_max = 24;
|
||||
color_delim = base0E;
|
||||
};
|
||||
input = {
|
||||
items = "[input_prompt]+(away),[input_search],[input_paste],input_text,[vi_buffer]";
|
||||
color_delim = base0E;
|
||||
conditions = "\${window.buffer.full_name} != perl.highmon";
|
||||
};
|
||||
nicklist = {
|
||||
size_max = 18;
|
||||
color_delim = base0E;
|
||||
};
|
||||
status = {
|
||||
color_bg = base02;
|
||||
color_fg = base06;
|
||||
color_delim = base0E;
|
||||
items = "[time],mode_indicator,[buffer_last_number],[buffer_plugin],buffer_number+:+buffer_name+(buffer_modes)+{buffer_nicklist_count}+matrix_typing_notice+buffer_zoom+buffer_filter,scroll,[lag],[hotlist],completion,cmd_completion";
|
||||
conditions = "\${window.buffer.full_name} != perl.highmon";
|
||||
};
|
||||
title = {
|
||||
color_bg = base02;
|
||||
color_fg = base06;
|
||||
color_delim = base0E;
|
||||
conditions = "\${window.buffer.full_name} != perl.highmon";
|
||||
};
|
||||
};
|
||||
};
|
||||
urlgrab.default.copycmd = "${pkgs.wl-clipboard}/bin/wl-copy";
|
||||
plugins.var = {
|
||||
python = {
|
||||
title = {
|
||||
title_prefix = "weechat - ";
|
||||
show_hotlist = true;
|
||||
current_buffer_suffix = " [";
|
||||
title_suffix = " ]";
|
||||
};
|
||||
vimode = {
|
||||
copy_clipboard_cmd = "wl-copy";
|
||||
paste_clipboard_cmd = "wl-paste --no-newline";
|
||||
imap_esc_timeout = "100";
|
||||
search_vim = true;
|
||||
user_mappings = builtins.toJSON {
|
||||
"," = "/buffer #{1}<CR>";
|
||||
"``" = "/input jump_last_buffer_displayed<CR>";
|
||||
"`n" = "/input jump_smart<CR>";
|
||||
"k" = "/input history_previous<CR>";
|
||||
"j" = "/input history_next<CR>";
|
||||
"p" = "a/input clipboard_paste<ICMD><ESC>";
|
||||
"P" = "/input clipboard_paste<CR>";
|
||||
#"u" = "/input undo<CR>";
|
||||
#"\\x01R" = "/input redo<CR>";
|
||||
"\\x01K" = "/buffer move -1<CR>";
|
||||
"\\x01J" = "/buffer move +1<CR>";
|
||||
};
|
||||
user_mappings_noremap = builtins.toJSON {
|
||||
"\\x01P" = "p";
|
||||
"/" = "i/";
|
||||
};
|
||||
user_search_mapping = "?";
|
||||
mode_indicator_cmd_color_bg = base01;
|
||||
mode_indicator_cmd_color = base04;
|
||||
mode_indicator_insert_color_bg = base01;
|
||||
mode_indicator_insert_color = base04;
|
||||
mode_indicator_normal_color_bg = base01;
|
||||
mode_indicator_normal_color = base04;
|
||||
mode_indicator_replace_color_bg = base01;
|
||||
mode_indicator_replace_color = base0E;
|
||||
mode_indicator_search_color_bg = base0E;
|
||||
mode_indicator_search_color = base04;
|
||||
no_warn = true;
|
||||
};
|
||||
notify_send.icon = "";
|
||||
go.short_name = true;
|
||||
};
|
||||
perl = {
|
||||
highmon = {
|
||||
short_names = "on";
|
||||
output = "buffer";
|
||||
merge_private = "on";
|
||||
alignment = "nchannel,nick";
|
||||
};
|
||||
parse_relayed_msg = {
|
||||
servername = "espernet";
|
||||
supported_bot_names = "cord";
|
||||
};
|
||||
};
|
||||
};
|
||||
irc = {
|
||||
look = {
|
||||
server_buffer = "independent";
|
||||
color_nicks_in_nicklist = true;
|
||||
};
|
||||
};
|
||||
matrix = {
|
||||
network = {
|
||||
max_backlog_sync_events = 30;
|
||||
lazy_load_room_users = true;
|
||||
autoreconnect_delay_max = 5;
|
||||
lag_min-show = 1000;
|
||||
};
|
||||
look = {
|
||||
server_buffer = "independent";
|
||||
redactions = "notice";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
wezterm
|
||||
];
|
||||
|
||||
xdg.configFile."wezterm/wezterm.lua".text = ''
|
||||
local wezterm = require 'wezterm'
|
||||
return {
|
||||
check_for_updates = true,
|
||||
enable_tab_bar = true,
|
||||
font = wezterm.font "${config.nixfiles.theme.font.termName}",
|
||||
font_size = ${toString config.nixfiles.theme.font.size},
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{ config, nixfiles, ... }:
|
||||
|
||||
{
|
||||
xdg.configFile."wofi/wofi.css" = { inherit (nixfiles.sassTemplate { name = "wofi-style"; src = ./wofi.sass; }) source; };
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
#scroll
|
||||
background: $base01
|
||||
border: 1px solid $base03
|
||||
|
||||
#input
|
||||
background: $base01
|
||||
border: 1px solid $base0C
|
||||
margin: 1em
|
||||
background: $base02
|
||||
color: $base04
|
||||
|
||||
window
|
||||
font-family: $font
|
||||
background: $base00t
|
||||
border-radius: 1em
|
||||
font-size: $font_size
|
||||
color: $base07
|
||||
|
||||
#outer-box
|
||||
margin: 1em
|
||||
|
||||
#entry
|
||||
border-bottom: 1px dashed $base04
|
||||
padding: .75em
|
||||
&:selected
|
||||
background-color: $base0D
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{ config, pkgs, ... }: {
|
||||
home.packages = with pkgs; [
|
||||
];
|
||||
}
|
||||
18
home/xdg.nix
18
home/xdg.nix
|
|
@ -1,18 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
xdg = {
|
||||
enable = true;
|
||||
userDirs = {
|
||||
enable = true;
|
||||
pictures = "$HOME/media";
|
||||
videos = "$HOME/media/videos";
|
||||
documents = "$HOME/docs";
|
||||
download = "$HOME/downloads";
|
||||
desktop = "$HOME/tmp";
|
||||
templates = "$HOME/tmp";
|
||||
publicShare = "$HOME/shared";
|
||||
music = "$HOME/media/music";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home.file = {
|
||||
".xkb/symbols/us_gbp_map".source = ./layout.xkb;
|
||||
};
|
||||
|
||||
home.keyboard = null;
|
||||
}
|
||||
103
meta.nix
103
meta.nix
|
|
@ -1,61 +1,62 @@
|
|||
{ inputs, system ? builtins.currentSystem or "x86_64-linux" , ... }: let
|
||||
patchedInputs = import ./patchedInputs.nix { inherit inputs system; };
|
||||
pkgs = import ./overlays { inherit system; inputs = patchedInputs; };
|
||||
{
|
||||
inputs,
|
||||
system ? builtins.currentSystem or "x86_64-linux",
|
||||
...
|
||||
}: let
|
||||
patchedInputs = import ./patchedInputs.nix {inherit inputs system;};
|
||||
pkgs = import ./overlays {
|
||||
inherit system;
|
||||
inputs = patchedInputs;
|
||||
};
|
||||
inherit (pkgs) lib;
|
||||
tree = import ./tree.nix { inherit lib; inputs = patchedInputs; };
|
||||
tree = import ./tree.nix {
|
||||
inherit lib;
|
||||
inputs = patchedInputs;
|
||||
};
|
||||
root = ./.; # Required for modules/meta/imports.nix to find hosts
|
||||
nixfiles = tree.impure;
|
||||
|
||||
eval = let
|
||||
esphomeNodes = (map
|
||||
(node: {
|
||||
network.nodes.esphome.${node} = {
|
||||
imports = config.lib.nixfiles.esphomeImport node;
|
||||
esphome = {
|
||||
name = node;
|
||||
};
|
||||
};
|
||||
})
|
||||
(lib.attrNames nixfiles.esphome.boards));
|
||||
nixosNodes = (map
|
||||
(node: {
|
||||
network.nodes.nixos.${node} = {
|
||||
imports = config.lib.nixfiles.nixosImport node;
|
||||
networking = {
|
||||
hostName = node;
|
||||
};
|
||||
};
|
||||
})
|
||||
(lib.attrNames nixfiles.nixos.systems));
|
||||
darwinNodes = (map
|
||||
(node: {
|
||||
network.nodes.darwin.${node} = {
|
||||
imports = config.lib.nixfiles.darwinImport node;
|
||||
networking = {
|
||||
hostName = node;
|
||||
};
|
||||
};
|
||||
})
|
||||
(lib.attrNames nixfiles.darwin.systems));
|
||||
in lib.evalModules {
|
||||
modules = [
|
||||
nixfiles.modules.meta
|
||||
nixosNodes = [
|
||||
{
|
||||
_module.args.pkgs = lib.mkDefault pkgs;
|
||||
network.nodes.tewi = {
|
||||
imports = [
|
||||
./tewi/nixos.nix
|
||||
nixfiles.nixos.base
|
||||
];
|
||||
networking = {
|
||||
hostName = "tewi";
|
||||
};
|
||||
};
|
||||
}
|
||||
]
|
||||
++ lib.attrValues nixfiles.targets
|
||||
++ nixosNodes
|
||||
++ darwinNodes
|
||||
++ esphomeNodes;
|
||||
];
|
||||
in
|
||||
lib.evalModules {
|
||||
modules =
|
||||
[
|
||||
nixfiles.modules.meta
|
||||
{
|
||||
_module.args.pkgs = lib.mkDefault pkgs;
|
||||
}
|
||||
]
|
||||
++ nixosNodes;
|
||||
|
||||
specialArgs = {
|
||||
inherit root tree;
|
||||
inputs = patchedInputs;
|
||||
meta = self;
|
||||
} // nixfiles;
|
||||
};
|
||||
specialArgs =
|
||||
{
|
||||
inherit root tree;
|
||||
inputs = patchedInputs;
|
||||
meta = self;
|
||||
}
|
||||
// nixfiles;
|
||||
};
|
||||
|
||||
inherit (eval) config;
|
||||
self = config // { inherit pkgs lib tree; inputs = patchedInputs; } // nixfiles;
|
||||
in self
|
||||
self =
|
||||
config
|
||||
// {
|
||||
inherit pkgs lib tree;
|
||||
inputs = patchedInputs;
|
||||
}
|
||||
// nixfiles;
|
||||
in
|
||||
self
|
||||
|
|
|
|||
|
|
@ -1,119 +0,0 @@
|
|||
{ tf, target, name, meta, pkgs, config, lib, ... }:
|
||||
|
||||
/*
|
||||
This module:
|
||||
* aliases <hostname>.system.build.toplevel to <hostname>.deploy.system for ease of use.
|
||||
* marries meta config to NixOS configs for each host.
|
||||
* provides in-scope TF config in NixOS and home-manager, instead of only as a part of meta config.
|
||||
*/
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.deploy;
|
||||
unmergedValues = types.mkOptionType {
|
||||
name = "unmergedValues";
|
||||
merge = loc: defs: map (def: def.value) defs;
|
||||
};
|
||||
in {
|
||||
options = {
|
||||
out = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
deploy.tf = mkOption {
|
||||
type = types.submodule {
|
||||
inherit (unmerged) freeformType;
|
||||
|
||||
options = {
|
||||
triggers = mkOption {
|
||||
type = types.attrsOf types.unspecified;
|
||||
default = { };
|
||||
};
|
||||
import = mkOption {
|
||||
type = types.attrsOf types.unspecified;
|
||||
default = [ ];
|
||||
};
|
||||
imports = mkOption {
|
||||
type = types.listOf types.str;
|
||||
description = "Other targets to depend on";
|
||||
default = [ ];
|
||||
};
|
||||
attrs = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
};
|
||||
out.set = mkOption { type = types.unspecified; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
functionlessConfig = lib.removeAttrs config ["out" "_module" "platform" "deploy" "secrets"];
|
||||
mutatedConfig = functionlessConfig // (optionalAttrs (config.platform != {}) {
|
||||
${functionlessConfig.esphome.platform} = config.platform;
|
||||
});
|
||||
jsonConfig = builtins.toJSON mutatedConfig;
|
||||
secretsMap = mapAttrs (name: _: tf.variables."${config.esphome.name}-secret-${name}".ref) config.secrets;
|
||||
secretsFile = builtins.toJSON secretsMap;
|
||||
closureConfig = pkgs.writeText "${functionlessConfig.esphome.name}.json" jsonConfig;
|
||||
in mkMerge [
|
||||
{
|
||||
_module.args.tf = mapNullable (target: target.tf) target;
|
||||
out = jsonConfig;
|
||||
deploy.tf = {
|
||||
terraform.environment.ESPHOME = "${pkgs.esphome}";
|
||||
attrs = [ "import" "imports" "out" "attrs" "triggers" ];
|
||||
import = genAttrs cfg.tf.imports (target: meta.deploy.targets.${target}.tf);
|
||||
out.set = removeAttrs cfg.tf cfg.tf.attrs;
|
||||
triggers = {
|
||||
upload = {
|
||||
system = config.out;
|
||||
};
|
||||
};
|
||||
resources = {
|
||||
"${name}-secrets" = {
|
||||
provider = "local";
|
||||
type = "file";
|
||||
inputs = {
|
||||
filename = "${builtins.toString tf.terraform.dataDir}/esphome-${name}-secrets.json";
|
||||
content = secretsFile;
|
||||
};
|
||||
};
|
||||
"${name}-upload" = {
|
||||
provider = "null";
|
||||
type = "resource";
|
||||
inputs.triggers = cfg.tf.triggers.upload;
|
||||
provisioners = [
|
||||
{
|
||||
type = "local-exec";
|
||||
local-exec = {
|
||||
working_dir = builtins.toString tf.terraform.dataDir;
|
||||
command = ''
|
||||
${pkgs.esphome}/bin/esphome compile ${closureConfig} ${tf.resources."${name}-secrets".refAttr "filename"}
|
||||
${pkgs.esphome}/bin/esphome upload ${closureConfig} ${tf.resources."${name}-secrets".refAttr "filename"} --device ${name}.local
|
||||
'';
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
(mkIf (config.secrets != {}) {
|
||||
deploy.tf.variables = mapAttrs' (name: content: let
|
||||
parts = if hasInfix "#" content then splitString "#" content else content;
|
||||
field = head (reverseList parts);
|
||||
path = if length parts > 1 then head parts else "password";
|
||||
in nameValuePair "${config.esphome.name}-secret-${name}" ({
|
||||
value.shellCommand = let
|
||||
bitw = pkgs.writeShellScriptBin "bitw" ''${pkgs.rbw-bitw}/bin/bitw -p gpg://${meta.network.nodes.all.${builtins.getEnv "HOME_HOSTNAME"}.secrets.repo.bitw.source} "$@"'';
|
||||
in "${bitw}/bin/bitw get ${path} -f ${field}";
|
||||
type = "string";
|
||||
sensitive = true;
|
||||
})
|
||||
) config.secrets;
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
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