Compare commits
No commits in common. "fd246d7daf6584609216fbbba8c59edb86852a9b" and "18f9cc3fa828b089dd36462ca05cf022c8f24e80" have entirely different histories.
fd246d7daf
...
18f9cc3fa8
27
homes/julian/features/i3/i3/scripts/open-messaging
Executable file
27
homes/julian/features/i3/i3/scripts/open-messaging
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
start_if_not_running()
|
||||||
|
{
|
||||||
|
program=$1
|
||||||
|
pidof -sq $program
|
||||||
|
if [ "$?" -eq "1" ]; then
|
||||||
|
start_program $1
|
||||||
|
else
|
||||||
|
echo "$program is already running"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
start_program()
|
||||||
|
{
|
||||||
|
program=$1
|
||||||
|
echo "Starting $program..."
|
||||||
|
$program & > /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
i3-msg 'workspace 9; append_layout ~/.config/i3/workspace-messaging.json'
|
||||||
|
start_program nheko
|
||||||
|
sleep 0.1
|
||||||
|
start_program telegram-desktop
|
||||||
|
sleep 0.1
|
||||||
|
start_program thunderbird
|
||||||
|
sleep 0.1
|
20
homes/julian/features/i3/i3/scripts/pulse_popup
Executable file
20
homes/julian/features/i3/i3/scripts/pulse_popup
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
HDMI_SINK="alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_3__sink"
|
||||||
|
LAPTOP_SINK="alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink"
|
||||||
|
|
||||||
|
HDMI_ICON=$(pactl info | grep -q $HDMI_SINK && echo "checkbox")
|
||||||
|
LAPTOP_ICON=$(pactl info | grep -q $LAPTOP_SINK && echo "checkbox")
|
||||||
|
|
||||||
|
HDMI_VOLUME=$(pactl get-sink-volume $HDMI_SINK | head -n 1 | awk '{print $5}')
|
||||||
|
LAPTOP_VOLUME=$(pactl get-sink-volume $LAPTOP_SINK | head -n 1 | awk '{print $5}')
|
||||||
|
|
||||||
|
read -r -d '' CONF <<EOF
|
||||||
|
Open Pavucontrol,pavucontrol,pavucontrol
|
||||||
|
|
||||||
|
^sep()
|
||||||
|
HDMI - $HDMI_VOLUME,pactl set-default-sink $HDMI_SINK,$HDMI_ICON
|
||||||
|
Laptop - $LAPTOP_VOLUME,pactl set-default-sink $LAPTOP_SINK,$LAPTOP_ICON
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "$CONF" | jgmenu --simple
|
@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
system.hydraAutoUpgrade = {
|
|
||||||
# Only enable if not dirty
|
|
||||||
enable = inputs.self ? rev;
|
|
||||||
dates = "*:0/10"; # Every 10 minutes
|
|
||||||
instance = "http://hydra.julian-mutter.de";
|
|
||||||
project = "dotfiles";
|
|
||||||
jobset = "main";
|
|
||||||
job = "hosts.${config.networking.hostName}";
|
|
||||||
oldFlakeRef = "self";
|
|
||||||
};
|
|
||||||
}
|
|
@ -13,7 +13,7 @@ in {
|
|||||||
PasswordAuthentication = false;
|
PasswordAuthentication = false;
|
||||||
PermitRootLogin = "no";
|
PermitRootLogin = "no";
|
||||||
|
|
||||||
# TODO: what does this do
|
# TODO: what does this d
|
||||||
# Let WAYLAND_DISPLAY be forwarded
|
# Let WAYLAND_DISPLAY be forwarded
|
||||||
AcceptEnv = "WAYLAND_DISPLAY";
|
AcceptEnv = "WAYLAND_DISPLAY";
|
||||||
X11Forwarding = true;
|
X11Forwarding = true;
|
||||||
@ -34,7 +34,7 @@ in {
|
|||||||
# publicKeyFile = ../../${hostname}/ssh_host_ed25519_key.pub;
|
# publicKeyFile = ../../${hostname}/ssh_host_ed25519_key.pub;
|
||||||
# extraHostNames =
|
# extraHostNames =
|
||||||
# [
|
# [
|
||||||
# # "${hostname}.m7.rs"
|
# "${hostname}.m7.rs"
|
||||||
# ]
|
# ]
|
||||||
# ++
|
# ++
|
||||||
# # Alias for localhost if it's the same host
|
# # Alias for localhost if it's the same host
|
||||||
|
@ -10,12 +10,9 @@
|
|||||||
../common/optional/boot-efi.nix
|
../common/optional/boot-efi.nix
|
||||||
|
|
||||||
../common/optional/greetd.nix
|
../common/optional/greetd.nix
|
||||||
|
|
||||||
# ../common/optional/gdm.nix
|
# ../common/optional/gdm.nix
|
||||||
# ../common/optional/i3.nix
|
# ../common/optional/i3.nix
|
||||||
|
|
||||||
../common/optional/openssh.nix
|
|
||||||
|
|
||||||
../common/optional/authentication.nix
|
../common/optional/authentication.nix
|
||||||
../common/optional/pcmanfm.nix
|
../common/optional/pcmanfm.nix
|
||||||
../common/optional/pipewire.nix
|
../common/optional/pipewire.nix
|
||||||
@ -33,7 +30,7 @@
|
|||||||
programs.kdeconnect.enable = true;
|
programs.kdeconnect.enable = true;
|
||||||
|
|
||||||
# services.xserver.desktopManager.xfce.enable = true;
|
# services.xserver.desktopManager.xfce.enable = true;
|
||||||
services.desktopManager.plasma6.enable = true;
|
services.xserver.desktopManager.plasma6.enable = true;
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
# Enable CUPS to print documents.
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
|
@ -1,129 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.system.hydraAutoUpgrade;
|
|
||||||
in {
|
|
||||||
# Taken from Misterio
|
|
||||||
options = {
|
|
||||||
system.hydraAutoUpgrade = {
|
|
||||||
enable = lib.mkEnableOption "periodic hydra-based auto upgrade";
|
|
||||||
operation = lib.mkOption {
|
|
||||||
type = lib.types.enum ["switch" "boot"];
|
|
||||||
default = "switch";
|
|
||||||
};
|
|
||||||
dates = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "04:40";
|
|
||||||
example = "daily";
|
|
||||||
};
|
|
||||||
|
|
||||||
instance = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
example = "http://hydra.julian-mutter.de";
|
|
||||||
};
|
|
||||||
project = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
example = "dotfiles";
|
|
||||||
};
|
|
||||||
jobset = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
example = "main";
|
|
||||||
};
|
|
||||||
job = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = config.networking.hostName;
|
|
||||||
};
|
|
||||||
|
|
||||||
oldFlakeRef = lib.mkOption {
|
|
||||||
type = lib.types.nullOr lib.types.str;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
Current system's flake reference
|
|
||||||
|
|
||||||
If non-null, the service will only upgrade if the new config is newer
|
|
||||||
than this one's.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
assertions = [
|
|
||||||
{
|
|
||||||
assertion = cfg.enable -> !config.system.autoUpgrade.enable;
|
|
||||||
message = ''
|
|
||||||
hydraAutoUpgrade and autoUpgrade are mutually exclusive.
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
|
||||||
systemd.services.nixos-upgrade = {
|
|
||||||
description = "NixOS Upgrade";
|
|
||||||
restartIfChanged = false;
|
|
||||||
unitConfig.X-StopOnRemoval = false;
|
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
|
|
||||||
path = with pkgs; [
|
|
||||||
config.nix.package.out
|
|
||||||
config.programs.ssh.package
|
|
||||||
coreutils
|
|
||||||
curl
|
|
||||||
gitMinimal
|
|
||||||
gnutar
|
|
||||||
gzip
|
|
||||||
jq
|
|
||||||
nvd
|
|
||||||
];
|
|
||||||
|
|
||||||
script = let
|
|
||||||
buildUrl = "${cfg.instance}/job/${cfg.project}/${cfg.jobset}/${cfg.job}/latest";
|
|
||||||
in
|
|
||||||
(lib.optionalString (cfg.oldFlakeRef != null) ''
|
|
||||||
eval="$(curl -sLH 'accept: application/json' "${buildUrl}" | jq -r '.jobsetevals[0]')"
|
|
||||||
flake="$(curl -sLH 'accept: application/json' "${cfg.instance}/eval/$eval" | jq -r '.flake')"
|
|
||||||
echo "New flake: $flake" >&2
|
|
||||||
new="$(nix flake metadata "$flake" --json | jq -r '.lastModified')"
|
|
||||||
echo "Modified at: $(date -d @$new)" >&2
|
|
||||||
|
|
||||||
echo "Current flake: ${cfg.oldFlakeRef}" >&2
|
|
||||||
current="$(nix flake metadata "${cfg.oldFlakeRef}" --json | jq -r '.lastModified')"
|
|
||||||
echo "Modified at: $(date -d @$current)" >&2
|
|
||||||
|
|
||||||
if [ "$new" -le "$current" ]; then
|
|
||||||
echo "Skipping upgrade, not newer" >&2
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
'')
|
|
||||||
+ ''
|
|
||||||
profile="/nix/var/nix/profiles/system"
|
|
||||||
path="$(curl -sLH 'accept: application/json' ${buildUrl} | jq -r '.buildoutputs.out.path')"
|
|
||||||
|
|
||||||
if [ "$(readlink -f "$profile")" = "$path" ]; then
|
|
||||||
echo "Already up to date" >&2
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Building $path" >&2
|
|
||||||
nix build --no-link "$path"
|
|
||||||
|
|
||||||
echo "Comparing changes" >&2
|
|
||||||
nvd --color=always diff "$profile" "$path"
|
|
||||||
|
|
||||||
echo "Activating configuration" >&2
|
|
||||||
"$path/bin/switch-to-configuration" test
|
|
||||||
|
|
||||||
echo "Setting profile" >&2
|
|
||||||
nix build --no-link --profile "$profile" "$path"
|
|
||||||
|
|
||||||
echo "Adding to bootloader" >&2
|
|
||||||
"$path/bin/switch-to-configuration" boot
|
|
||||||
'';
|
|
||||||
|
|
||||||
startAt = cfg.dates;
|
|
||||||
after = ["network-online.target"];
|
|
||||||
wants = ["network-online.target"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -3,7 +3,7 @@
|
|||||||
nheko,
|
nheko,
|
||||||
telegram-desktop,
|
telegram-desktop,
|
||||||
thunderbird,
|
thunderbird,
|
||||||
discord, # TODO: discord not available for aarch64, this leads to flake evaluation for this arch fail.
|
discord,
|
||||||
}:
|
}:
|
||||||
writeShellApplication {
|
writeShellApplication {
|
||||||
name = "open-messaging";
|
name = "open-messaging";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user