adapt config for use with standalone home-manager
This commit is contained in:
19 files changed
+226
-95
No files matched your search
@@ -54,6 +54,8 @@
|
||||
x264
|
||||
gparted
|
||||
vlc
|
||||
iosevka-comfy.comfy
|
||||
nerd-fonts.jetbrains-mono
|
||||
];
|
||||
|
||||
dconf.settings = {
|
||||
@@ -62,8 +64,21 @@
|
||||
};
|
||||
};
|
||||
|
||||
home.pointerCursor = {
|
||||
enable = true;
|
||||
package = pkgs.bibata-cursors;
|
||||
name = "Bibata-Modern-Ice";
|
||||
size = 22;
|
||||
gtk.enable = true;
|
||||
x11.enable = true;
|
||||
};
|
||||
|
||||
gtk = {
|
||||
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.force = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -9,23 +9,23 @@
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { lib, pkgs, osConfig, ... }: {
|
||||
config = lib.mkIf ((osConfig.components.shells == "noctalia")||(builtins.elem "noctalia" osConfig.components.shells)) {
|
||||
flake.homeModules.graphics = { lib, pkgs, osConfig, config, ... }: {
|
||||
config = lib.mkIf (builtins.hasAttr "osConfig" self) (lib.mkIf ((osConfig.components.shells == "noctalia")||(builtins.elem "noctalia" osConfig.components.shells)) {
|
||||
home.activation = {
|
||||
symlinkNoctaliaState = lib.hm.dag.entryAfter ["writeBoundary"] (osConfig.helpers.mkSymlinkActivationScript {
|
||||
symlinkNoctaliaState = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||
target = ".local/state/noctalia/settings.toml";
|
||||
source = "dotfiles/${osConfig.info.hostName}/noctalia/settings.toml";
|
||||
source = "dotfiles/${config.info.hostName}/noctalia/settings.toml";
|
||||
});
|
||||
|
||||
symlinkNoctaliaStatePlugins = lib.hm.dag.entryAfter ["writeBoundary"] (osConfig.helpers.mkSymlinkActivationScript {
|
||||
symlinkNoctaliaStatePlugins = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||
target = ".local/state/noctalia/plugins";
|
||||
source = "dotfiles/${osConfig.info.hostName}/noctalia/plugins";
|
||||
source = "dotfiles/${config.info.hostName}/noctalia/plugins";
|
||||
isDir = true;
|
||||
});
|
||||
};
|
||||
|
||||
xdg.configFile."noctalia/settings.toml".source = "${self}/dotfiles/${osConfig.info.hostName}/noctalia/settings.toml";
|
||||
xdg.configFile."noctalia/plugins".source = "${self}/dotfiles/${osConfig.info.hostName}/noctalia/plugins";
|
||||
};
|
||||
xdg.configFile."noctalia/settings.toml".source = "${self}/dotfiles/${config.info.hostName}/noctalia/settings.toml";
|
||||
xdg.configFile."noctalia/plugins".source = "${self}/dotfiles/${config.info.hostName}/noctalia/plugins";
|
||||
});
|
||||
};
|
||||
}
|
||||
@@ -39,12 +39,12 @@
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { lib, osConfig, ... }: {
|
||||
config = lib.mkIf ((osConfig.components.windowManagers == "niri")||(builtins.elem "niri" osConfig.components.windowManagers)) {
|
||||
home.activation.symlinkNiriConfig = lib.hm.dag.entryAfter ["writeBoundary"] (osConfig.helpers.mkSymlinkActivationScript {
|
||||
flake.homeModules.graphics = { lib, osConfig, config, ... }: {
|
||||
config = lib.mkIf (builtins.hasAttr "osConfig" self) (lib.mkIf ((osConfig.components.windowManagers == "niri")||(builtins.elem "niri" osConfig.components.windowManagers)) {
|
||||
home.activation.symlinkNiriConfig = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||
target = ".config/niri/config.kdl";
|
||||
source = "dotfiles/${osConfig.info.hostName}/niri.kdl";
|
||||
source = "dotfiles/${config.info.hostName}/niri.kdl";
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.global = { lib, config, ... }: {
|
||||
flake.homeModules.global = { pkgs, lib, config, ... }: {
|
||||
options.features.applications.cli.fastfetch.enable = lib.mkEnableOption "fastfetch";
|
||||
};
|
||||
|
||||
flake.homeModules.global = { pkgs, lib, osConfig, ... }: {
|
||||
config = lib.mkIf (osConfig.features.applications.cli.fastfetch.enable) ({
|
||||
config = lib.mkIf (config.features.applications.cli.fastfetch.enable) ({
|
||||
programs.zsh.initContent = lib.mkOrder 1500 "fastfetch";
|
||||
programs.fastfetch.enable = true;
|
||||
});
|
||||
|
||||
@@ -1,26 +1,24 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, lib, config, ... }: {
|
||||
flake.homeModules.graphics = { pkgs, lib, config, ... }: {
|
||||
options.features.applications.gui.equibop.enable = lib.mkEnableOption "equibop";
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, lib, osConfig, ... }: {
|
||||
config = lib.mkIf (osConfig.features.applications.gui.equibop.enable) {
|
||||
config = lib.mkIf (config.features.applications.gui.equibop.enable) {
|
||||
programs.equibop.enable = true;
|
||||
|
||||
home.activation = {
|
||||
linkEquibopConfigSettings = lib.hm.dag.entryAfter ["writeBoundary"] (osConfig.helpers.mkSymlinkActivationScript {
|
||||
linkEquibopConfigSettings = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||
target = ".config/equibop/settings.json";
|
||||
source = "dotfiles/${osConfig.info.hostName}/equibop/settings.json";
|
||||
source = "dotfiles/${config.info.hostName}/equibop/settings.json";
|
||||
});
|
||||
|
||||
linkEquibopConfigEquicordSettings = lib.hm.dag.entryAfter ["writeBoundary"] (osConfig.helpers.mkSymlinkActivationScript {
|
||||
linkEquibopConfigEquicordSettings = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||
target = ".config/equibop/settings/settings.json";
|
||||
source = "dotfiles/${osConfig.info.hostName}/equibop/equicord-settings.json";
|
||||
source = "dotfiles/${config.info.hostName}/equibop/equicord-settings.json";
|
||||
});
|
||||
|
||||
linkEquibopConfigQuickCss = lib.hm.dag.entryAfter ["writeBoundary"] (osConfig.helpers.mkSymlinkActivationScript {
|
||||
linkEquibopConfigQuickCss = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||
target = ".config/equibop/settings/quickCss.css";
|
||||
source = "dotfiles/${osConfig.info.hostName}/equibop/quickCss.css";
|
||||
source = "dotfiles/${config.info.hostName}/equibop/quickCss.css";
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
flake.homeModules.graphics = { pkgs, lib, config, osConfig, ... }: {
|
||||
options.features.applications.gui.floorp.enable = lib.mkEnableOption "floorp";
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, lib, osConfig, ... }: {
|
||||
config = lib.mkIf (osConfig.features.applications.gui.floorp.enable) (
|
||||
config = lib.mkIf (config.features.applications.gui.floorp.enable) (
|
||||
let
|
||||
firefox-addons = with pkgs; inputs.firefox-addons.packages.${system};
|
||||
in {
|
||||
stylix.targets.floorp.profileNames = lib.mkIf (osConfig.features.nixos.stylix.enable) [ "default" ];
|
||||
|
||||
programs.floorp = {
|
||||
enable = true;
|
||||
nativeMessagingHosts = [
|
||||
@@ -210,7 +206,8 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
}) // lib.optionalAttrs (builtins.hasAttr "osConfig" self) {
|
||||
stylix.targets.floorp.profileNames = lib.mkIf (config.features.applications.gui.floorp.enable) [ "default" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.kitty.enable = lib.mkEnableOption "kitty";
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, osConfig, lib, ... }: {
|
||||
config = lib.mkIf (osConfig.features.applications.gui.kitty.enable) {
|
||||
config = lib.mkIf (config.features.applications.gui.kitty.enable) {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, osConfig, lib, ... }: {
|
||||
config = lib.mkIf (osConfig.features.applications.gui.nautilus.enable) {
|
||||
flake.homeModules.graphics = { pkgs, osConfig, config, lib, ... }: {
|
||||
config = lib.mkIf (builtins.hasAttr "osConfig" self) (lib.mkIf (osConfig.features.applications.gui.nautilus.enable) {
|
||||
gtk.gtk3.bookmarks = [
|
||||
"file://${osConfig.info.rootPath} NixOS"
|
||||
"file://${config.info.rootPath} NixOS"
|
||||
"file:///home/grey/Downloads Downloads"
|
||||
"file:///home/grey/Documents Documents"
|
||||
"file:///home/grey/Pictures Pictures"
|
||||
@@ -30,6 +30,6 @@
|
||||
"file:///home/grey/Videos Videos"
|
||||
"file:/// Root"
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
@@ -1,18 +1,16 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.remmina.enable = lib.mkEnableOption "remmina";
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, osConfig, lib, ... }: {
|
||||
config = lib.mkIf (osConfig.features.applications.gui.remmina.enable) {
|
||||
config = lib.mkIf (config.features.applications.gui.remmina.enable) {
|
||||
home.packages = with pkgs; [
|
||||
remmina
|
||||
freerdp
|
||||
];
|
||||
|
||||
home.activation.linkRemminaPresets = lib.hm.dag.entryAfter ["writeBoundary"] (osConfig.helpers.mkSymlinkActivationScript {
|
||||
home.activation.linkRemminaPresets = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||
target = ".local/share/remmina";
|
||||
source = "dotfiles/${osConfig.info.hostName}/remmina";
|
||||
source = "dotfiles/${config.info.hostName}/remmina";
|
||||
isDir = true;
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { lib, ... }: {
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.spotify = {
|
||||
enable = lib.mkEnableOption "spotify";
|
||||
spicetify.enable = lib.mkEnableOption "spicetify";
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, osConfig, ... }: {
|
||||
imports = [
|
||||
inputs.spicetify.homeManagerModules.default
|
||||
];
|
||||
|
||||
config = {
|
||||
home.packages = lib.mkIf (with osConfig.features.applications.gui.spotify; enable && !spicetify.enable) (with pkgs; [
|
||||
home.packages = lib.mkIf (with config.features.applications.gui.spotify; enable && !spicetify.enable) (with pkgs; [
|
||||
spotify
|
||||
]);
|
||||
|
||||
programs.spicetify =
|
||||
let
|
||||
spicePkgs = inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system};
|
||||
in lib.mkIf (with osConfig.features.applications.gui.spotify; enable && spicetify.enable) {
|
||||
in lib.mkIf (with config.features.applications.gui.spotify; enable && spicetify.enable) {
|
||||
enable = true;
|
||||
enabledExtensions = with spicePkgs.extensions; [
|
||||
hidePodcasts
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
flake.homeModules.graphics = { config, pkgs, lib, ... }: {
|
||||
options.features.applications.gui.vscode.enable = lib.mkEnableOption "vscode";
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { osConfig, pkgs, lib, ... }: {
|
||||
config = lib.mkIf (osConfig.features.applications.gui.vscode.enable) {
|
||||
config = lib.mkIf (config.features.applications.gui.vscode.enable) {
|
||||
home.packages = [ pkgs.vscode ];
|
||||
|
||||
home.activation = {
|
||||
linkVsCodeConfigSettings = lib.hm.dag.entryAfter ["writeBoundary"] (osConfig.helpers.mkSymlinkActivationScript {
|
||||
linkVsCodeConfigSettings = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||
target = ".config/Code/User/settings.json";
|
||||
source = "dotfiles/global/vscode/settings.json";
|
||||
});
|
||||
|
||||
linkVsCodeConfigKeybindings = lib.hm.dag.entryAfter ["writeBoundary"] (osConfig.helpers.mkSymlinkActivationScript {
|
||||
linkVsCodeConfigKeybindings = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||
target = ".config/Code/User/keybindings.json";
|
||||
source = "dotfiles/global/vscode/keybindings.json";
|
||||
});
|
||||
|
||||
@@ -12,8 +12,13 @@
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.global = { pkgs, osConfig, lib, ... }: {
|
||||
config = lib.mkIf (osConfig.features.shells.zsh.enable) {
|
||||
flake.homeModules.global = { pkgs, osConfig, config, lib, ... }: {
|
||||
options.features.shells.zsh = {
|
||||
enable = lib.mkEnableOption "zsh";
|
||||
antidote.enable = lib.mkEnableOption "antidote";
|
||||
};
|
||||
|
||||
config = (if builtins.hasAttr "osConfig" self then (lib.mkIf (osConfig.features.shells.zsh.enable || config.features.shells.zsh.enable)) else (lib.mkIf (config.features.shells.zsh.enable))) {
|
||||
home.shell.enableZshIntegration = true;
|
||||
|
||||
programs.kitty.shellIntegration.enableZshIntegration = true;
|
||||
@@ -21,7 +26,7 @@
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
completionInit = "";
|
||||
antidote = lib.mkIf (osConfig.features.shells.zsh.antidote.enable) {
|
||||
antidote = (if builtins.hasAttr "osConfig" self then (lib.mkIf (osConfig.features.shells.zsh.antidote.enable || config.features.shells.zsh.antidote.enable)) else (lib.mkIf (config.features.shells.zsh.antidote.enable))) {
|
||||
enable = true;
|
||||
plugins = [
|
||||
"getantidote/use-omz"
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.global = { pkgs, config, lib, ... }: {
|
||||
options.helpers = {
|
||||
# nothing here yet
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.global = { pkgs, config, lib, ... }: {
|
||||
options.helpers = {
|
||||
mkSymlinkActivationScript = lib.mkOption {
|
||||
type = lib.types.functionTo lib.types.str;
|
||||
|
||||
+14
-3
@@ -1,5 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.homeModules.global = { osConfig, config, pkgs, ... }: {
|
||||
flake.homeModules.global = { config, pkgs, osConfig, ... }: {
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
persistent = true;
|
||||
@@ -7,13 +7,24 @@
|
||||
};
|
||||
|
||||
home = {
|
||||
stateVersion = osConfig.info.stateVersion;
|
||||
stateVersion = config.info.stateVersion;
|
||||
|
||||
packages = with pkgs; [
|
||||
speedtest-go
|
||||
] ++ osConfig.features.applications.extraUserPackages;
|
||||
] ++ config.features.applications.extraPackages
|
||||
++ (if !(builtins.hasAttr "osConfig" self) then [
|
||||
pkgs.home-manager
|
||||
] else []);
|
||||
|
||||
shell.enableBashIntegration = true;
|
||||
|
||||
username = "grey";
|
||||
homeDirectory = "/home/${config.home.username}";
|
||||
};
|
||||
|
||||
xdg = {
|
||||
enable = true;
|
||||
localBinInPath = !(builtins.hasAttr "osConfig" self);
|
||||
};
|
||||
|
||||
programs = {
|
||||
|
||||
@@ -25,17 +25,36 @@
|
||||
default = "grub";
|
||||
};
|
||||
|
||||
features.applications = {
|
||||
extraPackages = lib.mkOption {
|
||||
features.applications.extraPackages = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.package);
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraUserPackages = lib.mkOption {
|
||||
flake.homeModules.global = { pkgs, config, lib, ... }: {
|
||||
options = {
|
||||
info = {
|
||||
rootPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/grey/nixos";
|
||||
};
|
||||
|
||||
hostName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
|
||||
stateVersion = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
||||
features.applications.extraPackages = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.package);
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.homeModules.kitagawa = { pkgs, lib, osConfig, ... }: {
|
||||
config = lib.mkIf (osConfig.features.applications.cli.fastfetch.enable) ({
|
||||
flake.homeModules.kitagawa = { pkgs, lib, config, ... }: {
|
||||
config = lib.mkIf (config.features.applications.cli.fastfetch.enable) ({
|
||||
programs.fastfetch = {
|
||||
settings = {
|
||||
logo = {
|
||||
|
||||
@@ -32,39 +32,18 @@
|
||||
};
|
||||
|
||||
applications = {
|
||||
cli = {
|
||||
fastfetch.enable = true;
|
||||
};
|
||||
|
||||
gui = {
|
||||
spotify = {
|
||||
enable = true;
|
||||
spicetify.enable = true;
|
||||
};
|
||||
kitty.enable = true;
|
||||
vscode.enable = true;
|
||||
floorp.enable = true;
|
||||
equibop.enable = true;
|
||||
remmina.enable = true;
|
||||
};
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
github-desktop
|
||||
moonlight-qt
|
||||
];
|
||||
|
||||
extraUserPackages = with pkgs; [
|
||||
obsidian
|
||||
thunderbird
|
||||
jetbrains.clion
|
||||
jetbrains.idea
|
||||
proton-vpn
|
||||
ente-auth
|
||||
signal-desktop
|
||||
xarchiver
|
||||
kdePackages.filelight
|
||||
loupe
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -109,6 +88,39 @@
|
||||
graphics
|
||||
];
|
||||
|
||||
info = {
|
||||
hostName = "kitagawa";
|
||||
stateVersion = "26.05";
|
||||
};
|
||||
|
||||
features = {
|
||||
applications = {
|
||||
cli = {
|
||||
fastfetch.enable = true;
|
||||
};
|
||||
|
||||
gui = {
|
||||
equibop.enable = true;
|
||||
floorp.enable = true;
|
||||
kitty.enable = true;
|
||||
remmina.enable = true;
|
||||
};
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
obsidian
|
||||
thunderbird
|
||||
jetbrains.clion
|
||||
jetbrains.idea
|
||||
proton-vpn
|
||||
ente-auth
|
||||
signal-desktop
|
||||
xarchiver
|
||||
kdePackages.filelight
|
||||
loupe
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
imports = [
|
||||
#"${global-configs}/gnome.nix"
|
||||
@@ -129,7 +141,6 @@
|
||||
};
|
||||
|
||||
xdg = {
|
||||
enable = true;
|
||||
mimeApps.defaultApplications = {
|
||||
"x-scheme-handler/x-github-client" = [ "github-desktop.desktop" ];
|
||||
"x-scheme-handler/x-github-desktop-dev-auth" = [ "github-desktop.desktop" ];
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.homeModules.takamaki = { config, pkgs, ... }: {
|
||||
programs.zsh.shellAliases = {
|
||||
apply-config = "zsh -c 'cd /home/grey/flake; git add .; home-manager switch --flake .#takamaki -b bak'";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.homeConfigurations.takamaki = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
||||
modules = with self.homeModules; [
|
||||
global
|
||||
graphics
|
||||
takamaki
|
||||
];
|
||||
};
|
||||
|
||||
flake.homeModules.takamaki = { pkgs, config, lib, ... }: {
|
||||
info = {
|
||||
rootPath = "/home/grey/flake";
|
||||
hostName = "takamaki";
|
||||
stateVersion = "26.11";
|
||||
};
|
||||
|
||||
features = {
|
||||
shells.zsh = {
|
||||
enable = true;
|
||||
antidote.enable = true;
|
||||
};
|
||||
|
||||
applications = {
|
||||
cli = {
|
||||
fastfetch.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 10 ]
|
||||
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 10 ]
|
||||
do true; done
|
||||
|
||||
noctalia msg notification-show "Set brightness to $WRITTEN for display $PRETTY_NAME"
|
||||
'')
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user