refactor how i decide which programs go on which machine (leverage "roles" like pc and handheld)

This commit is contained in:
2023-11-18 22:56:53 +00:00
parent 3c7ebb5385
commit 0893c90c51
10 changed files with 131 additions and 126 deletions

View File

@@ -12,9 +12,9 @@
sops.secrets.colin-passwd.neededForUsers = true; sops.secrets.colin-passwd.neededForUsers = true;
sane.roles.build-machine.enable = true; sane.roles.build-machine.enable = true;
sane.roles.ac = true;
sane.roles.client = true; sane.roles.client = true;
sane.roles.dev-machine = true; sane.roles.dev-machine = true;
sane.roles.pc = true;
sane.services.wg-home.enable = true; sane.services.wg-home.enable = true;
sane.services.wg-home.ip = config.sane.hosts.by-name."desko".wg-home.ip; sane.services.wg-home.ip = config.sane.hosts.by-name."desko".wg-home.ip;
sane.services.duplicity.enable = true; sane.services.duplicity.enable = true;
@@ -24,8 +24,6 @@
sane.programs.iphoneUtils.enableFor.user.colin = true; sane.programs.iphoneUtils.enableFor.user.colin = true;
sane.programs.steam.enableFor.user.colin = true; sane.programs.steam.enableFor.user.colin = true;
sane.programs.guiApps.suggestedPrograms = [ "desktopGuiApps" ];
sane.programs.consoleUtils.suggestedPrograms = [ "consoleMediaUtils" "desktopConsoleUtils" ];
# sane.programs.devPkgs.enableFor.user.colin = true; # sane.programs.devPkgs.enableFor.user.colin = true;
sane.programs.signal-desktop.config.autostart = true; sane.programs.signal-desktop.config.autostart = true;

View File

@@ -7,6 +7,7 @@
sane.roles.client = true; sane.roles.client = true;
sane.roles.dev-machine = true; sane.roles.dev-machine = true;
sane.roles.pc = true;
sane.services.wg-home.enable = true; sane.services.wg-home.enable = true;
sane.services.wg-home.ip = config.sane.hosts.by-name."lappy".wg-home.ip; sane.services.wg-home.ip = config.sane.hosts.by-name."lappy".wg-home.ip;
@@ -15,11 +16,7 @@
boot.loader.efi.canTouchEfiVariables = false; boot.loader.efi.canTouchEfiVariables = false;
sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ]; sane.image.extraBootFiles = [ pkgs.bootpart-uefi-x86_64 ];
sane.programs.guiApps.suggestedPrograms = [ sane.programs.stepmania.enableFor.user.colin = true;
"desktopGuiApps"
"stepmania"
];
sane.programs.consoleUtils.suggestedPrograms = [ "consoleMediaUtils" "desktopConsoleUtils" ];
sops.secrets.colin-passwd.neededForUsers = true; sops.secrets.colin-passwd.neededForUsers = true;

View File

@@ -20,6 +20,7 @@
]; ];
sane.roles.client = true; sane.roles.client = true;
sane.roles.handheld = true;
sane.zsh.showDeadlines = false; # unlikely to act on them when in shell sane.zsh.showDeadlines = false; # unlikely to act on them when in shell
sane.services.wg-home.enable = true; sane.services.wg-home.enable = true;
sane.services.wg-home.ip = config.sane.hosts.by-name."moby".wg-home.ip; sane.services.wg-home.ip = config.sane.hosts.by-name."moby".wg-home.ip;
@@ -32,17 +33,12 @@
sops.secrets.colin-passwd.neededForUsers = true; sops.secrets.colin-passwd.neededForUsers = true;
sane.gui.sxmo.enable = true; sane.gui.sxmo.enable = true;
sane.programs.guiApps.suggestedPrograms = [ "handheldGuiApps" ];
# sane.programs.consoleUtils.enableFor.user.colin = false; # sane.programs.consoleUtils.enableFor.user.colin = false;
# sane.programs.guiApps.enableFor.user.colin = false; # sane.programs.guiApps.enableFor.user.colin = false;
sane.programs.blueberry.enableFor.user.colin = false; # bluetooth manager: doesn't cross compile! sane.programs.blueberry.enableFor.user.colin = false; # bluetooth manager: doesn't cross compile!
sane.programs.dialect.enableFor.user.colin = false; # drags in 700MB of x86 dependencies (e.g. gtk4) sane.programs.dialect.enableFor.user.colin = false; # drags in 700MB of x86 dependencies (e.g. gtk4)
sane.programs.mercurial.enableFor.user.colin = false; # does not cross compile sane.programs.mercurial.enableFor.user.colin = false; # does not cross compile
sane.programs.nvme-cli.enableFor.system = false; # does not cross compile (libhugetlbfs) sane.programs.nvme-cli.enableFor.system = false; # does not cross compile (libhugetlbfs)
sane.programs.sequoia.enableFor.user.colin = false;
sane.programs.tuiApps.enableFor.user.colin = false; # visidata, others, don't compile well
# disabled for faster deploys
sane.programs.soundconverter.enableFor.user.colin = false;
# enabled for easier debugging # enabled for easier debugging
sane.programs.eg25-control.enableFor.user.colin = true; sane.programs.eg25-control.enableFor.user.colin = true;

