This commit is contained in:
Harald Hoyer 2024-01-11 10:26:46 +00:00
parent 66c05f9093
commit 45d6f4b0f3
205 changed files with 9040 additions and 342 deletions

View file

@ -0,0 +1,23 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps._1password;
in
{
options.plusultra.apps._1password = with types; {
enable = mkBoolOpt false "Whether or not to enable 1password.";
};
config = mkIf cfg.enable {
programs = {
_1password = enabled;
_1password-gui = {
enable = true;
polkitPolicyOwners = [ config.plusultra.user.name ];
};
};
};
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.ardour;
in
{
options.plusultra.apps.ardour = with types; {
enable = mkBoolOpt false "Whether or not to enable Ardour.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ ardour ]; };
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.blender;
in
{
options.plusultra.apps.blender = with types; {
enable = mkBoolOpt false "Whether or not to enable Blender.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ blender ]; };
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.bottles;
in
{
options.plusultra.apps.bottles = with types; {
enable = mkBoolOpt false "Whether or not to enable Bottles.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ bottles ]; };
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.cadence;
in
{
options.plusultra.apps.cadence = with types; {
enable = mkBoolOpt false "Whether or not to enable Cadence.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ cadence ]; };
}

View file

@ -0,0 +1,41 @@
{ options, config, lib, pkgs, inputs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.discord;
discord = lib.replugged.makeDiscordPlugged {
inherit pkgs;
# This is currently broken, but could speed up Discord startup in the future.
withOpenAsar = false;
plugins = {
inherit (inputs) discord-tweaks;
};
themes = {
inherit (inputs) discord-nord-theme;
};
};
in
{
options.plusultra.apps.discord = with types; {
enable = mkBoolOpt false "Whether or not to enable Discord.";
canary.enable = mkBoolOpt false "Whether or not to enable Discord Canary.";
chromium.enable = mkBoolOpt false
"Whether or not to enable the Chromium version of Discord.";
firefox.enable = mkBoolOpt false
"Whether or not to enable the Firefox version of Discord.";
native.enable = mkBoolOpt false "Whether or not to enable the native version of Discord.";
};
config = mkIf (cfg.enable or cfg.chromium.enable) {
environment.systemPackages =
lib.optional cfg.enable discord
++ lib.optional cfg.canary.enable pkgs.plusultra.discord
++ lib.optional cfg.chromium.enable pkgs.plusultra.discord-chromium
++ lib.optional cfg.firefox.enable pkgs.plusultra.discord-firefox
++ lib.optional cfg.native.enable pkgs.discord;
};
}

View file

@ -0,0 +1,18 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.dolphin;
in
{
options.plusultra.apps.dolphin = with types; {
enable = mkBoolOpt false "Whether or not to enable Dolphin.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ dolphin-emu ];
# Enable GameCube controller support.
services.udev.packages = [ pkgs.dolphinEmu ];
};
}

View file

@ -0,0 +1,30 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.doukutsu-rs;
desktopItem = pkgs.makeDesktopItem {
name = "doukutsu-rs";
desktopName = "doukutsu-rs";
genericName =
"A fully playable re-implementation of Cave Story (Doukutsu Monogatari) engine written in Rust.";
exec = "${pkgs.plusultra.doukutsu-rs}/bin/doukutsu-rs";
icon = ./icon.png;
type = "Application";
categories = [ "Game" "AdventureGame" ];
terminal = false;
};
in
{
options.plusultra.apps.doukutsu-rs = with types; {
enable = mkBoolOpt false "Whether or not to enable doukutsu-rs.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs.plusultra; [
doukutsu-rs
desktopItem
];
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -0,0 +1,16 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.element;
in
{
options.plusultra.apps.element = with types; {
enable = mkBoolOpt false "Whether or not to enable Element.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ element-desktop ];
};
}

View file

@ -0,0 +1,22 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.etcher;
in
{
options.plusultra.apps.etcher = with types; {
enable = mkBoolOpt false "Whether or not to enable etcher.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs;
[
# Etcher is currently broken in nixpkgs, temporarily replaced with
# gnome disk utility.
# etcher
gnome.gnome-disk-utility
];
};
}

View file

@ -0,0 +1,35 @@
{ lib, config, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.expressvpn;
in
{
options.plusultra.apps.expressvpn = {
enable = mkEnableOption "Express VPN";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
plusultra.expressvpn
] ++ optionals config.plusultra.desktop.gnome.enable [
gnomeExtensions.evpn-shell-assistant
];
boot.kernelModules = [ "tun" ];
systemd.services.expressvpn = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" "network-online.target" ];
description = "ExpressVPN Daemon";
serviceConfig = {
ExecStart = "${pkgs.plusultra.expressvpn}/bin/expressvpnd";
Restart = "on-failure";
RestartSec = 5;
};
};
};
}

View file

@ -0,0 +1,66 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.firefox;
defaultSettings = {
"browser.aboutwelcome.enabled" = false;
"browser.meta_refresh_when_inactive.disabled" = true;
"browser.startup.homepage" = "https://hamho.me";
"browser.bookmarks.showMobileBookmarks" = true;
"browser.urlbar.suggest.quicksuggest.sponsored" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.aboutConfig.showWarning" = false;
"browser.ssb.enabled" = true;
};
in
{
options.plusultra.apps.firefox = with types; {
enable = mkBoolOpt false "Whether or not to enable Firefox.";
extraConfig =
mkOpt str "" "Extra configuration for the user profile JS file.";
userChrome =
mkOpt str "" "Extra configuration for the user chrome CSS file.";
settings = mkOpt attrs defaultSettings "Settings to apply to the profile.";
};
config = mkIf cfg.enable {
plusultra.desktop.addons.firefox-nordic-theme = enabled;
services.gnome.gnome-browser-connector.enable = config.plusultra.desktop.gnome.enable;
plusultra.home = {
file = {
".mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json".source = "${pkgs.browserpass}/lib/mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json";
".mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source = mkIf config.plusultra.desktop.gnome.enable "${pkgs.chrome-gnome-shell}/lib/mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json";
};
extraOptions = {
programs.firefox = {
enable = true;
package = pkgs.firefox.override (
{
cfg = {
enableBrowserpass = true;
enableGnomeExtensions = config.plusultra.desktop.gnome.enable;
};
extraNativeMessagingHosts =
optional
config.plusultra.desktop.gnome.enable
pkgs.gnomeExtensions.gsconnect;
}
);
profiles.${config.plusultra.user.name} = {
inherit (cfg) extraConfig userChrome settings;
id = 0;
name = config.plusultra.user.name;
};
};
};
};
};
}

View file

@ -0,0 +1,16 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.frappe-books;
in
{
options.plusultra.apps.frappe-books = with types; {
enable = mkBoolOpt false "Whether or not to enable FrappeBooks.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ plusultra.frappe-books ];
};
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.freetube;
in
{
options.plusultra.apps.freetube = with types; {
enable = mkBoolOpt false "Whether or not to enable FreeTube.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ freetube ]; };
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.gimp;
in
{
options.plusultra.apps.gimp = with types; {
enable = mkBoolOpt false "Whether or not to enable Gimp.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ gimp ]; };
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.gparted;
in
{
options.plusultra.apps.gparted = with types; {
enable = mkBoolOpt false "Whether or not to enable gparted.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ gparted ]; };
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.hey;
in
{
options.plusultra.apps.hey = with types; {
enable = mkBoolOpt false "Whether or not to enable HEY.";
};
config = mkIf cfg.enable { environment.systemPackages = with pkgs.plusultra; [ hey ]; };
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.inkscape;
in
{
options.plusultra.apps.inkscape = with types; {
enable = mkBoolOpt false "Whether or not to enable Inkscape.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ inkscape-with-extensions google-fonts ];
};
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.logseq;
in
{
options.plusultra.apps.logseq = with types; {
enable = mkBoolOpt false "Whether or not to enable logseq.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ logseq ]; };
}

View file

@ -0,0 +1,9 @@
[input]
escapeKey=56
rawMouse=yes
mouseSens=6
[win]
size=1920x1080
autoResize=yes
quickSplash=yes

View file

@ -0,0 +1,23 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.looking-glass-client;
user = config.plusultra.user;
in
{
options.plusultra.apps.looking-glass-client = with types; {
enable =
mkBoolOpt false "Whether or not to enable the Looking Glass client.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ looking-glass-client ];
environment.etc."looking-glass-client.ini" = {
user = "+${toString config.users.users.${user.name}.uid}";
source = ./client.ini;
};
};
}

View file

@ -0,0 +1,21 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.lutris;
in
{
options.plusultra.apps.lutris = with types; {
enable = mkBoolOpt false "Whether or not to enable Lutris.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
lutris
# Needed for some installers like League of Legends
openssl
gnome.zenity
];
};
}

View file

@ -0,0 +1,25 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.obs;
in
{
options.plusultra.apps.obs = with types; {
enable = mkBoolOpt false "Whether or not to enable support for OBS.";
};
config = mkIf cfg.enable {
environment.systemPackages = [
(pkgs.wrapOBS {
plugins = with pkgs.obs-studio-plugins; [
wlrobs
obs-multi-rtmp
obs-move-transition
looking-glass-obs
];
})
];
};
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.pcsx2;
in
{
options.plusultra.apps.pcsx2 = with types; {
enable = mkBoolOpt false "Whether or not to enable PCSX2.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ pcsx2 ]; };
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.pitivi;
in
{
options.plusultra.apps.pitivi = with types; {
enable = mkBoolOpt false "Whether or not to enable Pitivi.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ pitivi ]; };
}

View file

@ -0,0 +1,16 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.pocketcasts;
in
{
options.plusultra.apps.pocketcasts = with types; {
enable = mkBoolOpt false "Whether or not to enable Pocketcasts.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs.plusultra; [ pocketcasts ];
};
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.prismlauncher;
in
{
options.plusultra.apps.prismlauncher = with types; {
enable = mkBoolOpt false "Whether or not to enable Prism Launcher.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ prismlauncher ]; };
}

View file

@ -0,0 +1,16 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.protontricks;
in
{
options.plusultra.apps.protontricks = with types; {
enable = mkBoolOpt false "Whether or not to enable Protontricks.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ protontricks ];
};
}

View file

@ -0,0 +1,18 @@
{ options
, config
, lib
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.apps.r2modman;
in
{
options.plusultra.apps.r2modman = with types; {
enable = mkBoolOpt false "Whether or not to enable r2modman.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ r2modman ]; };
}

View file

@ -0,0 +1,16 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.rpcs3;
in
{
options.plusultra.apps.rpcs3 = with types; {
enable = mkBoolOpt false "Whether or not to enable rpcs3.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ rpcs3 ];
};
}

View file

@ -0,0 +1,30 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.steam;
in
{
options.plusultra.apps.steam = with types; {
enable = mkBoolOpt false "Whether or not to enable support for Steam.";
};
config = mkIf cfg.enable {
programs.steam.enable = true;
programs.steam.remotePlay.openFirewall = true;
hardware.steam-hardware.enable = true;
# Enable GameCube controller support.
services.udev.packages = [ pkgs.dolphinEmu ];
environment.systemPackages = with pkgs.plusultra; [
steam
];
environment.sessionVariables = {
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "$HOME/.steam/root/compatibilitytools.d";
};
};
}

View file

@ -0,0 +1,18 @@
{ lib, pkgs, config, ... }:
let
cfg = config.plusultra.apps.steamtinkerlaunch;
inherit (lib) mkIf mkEnableOption;
in
{
options.plusultra.apps.steamtinkerlaunch = {
enable = mkEnableOption "Steam Tinker Launch";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
steamtinkerlaunch
];
};
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.twitter;
in
{
options.plusultra.apps.twitter = with types; {
enable = mkBoolOpt false "Whether or not to enable Twitter.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs.plusultra; [ twitter ]; };
}

View file

@ -0,0 +1,23 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.ubports-installer;
in
{
options.plusultra.apps.ubports-installer = with types; {
enable = mkBoolOpt false "Whether or not to enable the UBPorts Installer.";
};
config =
mkIf cfg.enable {
environment.systemPackages = with pkgs.plusultra; [
ubports-installer
];
services.udev.packages = with pkgs.plusultra; [
ubports-installer-udev-rules
];
};
}

View file

@ -0,0 +1,21 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.virtualbox;
in
{
options.plusultra.apps.virtualbox = with types; {
enable = mkBoolOpt false "Whether or not to enable Virtualbox.";
};
config = mkIf cfg.enable {
virtualisation.virtualbox.host = {
enable = true;
enableExtensionPack = true;
};
plusultra.user.extraGroups = [ "vboxusers" ];
};
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.vlc;
in
{
options.plusultra.apps.vlc = with types; {
enable = mkBoolOpt false "Whether or not to enable vlc.";
};
config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ vlc ]; };
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.apps.vscode;
in
{
options.plusultra.apps.vscode = with types; {
enable = mkBoolOpt false "Whether or not to enable vscode.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ vscode ]; };
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.winetricks;
in
{
options.plusultra.apps.winetricks = with types; {
enable = mkBoolOpt false "Whether or not to enable Winetricks.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs; [ winetricks ]; };
}

View file

@ -0,0 +1,15 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.yt-music;
in
{
options.plusultra.apps.yt-music = with types; {
enable = mkBoolOpt false "Whether or not to enable YouTube Music.";
};
config =
mkIf cfg.enable { environment.systemPackages = with pkgs.plusultra; [ yt-music ]; };
}

View file

@ -0,0 +1,17 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.yubikey;
in
{
options.plusultra.apps.yubikey = with types; {
enable = mkBoolOpt false "Whether or not to enable Yubikey.";
};
config = mkIf cfg.enable {
services.yubikey-agent.enable = true;
environment.systemPackages = with pkgs; [ yubikey-manager-qt ];
};
}

View file

@ -0,0 +1,16 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.apps.yuzu;
in
{
options.plusultra.apps.yuzu = with types; {
enable = mkBoolOpt false "Whether or not to enable Yuzu.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ yuzu-mainline ];
};
}

View file

@ -0,0 +1,22 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.archetypes.gaming;
in
{
options.plusultra.archetypes.gaming = with types; {
enable = mkBoolOpt false "Whether or not to enable the gaming archetype.";
};
config = mkIf cfg.enable {
plusultra.suites = {
common = enabled;
desktop = enabled;
games = enabled;
social = enabled;
media = enabled;
};
};
}

View file

@ -0,0 +1,26 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.archetypes.server;
in
{
options.plusultra.archetypes.server = with types; {
enable =
mkBoolOpt false "Whether or not to enable the server archetype.";
};
config = mkIf cfg.enable {
plusultra = {
suites = {
common-slim = enabled;
};
cli-apps = {
neovim = enabled;
tmux = enabled;
};
};
};
}

View file

@ -0,0 +1,29 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.archetypes.workstation;
in
{
options.plusultra.archetypes.workstation = with types; {
enable =
mkBoolOpt false "Whether or not to enable the workstation archetype.";
};
config = mkIf cfg.enable {
plusultra = {
suites = {
common = enabled;
desktop = enabled;
development = enabled;
art = enabled;
video = enabled;
social = enabled;
media = enabled;
};
tools = {
appimage-run = enabled;
};
};
};
}

18
modules/nixos/cache/public/default.nix vendored Normal file
View file

@ -0,0 +1,18 @@
{ config, lib, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.cache.public;
in
{
options.plusultra.cache.public = {
enable = mkEnableOption "Plus Ultra public cache";
};
config = mkIf cfg.enable {
plusultra.nix.extra-substituters = {
"https://attic.ruby.hamho.me/public".key = "public:QUkZTErD8fx9HQ64kuuEUZHO9tXNzws7chV8qy/KLUk=";
};
};
}

View file

@ -0,0 +1,18 @@
inputs@{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.cli-apps.flake;
in
{
options.plusultra.cli-apps.flake = with types; {
enable = mkBoolOpt false "Whether or not to enable flake.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
snowfallorg.flake
];
};
}

View file

@ -0,0 +1,47 @@
inputs @ { options
, config
, lib
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.cli-apps.neovim;
in
{
options.plusultra.cli-apps.neovim = with types; {
enable = mkBoolOpt false "Whether or not to enable neovim.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
# FIXME: As of today (2022-12-09), `page` no longer works with my Neovim
# configuration. Either something in my configuration is breaking it or `page` is busted.
# page
plusultra.neovim
];
environment.variables = {
# PAGER = "page";
# MANPAGER =
# "page -C -e 'au User PageDisconnect sleep 100m|%y p|enew! |bd! #|pu p|set ft=man'";
PAGER = "less";
MANPAGER = "less";
NPM_CONFIG_PREFIX = "$HOME/.npm-global";
EDITOR = "nvim";
};
plusultra.home = {
configFile = {
"dashboard-nvim/.keep".text = "";
};
extraOptions = {
# Use Neovim for Git diffs.
programs.zsh.shellAliases.vimdiff = "nvim -d";
programs.bash.shellAliases.vimdiff = "nvim -d";
programs.fish.shellAliases.vimdiff = "nvim -d";
};
};
};
}

View file

@ -0,0 +1,31 @@
{ lib, pkgs, config, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.cli-apps.prisma;
in
{
options.plusultra.cli-apps.prisma = with types; {
enable = mkBoolOpt false "Whether or not to install Prisma";
pkgs = {
npm = mkOpt package pkgs.nodePackages.prisma "The NPM package to install";
engines = mkOpt package pkgs.prisma-engines
"The package to get prisma engines from";
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ cfg.pkgs.npm ];
plusultra.home.extraOptions = {
programs.zsh.initExtra = ''
export PRISMA_MIGRATION_ENGINE_BINARY="${cfg.pkgs.engines}/bin/migration-engine"
export PRISMA_QUERY_ENGINE_BINARY="${cfg.pkgs.engines}/bin/query-engine"
export PRISMA_QUERY_ENGINE_LIBRARY="${cfg.pkgs.engines}/lib/libquery_engine.node"
export PRISMA_INTROSPECTION_ENGINE_BINARY="${cfg.pkgs.engines}/bin/introspection-engine"
export PRISMA_FMT_BINARY="${cfg.pkgs.engines}/bin/prisma-fmt"
'';
};
};
}

View file

@ -0,0 +1,16 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.cli-apps.proton;
in
{
options.plusultra.cli-apps.proton = with types; {
enable = mkBoolOpt false "Whether or not to enable Proton.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ proton-caller ];
};
}

View file

@ -0,0 +1,20 @@
{ config
, lib
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.cli-apps.thaw;
in
{
options.plusultra.cli-apps.thaw = with types; {
enable = mkBoolOpt false "Whether or not to enable thaw.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
snowfallorg.thaw
];
};
}

View file

@ -0,0 +1,5 @@
# Enable saving sessions.
set -g @continuum-restore 'on'
# Save every 30 minutes.
set -g @continuum-save-interval '30'

View file

@ -0,0 +1,15 @@
# Create a vertical split to show search & results to keep
# the content visible.
set -g @extrakto_split_direction "v"
# Override the way that Extrakto copies text. By default
# it was trying to use xclip and would not properly pick
# up on $XDG_SESSION_TYPE being wayland. Instead, use
# Tmux's built-in clipboard functionality.
set -g @extrakto_clip_tool_run "tmux_osc52"
# FIXME: The current version of Extrakto in
# NixPkgs is out of date and does not support wayland.
# This overrides the clipping tool to ensure that it works
# under wayland.
set -g @extrakto_clip_tool "wl-copy"

View file

@ -0,0 +1,2 @@
# Change default keybinding.
TMUX_FZF_LAUNCH_KEY="C-f"

View file

@ -0,0 +1,38 @@
# Lower delay waiting for chord after escape key press.
set -g escape-time 0
# Change the prefix from C-b to C-s to make it easier to type.
set -g prefix C-s
unbind C-b
bind C-s send-prefix
# Start window numbers at 1 rather than 0.
set -g base-index 1
# Use h, j, k, l for movement between panes.
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Fix colors being wrong in programs like Neovim.
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Expand the left status to accomodate longer session names.
set-option -g status-left-length 20
# One of the plugins binds C-l, make sure we have accces to it.
unbind C-l
bind -n C-l send-keys C-l
# Don't require a prompt to detach from the current session.
unbind -n M-E
bind -n M-E detach-client
# Reload tmux configuration from ~/.config/tmux/tmux.conf instead
# of Tilish's default of ~/.tmux.conf.
unbind -n M-C
bind -n M-C source-file "~/.config/tmux/tmux.conf"
# Use M-z to zoom and unzoom panes.
bind -n M-z resize-pane -Z

View file

@ -0,0 +1,21 @@
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'select-pane -L'
bind-key -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'select-pane -D'
bind-key -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'select-pane -U'
bind-key -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'M-h' select-pane -L
bind-key -T copy-mode-vi 'M-j' select-pane -D
bind-key -T copy-mode-vi 'M-k' select-pane -U
bind-key -T copy-mode-vi 'M-l' select-pane -R
bind-key -T copy-mode-vi 'M-p' select-pane -l

View file

@ -0,0 +1,37 @@
# Copyright (C) 2017-present Arctic Ice Studio <development@arcticicestudio.com>
# Copyright (C) 2017-present Sven Greb <development@svengreb.de>
# Copyright (C) 2022-present Jake Hamilton <jake.hamilton@hey.com>
# Project: Nord tmux
# Repository: https://github.com/arcticicestudio/nord-tmux
# License: MIT
#+----------------+
#+ Plugin Support +
#+----------------+
#+--- tmux-prefix-highlight ---+
set -g @prefix_highlight_output_prefix "#[fg=brightcyan]#[bg=black]#[nobold]#[noitalics]#[nounderscore]#[bg=brightcyan]#[fg=black]"
set -g @prefix_highlight_output_suffix ""
set -g @prefix_highlight_copy_mode_attr "fg=brightcyan,bg=black,bold"
#+--------+
#+ Status +
#+--------+
#+--- Bars ---+
set -g status-left "#[fg=brightblack,bg=black]#[fg=white,bg=brightblack,bold] #S #[fg=brightblack,bg=black,nobold,noitalics,nounderscore]"
set -g status-right "#{prefix_highlight}#[fg=brightblack,bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack,nobold] #H #[fg=brightblack,bg=black,nobold]"
#+--- Windows ---+
set -g window-status-format "#[fg=brightblack,bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] #I#[fg=white,bg=brightblack,nobold,noitalics,nounderscore]: #W #[fg=brightblack,bg=black,nobold,noitalics,nounderscore]"
set -g window-status-current-format "#[fg=#5e81ac,bg=black]#[fg=white,bg=#5e81ac,bold,noitalics,nounderscore] #I#[fg=white,bg=#5e81ac,bold,noitalics,nounderscore]: #W #[fg=#5e81ac,bg=black,nobold,noitalics,nounderscore]"
set -g window-status-separator " "
# Center the window list (yes, this value has to be written as "centre").
set -g status-justify centre
#+----------------+
#+ Windows +
#+----------------+
#+--- Bars ---+
set -g pane-active-border-style "bg=default fg=blue"

View file

@ -0,0 +1,12 @@
# Integrate Tmux and Neovim movement.
set -g @tilish-navigator "on"
# Default to splitting once vertically and then splitting horizontally
# after that.
select-layout "main-vertical"
select-layout -E
set -g @tilish-default "main-vertical"
bind-key -n "M-q" kill-pane

View file

@ -0,0 +1,20 @@
{ lib
, config
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.cli-apps.tmux;
in
{
options.plusultra.cli-apps.tmux = {
enable = mkEnableOption "Tmux";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
plusultra.tmux
];
};
}

View file

@ -0,0 +1,20 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.cli-apps.wine;
in
{
options.plusultra.cli-apps.wine = with types; {
enable = mkBoolOpt false "Whether or not to enable Wine.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
winePackages.unstable
winetricks
wine64Packages.unstable
];
};
}

View file

@ -0,0 +1,17 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.cli-apps.wshowkeys;
in
{
options.plusultra.cli-apps.wshowkeys = with types; {
enable = mkBoolOpt false "Whether or not to enable wshowkeys.";
};
config = mkIf cfg.enable {
plusultra.user.extraGroups = [ "input" ];
environment.systemPackages = with pkgs; [ wshowkeys ];
};
}

View file

@ -0,0 +1,17 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.cli-apps.yubikey;
in
{
options.plusultra.cli-apps.yubikey = with types; {
enable = mkBoolOpt false "Whether or not to enable Yubikey.";
};
config = mkIf cfg.enable {
services.yubikey-agent.enable = true;
environment.systemPackages = with pkgs; [ yubikey-manager ];
};
}

View file

@ -0,0 +1,19 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.desktop.addons.electron-support;
in
{
options.plusultra.desktop.addons.electron-support = with types; {
enable = mkBoolOpt false
"Whether to enable electron support in the desktop environment.";
};
config = mkIf cfg.enable {
plusultra.home.configFile."electron-flags.conf".source =
./electron-flags.conf;
environment.sessionVariables = { NIXOS_OZONE_WL = "1"; };
};
}

View file

@ -0,0 +1,2 @@
--enable-features=UseOzonePlatform
--ozone-platform=wayland

View file

@ -0,0 +1,23 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.desktop.addons.firefox-nordic-theme;
profileDir = ".mozilla/firefox/${config.plusultra.user.name}";
in
{
options.plusultra.desktop.addons.firefox-nordic-theme = with types; {
enable = mkBoolOpt false "Whether to enable the Nordic theme for firefox.";
};
config = mkIf cfg.enable {
plusultra.apps.firefox = {
extraConfig = builtins.readFile
"${pkgs.plusultra.firefox-nordic-theme}/configuration/user.js";
userChrome = ''
@import "${pkgs.plusultra.firefox-nordic-theme}/userChrome.css";
'';
};
};
}

View file

@ -0,0 +1,20 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.desktop.addons.foot;
in
{
options.plusultra.desktop.addons.foot = with types; {
enable = mkBoolOpt false "Whether to enable the gnome file manager.";
};
config = mkIf cfg.enable {
plusultra.desktop.addons.term = {
enable = true;
pkg = pkgs.foot;
};
plusultra.home.configFile."foot/foot.ini".source = ./foot.ini;
};
}

View file

@ -0,0 +1,50 @@
###########################################
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
#░░█▀█░█░░░█░█░█▀▀░░░█░█░█░░░▀█▀░█▀▄░█▀█░░#
#░░█▀▀░█░░░█░█░▀▀█░░░█░█░█░░░░█░░█▀▄░█▀█░░#
#░░▀░░░▀▀▀░▀▀▀░▀▀▀░░░▀▀▀░▀▀▀░░▀░░▀░▀░▀░▀░░#
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
###########################################
[main]
font=Hack Nerd Font Mono:size=12
#,Noto Color Emoji:size=12
line-height=14
underline-offset=2
pad=20x4 center
term=xterm-256color
[scrollback]
lines=2000
[url]
protocols=http,https,ftp,ftps,file,gemini,gopher,mailto
[cursor]
blink=yes
[colors]
# Nord
foreground=D8DEE9
background=2E3440
regular0=2E3440
regular1=BF616A
regular2=A3BE8C
regular3=EBCB8B
regular4=81A1C1
regular5=B48EAD
regular6=88C0D0
regular7=E5E9F0
bright0=4C566A
bright1=BF616A
bright2=A3BE8C
bright3=EBCB8B
bright4=8FBCBB
bright5=B48EAD
bright6=8FBCBB
bright7=ECEFF4
[csd]
size=0

View file

@ -0,0 +1,118 @@
{ options
, config
, lib
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.desktop.addons.gtk;
gdmCfg = config.services.xserver.displayManager.gdm;
in
{
options.plusultra.desktop.addons.gtk = with types; {
enable = mkBoolOpt false "Whether to customize GTK and apply themes.";
theme = {
name =
mkOpt str "Nordic-darker"
"The name of the GTK theme to apply.";
pkg = mkOpt package pkgs.nordic "The package to use for the theme.";
};
cursor = {
name =
mkOpt str "Bibata-Modern-Ice"
"The name of the cursor theme to apply.";
pkg = mkOpt package pkgs.plusultra.bibata-cursors "The package to use for the cursor theme.";
};
icon = {
name =
mkOpt str "Papirus"
"The name of the icon theme to apply.";
pkg = mkOpt package pkgs.papirus-icon-theme "The package to use for the icon theme.";
};
};
config = mkIf cfg.enable {
environment.systemPackages = [
cfg.icon.pkg
cfg.cursor.pkg
];
environment.sessionVariables = {
XCURSOR_THEME = cfg.cursor.name;
};
plusultra.home.extraOptions = {
gtk = {
enable = true;
theme = {
name = cfg.theme.name;
package = cfg.theme.pkg;
};
cursorTheme = {
name = cfg.cursor.name;
package = cfg.cursor.pkg;
};
iconTheme = {
name = cfg.icon.name;
package = cfg.icon.pkg;
};
};
};
# NOTE: In order to set the cursor theme in GDM we have to specify it in the
# dconf profile. However, the NixOS module doesn't provide an easy way to do this so the relevant
# parts have been extracted from:
# https://github.com/NixOS/nixpkgs/blob/96e18717904dfedcd884541e5a92bf9ff632cf39/nixos/modules/services/x11/display-managers/gdm.nix
#
# NOTE: The GTK and icon themes don't seem to affect recent GDM versions. I've
# left them here as reference for the future.
programs.dconf.profiles = mkIf gdmCfg.enable {
gdm =
let
customDconf = pkgs.writeTextFile {
name = "gdm-dconf";
destination = "/dconf/gdm-custom";
text = ''
${optionalString (!gdmCfg.autoSuspend) ''
[org/gnome/settings-daemon/plugins/power]
sleep-inactive-ac-type='nothing'
sleep-inactive-battery-type='nothing'
sleep-inactive-ac-timeout=0
sleep-inactive-battery-timeout=0
''}
[org/gnome/desktop/interface]
gtk-theme='${cfg.theme.name}'
cursor-theme='${cfg.cursor.name}'
icon-theme='${cfg.icon.name}'
'';
};
customDconfDb = pkgs.stdenv.mkDerivation {
name = "gdm-dconf-db";
buildCommand = ''
${pkgs.dconf}/bin/dconf compile $out ${customDconf}/dconf
'';
};
in
mkForce (
pkgs.stdenv.mkDerivation {
name = "dconf-gdm-profile";
buildCommand = ''
# Check that the GDM profile starts with what we expect.
if [ $(head -n 1 ${pkgs.gnome.gdm}/share/dconf/profile/gdm) != "user-db:user" ]; then
echo "GDM dconf profile changed, please update gtk/default.nix"
exit 1
fi
# Insert our custom DB behind it.
sed '2ifile-db:${customDconfDb}' ${pkgs.gnome.gdm}/share/dconf/profile/gdm > $out
'';
}
);
};
};
}

View file

@ -0,0 +1,3 @@
profile {
output eDP-1 enable scale 2
}

View file

@ -0,0 +1,41 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.desktop.addons.kanshi;
user = config.plusultra.user;
home = config.users.users.${user.name}.home;
in
{
options.plusultra.desktop.addons.kanshi = with types; {
enable =
mkBoolOpt false "Whether to enable Kanshi in the desktop environment.";
};
config = mkIf cfg.enable {
plusultra.home.configFile."kanshi/config".source = ./config;
environment.systemPackages = with pkgs; [ kanshi ];
# configuring kanshi
systemd.user.services.kanshi = {
description = "Kanshi output autoconfig ";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
environment = { XDG_CONFIG_HOME = "${home}/.config"; };
serviceConfig = {
ExecCondition = ''
${pkgs.bash}/bin/bash -c '[ -n "$WAYLAND_DISPLAY" ]'
'';
ExecStart = ''
${pkgs.kanshi}/bin/kanshi
'';
RestartSec = 5;
Restart = "always";
};
};
};
}

View file

@ -0,0 +1,17 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.desktop.addons.keyring;
in
{
options.plusultra.desktop.addons.keyring = with types; {
enable = mkBoolOpt false "Whether to enable the gnome keyring.";
};
config = mkIf cfg.enable {
services.gnome.gnome-keyring.enable = true;
environment.systemPackages = with pkgs; [ gnome.seahorse ];
};
}

View file

@ -0,0 +1,18 @@
###########################################
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
#░░█▀█░█░░░█░█░█▀▀░░░█░█░█░░░▀█▀░█▀▄░█▀█░░#
#░░█▀▀░█░░░█░█░▀▀█░░░█░█░█░░░░█░░█▀▄░█▀█░░#
#░░▀░░░▀▀▀░▀▀▀░▀▀▀░░░▀▀▀░▀▀▀░░▀░░▀░▀░▀░▀░░#
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
###########################################
font=Hack Nerd Font Mono 10
border-radius=8
text-color=#2e3440ff
background-color=#eceff4f4
border-color=#d8dee9ff
border-size=0
margin=12,12,6
padding=12,12,12,12
default-timeout=5000
max-visible=3

View file

@ -0,0 +1,44 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.desktop.addons.mako;
in
{
options.plusultra.desktop.addons.mako = with types; {
enable = mkBoolOpt false "Whether to enable Mako in Sway.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ mako libnotify ];
systemd.user.services.mako = {
description = "Mako notification daemon";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "dbus";
BusName = "org.freedesktop.Notifications";
ExecCondition = ''
${pkgs.bash}/bin/bash -c '[ -n "$WAYLAND_DISPLAY" ]'
'';
ExecStart = ''
${pkgs.mako}/bin/mako
'';
ExecReload = ''
${pkgs.mako}/bin/makoctl reload
'';
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
plusultra.home.configFile."mako/config".source = ./config;
};
}

View file

@ -0,0 +1,20 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.desktop.addons.nautilus;
in
{
options.plusultra.desktop.addons.nautilus = with types; {
enable = mkBoolOpt false "Whether to enable the gnome file manager.";
};
config = mkIf cfg.enable {
# Enable support for browsing samba shares.
services.gvfs.enable = true;
networking.firewall.extraCommands =
"iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns";
environment.systemPackages = with pkgs; [ gnome.nautilus ];
};
}

View file

@ -0,0 +1,42 @@
/*
vim: filetype=css
*/
configuration {
fullscreen: false;
show-icons: false;
sidebar-mode: false;
}
* {
// Default bg is transparent.
background-color: transparent;
// Default text is white
text-color: white;
spacing: 30;
}
#window {
// Default font
font: "Nerd Font Hack 18";
fullscreen: true;
transparency: "background";
background-color: #282a36BA;
// Add dummy widgets on top and bottom so the sizing
// nicely centers hdum, independent of resolution.
children: [ dummy1, hdum, dummy2 ];
}
#hdum {
orientation: horizontal;
// Add dummy widgets on left and right so the sizing
// nicely centers mainbox, independent of resolution.
children: [ dummy3, mainbox, dummy4 ];
}
#element selected {
text-color: #caa9fa;
}

View file

@ -0,0 +1,18 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.desktop.addons.rofi;
in
{
options.plusultra.desktop.addons.rofi = with types; {
enable =
mkBoolOpt false "Whether to enable Rofi in the desktop environment.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ rofi ];
plusultra.home.configFile."rofi/config.rasi".source = ./config.rasi;
};
}

View file

@ -0,0 +1,3 @@
[Default]
save_dir=$HOME/Pictures/screenshots
save_filename_format=%Y%m%d-%H%M%S.png

View file

@ -0,0 +1,19 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.desktop.addons.swappy;
in
{
options.plusultra.desktop.addons.swappy = with types; {
enable =
mkBoolOpt false "Whether to enable Swappy in the desktop environment.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ swappy ];
plusultra.home.configFile."swappy/config".source = ./config;
plusultra.home.file."Pictures/screenshots/.keep".text = "";
};
}

View file

@ -0,0 +1,14 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.desktop.addons.term;
in
{
options.plusultra.desktop.addons.term = with types; {
enable = mkBoolOpt false "Whether to enable the gnome file manager.";
pkg = mkOpt package pkgs.foot "The terminal to install.";
};
config = mkIf cfg.enable { environment.systemPackages = [ cfg.pkg ]; };
}

View file

@ -0,0 +1,26 @@
{ options, config, pkgs, lib, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.desktop.addons.wallpapers;
inherit (pkgs.plusultra) wallpapers;
in
{
options.plusultra.desktop.addons.wallpapers = with types; {
enable = mkBoolOpt false
"Whether or not to add wallpapers to ~/Pictures/wallpapers.";
};
config = {
plusultra.home.file = lib.foldl
(acc: name:
let wallpaper = wallpapers.${name};
in
acc // {
"Pictures/wallpapers/${wallpaper.fileName}".source = wallpaper;
})
{ }
(wallpapers.names);
};
}

View file

@ -0,0 +1,119 @@
{
"layer": "top",
"modules-left": [
"sway/workspaces",
"custom/media",
"sway/mode"
],
"modules-center": [],
"modules-right": [
"network",
"pulseaudio",
"cpu",
"battery",
"tray",
"clock#date",
"clock#time"
],
"sway/mode": {
"format": "{}"
},
"custom/media": {
"format": "{icon}",
"return-type": "json",
"format-icons": {
"Playing": "",
"Paused": "ﳌ"
},
"max-length": 70,
"exec": "playerctl -a metadata --format '{\"text\": \"{{playerName}}\", \"tooltip\": \"{{playerName}}: {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F",
"on-click": "playerctl play-pause"
},
"mpd": {
"tooltip": false,
"format": "{stateIcon} {artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S})",
"format-disconnected": "ﳌ",
"format-stopped": "",
"state-icons": {
"playing": "",
"paused": ""
}
},
"pulseaudio": {
"tooltip": true,
"tooltip-format": "{volume}%",
"scroll-step": 5,
"format": "{icon}",
"format-bluetooth": "",
"format-muted": "婢",
"format-icons": {
"default": [
"奄",
"奔",
"墳"
]
},
"on-click": "gnome-control-center sound"
},
"network": {
"tooltip": true,
"format-wifi": " ",
"tooltip-format-wifi": "{essid} @ {signalStrength}%",
"format-ethernet": "",
"on-click": "gnome-control-center wifi"
},
"temperature": {
"tooltip": true,
"tooltip-format": "{temperatureC} 糖",
"critical-threshold": 70,
"format-icons": [
"",
"",
""
],
"format": "{icon}"
},
"cpu": {
"tooltip": true,
"format": "",
"states": {
"heavy": 70,
"full": 90
}
},
"memory": {
"tooltip": true,
"tooltip-format": "{used:0.1f}G/{total:0.1f}G",
"format": "",
"states": {
"heavy": 70,
"full": 90
}
},
"battery": {
"bat": "BAT1",
"interval": 60,
"states": {
"warning": 30,
"critical": 15
},
"format": "{icon}",
"format-critical": "",
"format-icons": {
"default": ["", "", "", "", "", "", "", "", "", ""],
"charging": ["", "", "", "", "", "", ""],
"not": "",
"plugged": ""
}
},
"tray": {
"icon-size": 16,
"spacing": 10
},
"clock#date": {
"format": "{:%a, %b %d}"
},
"clock#time": {
"format": "{:%I:%M %p}"
}
}

View file

@ -0,0 +1,19 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.desktop.addons.waybar;
in
{
options.plusultra.desktop.addons.waybar = with types; {
enable =
mkBoolOpt false "Whether to enable Waybar in the desktop environment.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ waybar ];
plusultra.home.configFile."waybar/config".source = ./config;
plusultra.home.configFile."waybar/style.css".source = ./style.css;
};
}

View file

@ -0,0 +1,314 @@
/*
********************************************
**
**
**
**
**
********************************************
*/
* {
border: none;
border-radius: 0;
font-family: Nerd Font Hack;
font-size: 14px;
}
window#waybar {
background: transparent;
}
window#waybar.hidden {
opacity: 0.2;
}
#window {
margin-top: 8px;
padding-left: 20px;
padding-right: 20px;
border-radius: 8px;
transition: none;
color: transparent;
background: transparent;
}
window#waybar.termite #window,
window#waybar.Firefox #window,
window#waybar.Navigator #window,
window#waybar.PCSX2 #window {
color: #4d4d4d;
background: #e6e6e6;
}
tooltip {
border-radius: 12px;
background: #eceff4;
}
tooltip label {
color: #2e3440;
text-shadow: none;
padding: 0 4px;
}
#workspaces button,
#mode,
#mpd,
#custom-media,
#network,
#pulseaudio,
#temperature,
#cpu,
#memory,
#tray,
#clock,
#battery {
color: #2e3440;
background: #eceff4;
}
#workspaces {
margin-top: 8px;
margin-left: 12px;
margin-bottom: 0;
border-radius: 8px;
transition: none;
background: #d8dee9;
}
#workspaces button {
transition: none;
font-size: 16px;
border-radius: 8px;
padding: 4px 8px;
font-weight: bold;
background: #d8dee9;
}
#workspaces button.visible {
color: #88c0d0;
background: #eceff4;
}
#workspaces button.visible:hover {
color: #88c0d0;
background: #eceff4;
}
#workspaces button:hover {
transition: none;
box-shadow: inherit;
text-shadow: inherit;
color: #81a1c1;
}
#custom-media {
margin-top: 8px;
margin-left: 8px;
padding-left: 16px;
padding-right: 16px;
margin-bottom: 0;
border-radius: 8px;
transition: none;
font-weight: bold;
}
#custom-media.Paused {
color: #4c566a;
background: #d8dee9;
}
#custom-media.Playing {
color: #eceff4;
background: #8fbcbb;
}
#network {
margin-top: 8px;
margin-left: 8px;
padding-left: 16px;
padding-right: 10px;
margin-bottom: 0;
border-radius: 8px;
transition: none;
font-size: 24px;
}
#network.disconnected,
#network.disabled {
color: #2e3440;
background: #eceff4;
}
#network.wifi {
color: #d8dee9;
background: #8fbcbb;
}
#pulseaudio {
margin-top: 8px;
margin-left: 8px;
padding-left: 16px;
padding-right: 16px;
margin-bottom: 0;
border-radius: 8px;
transition: none;
font-size: 18px;
}
#pulseaudio.bluetooth {
color: #d8dee9;
background: #81a1c1;
}
#pulseaudio.muted {
color: #d8dee9;
background: #bf616a;
}
#battery {
margin-top: 8px;
margin-left: 8px;
padding-left: 16px;
padding-right: 16px;
margin-bottom: 0;
border-radius: 8px;
transition: none;
font-size: 18px;
}
#battery.warning {
color: #eceff4;
background: #d08770;
}
#battery.critical {
color: #eceff4;
background: #bf616a;
}
#temperature {
margin-top: 8px;
margin-left: 8px;
padding-left: 16px;
padding-right: 16px;
margin-bottom: 0;
border-radius: 8px;
transition: none;
font-size: 20px;
}
#temperature.critical {
color: #d8dee9;
background: #bf616a;
animation: red-flash 1s linear infinite;
}
@keyframes red-flash {
0% {
background: #bf616a;
}
50% {
background: #d37f87;
}
100% {
background: #bf616a;
}
}
#cpu {
margin-top: 8px;
margin-left: 8px;
padding-left: 16px;
padding-right: 16px;
margin-bottom: 0;
border-radius: 8px;
transition: none;
font-size: 20px;
}
#cpu.heavy {
color: #d8dee9;
background: #d08770;
}
#cpu.full {
color: #d8dee9;
background: #bf616a;
}
#memory {
margin-top: 8px;
margin-left: 8px;
padding-left: 16px;
padding-right: 16px;
margin-bottom: 0;
border-radius: 8px;
transition: none;
font-size: 20px;
}
#memory.heavy {
color: #d8dee9;
background: #d08770;
}
#memory.full {
color: #d8dee9;
background: #bf616a;
}
#tray {
margin-top: 8px;
margin-left: 8px;
padding-left: 16px;
padding-right: 16px;
margin-bottom: 0;
border-radius: 8px;
transition: none;
font-size: 20px;
}
#mode {
margin-top: 8px;
margin-left: 8px;
padding-left: 16px;
padding-right: 16px;
margin-bottom: 0;
border-radius: 8px;
transition: none;
/* font-size: 20px; */
color: #eceff4;
background: #d08770;
font-weight: bold;
}
#clock {
margin-top: 8px;
margin-bottom: 0;
transition: none;
font-weight: bold;
}
#clock.date {
margin-left: 8px;
border-radius: 8px;
padding-left: 16px;
padding-right: 10px;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
background: #e5e9f0;
}
#clock.time {
padding-left: 10px;
padding-right: 16px;
border-radius: 8px;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
margin-right: 12px;
background: #d8dee9;
}

