workstation | remove dup code, update version to 23.11

This commit is contained in:
Don Harper 2023-05-29 17:17:27 -05:00
parent 807aaec0b7
commit 08a01ad229

View file

@ -4,8 +4,6 @@ let
my-python-packages = python-packages: with python-packages; [
pip
pipx
#recipe-scrapers
#tldextract
#setuptools
];
python-with-my-packages = pkgs.python311Full.withPackages my-python-packages;
@ -291,47 +289,6 @@ in
(final: super:{ khal = super.khal.overridePythonAttrs (_: { doCheck = false; }); })
];
systemd.services = {
tailscale-autoconnect = {
description = "Automatic connection to Tailscale";
# make sure tailscale is running before trying to connect to tailscale
after = [ "network-pre.target" "tailscale.service" ];
wants = [ "network-pre.target" "tailscale.service" ];
wantedBy = [ "multi-user.target" ];
# set this service as a oneshot job
serviceConfig.Type = "oneshot";
# have the job run this shell script
script = with pkgs; ''
# wait for tailscaled to settle
sleep 2
# check if we are already authenticated to tailscale
status="$(${tailscale}/bin/tailscale status -json | ${jq}/bin/jq -r .BackendState)"
if [ $status = "Running" ]; then # if so, then do nothing
exit 0
fi
# otherwise authenticate with tailscale
${tailscale}/bin/tailscale up --operator=don --authkey tskey-api-kDQcva6CNTRL-kvcJzSix6yLb2dgjr1Pi
'';
};
clean-keychain = {
description = "Clean up .keychain on boot";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.coreutils-full}/bin/rm -rf /home/don/.keychain";
};
};
};
# Open ports in the firewall.
networking.firewall = {
enable = true;
@ -355,7 +312,7 @@ in
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
system.stateVersion = "23.11"; # Did you read the comment?
programs.msmtp = {
enable = true;
accounts = {