View File

@@ -14,12 +14,11 @@
signaldctl.enableFor.user.colin = true; signaldctl.enableFor.user.colin = true;
}; };
sane.roles.ac = true;
sane.roles.build-machine.enable = true; sane.roles.build-machine.enable = true;
sane.roles.build-machine.emulation = false; sane.roles.build-machine.emulation = false;
sane.zsh.showDeadlines = false; # ~/knowledge doesn't always exist sane.zsh.showDeadlines = false; # ~/knowledge doesn't always exist
sane.programs.consoleUtils.suggestedPrograms = [ sane.programs.consoleUtils.suggestedPrograms = [
"desktopConsoleUtils" "pcConsoleUtils"
"sane-scripts.stop-all-servo" "sane-scripts.stop-all-servo"
]; ];
sane.services.dyn-dns.enable = true; sane.services.dyn-dns.enable = true;

View File

@@ -173,7 +173,7 @@ in
"zsh" "zsh"
]; ];
desktopConsoleUtils = declPackageSet [ pcConsoleUtils = declPackageSet [
"gh" # MS GitHub cli "gh" # MS GitHub cli
"nix-index" "nix-index"
"nixpkgs-review" "nixpkgs-review"
@@ -188,11 +188,11 @@ in
"yt-dlp" "yt-dlp"
]; ];
tuiApps = declPackageSet [ pcTuiApps = declPackageSet [
"aerc" # email client "aerc" # email client
"msmtp" # sendmail "msmtp" # sendmail
"offlineimap" # email mailbox sync "offlineimap" # email mailbox sync
"sfeed" # RSS fetcher # "sfeed" # RSS fetcher
"visidata" # TUI spreadsheet viewer/editor "visidata" # TUI spreadsheet viewer/editor
"w3m" # web browser "w3m" # web browser
]; ];

View File