View file

@ -0,0 +1,3 @@
stylesheet=./style.css
term=foot
insensitive=true

View file

@ -0,0 +1,23 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.desktop.addons.wofi;
in
{
options.plusultra.desktop.addons.wofi = with types; {
enable =
mkBoolOpt false "Whether to enable the Wofi in the desktop environment.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ wofi wofi-emoji ];
# config -> .config/wofi/config
# css -> .config/wofi/style.css
# colors -> $XDG_CACHE_HOME/wal/colors
# plusultra.home.configFile."foot/foot.ini".source = ./foot.ini;
plusultra.home.configFile."wofi/config".source = ./config;
plusultra.home.configFile."wofi/style.css".source = ./style.css;
};
}

View file

@ -0,0 +1,127 @@
window {
font-family: "Hack Nerd Font";
background: transparent;
}
#outer-box {
padding: 10px;
border-radius: 8px;
background: #2e3440;
}
#scroll {
/* The Nordic gtk theme adds an outline to show scroll areas... */
outline-color: transparent;
}
#input {
color: #e5e9f0;
caret-color: #e5e9f0;
background: #3b4252;
border-top-color: #3b4252;
border-left-color: #3b4252;
border-right-color: #3b4252;
border-bottom-color: #3b4252;
box-shadow: 0 0 0 1px transparent inset;
outline-color: transparent !important;
}
#input:focus {
background: #3b4252;
border-color: #3b4252 !important;
box-shadow: 0 0 0 1px transparent inset;
border-top-color: #3b4252 !important;
border-left-color: #3b4252 !important;
border-right-color: #3b4252 !important;
border-bottom-color: #3b4252 !important;
box-shadow: none !important;
outline-color: transparent !important;
}
#input image.left {
color: #d8dee9;
}
#input:focus image.left {
color: #e5e9f0;
}
#input image.right {
color: #d8dee9;
}
#input:focus image.right {
color: #e5e9f0;
}
label {
/* We set backgrounds on the block level. */
background: transparent;
}
#scroll {
padding-top: 6px;
}
#entry {
color: #4c566a;
padding: 8px 8px;
border-radius: 4px;
background: transparent;
}
#entry:selected {
color: #eceff4;
background: #8fbcbb;
font-weight: bold;
}
expander arrow {
margin-right: 8px;
}
#entry #selected #text {
color: #eceff4;
}
expander list {
margin-top: 8px;
/* background: #8fbcbb; */
background: transparent;
padding-left: 16px;
}
expander list #entry {
transition: none;
background: transparent;
}
expander list #entry:hover,
expander list #entry:active {
/* color: #8fbcbb;
background: #e5e9f0; */
}
expander list #entry #selected {
background: #8fbcbb;
}
expander list #entry #selected label {
color: #eceff4;
font-weight: bold;
}
expander list #entry:hover,
expander list #entry:active {
background: #8fbcbb;
}
expander list #entry:hover label,
expander list #entry:active label {
color: #eceff4;
font-weight: bold;
}
expander list label {
color: #d8dee9;
}

