2020-05-09 14:04:35 +00:00
|
|
|
{ pkgs, lib, ... }:
|
|
|
|
let
|
|
|
|
inherit (import ../lib) unfreePkgs;
|
2020-05-09 14:24:20 +00:00
|
|
|
modes = map (lib.removePrefix "apollo-")
|
|
|
|
(builtins.filter (lib.hasPrefix "apollo-")
|
|
|
|
(pkgs.lib.attrNames (import ../home.nix)));
|
2020-05-05 23:40:57 +00:00
|
|
|
in {
|
|
|
|
home.packages = builtins.attrValues {
|
|
|
|
maintenance = pkgs.writeShellScriptBin "maintenance" ''
|
|
|
|
git -C ~/git/config pull
|
2020-05-09 14:04:35 +00:00
|
|
|
update-modes
|
2020-05-05 23:40:57 +00:00
|
|
|
sudo -A update-system
|
2020-05-09 14:24:20 +00:00
|
|
|
sudo -A nix-collect-garbage -d
|
2020-05-05 23:40:57 +00:00
|
|
|
sudo -A nix optimise-store
|
|
|
|
'';
|
2020-05-09 14:04:35 +00:00
|
|
|
activateMode = pkgs.writeShellScriptBin "activate-mode" ''
|
2020-05-09 14:24:20 +00:00
|
|
|
~/.modes/result-home-manager-apollo-$(cat ~/tmp/mode)/activate
|
2020-05-09 14:04:35 +00:00
|
|
|
'';
|
|
|
|
updateModes = pkgs.writeShellScriptBin "update-modes" ''
|
|
|
|
set -e
|
2020-05-09 14:24:20 +00:00
|
|
|
update-home -A apollo-$(cat ~/tmp/mode)
|
2020-05-09 14:04:35 +00:00
|
|
|
mkdir -p ~/.modes
|
|
|
|
cd ~/.modes
|
|
|
|
${lib.concatStringsSep "\n"
|
2020-05-09 14:24:20 +00:00
|
|
|
(map (mode: "test-home-config ~/git/config apollo-${mode}") modes)}
|
2020-05-05 23:40:57 +00:00
|
|
|
'';
|
2020-05-06 09:01:08 +00:00
|
|
|
selectMode = pkgs.writeShellScriptBin "select-mode" ''
|
2020-05-09 14:04:35 +00:00
|
|
|
${pkgs.dialog}/bin/dialog --menu "Select Mode" 20 80 5 ${
|
|
|
|
lib.concatStrings (map (mode: "${mode} '' ") modes)
|
|
|
|
} 2> ~/tmp/mode
|
2020-05-09 14:24:20 +00:00
|
|
|
clear
|
|
|
|
echo "Switching to mode $(cat ~/tmp/mode)..."
|
|
|
|
activate-mode > /dev/null
|
2020-05-06 09:01:08 +00:00
|
|
|
'';
|
|
|
|
|
2020-05-05 23:40:57 +00:00
|
|
|
inherit (unfreePkgs) zoom-us skypeforlinux google-chrome;
|
|
|
|
inherit (pkgs.gnome3) nautilus;
|
|
|
|
inherit (pkgs.xorg) xbacklight;
|
|
|
|
inherit (pkgs)
|
|
|
|
# web
|
|
|
|
chromium
|
|
|
|
|
|
|
|
upower speedtest-cli acpi
|
|
|
|
|
|
|
|
anki
|
|
|
|
|
|
|
|
# tools & office
|
|
|
|
feh gimp imagemagick libreoffice-fresh xournal musescore handbrake evince
|
|
|
|
abcde beets
|
|
|
|
|
|
|
|
# media
|
|
|
|
ncpamixer pavucontrol deluge gmpc calibre mpv youtubeDL;
|
|
|
|
};
|
|
|
|
}
|