2020-07-03 13:18:43 +00:00
|
|
|
{ pkgs, lib, config, ... }:
|
2020-05-09 14:04:35 +00:00
|
|
|
let
|
2020-07-03 13:18:43 +00:00
|
|
|
modes = pkgs.lib.attrNames (import ../machines.nix).apollo;
|
|
|
|
configPath = "${config.home.homeDirectory}/git/config";
|
2020-05-05 23:40:57 +00:00
|
|
|
in {
|
2020-05-14 00:11:36 +00:00
|
|
|
|
2020-05-16 13:59:02 +00:00
|
|
|
home.packages = builtins.attrValues rec {
|
2020-05-05 23:40:57 +00:00
|
|
|
maintenance = pkgs.writeShellScriptBin "maintenance" ''
|
2020-05-16 13:59:02 +00:00
|
|
|
set -e
|
2020-09-17 00:17:05 +00:00
|
|
|
git -C ~/git/config pull --ff-only
|
2020-05-09 14:04:35 +00:00
|
|
|
update-modes
|
2020-05-05 23:40:57 +00:00
|
|
|
sudo -A update-system
|
|
|
|
'';
|
2020-05-27 13:20:08 +00:00
|
|
|
activateMode = pkgs.writeHaskellScript { name = "activate-mode"; } ''
|
2020-05-16 13:59:02 +00:00
|
|
|
getMode :: IO Text
|
2020-05-21 23:10:41 +00:00
|
|
|
getMode = decodeUtf8 <$> (cat "/home/maralorn/volatile/mode" |> captureTrim)
|
2020-05-16 13:59:02 +00:00
|
|
|
|
|
|
|
main = do
|
|
|
|
mode <- getMode
|
|
|
|
say [i|Switching to mode #{mode}...|]
|
|
|
|
exe ([i|/home/maralorn/.modes/#{mode}/activate|] :: String)
|
|
|
|
exe "random-wallpaper"
|
2020-05-09 14:04:35 +00:00
|
|
|
'';
|
2020-05-27 13:20:08 +00:00
|
|
|
updateModes = pkgs.writeHaskellScript {
|
2020-05-16 13:59:02 +00:00
|
|
|
name = "update-modes";
|
|
|
|
bins = [ activateMode ];
|
|
|
|
} ''
|
|
|
|
main = do
|
|
|
|
say "Building ~/.modes for apollo"
|
2020-05-16 14:47:52 +00:00
|
|
|
nixPath <- myNixPath "${configPath}"
|
2020-06-27 19:54:32 +00:00
|
|
|
nix_build nixPath "${configPath}/home-manager/target.nix" "-A" "apollo" "-o" "/home/maralorn/.modes"
|
2020-05-16 13:59:02 +00:00
|
|
|
activate_mode
|
2020-05-05 23:40:57 +00:00
|
|
|
'';
|
2020-09-21 08:39:24 +00:00
|
|
|
selectMode = pkgs.writeHaskellScript {
|
|
|
|
name = "select-mode";
|
|
|
|
bins = [ pkgs.dialog activateMode pkgs.ncurses ];
|
|
|
|
} ''
|
|
|
|
main = do
|
|
|
|
mode <- decodeUtf8 <$> (dialog "--menu" "Select Mode" "20" "80" "5" ${
|
|
|
|
lib.concatStrings (map (mode: "\"${mode}\" \"\" ") modes)
|
|
|
|
} |!> captureTrim)
|
|
|
|
clear
|
|
|
|
writeFile "/home/maralorn/volatile/mode" mode
|
|
|
|
activate_mode
|
2020-05-06 09:01:08 +00:00
|
|
|
'';
|
|
|
|
|
2020-05-05 23:40:57 +00:00
|
|
|
inherit (pkgs.gnome3) nautilus;
|
|
|
|
inherit (pkgs.xorg) xbacklight;
|
|
|
|
inherit (pkgs)
|
|
|
|
# web
|
|
|
|
chromium
|
|
|
|
|
2020-09-16 17:55:08 +00:00
|
|
|
zoom-us skypeforlinux google-chrome
|
|
|
|
|
2020-05-13 12:34:10 +00:00
|
|
|
mumble upower speedtest-cli acpi
|
2020-05-05 23:40:57 +00:00
|
|
|
|
|
|
|
anki
|
|
|
|
|
|
|
|
# tools & office
|
|
|
|
feh gimp imagemagick libreoffice-fresh xournal musescore handbrake evince
|
|
|
|
abcde beets
|
|
|
|
|
|
|
|
# media
|
|
|
|
ncpamixer pavucontrol deluge gmpc calibre mpv youtubeDL;
|
|
|
|
};
|
|
|
|
}
|