Compare commits
8 Commits
5fca31d1ee
...
fa9414149d
| Author | SHA1 | Date | |
|---|---|---|---|
|
fa9414149d
|
|||
|
20a83ab018
|
|||
|
1652c11c12
|
|||
|
b905fc39ea
|
|||
|
3c3caa6750
|
|||
|
4d752e0ab4
|
|||
|
141207707c
|
|||
|
9cb759f56e
|
@@ -33,6 +33,7 @@
|
|||||||
};
|
};
|
||||||
hardware = {
|
hardware = {
|
||||||
bluetooth.enable = true;
|
bluetooth.enable = true;
|
||||||
|
fingerprint.enable = true;
|
||||||
input = {
|
input = {
|
||||||
corne.allowHidAccess = true;
|
corne.allowHidAccess = true;
|
||||||
ibmTrackpoint.disable = true;
|
ibmTrackpoint.disable = true;
|
||||||
|
|||||||
@@ -46,11 +46,14 @@
|
|||||||
|
|
||||||
mySystem = {
|
mySystem = {
|
||||||
boot = {
|
boot = {
|
||||||
|
plymouth.enable = true;
|
||||||
|
kernel = {
|
||||||
|
cpuVendor = "amd";
|
||||||
|
v4l2loopback.enable = true;
|
||||||
extraModprobeConfig = ''
|
extraModprobeConfig = ''
|
||||||
options snd_usb_audio vid=0x1235 pid=0x8212 device_setup=1
|
options snd_usb_audio vid=0x1235 pid=0x8212 device_setup=1
|
||||||
'';
|
'';
|
||||||
plymouth.enable = true;
|
};
|
||||||
kernel.cpuVendor = "amd";
|
|
||||||
systemd-boot = true;
|
systemd-boot = true;
|
||||||
};
|
};
|
||||||
desktop = {
|
desktop = {
|
||||||
@@ -103,13 +106,13 @@
|
|||||||
programs.steam.enable = true;
|
programs.steam.enable = true;
|
||||||
services = {
|
services = {
|
||||||
fwupd.enable = true;
|
fwupd.enable = true;
|
||||||
|
languagetool.enable = true;
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
ssh.enable = true;
|
ssh.enable = true;
|
||||||
sunshine = {
|
sunshine = {
|
||||||
enable = true;
|
enable = true;
|
||||||
autostart = true;
|
autostart = true;
|
||||||
};
|
};
|
||||||
languagetool.enable = true;
|
|
||||||
};
|
};
|
||||||
users = {
|
users = {
|
||||||
root.disablePassword = true;
|
root.disablePassword = true;
|
||||||
|
|||||||
@@ -8,13 +8,6 @@ with lib; let
|
|||||||
cfg = config.mySystem.boot;
|
cfg = config.mySystem.boot;
|
||||||
in {
|
in {
|
||||||
options.mySystem.boot = {
|
options.mySystem.boot = {
|
||||||
extraModprobeConfig = mkOption {
|
|
||||||
type = types.lines;
|
|
||||||
default = "";
|
|
||||||
example = ''
|
|
||||||
options snd_usb_audio vid=0x1235 pid=0x8212 device_setup=1
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
kernel = {
|
kernel = {
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.raw;
|
type = types.raw;
|
||||||
@@ -29,12 +22,15 @@ in {
|
|||||||
type = types.enum ["intel" "amd"];
|
type = types.enum ["intel" "amd"];
|
||||||
default = "amd";
|
default = "amd";
|
||||||
};
|
};
|
||||||
v4l2loopback = mkOption {
|
v4l2loopback.enable = mkEnableOption "Enables v4l2loopback kernel module";
|
||||||
description = "Enables v4l2loopback";
|
|
||||||
type = types.bool;
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
hardened = mkEnableOption "Enables hardened Linux kernel";
|
hardened = mkEnableOption "Enables hardened Linux kernel";
|
||||||
|
extraModprobeConfig = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
example = ''
|
||||||
|
options snd_usb_audio vid=0x1235 pid=0x8212 device_setup=1
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
systemd-boot = mkOption {
|
systemd-boot = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
@@ -64,6 +60,10 @@ in {
|
|||||||
then "amdgpu"
|
then "amdgpu"
|
||||||
else "i915"
|
else "i915"
|
||||||
);
|
);
|
||||||
|
extraModulePackages = lists.optional cfg.kernel.v4l2loopback.enable config.boot.kernelPackages.v4l2loopback;
|
||||||
|
extraModulePackages =
|
||||||
|
strings.concatLines (strings.optionalString cfg.kernel.v4l2loopback.enable "options v4l2loopback exclusive_caps=1 devices=1 video_nr=0 card_label=" "OBS Studio" "")
|
||||||
|
cfg.kernel.extraModprobeConfig;
|
||||||
loader = {
|
loader = {
|
||||||
systemd-boot.enable = cfg.systemd-boot;
|
systemd-boot.enable = cfg.systemd-boot;
|
||||||
efi.canTouchEfiVariables = cfg.systemd-boot;
|
efi.canTouchEfiVariables = cfg.systemd-boot;
|
||||||
@@ -80,7 +80,6 @@ in {
|
|||||||
kernelModules =
|
kernelModules =
|
||||||
cfg.kernel.modules
|
cfg.kernel.modules
|
||||||
++ ["kvm-${cfg.kernel.cpuVendor}"]
|
++ ["kvm-${cfg.kernel.cpuVendor}"]
|
||||||
++ lists.optional cfg.kernel.v4l2loopback "v4l2loopback"
|
|
||||||
++ lists.optional cfg.kernel.hardened "tcp_bbr";
|
++ lists.optional cfg.kernel.hardened "tcp_bbr";
|
||||||
kernel.sysctl = mkIf cfg.kernel.hardened {
|
kernel.sysctl = mkIf cfg.kernel.hardened {
|
||||||
"kernel.sysrq" = 0; # Disable magic SysRq key
|
"kernel.sysrq" = 0; # Disable magic SysRq key
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./amdgpu.nix
|
./amdgpu.nix
|
||||||
./bluetooth.nix
|
./bluetooth.nix
|
||||||
|
./fingerprint.nix
|
||||||
./sound.nix
|
./sound.nix
|
||||||
./input
|
./input
|
||||||
];
|
];
|
||||||
|
|||||||
12
system/hardware/fingerprint.nix
Normal file
12
system/hardware/fingerprint.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: with lib; let
|
||||||
|
cfg = config.mySystem.hardware.fingerprint;
|
||||||
|
in {
|
||||||
|
options.mySystem.hardware.fingerprint.enable = mkEnableOption "Enable fingerprint reader";
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
hardware.facter.detected.fingerprint.enable = cfg.enable;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,10 +1,22 @@
|
|||||||
{pkgs, ...}: {
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (config.home) gpuType;
|
||||||
|
in
|
||||||
|
{
|
||||||
programs.btop = {
|
programs.btop = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.btop.override {
|
package =
|
||||||
rocmSupport = true;
|
if gpuType != null then
|
||||||
cudaSupport = true;
|
pkgs.btop.override {
|
||||||
};
|
rocmSupport = gpuType == "amd";
|
||||||
|
cudaSupport = gpuType == "nvidia";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
pkgs.btop;
|
||||||
settings = {
|
settings = {
|
||||||
color_theme = "${pkgs.btop}/share/btop/themes/nord.theme";
|
color_theme = "${pkgs.btop}/share/btop/themes/nord.theme";
|
||||||
cpu_bottom = false;
|
cpu_bottom = false;
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
{pkgs, ...}:
|
{pkgs, ...}:
|
||||||
pkgs.writeShellScriptBin "mp42webm" ''
|
pkgs.writeShellScriptBin "mp42webm" ''
|
||||||
${pkgs.ffmpeg}/bin/ffmpeg -i "$1" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "$1".webm''
|
${pkgs.ffmpeg}/bin/ffmpeg -i "$1" -c:v libvpx -crf 10 -b:v 1M -c:a -hwaccel=auto libvorbis "$1".webm''
|
||||||
|
|||||||
@@ -1,16 +1,40 @@
|
|||||||
{pkgs, ...}:
|
{pkgs, ...}:
|
||||||
pkgs.writeShellScriptBin "plock" ''
|
pkgs.writeShellScriptBin "plock" ''
|
||||||
|
LOG_FILE="$HOME/.local/share/plock.log"
|
||||||
|
|
||||||
|
logger() {
|
||||||
|
local level="$1"
|
||||||
|
local message="$2"
|
||||||
|
local timestamp
|
||||||
|
timestamp=$(date +"%Y-%m-%d %H:%M:%S")
|
||||||
|
printf "[%s] [%-7s] %s\n" "$timestamp" "''${level^^}" "$message" >> "$LOG_FILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
CAELESTIA_ACTIVE=$(systemctl --user is-active caelestia.service)
|
||||||
|
logger debug "Caelestia activity: $CAELESTIA_ACTIVE"
|
||||||
|
if systemctl --user is-active caelestia.service | grep 'active' &> /dev/null ; then
|
||||||
|
logger info "locking Caelestia session"
|
||||||
|
caelestia shell lock lock || \
|
||||||
|
logger error "failed to lock Caelestia session"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
TMPBG="/tmp/screen.png"
|
TMPBG="/tmp/screen.png"
|
||||||
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
|
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
|
||||||
|
logger info "wayland session detected"
|
||||||
SCREENER=${pkgs.grim}/bin/grim
|
SCREENER=${pkgs.grim}/bin/grim
|
||||||
LOCKER="${pkgs.swaylock}/bin/swaylock -feF"
|
LOCKER="${pkgs.swaylock}/bin/swaylock -feF"
|
||||||
else
|
else
|
||||||
|
logger info "x11 session detected"
|
||||||
SCREENER=${pkgs.scrot}/bin/scrot
|
SCREENER=${pkgs.scrot}/bin/scrot
|
||||||
LOCKER="${pkgs.i3lock}/bin/i3lock -ef"
|
LOCKER="${pkgs.i3lock}/bin/i3lock -ef"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$SCREENER "$TMPBG"
|
$SCREENER "$TMPBG"
|
||||||
${pkgs.corrupter}/bin/corrupter -add 0 "$TMPBG" "$TMPBG"
|
logger info "generating lock screen image"
|
||||||
|
${pkgs.corrupter}/bin/corrupter -add 0 "$TMPBG" "$TMPBG" || logger error "failed to generate lock screen image"
|
||||||
|
logger info "locking screen"
|
||||||
|
logger debug "locking screen with command `''${SCREENER}`"
|
||||||
$LOCKER -ti "$TMPBG"
|
$LOCKER -ti "$TMPBG"
|
||||||
rm "$TMPBG"
|
rm "$TMPBG"
|
||||||
''
|
''
|
||||||
|
|||||||
@@ -17,7 +17,14 @@ in {
|
|||||||
./shell
|
./shell
|
||||||
];
|
];
|
||||||
|
|
||||||
options.home.fullDesktop = mkEnableOption "Enable most modules";
|
options.home = {
|
||||||
|
fullDesktop = mkEnableOption "Enable most modules";
|
||||||
|
gpuType = mkOption {
|
||||||
|
type = types.nullOr (types.enum ["nvidia" "amd" "intel"]);
|
||||||
|
default = null;
|
||||||
|
example = "amd";
|
||||||
|
};
|
||||||
|
};
|
||||||
config.home = {
|
config.home = {
|
||||||
cli.fullDesktop = mkDefault cfg.fullDesktop;
|
cli.fullDesktop = mkDefault cfg.fullDesktop;
|
||||||
desktop.fullDesktop = mkDefault cfg.fullDesktop;
|
desktop.fullDesktop = mkDefault cfg.fullDesktop;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ in {
|
|||||||
wallpapers = true;
|
wallpapers = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
osd.enableMicrophone = true;
|
||||||
bar = {
|
bar = {
|
||||||
status = {
|
status = {
|
||||||
showAudio = true;
|
showAudio = true;
|
||||||
@@ -59,7 +60,9 @@ in {
|
|||||||
};
|
};
|
||||||
tray.compact = true;
|
tray.compact = true;
|
||||||
};
|
};
|
||||||
services.gpuType = "amd";
|
services = mkIf (config.home.gpuType != null) {
|
||||||
|
inherit (config.home) gpuType;
|
||||||
|
};
|
||||||
session.commands = {
|
session.commands = {
|
||||||
logout = ["uwsm" "stop"];
|
logout = ["uwsm" "stop"];
|
||||||
shutdown = ["systemctl" "poweroff"];
|
shutdown = ["systemctl" "poweroff"];
|
||||||
|
|||||||
@@ -172,6 +172,8 @@ in {
|
|||||||
bind = SUPER_SHIFT, minus, movetoworkspace, 8
|
bind = SUPER_SHIFT, minus, movetoworkspace, 8
|
||||||
bind = SUPER_SHIFT, slash, movetoworkspace, 9
|
bind = SUPER_SHIFT, slash, movetoworkspace, 9
|
||||||
bind = SUPER_SHIFT, asterisk, movetoworkspace, 10
|
bind = SUPER_SHIFT, asterisk, movetoworkspace, 10
|
||||||
|
|
||||||
|
env = XCURSOR_SIZE,12
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,15 +8,15 @@ with lib; let
|
|||||||
cfg = config.home.dev.ai;
|
cfg = config.home.dev.ai;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./ollama.nix
|
|
||||||
./claude.nix
|
./claude.nix
|
||||||
|
./ollama.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.home.dev.ai.enable = mkEnableOption "Enables AI features";
|
options.home.dev.ai.enable = mkEnableOption "Enables AI features";
|
||||||
config.home = mkIf cfg.enable {
|
config.home = mkIf cfg.enable {
|
||||||
dev.ai = {
|
dev.ai = {
|
||||||
ollama.enable = mkDefault cfg.enable;
|
|
||||||
claude.enable = mkDefault cfg.enable;
|
claude.enable = mkDefault cfg.enable;
|
||||||
|
ollama.enable = mkDefault cfg.enable;
|
||||||
};
|
};
|
||||||
packages = [pkgs.lmstudio];
|
packages = [pkgs.lmstudio];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ in {
|
|||||||
force-seekable = true; # force streams to be seekable
|
force-seekable = true; # force streams to be seekable
|
||||||
slang = "jpn,jp,eng,en,fra,fr";
|
slang = "jpn,jp,eng,en,fra,fr";
|
||||||
alang = "eng,en,fra,fr";
|
alang = "eng,en,fra,fr";
|
||||||
gpu-api = "vulkan";
|
gpu-api = "auto";
|
||||||
osc = true;
|
osc = true;
|
||||||
profile = "gpu-hq";
|
profile = "gpu-hq";
|
||||||
# geometry = "50%x50%";
|
# geometry = "50%x50%";
|
||||||
|
|||||||
@@ -63,7 +63,13 @@
|
|||||||
LSP_USE_PLISTS = "true";
|
LSP_USE_PLISTS = "true";
|
||||||
OPENAI_API_URL = "http://localhost:1234/";
|
OPENAI_API_URL = "http://localhost:1234/";
|
||||||
};
|
};
|
||||||
desktop.caelestia.enable = true;
|
desktop = {
|
||||||
|
caelestia.enable = true;
|
||||||
|
spotify = {
|
||||||
|
enable = true;
|
||||||
|
spicetify.enable = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
dev = {
|
dev = {
|
||||||
ai.claude.enable = true;
|
ai.claude.enable = true;
|
||||||
editors.emacs.package = emacsPackage;
|
editors.emacs.package = emacsPackage;
|
||||||
|
|||||||
@@ -5,4 +5,5 @@
|
|||||||
desktop.hyprland.host = "gampo";
|
desktop.hyprland.host = "gampo";
|
||||||
phundrak.sshKey.content = builtins.readFile ../keys/id_gampo.pub;
|
phundrak.sshKey.content = builtins.readFile ../keys/id_gampo.pub;
|
||||||
};
|
};
|
||||||
|
programs.caelestia.settings.bar.persistent = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{config, ...}: {
|
{config, ...}: {
|
||||||
imports = [../home.nix];
|
imports = [../home.nix];
|
||||||
home = {
|
home = {
|
||||||
|
gpuType = "amd";
|
||||||
cli.nh.flake = "${config.home.homeDirectory}/.dotfiles";
|
cli.nh.flake = "${config.home.homeDirectory}/.dotfiles";
|
||||||
dev.ai = {
|
dev.ai = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -9,4 +10,8 @@
|
|||||||
desktop.hyprland.host = "marpa";
|
desktop.hyprland.host = "marpa";
|
||||||
phundrak.sshKey.content = builtins.readFile ../keys/id_marpa.pub;
|
phundrak.sshKey.content = builtins.readFile ../keys/id_marpa.pub;
|
||||||
};
|
};
|
||||||
|
programs.caelestia.settings.bar = {
|
||||||
|
showBattery = false;
|
||||||
|
showWifi = false;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
fullscreen = import ./fullscreen.nix {inherit pkgs;};
|
fullscreen = import ./fullscreen.nix {inherit pkgs;};
|
||||||
logout = import ./logout.nix {inherit pkgs;};
|
logout = import ./logout.nix {inherit pkgs;};
|
||||||
ytplay = import ../../modules/cli/scripts/ytplay.nix {inherit pkgs;};
|
ytplay = import ../../modules/cli/scripts/ytplay.nix {inherit pkgs;};
|
||||||
|
plock = import ../../modules/cli/scripts/plock.nix {inherit pkgs;};
|
||||||
in [
|
in [
|
||||||
{
|
{
|
||||||
key = "a";
|
key = "a";
|
||||||
@@ -165,6 +166,11 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
key = "l";
|
||||||
|
desc = "Lock session";
|
||||||
|
cmd = "${plock}/bin/plock";
|
||||||
|
}
|
||||||
{
|
{
|
||||||
key = "p";
|
key = "p";
|
||||||
desc = "Power";
|
desc = "Power";
|
||||||
|
|||||||
Reference in New Issue
Block a user