2020-05-09 14:04:35 +00:00
|
|
|
{ pkgs, lib, ... }:
|
|
|
|
let
|
2020-05-16 13:59:02 +00:00
|
|
|
inherit (import ../lib) unfreePkgs writeHaskellScript;
|
2020-05-16 11:20:32 +00:00
|
|
|
modes = pkgs.lib.attrNames (import ./modes.nix).apollo;
|
2020-05-14 00:11:36 +00:00
|
|
|
autostart-script = pkgs.writeShellScriptBin "home-manager-autostart" ''
|
|
|
|
${pkgs.xorg.xrdb}/bin/xrdb ${builtins.toFile "Xresources" "Xft.dpi: 96"}
|
|
|
|
'';
|
2020-05-16 13:59:02 +00:00
|
|
|
configPath = "/home/maralorn/git/config";
|
2020-05-05 23:40:57 +00:00
|
|
|
in {
|
2020-05-14 00:11:36 +00:00
|
|
|
|
|
|
|
xdg.configFile."autostart/home-manager-autostart.desktop".source = "${
|
|
|
|
pkgs.makeDesktopItem {
|
|
|
|
name = "home-manager-autostart";
|
|
|
|
desktopName = "Home Manager Autostart Job";
|
|
|
|
exec = "${autostart-script}/bin/home-manager-autostart";
|
|
|
|
}
|
|
|
|
}/share/applications/home-manager-autostart.desktop";
|
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-05-05 23:40:57 +00:00
|
|
|
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-16 13:59:02 +00:00
|
|
|
activateMode = writeHaskellScript { name = "activate-mode"; } ''
|
|
|
|
getMode :: IO Text
|
|
|
|
getMode = decodeUtf8 <$> (cat "/home/maralorn/tmp/mode" |> captureTrim)
|
|
|
|
|
|
|
|
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-16 13:59:02 +00:00
|
|
|
updateModes = writeHaskellScript {
|
|
|
|
name = "update-modes";
|
|
|
|
bins = [ activateMode ];
|
|
|
|
} ''
|
|
|
|
main = do
|
|
|
|
say "Building ~/.modes for apollo"
|
2020-05-16 14:47:52 +00:00
|
|
|
nixPath <- myNixPath "${configPath}"
|
2020-05-16 13:59:02 +00:00
|
|
|
nix_build nixPath "${configPath}/home/target.nix" "-A" "apollo" "-o" "/home/maralorn/.modes"
|
|
|
|
activate_mode
|
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
|
|
|
|
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
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|