better consistency, add dotfiles for takamaki and new features

This commit is contained in:
greyweather committed 2026-08-31 01:10:23 +01:00
1 parent 023fc0c424
commit 5c2a328858
35 files changed
+2455 -190

No files matched your search

+10 -33
View File
@@ -1,33 +1,22 @@
{ inputs, self, ... }: {
{ inputs, self, ... }: let
wm-option-type = inputs.helpers.mkOptionalListOfType (inputs.helpers.mkEnumFromDirContents "${self}/modules/components/window-managers");
shell-option-type = inputs.helpers.mkOptionalListOfType (inputs.helpers.mkEnumFromDirContents "${self}/modules/components/shells");
in {
flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
options.components = {
displayManager = lib.mkOption {
# enum that dynamically populates itself with the contents of the display-managers directory
type = lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/display-managers")
));
type = inputs.helpers.mkEnumFromDirContents "${self}/modules/components/display-managers";
default = "lightdm";
};
windowManagers = lib.mkOption {
type = lib.types.either (lib.types.listOf (
lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/window-managers")
))
)) (lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/window-managers")
)));
type = wm-option-type;
default = [];
};
shells = lib.mkOption {
type = lib.types.either (lib.types.listOf (
lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/shells")
))
)) (lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/shells")
)));
type = shell-option-type;
default = [];
};
};
@@ -49,24 +38,12 @@
flake.homeModules.graphics = { config, pkgs, lib, ... }: {
options.components = {
windowManagers = lib.mkOption {
type = lib.types.either (lib.types.listOf (
lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/window-managers")
))
)) (lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/window-managers")
)));
type = wm-option-type;
default = [];
};
shells = lib.mkOption {
type = lib.types.either (lib.types.listOf (
lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/shells")
))
)) (lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/shells")
)));
type = shell-option-type;
default = [];
};
};
@@ -100,7 +77,7 @@
enable = true;
colorScheme = "dark";
gtk2.configLocation = "${config.home.homeDirectory}/.config/.gtkrc-2.0"; # prevents file conflicts between this and other parts of the nix config
gtk2.configLocation = "${config.xdg.configHome}/.gtkrc-2.0"; # prevents file conflicts between this and other parts of the nix config
gtk2.force = true;
};
};
+4 -5
View File
@@ -2,7 +2,7 @@
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
config = lib.mkIf ((config.components.shells == "noctalia")||(builtins.elem "noctalia" config.components.shells)) {
environment.systemPackages = [
inputs.noctalia.packages.${pkgs.system}.default
inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default
];
programs.noctalia.enable = true;
@@ -16,18 +16,17 @@
flake.homeModules.graphics = { pkgs, config, lib, inputs, ... }: {
config = lib.mkIf ((config.components.shells == "noctalia")||(builtins.elem "noctalia" config.components.shells)) {
home = {
packages = lib.mkIf (config.info.isStandalone) [ inputs.noctalia.packages.${pkgs.system}.default ];
packages = lib.mkIf (config.info.isStandalone) [ inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default ];
activation = {
symlinkNoctaliaState = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
linkNoctaliaState = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.home.homeDirectory}/.local/state/noctalia/settings.toml";
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/noctalia/settings.toml";
});
symlinkNoctaliaStatePlugins = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
linkNoctaliaStatePlugins = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.home.homeDirectory}/.local/state/noctalia/plugins";
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/noctalia/plugins";
isDir = true;
});
};
};
+15 -19
View File
@@ -20,21 +20,19 @@
enable = true;
useNautilus = true;
# override niri source to use https://github.com/niri-wm/niri/pull/3642
package = (pkgs.niri.overrideAttrs (finalAttrs: prevAttrs:
{
cargoHash = "sha256-HypBB3PL4nVFMNH2+jEK0+dG9dJ920nHi8GwRoeH/v4=";
src = pkgs.fetchFromGitHub {
owner = "niri-wm";
repo = "niri";
rev = "cb41d54703eef73883bb2be58e19bcf3715d777c";
sha256 = "sha256-cLzTeMcCdQJ+kHGcOposjeheFyEG/tGOA1jFAORMHjI=";
};
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname src version;
hash = finalAttrs.cargoHash;
};
}
));
package = (pkgs.niri.overrideAttrs (finalAttrs: prevAttrs: {
cargoHash = "sha256-HypBB3PL4nVFMNH2+jEK0+dG9dJ920nHi8GwRoeH/v4=";
src = pkgs.fetchFromGitHub {
owner = "niri-wm";
repo = "niri";
rev = "cb41d54703eef73883bb2be58e19bcf3715d777c";
sha256 = "sha256-cLzTeMcCdQJ+kHGcOposjeheFyEG/tGOA1jFAORMHjI=";
};
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname src version;
hash = finalAttrs.cargoHash;
};
}));
};
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) {
@@ -45,10 +43,8 @@
flake.homeModules.graphics = { config, pkgs, lib, inputs, ... }: {
home = lib.mkIf ((config.components.windowManagers == "niri")||(builtins.elem "niri" config.components.windowManagers)) {
packages = lib.mkIf (config.info.isStandalone) [ pkgs.niri ];
activation.symlinkNiriConfig = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.home.homeDirectory}/.config/niri/config.kdl";
activation.linkNiriConfig = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.xdg.configHome}/niri/config.kdl";
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/niri.kdl";
});
};
@@ -0,0 +1,49 @@
{ inputs, self, ... }: let
color-converter-package = { lib, pkgs }: pkgs.python3Packages.buildPythonApplication rec {
pname = "color-converter";
version = "1.0.0";
__structuredAttrs = true;
strictDeps = true;
pyproject = false;
src = pkgs.fetchFromGitHub {
owner = "sotrali";
repo = "color-converter";
tag = "v${version}";
hash = "sha256-xvU7Z6rV+o0F9s1JBGnRWccK0JhZPL7BbPOsnZJLTJM=";
};
dontUnpack = true;
installPhase = ''
install -Dm755 "${src}/${pname}.py" "$out/bin/${pname}"
'';
meta = {
description = "A robust CLI color conversion utility";
homepage = "https://github.com/sotrali/color-converter";
changelog = "https://github.com/sotrali/color-converter/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ];
mainProgram = "color-converter";
platforms = lib.platforms.all;
};
};
in {
flake.nixosModules.global = { pkgs, lib, config, ... }: {
options.features.applications.cli.color-converter.enable = lib.mkEnableOption "color-converter";
config = lib.mkIf (config.features.applications.cli.color-converter.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
home-manager.users.grey.features.applications.cli.color-converter.enable = lib.mkDefault true;
} {
environment.systemPackages = [ (pkgs.callPackage color-converter-package {}) ];
});
};
flake.homeModules.global = { pkgs, config, lib, ... }: {
options.features.applications.cli.color-converter.enable = lib.mkEnableOption "color-converter";
config = lib.mkIf (config.features.applications.cli.color-converter.enable) {
home.packages = [ (pkgs.callPackage color-converter-package {}) ];
};
};
}
+31
View File
@@ -0,0 +1,31 @@
{ inputs, self, ... }: let
mkNhAttrs = flake: {
enable = true;
inherit flake;
clean = {
enable = true;
dates = "Sun 05:00";
extraArgs = "--keep 5 --keep-since 3d";
};
};
in {
flake.nixosModules.global = { pkgs, config, lib, ... }: {
options.features.applications.cli.nh.enable = lib.mkEnableOption "nh";
config = lib.mkIf (config.features.applications.cli.nh.enable) {
programs.nh = mkNhAttrs config.info.rootPath;
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) {
features.applications.cli.nh.enable = lib.mkDefault true;
};
};
};
flake.homeModules.global = { pkgs, config, lib, ... }: {
options.features.applications.cli.nh.enable = lib.mkEnableOption "nh";
config = lib.mkIf (config.features.applications.cli.nh.enable && config.info.isStandalone) {
programs.nh = mkNhAttrs config.info.rootPath;
};
};
}
@@ -17,17 +17,17 @@
home.activation = {
linkEquibopConfigSettings = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.home.homeDirectory}/.config/equibop/settings.json";
target = "${config.xdg.configHome}/equibop/settings.json";
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/equibop/settings.json";
});
linkEquibopConfigEquicordSettings = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.home.homeDirectory}/.config/equibop/settings/settings.json";
target = "${config.xdg.configHome}/equibop/settings/settings.json";
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/equibop/equicord-settings.json";
});
linkEquibopConfigQuickCss = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.home.homeDirectory}/.config/equibop/settings/quickCss.css";
target = "${config.xdg.configHome}/equibop/settings/quickCss.css";
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/equibop/quickCss.css";
});
};
+1 -1
View File
@@ -14,7 +14,7 @@
config = lib.mkIf (config.features.applications.gui.floorp.enable) (
let
firefox-addons = with pkgs; inputs.firefox-addons.packages.${system};
firefox-addons = with pkgs; inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system};
in {
programs.floorp = {
enable = true;
@@ -24,7 +24,6 @@
home.activation.linkRemminaPresets = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.home.homeDirectory}/.local/share/remmina";
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/remmina";
isDir = true;
});
};
};
+27 -10
View File
@@ -1,24 +1,42 @@
{ inputs, self, ... }: {
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
flake.nixosModules.graphics = { pkgs, config, lib, ... }: let
spicePkgs = inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system};
theme-option-type = with inputs.nixpkgs; lib.types.enum (builtins.attrNames spicePkgs.themes);
in {
options.features.applications.gui.spotify = {
enable = lib.mkEnableOption "spotify";
spicetify.enable = lib.mkEnableOption "spicetify";
spicetify = {
enable = lib.mkEnableOption "spicetify";
theme = lib.mkOption {
type = lib.types.nullOr (theme-option-type);
default = null;
};
};
};
config = lib.mkIf (config.features.applications.gui.spotify.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
home-manager.users.grey.features.applications.gui.spotify = {
enable = lib.mkDefault true;
spicetify.enable = lib.mkDefault config.features.applications.gui.spotify.spicetify.enable;
spicetify = lib.mkDefault config.features.applications.gui.spotify.spicetify;
};
} {
environment.systemPackages = [ pkgs.spotify ];
});
};
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
flake.homeModules.graphics = { pkgs, config, lib, ... }: let
spicePkgs = inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system};
theme-option-type = with inputs.nixpkgs; lib.types.enum (builtins.attrNames spicePkgs.themes);
in {
options.features.applications.gui.spotify = {
enable = lib.mkEnableOption "spotify";
spicetify.enable = lib.mkEnableOption "spicetify";
spicetify = {
enable = lib.mkEnableOption "spicetify";
theme = lib.mkOption {
type = lib.types.nullOr (theme-option-type);
default = null;
};
};
};
imports = [
@@ -28,13 +46,10 @@
config = lib.mkIf (config.features.applications.gui.spotify.enable) {
home.packages = lib.mkIf (!config.features.applications.gui.spotify.spicetify.enable) [ pkgs.spotify ];
programs.spicetify =
let
spicePkgs = inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in lib.mkIf (config.features.applications.gui.spotify.spicetify.enable) {
programs.spicetify = lib.mkIf (config.features.applications.gui.spotify.spicetify.enable) {
enable = true;
enabledExtensions = with spicePkgs.extensions; [
hidePodcasts
# hidePodcasts
];
enabledSnippets = with spicePkgs.snippets; [
spinningCdCoverArt
@@ -47,6 +62,8 @@
enabledCustomApps = with spicePkgs.apps; [
# marketplace
];
theme = lib.mkIf (config.features.applications.gui.spotify.spicetify.theme != null) spicePkgs.themes.${config.features.applications.gui.spotify.spicetify.theme};
windowManagerPatch = true;
};
};
};
+2 -2
View File
@@ -17,12 +17,12 @@
home.activation = {
linkVsCodeConfigSettings = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.home.homeDirectory}/.config/Code/User/settings.json";
target = "${config.xdg.configHome}/Code/User/settings.json";
source = "${config.info.rootPath}/dotfiles/global/vscode/settings.json";
});
linkVsCodeConfigKeybindings = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.home.homeDirectory}/.config/Code/User/keybindings.json";
target = "${config.xdg.configHome}/Code/User/keybindings.json";
source = "${config.info.rootPath}/dotfiles/global/vscode/keybindings.json";
});
};
-19
View File
@@ -1,19 +0,0 @@
{ inputs, self, ... }: {
flake.nixosModules.global = { pkgs, config, lib, ... }: {
options.features.nixos.nh.enable = lib.mkOption {
type = lib.types.bool;
default = true;
};
config = lib.mkIf (config.features.nixos.nh.enable) {
environment.systemPackages = [
inputs.nh.packages.${pkgs.stdenv.hostPlatform.system}.default
];
programs.nh = {
enable = true;
flake = "/home/grey/nixos";
};
};
};
}
+14
View File
@@ -0,0 +1,14 @@
{ inputs, self, ... }: {
flake.homeModules.audio = { pkgs, config, lib, ...}: {
options.features.services.easyeffects.enable = lib.mkEnableOption "easyeffects";
config = lib.mkIf (config.features.services.easyeffects.enable) {
services.easyeffects.enable = true;
home.activation.linkEasyEffectsConfig = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
target = "${config.xdg.configHome}/easyeffects/db";
source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/easyeffects";
});
};
};
}
+1 -3
View File
@@ -1,9 +1,7 @@
{ inputs, self, ... }: {
flake.nixosModules.global = { config, pkgs, lib, ... }: {
options.features.shells.defaultShell = lib.mkOption {
type = lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/features/shells")
));
type = inputs.helpers.mkEnumFromDirContents "${self}/modules/features/shells";
default = "zsh";
};
+12 -6
View File
@@ -1,6 +1,6 @@
{ inputs, self, ... }: {
flake.homeModules.global = { lib, config, pkgs, ... }: {
nix.gc = {
nix.gc = lib.mkIf (!config.features.applications.cli.nh.enable) {
automatic = true;
persistent = true;
dates = "Sun 05:00";
@@ -25,18 +25,24 @@
username = "grey";
homeDirectory = "/home/${config.home.username}";
file = inputs.helpers.homeFilesFromStringAttrs {
dir = ".local/bin";
attrs = config.features.applications.shellScripts;
exec = true;
};
file = inputs.helpers.localBinFromStringAttrs config.features.applications.shellScripts;
};
targets.genericLinux.enable = config.info.isStandalone;
xdg = {
enable = true;
localBinInPath = true;
portal = lib.mkIf (config.info.isStandalone) {
enable = true;
xdgOpenUsePortal = true;
config.common.default = "*";
extraPortals = with pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-gnome ];
};
};
services.gnome-keyring.enable = config.info.isStandalone;
programs = {
git = {
enable = true;
+12 -1
View File
@@ -8,7 +8,7 @@
"flakes"
];
gc = {
gc = lib.mkIf (!config.features.applications.cli.nh.enable) {
automatic = true;
persistent = true;
dates = "Sun 05:00";
@@ -90,5 +90,16 @@
isStandalone = lib.mkDefault false;
};
};
xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
config.common.default = "*";
extraPortals = with pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-gnome ];
};
services.gnome.gnome-keyring.enable = true;
environment.pathsToLink = [ "/share/xdg-desktop-portal" "/share/applications" ]; # from description of this home-manager option: https://search.nixos.org/options?channel=26.05&query=xdg.portal.enable&source=home_manager&type=options
};
}
+1 -3
View File
@@ -19,9 +19,7 @@
};
components.bootLoader = lib.mkOption {
type = lib.types.enum (map (name: lib.removeSuffix ".nix" name) (
builtins.attrNames (builtins.readDir "${self}/modules/components/boot-loaders")
));
type = inputs.helpers.mkEnumFromDirContents "${self}/modules/components/boot-loaders";
default = "grub";
};
+2 -2
View File
@@ -5,8 +5,8 @@
shutdown-takamaki = "ssh takamaki universal-shutdown";
reboot-takamaki = "ssh takamaki universal-reboot";
switch-takamaki-os = "ssh takamaki switch-os";
apply-config = "zsh -c 'cd /home/grey/nixos; git add .; nh os switch .'";
update-system = "zsh -c 'cd /home/grey/nixos; git add .; nh os switch -u .'";
apply-config = "zsh -c 'cd ${config.info.rootPath}; git add .; nh os switch .'";
update-system = "zsh -c 'cd ${config.info.rootPath}; git add .; nh os switch -u .'";
};
};
}
+1
View File
@@ -46,6 +46,7 @@
cli = {
fastfetch.enable = true;
nh.enable = true;
};
extraPackages = with pkgs; [
+15
View File
@@ -0,0 +1,15 @@
{ inputs, self, ... }: {
flake.homeModules."grey@takamaki" = { pkgs, config, lib, ... }: {
programs.kitty = {
font = lib.mkForce {
name = "Jetbrains Mono";
package = pkgs.nerd-fonts.jetbrains-mono;
size = 12;
};
extraConfig = ''
include ${config.xdg.configHome}/kitty/themes/noctalia.conf
'';
};
};
}
+7 -5
View File
@@ -1,9 +1,11 @@
{ inputs, self, ... }: {
flake.homeModules.takamaki = { config, pkgs, ... }: {
programs.zsh.shellAliases = {
apply-config = "zsh -c 'cd ${config.info.rootPath}; git add .; home-manager switch --flake .#takamaki -b bak'";
apply-config-trace = "zsh -c 'cd ${config.info.rootPath}; git add .; home-manager switch --flake .#takamaki -b bak --show-trace'";
update-config = "zsh -c 'cd ${config.info.rootPath}; git add .; nix flake update; home-manager switch --flake .#takamaki -b bak'";
flake.homeModules."grey@takamaki" = { config, pkgs, ... }: {
programs.zsh.shellAliases = let
mkConfigCommand = args: "zsh -c 'cd ${config.info.rootPath}; git add .; nh home switch ${args} -b bak'";
in {
apply-config = mkConfigCommand "";
trace-config = mkConfigCommand "-t";
update-config = mkConfigCommand "-u";
};
};
}
+69 -35
View File
@@ -1,16 +1,17 @@
{ inputs, self, ... }: {
flake.homeConfigurations.takamaki = inputs.home-manager.lib.homeManagerConfiguration {
flake.homeConfigurations."grey@takamaki" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
modules = with self.homeModules; [
takamaki
modules = [
self.homeModules."grey@takamaki"
inputs.stylix.homeModules.stylix
];
extraSpecialArgs = { inherit inputs; };
};
flake.homeModules.takamaki = { pkgs, config, lib, ... }: {
flake.homeModules."grey@takamaki" = { pkgs, config, lib, ... }: {
imports = with self.homeModules; [
global
audio
graphics
];
@@ -27,22 +28,63 @@
'';
};
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";
};
};
};
shellScripts = {
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
@@ -55,38 +97,30 @@
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 "-";
};
};
};
extraPackages = with pkgs; [
(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"
'')
];
programs.ssh.settings = {
"sakamoto" = {
HostName = "192.168.0.40";
Port = "22";
User = "grey";
IdentityFile = "~/.ssh/id_sakamoto";
};
};
};