mirror of
https://github.com/ItsDrike/nixdots
synced 2024-11-14 03:37:18 +00:00
Compare commits
4 commits
7a79342f93
...
47d070ce5e
Author | SHA1 | Date | |
---|---|---|---|
ItsDrike | 47d070ce5e | ||
ItsDrike | 2acdfac532 | ||
ItsDrike | 1440de4713 | ||
ItsDrike | 0699de3cbe |
|
@ -7,6 +7,7 @@ the window names. Window name and class are obtained from piped stdin, to preven
|
||||||
needlessly keep restarting this program, which takes a while due to the interpreter starting
|
needlessly keep restarting this program, which takes a while due to the interpreter starting
|
||||||
overhead.
|
overhead.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
@ -64,7 +65,7 @@ REMAP_RULES: list[RemapRule] = [
|
||||||
RemapRule(r"(?:\(\d+\) )?Discord \| (.+)", " {}", "vesktop"),
|
RemapRule(r"(?:\(\d+\) )?Discord \| (.+)", " {}", "vesktop"),
|
||||||
RemapRule(r"(.+) - mpv", " {}", "mpv"),
|
RemapRule(r"(.+) - mpv", " {}", "mpv"),
|
||||||
RemapRule(r"Stremio - (.+)", " Stremio - {}", r"(Stremio)|(com.stremio.stremio)"),
|
RemapRule(r"Stremio - (.+)", " Stremio - {}", r"(Stremio)|(com.stremio.stremio)"),
|
||||||
RemapRule(r"Spotify", " Spotify", "Spotify"),
|
RemapRule(r"Spotify((?: Premium)?)", " Spotify{}", "[Ss]potify"),
|
||||||
RemapRule(r"pulsemixer", " Pulsemixer"),
|
RemapRule(r"pulsemixer", " Pulsemixer"),
|
||||||
RemapRule(r"(.*)", " {}", "Pcmanfm"),
|
RemapRule(r"(.*)", " {}", "Pcmanfm"),
|
||||||
RemapRule(r"(.*)", " {}", "pcmanfm-qt"),
|
RemapRule(r"(.*)", " {}", "pcmanfm-qt"),
|
||||||
|
@ -81,7 +82,9 @@ def iter_window() -> Iterator[tuple[str, str]]:
|
||||||
line = line.removesuffix("\n")
|
line = line.removesuffix("\n")
|
||||||
els = line.split(",", maxsplit=1)
|
els = line.split(",", maxsplit=1)
|
||||||
if len(els) != 2:
|
if len(els) != 2:
|
||||||
raise ValueError(f"Expected 2 arguments from stdin line (name, class), but got {len(els)}")
|
raise ValueError(
|
||||||
|
f"Expected 2 arguments from stdin line (name, class), but got {len(els)}"
|
||||||
|
)
|
||||||
yield els[1], els[0]
|
yield els[1], els[0]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -54,29 +54,42 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
persistentMountPoint = "/persist/home";
|
persistentMountPoint = "/persist/home";
|
||||||
extraDirectories = [
|
extraDirectories = [
|
||||||
|
# Nixos flake
|
||||||
|
"dots"
|
||||||
|
|
||||||
|
# Personal data
|
||||||
"Downloads"
|
"Downloads"
|
||||||
"Personal"
|
"Personal"
|
||||||
"Media"
|
"Media"
|
||||||
"dots"
|
|
||||||
|
|
||||||
|
# Browsers
|
||||||
".mozilla"
|
".mozilla"
|
||||||
".mullvad"
|
".mullvad"
|
||||||
".config/chromium"
|
".config/chromium"
|
||||||
|
|
||||||
|
# Applications
|
||||||
".config/spotify"
|
".config/spotify"
|
||||||
".config/vesktop"
|
".config/vesktop"
|
||||||
|
".local/share/Smart Code ltd/Stremio"
|
||||||
|
|
||||||
|
# Tools
|
||||||
".local/share/gnupg"
|
".local/share/gnupg"
|
||||||
".local/share/zoxide"
|
".local/share/zoxide"
|
||||||
".local/share/wakatime"
|
".local/share/wakatime"
|
||||||
".local/share/nvim"
|
".local/share/nvim"
|
||||||
".local/state/nvim"
|
".local/state/nvim"
|
||||||
".local/share/zsh"
|
|
||||||
".local/share/Smart Code ltd/Stremio"
|
# Services
|
||||||
|
".local/state/wireplumber" # volume settings
|
||||||
|
|
||||||
|
# Language package managers
|
||||||
".local/share/cargo"
|
".local/share/cargo"
|
||||||
".local/share/go"
|
".local/share/go"
|
||||||
];
|
];
|
||||||
extraFiles = [
|
extraFiles = [
|
||||||
".config/git/git-credentials"
|
".config/git/git-credentials"
|
||||||
".cache/walker/history.gob"
|
".cache/walker/history.gob"
|
||||||
|
".local/share/zsh/zsh_history"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ _: {
|
||||||
./generic.nix
|
./generic.nix
|
||||||
./secure-boot.nix
|
./secure-boot.nix
|
||||||
./initrd.nix
|
./initrd.nix
|
||||||
|
./numlock.nix
|
||||||
./plymouth.nix
|
./plymouth.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
32
system/shared/boot/numlock.nix
Normal file
32
system/shared/boot/numlock.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
boot.initrd.systemd = {
|
||||||
|
# Include setleds binary in the initrd
|
||||||
|
# (the nix store doesn't exists in there yet, so we need to include
|
||||||
|
# all of the necessary binaries ahead of time here)
|
||||||
|
extraBin = {
|
||||||
|
setleds = "${pkgs.kbd}/bin/setleds";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable numlock in the early userspace (initrd)
|
||||||
|
# This will happen before we're asked for the disk decryption password
|
||||||
|
services."numlock" = {
|
||||||
|
enable = true;
|
||||||
|
description = "Activate Numlock";
|
||||||
|
wantedBy = [ "initrd.target" ];
|
||||||
|
# Delay disk decryption until this unit is started
|
||||||
|
before = [ "systemd-cryptsetup@cryptfs.service" ];
|
||||||
|
unitConfig.DefaultDependencies = "no";
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
|
# This is essentially runs the same code as present in the
|
||||||
|
# mkinitcpio-numlock hook on Arch Linux (AUR).
|
||||||
|
script = ''
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
for tty in /dev/tty{1..6}
|
||||||
|
do
|
||||||
|
/bin/setleds -D +num < "$tty";
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue