init: firstCommit

This commit is contained in:
2026-03-01 01:39:57 +09:00
commit 36c0a5a114
47 changed files with 1553 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
{
imports = [
./theme-switcher.nix
];
home.activation = {
makedir = ''
mkdir -p ~/.config/cornflake
'';
};
}
+29
View File
@@ -0,0 +1,29 @@
{ pkgs, ... }:
let
apply-theme-script = pkgs.writeScript "apply-theme" ''
curr=$(cat ~/.config/cornflake/current-theme)
if [ "$curr" = "prefer-light" ]; then
dconf write /org/gnome/desktop/interface/color-scheme "'prefer-light'"
else
dconf write /org/gnome/desktop/interface/color-scheme "'prefer-dark'"
fi
'';
desktopEntry = {
name = "Toggle theme";
exec = ''${pkgs.writeScript "theme" ''
curr=$(cat ~/.config/cornflake/current-theme)
if [ "$curr" = "prefer-light" ]; then
echo 'prefer-dark' > ~/.config/cornflake/current-theme
else
echo 'prefer-light' > ~/.config/cornflake/current-theme
fi
${apply-theme-script}
''}'';
};
in
{
xdg.desktopEntries = {
theme-switcher = desktopEntry;
};
}