Files
nix-flake/modules/hosts/takamaki/takamaki.nix
T
greyweather 06e958ae71 fix problems rebuilding, make niri and noctalia more HM friendly
added `inputs` to `extraSpecialArgs`, giving homeModules access to helper functions
cleaned up the logic for the stylix file, removing the final `sharedModules` in the process in favour of `home-manager.users.grey`
2026-08-30 00:31:13 +01:00

87 lines
2.8 KiB
Nix

{ inputs, self, ... }: {
flake.homeConfigurations.takamaki = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
modules = with self.homeModules; [
takamaki
];
extraSpecialArgs = { inherit inputs; };
};
flake.homeModules.takamaki = { pkgs, config, lib, ... }: {
imports = with self.homeModules; [
global
graphics
];
info = {
rootPath = "/home/grey/flake";
hostName = "takamaki";
stateVersion = "26.11";
};
services.gpg-agent = {
enable = true;
extraConfig = ''
pinentry-program /usr/bin/pinentry
'';
};
features = {
shells.zsh = {
enable = true;
antidote.enable = true;
};
applications = {
cli = {
fastfetch.enable = true;
};
gui = {
vscode.enable = true;
};
extraPackages = with pkgs; [
(writeShellScriptBin "switch-os" ''
sudo efibootmgr --bootnext 0000
sudo reboot
'')
(writeShellScriptBin "universal-reboot" ''
sudo reboot
'')
(writeShellScriptBin "universal-shutdown" ''
sudo systemctl poweroff
'')
(writeShellScriptBin "increase-brightness" ''
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//')
while
RESULT=$(sudo ddccontrol -r 0x10 -W +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))
[[ "$WRITTEN" != "$CONTROL" ]] && [ $LOOP_COUNTER -lt 5 ]
do true; done
noctalia msg notification-show "Set brightness to $WRITTEN for display $PRETTY_NAME"
'')
(writeShellScriptBin "decrease-brightness" ''
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//')
while
RESULT=$(sudo ddccontrol -r 0x10 -W -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))
[[ "$WRITTEN" != "$CONTROL" ]] && [ $LOOP_COUNTER -lt 5 ]
do true; done
noctalia msg notification-show "Set brightness to $WRITTEN for display $PRETTY_NAME"
'')
];
};
};
};
}