Compare commits

...

7 Commits

15 changed files with 100 additions and 32 deletions

View File

@@ -46,11 +46,14 @@
mySystem = {
boot = {
extraModprobeConfig = ''
options snd_usb_audio vid=0x1235 pid=0x8212 device_setup=1
'';
plymouth.enable = true;
kernel.cpuVendor = "amd";
kernel = {
cpuVendor = "amd";
v4l2loopback.enable = true;
extraModprobeConfig = ''
options snd_usb_audio vid=0x1235 pid=0x8212 device_setup=1
'';
};
systemd-boot = true;
};
desktop = {
@@ -103,13 +106,13 @@
programs.steam.enable = true;
services = {
fwupd.enable = true;
languagetool.enable = true;
printing.enable = true;
ssh.enable = true;
sunshine = {
enable = true;
autostart = true;
};
languagetool.enable = true;
};
users = {
root.disablePassword = true;

23
packages/handy.nix Normal file
View File

@@ -0,0 +1,23 @@
{
appimageTools,
fetchurl,
lib,
}: let
name = "Handy";
pname = lib.strings.toLower name;
version = "0.7.6";
src = fetchurl {
url = "https://github.com/cjpais/${name}/releases/download/v${version}/${name}_${version}_amd64.AppImage";
hash = "sha256-UZNt3lfKo6dBRWK1YD03HmcZsx/Zu2J3eD5VdTw+poU=";
};
appimageContent = appimageTools.extractType2 {inherit pname version src;};
in
appimageTools.wrapType2 {
inherit pname version src;
extraPkgs = pkgs: [pkgs.wtype];
extraInstallCommands = ''
install -m 444 -D ${appimageContent}/${name}.desktop $out/share/applications/${name}.desktop
install -m 444 -D ${appimageContent}/${name}.png $out/share/icons/hicolor/256x256/apps/${name}.png
install -m 444 -D ${appimageContent}/${pname}.png $out/share/icons/hicolor/256x256/apps/${pname}.png
'';
}

View File

@@ -8,13 +8,6 @@ with lib; let
cfg = config.mySystem.boot;
in {
options.mySystem.boot = {
extraModprobeConfig = mkOption {
type = types.lines;
default = "";
example = ''
options snd_usb_audio vid=0x1235 pid=0x8212 device_setup=1
'';
};
kernel = {
package = mkOption {
type = types.raw;
@@ -29,12 +22,15 @@ in {
type = types.enum ["intel" "amd"];
default = "amd";
};
v4l2loopback = mkOption {
description = "Enables v4l2loopback";
type = types.bool;
default = true;
};
v4l2loopback.enable = mkEnableOption "Enables v4l2loopback kernel module";
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 {
type = types.bool;
@@ -64,6 +60,10 @@ in {
then "amdgpu"
else "i915"
);
extraModprobeConfig =
strings.concatLines
([cfg.kernel.extraModprobeConfig]
++ lists.optional cfg.kernel.v4l2loopback.enable ''options v4l2loopback exclusive_caps=1 devices=1 video_nr=0 card_label="OBS Studio"'');
loader = {
systemd-boot.enable = cfg.systemd-boot;
efi.canTouchEfiVariables = cfg.systemd-boot;
@@ -80,7 +80,6 @@ in {
kernelModules =
cfg.kernel.modules
++ ["kvm-${cfg.kernel.cpuVendor}"]
++ lists.optional cfg.kernel.v4l2loopback "v4l2loopback"
++ lists.optional cfg.kernel.hardened "tcp_bbr";
kernel.sysctl = mkIf cfg.kernel.hardened {
"kernel.sysrq" = 0; # Disable magic SysRq key

View File

@@ -1,10 +1,20 @@
{pkgs, ...}: {
{
pkgs,
config,
...
}: let
inherit (config.home) gpuType;
in {
programs.btop = {
enable = true;
package = pkgs.btop.override {
rocmSupport = true;
cudaSupport = true;
};
package =
if gpuType != null
then
pkgs.btop.override {
rocmSupport = gpuType == "amd";
cudaSupport = gpuType == "nvidia";
}
else pkgs.btop;
settings = {
color_theme = "${pkgs.btop}/share/btop/themes/nord.theme";
cpu_bottom = false;

View File

@@ -1,3 +1,3 @@
{pkgs, ...}:
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''

View File

@@ -17,7 +17,14 @@ in {
./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 = {
cli.fullDesktop = mkDefault cfg.fullDesktop;
desktop.fullDesktop = mkDefault cfg.fullDesktop;

View File

@@ -52,6 +52,7 @@ in {
wallpapers = true;
};
};
osd.enableMicrophone = true;
bar = {
status = {
showAudio = true;
@@ -59,7 +60,9 @@ in {
};
tray.compact = true;
};
services.gpuType = "amd";
services = mkIf (config.home.gpuType != null) {
inherit (config.home) gpuType;
};
session.commands = {
logout = ["uwsm" "stop"];
shutdown = ["systemctl" "poweroff"];

View File

@@ -172,6 +172,8 @@ in {
bind = SUPER_SHIFT, minus, movetoworkspace, 8
bind = SUPER_SHIFT, slash, movetoworkspace, 9
bind = SUPER_SHIFT, asterisk, movetoworkspace, 10
env = XCURSOR_SIZE,12
'';
};
};

View File

@@ -8,15 +8,15 @@ with lib; let
cfg = config.home.dev.ai;
in {
imports = [
./ollama.nix
./claude.nix
./ollama.nix
];
options.home.dev.ai.enable = mkEnableOption "Enables AI features";
config.home = mkIf cfg.enable {
dev.ai = {
ollama.enable = mkDefault cfg.enable;
claude.enable = mkDefault cfg.enable;
ollama.enable = mkDefault cfg.enable;
};
packages = [pkgs.lmstudio];
};

View File

@@ -15,7 +15,7 @@ in {
force-seekable = true; # force streams to be seekable
slang = "jpn,jp,eng,en,fra,fr";
alang = "eng,en,fra,fr";
gpu-api = "vulkan";
gpu-api = "auto";
osc = true;
profile = "gpu-hq";
# geometry = "50%x50%";

View File

@@ -63,7 +63,13 @@
LSP_USE_PLISTS = "true";
OPENAI_API_URL = "http://localhost:1234/";
};
desktop.caelestia.enable = true;
desktop = {
caelestia.enable = true;
spotify = {
enable = true;
spicetify.enable = false;
};
};
dev = {
ai.claude.enable = true;
editors.emacs.package = emacsPackage;

View File

@@ -5,4 +5,5 @@
desktop.hyprland.host = "gampo";
phundrak.sshKey.content = builtins.readFile ../keys/id_gampo.pub;
};
programs.caelestia.settings.bar.persistent = false;
}

View File

@@ -1,6 +1,7 @@
{config, ...}: {
imports = [../home.nix];
home = {
gpuType = "amd";
cli.nh.flake = "${config.home.homeDirectory}/.dotfiles";
dev.ai = {
enable = true;
@@ -9,4 +10,8 @@
desktop.hyprland.host = "marpa";
phundrak.sshKey.content = builtins.readFile ../keys/id_marpa.pub;
};
programs.caelestia.settings.bar = {
showBattery = false;
showWifi = false;
};
}

View File

@@ -6,6 +6,9 @@
}:
with lib; let
inherit (pkgs.stdenv.hostPlatform) system;
handy = pkgs.callPackage ../../packages/handy.nix {};
pumo-system-info = inputs.pumo-system-info.packages.${system}.default;
zen = inputs.zen-browser.packages.${system}.default;
in {
programs.bun.enable = true;
home.packages = with pkgs; [
@@ -40,14 +43,15 @@ in {
# Misc
bitwarden-desktop
gplates
handy
libnotify
nextcloud-client
onlyoffice-desktopeditors
pumo-system-info
scrcpy
syncthing
watchmate
inputs.zen-browser.packages.${system}.default
inputs.pumo-system-info.packages.${system}.default
zen
# Games
atlauncher

View File

@@ -57,6 +57,11 @@
desc = "Gimp";
cmd = "${pkgs.gimp}/bin/gimp";
}
{
key = "h";
desc = "Handy";
cmd = "pkill -USR2 -n handy";
}
{
key = "n";
desc = "Nemo";