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-12-01 16:02:22 +00:00
|
|
|
zoom = pkgs.zoom-us.overrideAttrs (old: {
|
|
|
|
postFixup = old.postFixup + ''
|
|
|
|
wrapProgram $out/bin/zoom-us --unset XDG_SESSION_TYPE
|
|
|
|
'';});
|
2020-11-24 23:19:47 +00:00
|
|
|
|
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-09-30 23:47:05 +00:00
|
|
|
git -C ~/git/config submodule update
|
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";
|
2020-10-11 13:03:01 +00:00
|
|
|
bins = [ activateMode pkgs.git pkgs.nix-output-monitor ];
|
2020-05-16 13:59:02 +00:00
|
|
|
} ''
|
2020-10-01 00:32:51 +00:00
|
|
|
params = ["${configPath}/home-manager/target.nix", "-A", "apollo", "-o", "/home/maralorn/.modes"]
|
|
|
|
|
2020-05-16 13:59:02 +00:00
|
|
|
main = do
|
|
|
|
say "Building ~/.modes for apollo"
|
2020-05-16 14:47:52 +00:00
|
|
|
nixPath <- myNixPath "${configPath}"
|
2020-12-16 18:26:20 +00:00
|
|
|
setEnv "WITH_SECRETS" "false"
|
2021-01-05 23:59:11 +00:00
|
|
|
nix_build nixPath (params ++ remoteBuildParams)
|
2020-12-16 18:26:20 +00:00
|
|
|
setEnv "WITH_SECRETS" "true"
|
2020-10-01 00:32:51 +00:00
|
|
|
nix_build nixPath params
|
2020-05-16 13:59:02 +00:00
|
|
|
activate_mode
|
2020-05-05 23:40:57 +00:00
|
|
|
'';
|
2020-10-11 13:03:01 +00:00
|
|
|
quickUpdateMode = pkgs.writeHaskellScript {
|
|
|
|
name = "quick-update-mode";
|
2020-10-19 13:32:40 +00:00
|
|
|
bins = [ updateModes pkgs.git pkgs.home-manager pkgs.nix-output-monitor ];
|
2020-10-11 13:03:01 +00:00
|
|
|
} ''
|
|
|
|
getMode :: IO Text
|
|
|
|
getMode = decodeUtf8 <$> (cat "/home/maralorn/volatile/mode" |> captureTrim)
|
|
|
|
|
|
|
|
main = do
|
|
|
|
nixPath <- myNixPath "${configPath}"
|
|
|
|
mode <- getMode
|
|
|
|
say [i|Quick switching to mode #{mode} ...|]
|
2021-01-05 23:59:11 +00:00
|
|
|
home_manager (nixPath <> ["switch", "-A", [i|apollo-#{mode}|]])
|
2020-10-11 13:03:01 +00:00
|
|
|
update_modes
|
|
|
|
'';
|
2020-09-21 08:39:24 +00:00
|
|
|
selectMode = pkgs.writeHaskellScript {
|
|
|
|
name = "select-mode";
|
2020-10-19 13:32:40 +00:00
|
|
|
bins = [
|
|
|
|
pkgs.dialog
|
|
|
|
activateMode
|
|
|
|
pkgs.ncurses
|
|
|
|
pkgs.sway
|
|
|
|
pkgs.gnome3.gnome-session
|
|
|
|
];
|
2020-09-21 08:39:24 +00:00
|
|
|
} ''
|
|
|
|
main = do
|
|
|
|
mode <- decodeUtf8 <$> (dialog "--menu" "Select Mode" "20" "80" "5" ${
|
2020-10-09 21:05:13 +00:00
|
|
|
lib.concatStrings (map (mode: ''"${mode}" "" '') modes)
|
|
|
|
} |!> captureTrim)
|
2020-09-21 08:39:24 +00:00
|
|
|
clear
|
|
|
|
writeFile "/home/maralorn/volatile/mode" mode
|
|
|
|
activate_mode
|
2020-10-19 13:32:40 +00:00
|
|
|
void $ (try $ swaymsg "exit" :: IO (Either SomeException ()))
|
|
|
|
void $ (try $ gnome_session_quit "--no-prompt" :: IO (Either SomeException ()))
|
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-11-24 23:19:47 +00:00
|
|
|
skypeforlinux google-chrome
|
2020-09-16 17:55:08 +00:00
|
|
|
|
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
|
2020-12-04 11:25:08 +00:00
|
|
|
abcde beets zbar
|
2020-05-05 23:40:57 +00:00
|
|
|
|
|
|
|
# media
|
2021-01-08 21:57:24 +00:00
|
|
|
ncpamixer pavucontrol deluge gmpc vlc mpv youtubeDL syncplay;
|
2020-05-05 23:40:57 +00:00
|
|
|
};
|
|
|
|
}
|