Files
nix-flake/modules/hosts/takamaki/takamaki.nix
T

143 lines
3.8 KiB
Nix

{ inputs, self, ... }: {
flake.homeConfigurations."grey@takamaki" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
modules = [
self.homeModules."grey@takamaki"
inputs.stylix.homeModules.stylix
];
extraSpecialArgs = { inherit inputs; };
};
flake.homeModules."grey@takamaki" = { pkgs, config, lib, ... }: let
pkgsCross = import inputs.nixpkgs {
localSystem = "x86_64-linux";
hostSystem = "x86_64-linux";
crossSystem = "i686-linux";
};
steam-overriden-desktop-file = pkgs.runCommand "modifySteamDesktopFile" {} ''
sed 's@Exec=/usr/bin/steam@Exec=env LD_PRELOAD=${pkgsCross.extest}/lib/libextest.so /usr/bin/steam@' ${self}/assets/steam.desktop.example > $out
'';
in {
imports = with self.homeModules; [
global
audio
graphics
];
info = {
rootPath = "/home/grey/flake";
hostName = "takamaki";
stateVersion = "26.11";
};
services.gpg-agent = {
enable = true;
extraConfig = ''
pinentry-program /usr/bin/pinentry
'';
};
xdg.dataFile."applications/steam.desktop".source = steam-overriden-desktop-file;
xdg.configFile."autostart/steam.desktop" = {
source = steam-overriden-desktop-file;
force = true;
};
components = {
windowManagers = "niri";
shells = "noctalia";
};
features = {
shells.zsh = {
enable = true;
antidote.enable = true;
};
services = {
easyeffects.enable = true;
};
applications = {
cli = {
fastfetch.enable = true;
color-converter.enable = true;
nh.enable = true;
};
gui = {
vscode.enable = true;
equibop.enable = true;
kitty.enable = true;
spotify = {
enable = true;
spicetify = {
enable = true;
theme = "comfy";
};
};
};
extraPackages = with pkgs; [
nix-init
github-desktop
];
shellScripts = let
mkBrightnessScript = direction: ''
LOOP_COUNTER=0
DEVICE=$1
PRETTY_NAME=$(sudo ddccontrol dev:$DEVICE 2>&1 >/dev/null | grep -oP "/usr/share/ddccontrol-db/monitor/\K.+\.xml" | sed 's/.xml//')
WRITTEN="foo"
CONTROL="bar"
while [[ "$WRITTEN" != "$CONTROL" ]] && [ $LOOP_COUNTER -lt 3 ]; do
RESULT=$(sudo ddccontrol -r 0x10 -W ${direction}5 dev:$DEVICE 2> /dev/null)
WRITTEN=$(echo $RESULT | grep -oP "Writing.+\(\K\d{1,3}\)" | sed 's/)//')
CONTROL=$(echo $RESULT | grep -oP "Control.+\+/\K\d{1,3}/100" | sed 's/\/100//')
LOOP_COUNTER=$(($LOOP_COUNTER + 1))
done
noctalia msg notification-show "Set brightness to $WRITTEN for display $PRETTY_NAME"
'';
in {
switch-os = ''
sudo efibootmgr --bootnext 0000
sudo reboot
'';
universal-reboot = ''
sudo reboot
'';
universal-shutdown = ''
sudo systemctl poweroff
'';
toggle-easyeffects = lib.mkIf (config.features.services.easyeffects.enable) ''
bypass_value=$(easyeffects -b 3)
if [ "$bypass_value" = "1" ]; then
easyeffects -b 2
else
easyeffects -b 1
fi
'';
increase-brightness = mkBrightnessScript "+";
decrease-brightness = mkBrightnessScript "-";
};
};
};
programs.ssh.settings = {
"sakamoto" = {
HostName = "192.168.0.40";
Port = "22";
User = "grey";
IdentityFile = "~/.ssh/id_sakamoto";
};
};
};
}