@@ -22,7 +22,7 @@ in
"superTux" # keyboard-only controls "superTux" # keyboard-only controls
"superTuxKart" # poor FPS on pinephone "superTuxKart" # poor FPS on pinephone
]; ];
sane.programs.desktopGameApps = declPackageSet [ sane.programs.pcGameApps = declPackageSet [
# "andyetitmoves" # TODO: fix build! # "andyetitmoves" # TODO: fix build!
# "armagetronad" # tron/lightcycles; WAN and LAN multiplayer # "armagetronad" # tron/lightcycles; WAN and LAN multiplayer
# "cutemaze" # meh: trivial maze game; qt6 and keyboard-only # "cutemaze" # meh: trivial maze game; qt6 and keyboard-only
@@ -30,6 +30,7 @@ in
"endless-sky" # space merchantilism/exploration "endless-sky" # space merchantilism/exploration
# "factorio" # "factorio"
"frozen-bubble" # WAN + LAN + 1P/2P bubble bobble "frozen-bubble" # WAN + LAN + 1P/2P bubble bobble
"hase" # WAN worms game
# "hedgewars" # WAN + LAN worms game (5~10 people online at any moment; <https://hedgewars.org>) # "hedgewars" # WAN + LAN worms game (5~10 people online at any moment; <https://hedgewars.org>)
# "libremines" # meh: trivial minesweeper; qt6 # "libremines" # meh: trivial minesweeper; qt6
# "mario0" # SMB + portal # "mario0" # SMB + portal
@@ -45,25 +46,18 @@ in
"vvvvvv" # keyboard-only controls "vvvvvv" # keyboard-only controls
]; ];
sane.programs.guiApps = declPackageSet ( sane.programs.guiApps = declPackageSet [
lib.optionals (pkgs.system == "x86_64-linux") [
"x86GuiApps"
] ++ [
# package sets # package sets
"tuiApps"
"gameApps" "gameApps"
] ++ [ "guiBaseApps"
];
sane.programs.guiBaseApps = declPackageSet [
"alacritty" # terminal emulator "alacritty" # terminal emulator
"calls" # gnome calls (dialer/handler)
# "celluloid" # mpv frontend
"chatty" # matrix/xmpp/irc client
"cozy" # audiobook player
"dialect" # language translation "dialect" # language translation
"dino" # XMPP client "dino" # XMPP client
# "emote" # "emote"
"epiphany" # gnome's web browser
"evince" # works on phosh "evince" # works on phosh
"firefox"
# "flare-signal" # gtk4 signal client # "flare-signal" # gtk4 signal client
# "foliate" # e-book reader # "foliate" # e-book reader
"fractal" # matrix client "fractal" # matrix client
@@ -71,7 +65,7 @@ in
# "gnome.cheese" # "gnome.cheese"
# "gnome-feeds" # RSS reader (with claimed mobile support) # "gnome-feeds" # RSS reader (with claimed mobile support)
# "gnome.file-roller" # "gnome.file-roller"
"gnome.geary" # adaptive e-mail client "gnome.geary" # adaptive e-mail client; uses webkitgtk 4.1
"gnome.gnome-calculator" "gnome.gnome-calculator"
"gnome.gnome-calendar" "gnome.gnome-calendar"
"gnome.gnome-clocks" "gnome.gnome-clocks"
@@ -80,11 +74,8 @@ in
# "gnome.gnome-system-monitor" # "gnome.gnome-system-monitor"
# "gnome.gnome-terminal" # works on phosh # "gnome.gnome-terminal" # works on phosh
"gnome.gnome-weather" "gnome.gnome-weather"
"gpodder"
"gthumb" "gthumb"
"gtkcord4" # Discord client "gtkcord4" # Discord client
"komikku"
"koreader"
"lemoa" # lemmy app "lemoa" # lemmy app
# "lollypop" # "lollypop"
"mate.engrampa" # archive manager "mate.engrampa" # archive manager
@@ -97,32 +88,47 @@ in
# "picard" # music tagging # "picard" # music tagging
# "libsForQt5.plasmatube" # Youtube player # "libsForQt5.plasmatube" # Youtube player
"signal-desktop" "signal-desktop"
"soundconverter"
"spot" # Gnome Spotfy client "spot" # Gnome Spotfy client
# "sublime-music" # "sublime-music"
"tangram" # web browser
# "tdesktop" # broken on phosh # "tdesktop" # broken on phosh
# "tokodon" # "tokodon"
"tuba" # mastodon/pleroma client (stores pw in keyring) "tuba" # mastodon/pleroma client (stores pw in keyring)
# "whalebird" # pleroma client (Electron). input is broken on phosh. # "whalebird" # pleroma client (Electron). input is broken on phosh.
"wike" # Wikipedia Reader
"xdg-terminal-exec" "xdg-terminal-exec"
"xterm" # broken on phosh "xterm" # broken on phosh
] ];
);
sane.programs.desktopGuiApps = declPackageSet ( sane.programs.handheldGuiApps = declPackageSet [
"calls" # gnome calls (dialer/handler)
# "celluloid" # mpv frontend
"chatty" # matrix/xmpp/irc client
"cozy" # audiobook player
"epiphany" # gnome's web browser
"gpodder"
"komikku"
"koreader"
"megapixels" # camera app
"portfolio-filemanager"
"tangram" # web browser
"wike" # Wikipedia Reader
"xarchiver"
];
sane.programs.pcGuiApps = declPackageSet (
[ [
# package sets # package sets
"desktopGameApps" "pcGameApps"
"pcTuiApps"
] ++ [ ] ++ [
"audacity" "audacity"
"blanket" # ambient noise generator "blanket" # ambient noise generator
"brave" # for the integrated wallet -- as a backup "brave" # for the integrated wallet -- as a backup
# "cantata" # music player (mpd frontend) # "cantata" # music player (mpd frontend)
# "chromium" # chromium takes hours to build. brave is chromium-based, distributed in binary form, so prefer it. # "chromium" # chromium takes hours to build. brave is chromium-based, distributed in binary form, so prefer it.
"discord" # x86-only
"electrum" "electrum"
"element-desktop" "element-desktop"
"firefox"
"font-manager" "font-manager"
# "gajim" # XMPP client. cross build tries to import host gobject-introspection types (2023/09/01) # "gajim" # XMPP client. cross build tries to import host gobject-introspection types (2023/09/01)
"gimp" # broken on phosh "gimp" # broken on phosh
@@ -132,46 +138,30 @@ in
"gnome.nautilus" # file browser "gnome.nautilus" # file browser
# "gnome.totem" # video player, supposedly supports UPnP # "gnome.totem" # video player, supposedly supports UPnP
"handbrake" "handbrake"
"hase"
"inkscape" "inkscape"
# "jellyfin-media-player" # "jellyfin-media-player"
"kdenlive" "kdenlive"
"kid3" # audio tagging "kid3" # audio tagging
"krita" "krita"
"libreoffice" # TODO: replace with an office suite that uses saner packaging? "libreoffice" # TODO: replace with an office suite that uses saner packaging?
"losslesscut-bin" # x86-only
"makemkv" # x86-only
"monero-gui" # x86-only
"mumble" "mumble"
# "nheko" # Matrix chat client # "nheko" # Matrix chat client
# "obsidian" # "obsidian"
# "rhythmbox" # local music player # "rhythmbox" # local music player
"slic3r" "slic3r"
"soundconverter"
"spotify" # x86-only
"steam" "steam"
"tor-browser-bundle-bin" # x86-only
"vlc" "vlc"
"wireshark" # could maybe ship the cli as sysadmin pkg "wireshark" # could maybe ship the cli as sysadmin pkg
"zecwallet-lite" # x86-only
] ]
); );
sane.programs.handheldGuiApps = declPackageSet [
"megapixels" # camera app
"portfolio-filemanager"
"xarchiver"
];
sane.programs.x86GuiApps = declPackageSet [
"discord"
# "gnome.zenity" # for kaiteki (it will use qarma, kdialog, or zenity)
# "gpt2tc" # XXX: unreliable mirror
# "kaiteki" # Pleroma client
# "logseq" # Personal Knowledge Management
"losslesscut-bin"
"makemkv"
"monero-gui"
# "signal-desktop"
"spotify"
"tor-browser-bundle-bin"
"zecwallet-lite"
];
sane.persist.sys.byStore.plaintext = lib.mkIf config.sane.programs.guiApps.enabled [ sane.persist.sys.byStore.plaintext = lib.mkIf config.sane.programs.guiApps.enabled [
"/var/lib/alsa" # preserve output levels, default devices "/var/lib/alsa" # preserve output levels, default devices
"/var/lib/colord" # preserve color calibrations (?) "/var/lib/colord" # preserve color calibrations (?)

View File

@@ -1,16 +0,0 @@
{ config, lib, ... }:
{
options.sane.roles.ac = with lib; mkOption {
type = types.bool;
default = false;
description = ''
services which you probably only want to use with AC power.
specifically because they drain resources like power or bandwidth.
'';
};
config = lib.mkIf config.sane.roles.ac {
# sane.yggdrasil.enable = true;
# services.i2p.enable = true;
};
}

View File

@@ -1,10 +1,11 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
imports = [ imports = [
./ac.nix
./build-machine.nix ./build-machine.nix
./client ./client
./dev-machine.nix ./dev-machine.nix
./handheld.nix
./pc.nix
]; ];
fileSystems."/tmp" = lib.mkIf (config.sane.roles.build-machine.enable || config.sane.roles.dev-machine) { fileSystems."/tmp" = lib.mkIf (config.sane.roles.build-machine.enable || config.sane.roles.dev-machine) {

View File

@@ -0,0 +1,17 @@
{ config, lib, ... }:
{
options.sane.roles.handheld = with lib; mkOption {
type = types.bool;
default = false;
description = ''
services/programs which you probably only want on a handheld device.
'';
};
config = lib.mkIf config.sane.roles.handheld {
sane.programs.guiApps.suggestedPrograms = [
"handheldGuiApps"
];
};
}

View File

@@ -0,0 +1,23 @@
{ config, lib, ... }:
{
options.sane.roles.pc = with lib; mkOption {
type = types.bool;
default = false;
description = ''
programs/services which only make sense for a PC form factor (e.g. keyboard + mouse).
'';
};
config = lib.mkIf config.sane.roles.pc {
sane.programs.guiApps.suggestedPrograms = [
"pcGuiApps"
];
sane.programs.gameApps.suggestedPrograms = [
"pcGameApps"
];
sane.programs.consoleUtils.suggestedPrograms = [
"consoleMediaUtils"
"pcConsoleUtils"
];
};
}