View file

@ -0,0 +1,24 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.desktop.addons.xdg-portal;
in
{
options.plusultra.desktop.addons.xdg-portal = with types; {
enable = mkBoolOpt false "Whether or not to add support for xdg portal.";
};
config = mkIf cfg.enable {
xdg = {
portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
];
gtkUsePortal = true;
};
};
};
}

View file

@ -0,0 +1,333 @@
{ options
, config
, lib
, pkgs
, ...
}:
with lib;
with lib.plusultra; let
cfg = config.plusultra.desktop.gnome;
gdmHome = config.users.users.gdm.home;
defaultExtensions = with pkgs.gnomeExtensions; [
appindicator
aylurs-widgets
dash-to-dock
emoji-selector
gsconnect
gtile
just-perfection
logo-menu
no-overview
remove-app-menu
space-bar
top-bar-organizer
wireless-hid
# NOTE: These extensions are currently unsupported. They may also
# no longer be required.
# audio-output-switcher
# big-avatar
# clear-top-bar
];
default-attrs = mapAttrs (key: mkDefault);
nested-default-attrs = mapAttrs (key: default-attrs);
in
{
options.plusultra.desktop.gnome = with types; {
enable =
mkBoolOpt false "Whether or not to use Gnome as the desktop environment.";
wallpaper = {
light = mkOpt (oneOf [ str package ]) pkgs.plusultra.wallpapers.nord-rainbow-light-nix "The light wallpaper to use.";
dark = mkOpt (oneOf [ str package ]) pkgs.plusultra.wallpapers.nord-rainbow-dark-nix "The dark wallpaper to use.";
};
color-scheme = mkOpt (enum [ "light" "dark" ]) "dark" "The color scheme to use.";
wayland = mkBoolOpt true "Whether or not to use Wayland.";
suspend =
mkBoolOpt true "Whether or not to suspend the machine after inactivity.";
monitors = mkOpt (nullOr path) null "The monitors.xml file to create.";
extensions = mkOpt (listOf package) [ ] "Extra Gnome extensions to install.";
};
config = mkIf cfg.enable {
plusultra.system.xkb.enable = true;
plusultra.desktop.addons = {
gtk = enabled;
wallpapers = enabled;
electron-support = enabled;
foot = enabled;
};
environment.systemPackages = with pkgs;
[
(hiPrio plusultra.xdg-open-with-portal)
wl-clipboard
gnome.gnome-tweaks
gnome.nautilus-python
]
++ defaultExtensions
++ cfg.extensions;
environment.gnome.excludePackages = with pkgs.gnome; [
pkgs.gnome-tour
epiphany
geary
gnome-font-viewer
gnome-system-monitor
gnome-maps
];
systemd.tmpfiles.rules =
[
"d ${gdmHome}/.config 0711 gdm gdm"
]
++ (
# "./monitors.xml" comes from ~/.config/monitors.xml when GNOME
# display information is updated.
lib.optional (cfg.monitors != null) "L+ ${gdmHome}/.config/monitors.xml - - - - ${cfg.monitors}"
);
systemd.services.plusultra-user-icon = {
before = [ "display-manager.service" ];
wantedBy = [ "display-manager.service" ];
serviceConfig = {
Type = "simple";
User = "root";
Group = "root";
};
script = ''
config_file=/var/lib/AccountsService/users/${config.plusultra.user.name}
icon_file=/run/current-system/sw/share/plusultra-icons/user/${config.plusultra.user.name}/${config.plusultra.user.icon.fileName}
if ! [ -d "$(dirname "$config_file")"]; then
mkdir -p "$(dirname "$config_file")"
fi
if ! [ -f "$config_file" ]; then
echo "[User]
Session=gnome
SystemAccount=false
Icon=$icon_file" > "$config_file"
else
icon_config=$(sed -E -n -e "/Icon=.*/p" $config_file)
if [[ "$icon_config" == "" ]]; then
echo "Icon=$icon_file" >> $config_file
else
sed -E -i -e "s#^Icon=.*$#Icon=$icon_file#" $config_file
fi
fi
'';
};
# Required for app indicators
services.udev.packages = with pkgs; [ gnome3.gnome-settings-daemon ];
services.xserver = {
enable = true;
libinput.enable = true;
displayManager.gdm = {
enable = true;
wayland = cfg.wayland;
autoSuspend = cfg.suspend;
};
desktopManager.gnome.enable = true;
};
plusultra.home.extraOptions = {
dconf.settings =
let
user = config.users.users.${config.plusultra.user.name};
get-wallpaper = wallpaper:
if lib.isDerivation wallpaper
then builtins.toString wallpaper
else wallpaper;
in
nested-default-attrs {
"org/gnome/shell" = {
disable-user-extensions = false;
enabled-extensions =
(builtins.map (extension: extension.extensionUuid) (cfg.extensions ++ defaultExtensions))
++ [
"native-window-placement@gnome-shell-extensions.gcampax.github.com"
"drive-menu@gnome-shell-extensions.gcampax.github.com"
"user-theme@gnome-shell-extensions.gcampax.github.com"
];
favorite-apps =
[ "org.gnome.Nautilus.desktop" ]
++ optional config.plusultra.apps.firefox.enable "firefox.desktop"
++ optional config.plusultra.apps.vscode.enable "code.desktop"
++ optional config.plusultra.desktop.addons.foot.enable "foot.desktop"
++ optional config.plusultra.apps.logseq.enable "logseq.desktop"
++ optional config.plusultra.apps.discord.enable "discord.desktop"
++ optional config.plusultra.apps.element.enable "element-desktop.desktop"
++ optional config.plusultra.apps.steam.enable "steam.desktop";
};
"org/gnome/desktop/background" = {
picture-uri = get-wallpaper cfg.wallpaper.light;
picture-uri-dark = get-wallpaper cfg.wallpaper.dark;
};
"org/gnome/desktop/screensaver" = {
picture-uri = get-wallpaper cfg.wallpaper.light;
picture-uri-dark = get-wallpaper cfg.wallpaper.dark;
};
"org/gnome/desktop/interface" = {
color-scheme =
if cfg.color-scheme == "light"
then "default"
else "prefer-dark";
enable-hot-corners = false;
};
"org/gnome/desktop/peripherals/touchpad" = {
disable-while-typing = false;
};
"org/gnome/desktop/wm/preferences" = {
num-workspaces = 10;
resize-with-right-button = true;
};
"org/gnome/desktop/wm/keybindings" = {
switch-to-workspace-1 = [ "<Super>1" ];
switch-to-workspace-2 = [ "<Super>2" ];
switch-to-workspace-3 = [ "<Super>3" ];
switch-to-workspace-4 = [ "<Super>4" ];
switch-to-workspace-5 = [ "<Super>5" ];
switch-to-workspace-6 = [ "<Super>6" ];
switch-to-workspace-7 = [ "<Super>7" ];
switch-to-workspace-8 = [ "<Super>8" ];
switch-to-workspace-9 = [ "<Super>9" ];
switch-to-workspace-10 = [ "<Super>0" ];
move-to-workspace-1 = [ "<Shift><Super>1" ];
move-to-workspace-2 = [ "<Shift><Super>2" ];
move-to-workspace-3 = [ "<Shift><Super>3" ];
move-to-workspace-4 = [ "<Shift><Super>4" ];
move-to-workspace-5 = [ "<Shift><Super>5" ];
move-to-workspace-6 = [ "<Shift><Super>6" ];
move-to-workspace-7 = [ "<Shift><Super>7" ];
move-to-workspace-8 = [ "<Shift><Super>8" ];
move-to-workspace-9 = [ "<Shift><Super>9" ];
move-to-workspace-10 = [ "<Shift><Super>0" ];
};
"org/gnome/shell/keybindings" = {
# Remove the default hotkeys for opening favorited applications.
switch-to-application-1 = [ ];
switch-to-application-2 = [ ];
switch-to-application-3 = [ ];
switch-to-application-4 = [ ];
switch-to-application-5 = [ ];
switch-to-application-6 = [ ];
switch-to-application-7 = [ ];
switch-to-application-8 = [ ];
switch-to-application-9 = [ ];
switch-to-application-10 = [ ];
};
"org/gnome/mutter" = {
edge-tiling = false;
dynamic-workspaces = false;
};
"org/gnome/shell/extensions/dash-to-dock" = {
autohide = true;
dock-fixed = false;
dock-position = "BOTTOM";
pressure-threshold = 200.0;
require-pressure-to-show = true;
show-favorites = true;
hot-keys = false;
};
"org/gnome/shell/extensions/just-perfection" = {
panel-size = 48;
activities-button = false;
};
"org/gnome/shell/extensions/Logo-menu" = {
hide-softwarecentre = true;
# Use right click to open Activities.
menu-button-icon-click-type = 3;
# Use the NixOS logo.
menu-button-icon-image = 23;
menu-button-terminal =
if config.plusultra.desktop.addons.term.enable
then lib.getExe config.plusultra.desktop.addons.term.pkg
else lib.getExe pkgs.gnome.gnome-terminal;
};
"org/gnome/shell/extensions/aylurs-widgets" = {
background-clock = false;
battery-bar = false;
dash-board = false;
date-menu-date-format = "%H:%M %B %d";
date-menu-hide-clocks = true;
date-menu-hide-system-levels = true;
date-menu-hide-user = true;
# Hide the indincator
date-menu-indicator-position = 2;
media-player = false;
media-player-prefer = "firefox";
notification-indicator = false;
power-menu = false;
quick-toggles = false;
workspace-indicator = false;
};
"org/gnome/shell/extensions/top-bar-organizer" = {
left-box-order = [
"menuButton"
"activities"
"dateMenu"
"appMenu"
];
center-box-order = [
"Space Bar"
];
right-box-order = [
"keyboard"
"EmojisMenu"
"wireless-hid"
"drive-menu"
"vitalsMenu"
"screenRecording"
"screenSharing"
"dwellClick"
"a11y"
"quickSettings"
];
};
"org/gnome/shell/extensions/space-bar/shortcuts" = {
enable-activate-workspace-shortcuts = false;
};
"org/gnome/shell/extensions/space-bar/behavior" = {
show-empty-workspaces = false;
};
"org/gnome/shell/extensions/gtile" = {
show-icon = false;
grid-sizes = "8x2,4x2,2x2";
};
};
};
programs.kdeconnect = {
enable = true;
package = pkgs.gnomeExtensions.gsconnect;
};
# Open firewall for samba connections to work.
networking.firewall.extraCommands = "iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns";
};
}

