Compare commits
5 Commits
18f9cc3fa8
...
fd246d7daf
Author | SHA1 | Date | |
---|---|---|---|
fd246d7daf | |||
edae0d2bb0 | |||
1cb23dd0a4 | |||
ab1052193a | |||
6dadb2008c |
@ -1,27 +0,0 @@
|
||||
#!/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
|
@ -1,20 +0,0 @@
|
||||
#!/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
|
16
hosts/common/global/auto-upgrade.nix
Normal file
16
hosts/common/global/auto-upgrade.nix
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
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;
|
||||
PermitRootLogin = "no";
|
||||
|
||||
# TODO: what does this d
|
||||
# TODO: what does this do
|
||||
# Let WAYLAND_DISPLAY be forwarded
|
||||
AcceptEnv = "WAYLAND_DISPLAY";
|
||||
X11Forwarding = true;
|
||||
@ -34,7 +34,7 @@ in {
|
||||
# publicKeyFile = ../../${hostname}/ssh_host_ed25519_key.pub;
|
||||
# extraHostNames =
|
||||
# [
|
||||
# "${hostname}.m7.rs"
|
||||
# # "${hostname}.m7.rs"
|
||||
# ]
|
||||
# ++
|
||||
# # Alias for localhost if it's the same host
|
||||
|
@ -10,9 +10,12 @@
|
||||
../common/optional/boot-efi.nix
|
||||
|
||||
../common/optional/greetd.nix
|
||||
|
||||
# ../common/optional/gdm.nix
|
||||
# ../common/optional/i3.nix
|
||||
|
||||
../common/optional/openssh.nix
|
||||
|
||||
../common/optional/authentication.nix
|
||||
../common/optional/pcmanfm.nix
|
||||
../common/optional/pipewire.nix
|
||||
@ -30,7 +33,7 @@
|
||||
programs.kdeconnect.enable = true;
|
||||
|
||||
# services.xserver.desktopManager.xfce.enable = true;
|
||||
services.xserver.desktopManager.plasma6.enable = true;
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
services.printing.enable = true;
|
||||
|
129
modules/nixos/hydra-auto-upgrade.nix
Normal file
129
modules/nixos/hydra-auto-upgrade.nix
Normal file
@ -0,0 +1,129 @@
|
||||
{
|
||||
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,
|
||||
telegram-desktop,
|
||||
thunderbird,
|
||||
discord,
|
||||
discord, # TODO: discord not available for aarch64, this leads to flake evaluation for this arch fail.
|
||||
}:
|
||||
writeShellApplication {
|
||||
name = "open-messaging";
|
||||
|
Loading…
x
Reference in New Issue
Block a user