refactor: notebook configration
This commit is contained in:
17
hosts/nb/modules/desktop/bitwarden.nix
Normal file
17
hosts/nb/modules/desktop/bitwarden.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
bitwarden
|
||||
bitwarden-cli
|
||||
];
|
||||
|
||||
environment.shellAliases = {
|
||||
bw-epicenter = "BITWARDENCLI_APPDATA_DIR=~/.config/bitwarden-cli-epicenter ${pkgs.bitwarden-cli}/bin/bw";
|
||||
bw-cloonar = "BITWARDENCLI_APPDATA_DIR=~/.config/bitwarden-cli-cloonar ${pkgs.bitwarden-cli}/bin/bw";
|
||||
};
|
||||
|
||||
environment.shellInit = ''
|
||||
mkdir -p ~/.config/bitwarden-cli-epicenter ~/.config/bitwarden-cli-cloonar
|
||||
'';
|
||||
}
|
||||
@@ -1,4 +1,169 @@
|
||||
{ pkgs, ... }: {
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
apache-ds-pin = import (builtins.fetchTarball {
|
||||
url = "https://github.com/NixOS/nixpkgs/archive/9aec01027f7ea2bca07bb51d5ed83e78088871c1.tar.gz";
|
||||
}) {};
|
||||
in {
|
||||
imports = [
|
||||
../sway/sway.nix
|
||||
./social.nix
|
||||
./signal-work.nix
|
||||
./thunderbird.nix
|
||||
./bitwarden.nix
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
alacritty
|
||||
apache-ds-pin.apache-directory-studio
|
||||
cryptomator
|
||||
fontforge
|
||||
freecad
|
||||
openscad
|
||||
|
||||
(where-is-my-sddm-theme.override {
|
||||
themeConfig.General = {
|
||||
showUsersByDefault = true;
|
||||
background = "/nix/persist/system/wallpaper.png";
|
||||
backgroundFill = "#252525";
|
||||
backgroundFillMode="Image.Pad";
|
||||
passwordInputWidth = 0.25;
|
||||
passwordInputBackground = "#60ffffff";
|
||||
passwordFontSize = 28;
|
||||
showSessionsByDefault = true;
|
||||
sessionsFontSize=24;
|
||||
usersFontSize=32;
|
||||
};
|
||||
variants = ["qt5"];
|
||||
})
|
||||
|
||||
vscode
|
||||
|
||||
|
||||
dracula-theme
|
||||
foot
|
||||
fractal
|
||||
|
||||
gimp
|
||||
seahorse
|
||||
adwaita-icon-theme
|
||||
grim
|
||||
hunspell
|
||||
hunspellDicts.de_DE
|
||||
hunspellDicts.en_US
|
||||
libreoffice
|
||||
libsForQt5.qtgraphicaleffects
|
||||
mako
|
||||
moonlight-qt
|
||||
nautilus
|
||||
netflix
|
||||
networkmanagerapplet
|
||||
nextcloud-client
|
||||
onlyoffice-bin
|
||||
obs-studio
|
||||
pavucontrol
|
||||
pinentry
|
||||
rbw
|
||||
rofi-rbw
|
||||
# unstable.rustdesk
|
||||
rustdesk-flutter
|
||||
thunderbird
|
||||
vlc
|
||||
wl-clipboard
|
||||
wtype
|
||||
xfce.thunar
|
||||
xfce.thunar-volman
|
||||
xfce.thunar-archive-plugin
|
||||
xorg.libX11
|
||||
xorg.libXcursor
|
||||
xorg.libXi
|
||||
xorg.libXrandr
|
||||
yubioath-flutter
|
||||
];
|
||||
|
||||
environment.variables.XCURSOR_SIZE = "24";
|
||||
|
||||
services.displayManager.defaultSession = "sway";
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
theme = "where_is_my_sddm_theme_qt5";
|
||||
};
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
};
|
||||
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
services.gvfs.enable = true;
|
||||
|
||||
virtualisation.virtualbox.host.enable = true;
|
||||
users.extraGroups.vboxusers.members = [ "dominik" ];
|
||||
|
||||
fonts.packages = with pkgs; [
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-emoji
|
||||
nerd-fonts._0xproto
|
||||
nerd-fonts.droid-sans-mono
|
||||
open-sans
|
||||
];
|
||||
|
||||
programs.light.enable = true;
|
||||
|
||||
hardware.graphics.extraPackages = [ pkgs.amdvlk ];
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
hardware.bluetooth.powerOnBoot = true;
|
||||
hardware.bluetooth.settings = {
|
||||
General = { ControllerMode = "bredr"; };
|
||||
};
|
||||
services.blueman.enable = true;
|
||||
|
||||
services.tlp.enable = true;
|
||||
services.tlp.settings = {
|
||||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||||
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||
START_CHARGE_THRESH_BAT0 = 60;
|
||||
STOP_CHARGE_THRESH_BAT0 = 80;
|
||||
};
|
||||
|
||||
boot.plymouth = {
|
||||
enable = true;
|
||||
theme = "spin";
|
||||
themePackages = with pkgs; [
|
||||
(adi1090x-plymouth-themes.override {
|
||||
selected_themes = [ "spin" ];
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
security.polkit.enable = true;
|
||||
systemd.user.services.polkit-gnome-authentication-agent-1 = {
|
||||
description = "polkit-gnome-authentication-agent-1";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
wants = [ "graphical-session.target" ];
|
||||
after = [ "graphical-session.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
TimeoutStopSec = 10;
|
||||
};
|
||||
};
|
||||
|
||||
services.flatpak.enable = true;
|
||||
systemd.services.flatpak-repo = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
path = [ pkgs.flatpak ];
|
||||
script = ''
|
||||
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
'';
|
||||
};
|
||||
|
||||
environment.variables.TERMINAL_COMMAND = "alacritty";
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
# firefox-container-controller-extension.nix
|
||||
# Import this file in your configuration.nix to build and install the Container Controller extension.
|
||||
# Usage in configuration.nix:
|
||||
#
|
||||
# let
|
||||
# containerControllerXpi = import ./firefox-container-controller-extension.nix { inherit pkgs; };
|
||||
# in {
|
||||
# programs.firefox = {
|
||||
# enable = true;
|
||||
# profiles.default = {
|
||||
# extensions = [ containerControllerXpi ];
|
||||
# };
|
||||
# };
|
||||
# }
|
||||
|
||||
{ pkgs }:
|
||||
|
||||
pkgs.runCommand "firefox-containercontroller-xpi" {
|
||||
nativeBuildInputs = [ pkgs.zip ];
|
||||
} ''
|
||||
# Create temp dir for packaging
|
||||
TMPDIR=$(mktemp -d)
|
||||
cd "$TMPDIR"
|
||||
|
||||
# Write manifest.json without leading spaces
|
||||
cat > manifest.json << 'EOF'
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Container Controller",
|
||||
"version": "1.0",
|
||||
"applications": { "gecko": { "id": "containercontroller@cloonar.com" } },
|
||||
"permissions": ["containers", "nativeMessaging"],
|
||||
"background": { "scripts": ["background.js"] }
|
||||
}
|
||||
EOF
|
||||
|
||||
# Write background.js without indentation
|
||||
cat > background.js << 'EOF'
|
||||
async function poll() {
|
||||
const resp = await browser.runtime.sendNativeMessage(
|
||||
"com.firefox.containercontroller", {}
|
||||
);
|
||||
if (resp.userContextId && resp.action) {
|
||||
try {
|
||||
if (resp.action === "hide") {
|
||||
await browser.containers.hideContainer({ userContextId: resp.userContextId });
|
||||
} else if (resp.action === "show") {
|
||||
await browser.containers.showContainer({ userContextId: resp.userContextId });
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
// Poll every second
|
||||
setInterval(poll, 1000);
|
||||
EOF
|
||||
|
||||
# Ensure the Firefox extensions directory exists in the output
|
||||
mkdir -p "$out/share/firefox/extensions"
|
||||
|
||||
# Create ZIP archive at root of package
|
||||
# and use the updated extension id for the filename
|
||||
zip -r "$out/share/firefox/extensions/containercontroller@cloonar.com.xpi" manifest.json background.js
|
||||
|
||||
# Clean up
|
||||
rm -rf "$TMPDIR"
|
||||
''
|
||||
@@ -1,59 +0,0 @@
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
# 1) Native‐messaging host: reads and clears the queued JSON command
|
||||
containerControllerHost = pkgs.writeScriptBin "firefox-containercontroller-host" ''
|
||||
#!/usr/bin/env bash
|
||||
CMD_FILE="$HOME/.cache/firefox-container-command.json"
|
||||
if [ -f "$CMD_FILE" ]; then
|
||||
cat "$CMD_FILE"
|
||||
rm "$CMD_FILE"
|
||||
else
|
||||
echo '{}'
|
||||
fi
|
||||
'';
|
||||
|
||||
# 2) CLI helper to enqueue a “hide” command
|
||||
hideContainer = pkgs.writeScriptBin "hide-container" ''
|
||||
#!/usr/bin/env bash
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <userContextId>" >&2
|
||||
exit 1
|
||||
fi
|
||||
ID="$1"
|
||||
mkdir -p "$HOME/.cache"
|
||||
printf '{"userContextId": %s, "action": "hide"}' "$ID" \
|
||||
> "$HOME/.cache/firefox-container-command.json"
|
||||
'';
|
||||
|
||||
# 3) CLI helper to enqueue a “show” command
|
||||
showContainer = pkgs.writeScriptBin "show-container" ''
|
||||
#!/usr/bin/env bash
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <userContextId>" >&2
|
||||
exit 1
|
||||
fi
|
||||
ID="$1"
|
||||
mkdir -p "$HOME/.cache"
|
||||
printf '{"userContextId": %s, "action": "show"}' "$ID" \
|
||||
> "$HOME/.cache/firefox-container-command.json"
|
||||
'';
|
||||
in
|
||||
{
|
||||
# Install host + helpers
|
||||
environment.systemPackages = [
|
||||
containerControllerHost
|
||||
hideContainer
|
||||
showContainer
|
||||
];
|
||||
|
||||
# Register the native‐messaging host for our extension
|
||||
environment.etc."mozilla/native-messaging-hosts/com.firefox.containercontroller.json".text =
|
||||
builtins.toJSON {
|
||||
name = "com.firefox.containercontroller";
|
||||
description = "Native messaging host for Container Controller";
|
||||
path = containerControllerHost;
|
||||
type = "stdio";
|
||||
allowed_extensions = [ "containercontroller@cloonar.com" ];
|
||||
};
|
||||
}
|
||||
26
hosts/nb/modules/desktop/signal-work.nix
Normal file
26
hosts/nb/modules/desktop/signal-work.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
signalWorkDesktopItem = pkgs.makeDesktopItem {
|
||||
name = "signal-work";
|
||||
desktopName = "Signal with work profile";
|
||||
icon = "signal-desktop";
|
||||
exec = "signal-desktop --enable-dev-tools --enable-features=VaapiVideoDecoder --user-data-dir=/home/dominik/.config/Signal-work -- %u";
|
||||
};
|
||||
in {
|
||||
environment.systemPackages = [
|
||||
pkgs.signal-cli
|
||||
pkgs.signal-desktop
|
||||
pkgs.zbar
|
||||
signalWorkDesktopItem
|
||||
];
|
||||
}
|
||||
# signal-cli is a command line interface for Signal
|
||||
# use it like follows:
|
||||
# signal-cli -u +4300000000 register
|
||||
# signal-cli -u +4300000000 verify 123-456
|
||||
# zbarimg /tmp/qr.png
|
||||
# QR-Code:tsdevice:/?uuid...
|
||||
# convert svg to png
|
||||
# signal-cli -u +4300000000 addDevice --uri "tsdevice:/?uuid=xxx"
|
||||
14
hosts/nb/modules/desktop/social.nix
Normal file
14
hosts/nb/modules/desktop/social.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
socialDesktopItem = pkgs.makeDesktopItem {
|
||||
name = "social";
|
||||
desktopName = "Firefox browser with social profile";
|
||||
exec = "firefox -P social";
|
||||
# exec= "firefox -P social --marionette --remote-debugging-port 2828 --no-remote";
|
||||
};
|
||||
in {
|
||||
environment.systemPackages = with pkgs; [
|
||||
socialDesktopItem
|
||||
];
|
||||
}
|
||||
23
hosts/nb/modules/desktop/thunderbird.nix
Normal file
23
hosts/nb/modules/desktop/thunderbird.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
thunderbirdWorkDesktopItem = pkgs.makeDesktopItem {
|
||||
name = "thunderbird-work";
|
||||
desktopName = "Thunderbird Work";
|
||||
icon = "thunderbird";
|
||||
exec = "thunderbird -p work";
|
||||
};
|
||||
thunderbirdCloonarDesktopItem = pkgs.makeDesktopItem {
|
||||
name = "thunderbird-cloonar";
|
||||
desktopName = "Thunderbird Cloonar";
|
||||
icon = "thunderbird";
|
||||
exec = "thunderbird -p cloonar";
|
||||
};
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs.thunderbird
|
||||
thunderbirdWorkDesktopItem
|
||||
thunderbirdCloonarDesktopItem
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user