View file

@ -0,0 +1,31 @@
<monitors version="2">
<configuration>
<logicalmonitor>
<x>0</x>
<y>0</y>
<scale>1</scale>
<primary>yes</primary>
<monitor>
<monitorspec>
<connector>DP-3</connector>
<vendor>DEL</vendor>
<product>Dell U4919DW</product>
<serial>D3TXTY2</serial>
</monitorspec>
<mode>
<width>5120</width>
<height>1440</height>
<rate>59.976879119873047</rate>
</mode>
</monitor>
</logicalmonitor>
<disabled>
<monitorspec>
<connector>HDMI-2</connector>
<vendor>AOC</vendor>
<product>28E850</product>
<serial>0x00000000</serial>
</monitorspec>
</disabled>
</configuration>
</monitors>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

View file

@ -0,0 +1,274 @@
###########################################
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
#░░█▀█░█░░░█░█░█▀▀░░░█░█░█░░░▀█▀░█▀▄░█▀█░░#
#░░█▀▀░█░░░█░█░▀▀█░░░█░█░█░░░░█░░█▀▄░█▀█░░#
#░░▀░░░▀▀▀░▀▀▀░▀▀▀░░░▀▀▀░▀▀▀░░▀░░▀░▀░▀░▀░░#
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
###########################################
#########################################
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
#░░█░█░█▀█░█▀▄░▀█▀░█▀█░█▀▄░█░░░█▀▀░█▀▀░░#
#░░▀▄▀░█▀█░█▀▄░░█░░█▀█░█▀▄░█░░░█▀▀░▀▀█░░#
#░░░▀░░▀░▀░▀░▀░▀▀▀░▀░▀░▀▀░░▀▀▀░▀▀▀░▀▀▀░░#
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
#########################################
# Modifier key (Mod1 = Alt, Mod4 = Meta)
set $mod Mod4
# Movement keys
set $left h
set $down j
set $up k
set $right l
# Terminal
set $term env @term@
# Swaylock
set $swaylock swaylock-fancy -f "Hack-Regular-Nerd-Font-Complete"
# Menu
set $menu-run wofi --show drun --prompt search
# Output names
set $laptop-screen eDP-1
# set $monitor-left HDMI-A-1
# set $monitor-center HDMI-A-2
# Workspace names
set $workspace1 1
set $workspace2 2
set $workspace3 3
set $workspace4 4
set $workspace5 5
set $workspace6 6
set $workspace7 7
set $workspace8 8
set $workspace9 9
set $workspace10 10
#############################
#░░░░░░░░░░░░░░░░░░░░░░░░░░░#
#░░█▀█░█░█░▀█▀░█▀█░█░█░▀█▀░░#
#░░█░█░█░█░░█░░█▀▀░█░█░░█░░░#
#░░▀▀▀░▀▀▀░░▀░░▀░░░▀▀▀░░▀░░░#
#░░░░░░░░░░░░░░░░░░░░░░░░░░░#
#############################
# Backgrounds
# output $monitor-left bg /home/short/Photos/wallpapers/left.jpg fill
# output $monitor-center bg /home/short/Photos/wallpapers/center.jpg fill
# Positioning
# output $monitor-left resolution 1920x1080 position 0,300
# output $monitor-center resolution 1920x1080 position 1920,0
###################################################
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
#░░█░█░█▀▀░█░█░░░█▀▄░▀█▀░█▀█░█▀▄░▀█▀░█▀█░█▀▀░█▀▀░░#
#░░█▀▄░█▀▀░░█░░░░█▀▄░░█░░█░█░█░█░░█░░█░█░█░█░▀▀█░░#
#░░▀░▀░▀▀▀░░▀░░░░▀▀░░▀▀▀░▀░▀░▀▀░░▀▀▀░▀░▀░▀▀▀░▀▀▀░░#
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░#
###################################################
# Start a terminal
bindsym $mod+Return exec $term
# Kill focused window
bindsym $mod+q kill
# Reload configuration
bindsym $mod+Shift+r reload
# Exit sway
bindsym $mod+Shift+e exit
# Lock
bindsym $mod+Control+l exec $swaylock
# Open run menu
bindsym $mod+d exec $menu-run
# Drag floating windows while holding down modifier key
floating_modifier $mod normal
# Sticky windows
bindsym $mod+Shift+s sticky toggle
# Toggle fullscreen
bindsym $mod+f fullscreen
# Toggle floating
bindsym $mod+Shift+space floating toggle
# Toggle floating focus
bindsym $mod+space focus mode_toggle
# Focus the parent container
bindsym $mod+a focus parent
# Focus the child container
bindsym $mod+c focus child
# Split horizontal
bindsym $mod+b splith
# Split vertical
bindsym $mod+v splitv
# Move window into scratchpad
bindsym $mod+Shift+minus move scratchpad
# Get window out of scratchpad
bindsym $mod+minus scratchpad show
# Change layout style
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
bindsym $mod+Shift+v layout splitv
bindsym $mod+Shift+b layout splith
# Moving focus
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Moving windows
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Switching workspace
bindsym $mod+1 workspace $workspace1
bindsym $mod+2 workspace $workspace2
bindsym $mod+3 workspace $workspace3
bindsym $mod+4 workspace $workspace4
bindsym $mod+5 workspace $workspace5
bindsym $mod+6 workspace $workspace6
bindsym $mod+7 workspace $workspace7
bindsym $mod+8 workspace $workspace8
bindsym $mod+9 workspace $workspace9
bindsym $mod+0 workspace $workspace10
# Moving windows to workspace
bindsym $mod+Shift+1 move container to workspace $workspace1
bindsym $mod+Shift+2 move container to workspace $workspace2
bindsym $mod+Shift+3 move container to workspace $workspace3
bindsym $mod+Shift+4 move container to workspace $workspace4
bindsym $mod+Shift+5 move container to workspace $workspace5
bindsym $mod+Shift+6 move container to workspace $workspace6
bindsym $mod+Shift+7 move container to workspace $workspace7
bindsym $mod+Shift+8 move container to workspace $workspace8
bindsym $mod+Shift+9 move container to workspace $workspace9
bindsym $mod+Shift+0 move container to workspace $workspace10
# Brightness
bindsym XF86MonBrightnessUp exec brightnessctl set 5%+
bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
# Sound
bindsym XF86AudioMute exec pulsemixer --toggle-mute
bindsym XF86AudioRaiseVolume exec pulsemixer --change-volume +10
bindsym XF86AudioLowerVolume exec pulsemixer --change-volume -10
# Media
bindsym XF86AudioPrev exec playerctl previous
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
# Print screen
bindsym Print exec grimshot --notify save screen - | swappy -f -
bindsym Shift+Print exec grimshot --notify save area - | swappy -f -
bindsym Control+Print exec grimshot --notify save window - | swappy -f -
bindsym $mod+Print exec grimshot --notify copy screen
bindsym $mod+Shift+Print exec grimshot --notify copy area
bindsym $mod+Control+Print exec grimshot --notify copy window
# Airplane mode
# bindsym XF86RFKill exec nmcli radio all $(test $(nmcli -g wifi radio all) == "enabled" && "off" || echo "on")
# Resize mode
mode "resize" {
# Shrink the width
bindsym $left resize shrink width 10px
# Grow the width
bindsym $right resize grow width 10px
# Grow the height
bindsym $up resize grow height 10px
# Shrink the height
bindsym $down resize shrink height 10px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
# Enter resize mode
bindsym $mod+r mode "resize"
######################
#░░░░░░░░░░░░░░░░░░░░#
#░▀█▀░█▀█░█▀█░█░█░▀█▀#
#░░█░░█░█░█▀▀░█░█░░█░#
#░▀▀▀░▀░▀░▀░░░▀▀▀░░▀░#
#░░░░░░░░░░░░░░░░░░░░#
######################
input type:keyboard {
xkb_options caps:swapescape
}
input type:touchpad {
natural_scroll enabled
tap enabled
tap_button_map lrm
}
#################
#░░░░░░░░░░░░░░░#
#░░█▀▄░█▀█░█▀▄░░#
#░░█▀▄░█▀█░█▀▄░░#
#░░▀▀░░▀░▀░▀░▀░░#
#░░░░░░░░░░░░░░░#
#################
bar {
# Run waybar
swaybar_command waybar
}
#########################
#░░░░░░░░░░░░░░░░░░░░░░░#
#░░█▀▀░▀█▀░█░█░█░░░█▀▀░░#
#░░▀▀█░░█░░░█░░█░░░█▀▀░░#
#░░▀▀▀░░▀░░░▀░░▀▀▀░▀▀▀░░#
#░░░░░░░░░░░░░░░░░░░░░░░#
#########################
# Remove title bars
default_border pixel 1
default_floating_border pixel 1
client.focused #8fbcbb #8fbcbb #eceff4 #eceff4
client.focused_inactive #2E3440 #2E3440 #e5e9f0 #5e81ac
client.unfocused #3b4252 #3b4252 #4c566a #5e81ac
client.urgent #d08770 #d08770 #eceff4 #bf616a
for_window [app_id="wofi"] border none
# for_window [app_id="firefox"] border none
# Don't focus moused over windows
focus_follows_mouse no
# Gaps
gaps outer 4
gaps inner 5

View file

@ -0,0 +1,148 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.desktop.sway;
term = config.plusultra.desktop.addons.term;
substitutedConfig = pkgs.substituteAll {
src = ./config;
term = term.pkg.pname or term.pkg.name;
};
in
{
options.plusultra.desktop.sway = with types; {
enable = mkBoolOpt false "Whether or not to enable Sway.";
wallpaper = mkOpt (nullOr package) null "The wallpaper to display.";
extraConfig =
mkOpt str "" "Additional configuration for the Sway config file.";
};
config = mkIf cfg.enable {
# Desktop additions
plusultra.desktop.addons = {
gtk = enabled;
foot = enabled;
mako = enabled;
rofi = enabled;
wofi = enabled;
swappy = enabled;
kanshi = enabled;
waybar = enabled;
keyring = enabled;
nautilus = enabled;
xdg-portal = enabled;
electron-support = enabled;
};
plusultra.home.configFile."sway/config".text =
fileWithText substitutedConfig ''
#############################
#░░░░░░░░░░░░░░░░░░░░░░░░░░░#
#░░█▀▀░█░█░█▀▀░▀█▀░█▀▀░█▄█░░#
#░░▀▀█░░█░░▀▀█░░█░░█▀▀░█░█░░#
#░░▀▀▀░░▀░░▀▀▀░░▀░░▀▀▀░▀░▀░░#
#░░░░░░░░░░░░░░░░░░░░░░░░░░░#
#############################
# Launch services waiting for the systemd target sway-session.target
exec "systemctl --user import-environment; systemctl --user start sway-session.target"
# Start a user session dbus (required for things like starting
# applications through wofi).
exec dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus
${optionalString (cfg.wallpaper != null) ''
output * {
bg ${cfg.wallpaper.gnomeFilePath or cfg.wallpaper} fill
}
''}
${cfg.extraConfig}
'';
programs.sway = {
enable = true;
extraPackages = with pkgs; [
rofi
swaylock
swayidle
xwayland
sway-contrib.grimshot
swaylock-fancy
wl-clipboard
wf-recorder
libinput
playerctl
brightnessctl
glib # for gsettings
gtk3.out # for gtk-launch
gnome.gnome-control-center
];
extraSessionCommands = ''
export SDL_VIDEODRIVER=wayland
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
export _JAVA_AWT_WM_NONREPARENTING=1
export MOZ_ENABLE_WAYLAND=1
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=sway
export XDG_CURRENT_DESKTOP=sway
'';
};
environment.systemPackages = with pkgs;
[
(pkgs.writeTextFile {
name = "startsway";
destination = "/bin/startsway";
executable = true;
text = ''
#! ${pkgs.bash}/bin/bash
# Import environment variables from the login manager
systemctl --user import-environment
# Start Sway
exec systemctl --user start sway.service
'';
})
];
# configuring sway itself (assmung a display manager starts it)
systemd.user.targets.sway-session = {
description = "Sway compositor session";
documentation = [ "man:systemd.special(7)" ];
bindsTo = [ "graphical-session.target" ];
wants = [ "graphical-session-pre.target" ];
after = [ "graphical-session-pre.target" ];
};
systemd.user.services.sway = {
description = "Sway - Wayland window manager";
documentation = [ "man:sway(5)" ];
bindsTo = [ "graphical-session.target" ];
wants = [ "graphical-session-pre.target" ];
after = [ "graphical-session-pre.target" ];
# We explicitly unset PATH here, as we want it to be set by
# systemctl --user import-environment in startsway
environment.PATH = lib.mkForce null;
serviceConfig = {
Type = "simple";
ExecStart = ''
${pkgs.dbus}/bin/dbus-run-session ${pkgs.sway}/bin/sway --debug
'';
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
services.xserver.enable = true;
services.xserver.displayManager.defaultSession = "sway";
services.xserver.displayManager.gdm.enable = true;
services.xserver.displayManager.gdm.wayland = true;
services.xserver.libinput.enable = true;
};
}

View file

@ -0,0 +1,200 @@
{ options
, config
, pkgs
, lib
, ...
}:
# FIXME: The transition to wireplumber from media-session has completely
# broken my setup. I'll need to invest some time to figure out how to override Alsa things
# again...
with lib;
with lib.plusultra; let
cfg = config.plusultra.hardware.audio;
lua-format = {
type = with lib.types; let
valueType =
nullOr
(oneOf [
bool
int
float
str
path
(attrsOf valueType)
(listOf valueType)
])
// {
description = "Lua value";
};
in
valueType;
generate = name: value:
let
toLuaValue = value:
if value == null
then "null"
else if value == true
then "true"
else if value == false
then "false"
else if builtins.isInt value || builtins.isFloat value
then builtins.toString value
else if builtins.isString value
then toLuaString value
else if builtins.isAttrs value
then toLuaTable value
else if builtins.isList value
then toLuaList value
else builtins.abort "Unsupported value used with formats.lua.generate: ${value}";
toLuaString = value: "\"${builtins.toString value}\"";
toLuaTable = value:
let
pairs =
mapAttrsToList
(name: value: "[${toLuaString name}] = ${toLuaValue value}")
value;
content = concatStringsSep ", " pairs;
in
"{ ${content} }";
toLuaList = value:
let
parts = builtins.map toLuaValue value;
content = concatStringsSep ", " parts;
in
"{ ${content} }";
in
toLuaValue value;
};
pipewire-config = {
"context.objects" = cfg.nodes ++ [ ];
"context.modules" =
[
{
name = "libpipewire-module-rtkit";
args = { };
flags = [ "ifexists" "nofail" ];
}
{ name = "libpipewire-module-protocol-native"; }
{ name = "libpipewire-module-profiler"; }
# {
# name = "libpipewire-module-metadata";
# flags = [ "ifexists" "nofail" ];
# }
{ name = "libpipewire-module-spa-device-factory"; }
{ name = "libpipewire-module-spa-node-factory"; }
# {
# name = "libpipewire-module-client-node";
# flags = [ "ifexists" "nofail" ];
# }
# {
# name = "libpipewire-module-client-device";
# flags = [ "ifexists" "nofail" ];
# }
{
name = "libpipewire-module-portal";
flags = [ "ifexists" "nofail" ];
}
{
name = "libpipewire-module-access";
args = { };
}
{ name = "libpipewire-module-adapter"; }
{ name = "libpipewire-module-link-factory"; }
{ name = "libpipewire-module-session-manager"; }
]
++ cfg.modules;
"context.components" = [
{
name = "libwireplumber-module-lua-scripting";
type = "module";
}
{
name = "config.lua";
type = "config/lua";
}
];
};
alsa-config = {
alsa_monitor = cfg.alsa-monitor;
};
in
{
options.plusultra.hardware.audio = with types; {
enable = mkBoolOpt false "Whether or not to enable audio support.";
alsa-monitor = mkOpt attrs { } "Alsa configuration.";
nodes =
mkOpt (listOf attrs) [ ]
"Audio nodes to pass to Pipewire as `context.objects`.";
modules =
mkOpt (listOf attrs) [ ]
"Audio modules to pass to Pipewire as `context.modules`.";
extra-packages = mkOpt (listOf package) [
pkgs.qjackctl
pkgs.easyeffects
] "Additional packages to install.";
};
config = mkIf cfg.enable {
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
};
environment.etc = {
# "pipewire/pipewire.conf.d/10-pipewire.conf".source =
# pkgs.writeText "pipewire.conf" (builtins.toJSON pipewire-config);
# "pipewire/pipewire.conf.d/21-alsa.conf".source =
# pkgs.writeText "pipewire.conf" (builtins.toJSON alsa-config);
# "wireplumber/wireplumber.conf".source =
# pkgs.writeText "pipewire.conf" (builtins.toJSON pipewire-config);
# "wireplumber/scripts/config.lua.d/alsa.lua".text = ''
# local input = ${lua-format.generate "sample.lua" cfg.alsa-monitor}
# if input.rules == nil then
# input.rules = {}
# end
# local rules = input.rules
# for _, rule in ipairs(input.rules) do
# table.insert(alsa_monitor.rules, rule)
# end
# '';
};
hardware.pulseaudio.enable = mkForce false;
environment.systemPackages = with pkgs;
[
pulsemixer
pavucontrol
]
++ cfg.extra-packages;
plusultra.user.extraGroups = [ "audio" ];
plusultra.home.extraOptions = {
systemd.user.services.mpris-proxy = {
Unit.Description = "Mpris proxy";
Unit.After = [ "network.target" "sound.target" ];
Service.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
Install.WantedBy = [ "default.target" ];
};
};
};
}

View file

@ -0,0 +1,13 @@
{ options, config, pkgs, lib, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.hardware.fingerprint;
in
{
options.plusultra.hardware.fingerprint = with types; {
enable = mkBoolOpt false "Whether or not to enable fingerprint support.";
};
config = mkIf cfg.enable { services.fprintd.enable = true; };
}

View file

@ -0,0 +1,32 @@
{ options, config, pkgs, lib, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.hardware.networking;
in
{
options.plusultra.hardware.networking = with types; {
enable = mkBoolOpt false "Whether or not to enable networking support";
hosts = mkOpt attrs { }
(mdDoc "An attribute set to merge with `networking.hosts`");
};
config = mkIf cfg.enable {
plusultra.user.extraGroups = [ "networkmanager" ];
networking = {
hosts = {
"127.0.0.1" = [ "local.test" ] ++ (cfg.hosts."127.0.0.1" or [ ]);
} // cfg.hosts;
networkmanager = {
enable = true;
dhcp = "internal";
};
};
# Fixes an issue that normally causes nixos-rebuild to fail.
# https://github.com/NixOS/nixpkgs/issues/180175
systemd.services.NetworkManager-wait-online.enable = false;
};
}

View file

@ -0,0 +1,16 @@
{ options, config, pkgs, lib, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.hardware.storage;
in
{
options.plusultra.hardware.storage = with types; {
enable = mkBoolOpt false
"Whether or not to enable support for extra storage devices.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ ntfs3g fuseiso ];
};
}

View file

@ -0,0 +1,36 @@
{ options, config, pkgs, lib, inputs, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.home;
in
{
# imports = with inputs; [
# home-manager.nixosModules.home-manager
# ];
options.plusultra.home = with types; {
file = mkOpt attrs { }
(mdDoc "A set of files to be managed by home-manager's `home.file`.");
configFile = mkOpt attrs { }
(mdDoc "A set of files to be managed by home-manager's `xdg.configFile`.");
extraOptions = mkOpt attrs { } "Options to pass directly to home-manager.";
};
config = {
plusultra.home.extraOptions = {
home.stateVersion = config.system.stateVersion;
home.file = mkAliasDefinitions options.plusultra.home.file;
xdg.enable = true;
xdg.configFile = mkAliasDefinitions options.plusultra.home.configFile;
};
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
users.${config.plusultra.user.name} =
mkAliasDefinitions options.plusultra.home.extraOptions;
};
};
}

View file

@ -0,0 +1,92 @@
{ options, config, pkgs, lib, inputs, ... }:
with lib;
with lib.plusultra;
let
cfg = config.plusultra.nix;
substituters-submodule = types.submodule ({ name, ... }: {
options = with types; {
key = mkOpt (nullOr str) null "The trusted public key for this substituter.";
};
});
in
{
options.plusultra.nix = with types; {
enable = mkBoolOpt true "Whether or not to manage nix configuration.";
package = mkOpt package pkgs.nixUnstable "Which nix package to use.";
default-substituter = {
url = mkOpt str "https://cache.nixos.org" "The url for the substituter.";
key = mkOpt str "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "The trusted public key for the substituter.";
};
extra-substituters = mkOpt (attrsOf substituters-submodule) { } "Extra substituters to configure.";
};
config = mkIf cfg.enable {
assertions = mapAttrsToList
(name: value: {
assertion = value.key != null;
message = "plusultra.nix.extra-substituters.${name}.key must be set";
})
cfg.extra-substituters;
environment.systemPackages = with pkgs; [
plusultra.nixos-revision
(plusultra.nixos-hosts.override {
hosts = inputs.self.nixosConfigurations;
})
deploy-rs
nixfmt
nix-index
nix-prefetch-git
nix-output-monitor
flake-checker
];
nix =
let
users = [ "root" config.plusultra.user.name ] ++
optional config.services.hydra.enable "hydra";
in
{
package = cfg.package;
settings = {
experimental-features = "nix-command flakes";
http-connections = 50;
warn-dirty = false;
log-lines = 50;
sandbox = "relaxed";
auto-optimise-store = true;
trusted-users = users;
allowed-users = users;
substituters =
[ cfg.default-substituter.url ]
++
(mapAttrsToList (name: value: name) cfg.extra-substituters);
trusted-public-keys =
[ cfg.default-substituter.key ]
++
(mapAttrsToList (name: value: value.key) cfg.extra-substituters);
} // (lib.optionalAttrs config.plusultra.tools.direnv.enable {
keep-outputs = true;
keep-derivations = true;
});
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
# flake-utils-plus
generateRegistryFromInputs = true;
generateNixPathFromInputs = true;
linkInputs = true;
};
};
}

View file

@ -0,0 +1,31 @@
{ lib, pkgs, config, virtual, ... }:
let
inherit (lib) mkIf mkEnableOption optional;
inherit (lib.plusultra) mkOpt;
cfg = config.plusultra.security.acme;
in
{
options.plusultra.security.acme = with lib.types; {
enable = mkEnableOption "default ACME configuration";
email = mkOpt str config.plusultra.user.email "The email to use.";
staging = mkOpt bool virtual "Whether to use the staging server or not.";
};
config = mkIf cfg.enable {
security.acme = {
acceptTerms = true;
defaults = {
inherit (cfg) email;
group = mkIf config.services.nginx.enable "nginx";
server = mkIf cfg.staging "https://acme-staging-v02.api.letsencrypt.org/directory";
# Reload nginx when certs change.
reloadServices = optional config.services.nginx.enable "nginx.service";
};
};
};
}

View file

@ -0,0 +1,29 @@
{ options, config, pkgs, lib, ... }:
with lib;
with lib.plusultra;
let cfg = config.plusultra.security.doas;
in
{
options.plusultra.security.doas = {
enable = mkBoolOpt false "Whether or not to replace sudo with doas.";
};
config = mkIf cfg.enable {
# Disable sudo
security.sudo.enable = false;
# Enable and configure `doas`.
security.doas = {
enable = true;
extraRules = [{
users = [ config.plusultra.user.name ];
noPass = true;
keepEnv = true;
}];
};
# Add an alias to the shell for backward-compat and convenience.
environment.shellAliases = { sudo = "doas"; };
};
}

Some files were not shown because too many files have changed in this diff Show more