From 962acece38e6d8d1fb8d48ce214a7cee70e49fe0 Mon Sep 17 00:00:00 2001 From: clerie Date: Mon, 9 Dec 2024 18:34:32 +0100 Subject: [PATCH 1/4] hosts/carbon: Fix broken per start script generation --- hosts/carbon/ppp.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hosts/carbon/ppp.nix b/hosts/carbon/ppp.nix index 784c1de..200b161 100644 --- a/hosts/carbon/ppp.nix +++ b/hosts/carbon/ppp.nix @@ -1,4 +1,4 @@ -{ config, pkgs, utils, ... }: +{ config, pkgs, lib, ... }: { @@ -44,12 +44,15 @@ cat ${config.sops.secrets.pppd-dtagdsl-secrets.path} > /etc/ppp/chap-secrets ''; - preStartFile = utils.systemdUtils.lib.makeJobScript "pppd-dtagdsl-pre-start" preStart; + preStartFile = pkgs.writeShellApplication { + name = "pppd-dtagdsl-pre-start"; + text = preStart; + }; in { EnvironmentFile = config.sops.secrets.pppd-dtagdsl-username.path; ExecStartPre = [ # "+" marks script to be executed without priviledge restrictions - "+${preStartFile}" + "+${lib.getExe preStartFile}" ]; }; From 36c6ada07c72c2000ccd9d6066f4a6386be5026e Mon Sep 17 00:00:00 2001 From: clerie Date: Mon, 9 Dec 2024 18:53:17 +0100 Subject: [PATCH 2/4] flake.lock: Update scan-to-gpg --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index b7482bf..98cf1d2 100644 --- a/flake.lock +++ b/flake.lock @@ -347,11 +347,11 @@ ] }, "locked": { - "lastModified": 1732477156, - "narHash": "sha256-Cpw9YtpnZpVz5gcuiJO6rpJjLvS9O/Y8AuRt3/NFz1w=", + "lastModified": 1733765838, + "narHash": "sha256-piKf5W1vUl4y36WuW/192LMXBJyATBF83T9YEz9K3/Y=", "ref": "refs/heads/main", - "rev": "f727e7f9717bebb13f80dfb6d6a92afe5284ffdf", - "revCount": 14, + "rev": "b0c07f95146d85a7b62a84fb2a62a773a5942733", + "revCount": 17, "type": "git", "url": "https://git.clerie.de/clerie/scan-to-gpg.git" }, From 75af9b738346af22d604f53fde0eb3c9a87c3a2f Mon Sep 17 00:00:00 2001 From: clerie Date: Mon, 9 Dec 2024 20:34:07 +0100 Subject: [PATCH 3/4] pkgs/factorio-launcher: Add wrapper to launch factorio --- flake.nix | 1 + hosts/krypton/programs.nix | 2 ++ hosts/zinc/programs.nix | 2 ++ pkgs/factorio-launcher/default.nix | 25 ++++++++++++++++++++ pkgs/factorio-launcher/launch-factorio.sh | 28 +++++++++++++++++++++++ pkgs/overlay.nix | 1 + 6 files changed, 59 insertions(+) create mode 100644 pkgs/factorio-launcher/default.nix create mode 100644 pkgs/factorio-launcher/launch-factorio.sh diff --git a/flake.nix b/flake.nix index bcd41ea..9ca4456 100644 --- a/flake.nix +++ b/flake.nix @@ -126,6 +126,7 @@ clerie-sops-config clerie-sops-edit chromium-incognito + factorio-launcher git-checkout-github-pr git-diff-word git-pp diff --git a/hosts/krypton/programs.nix b/hosts/krypton/programs.nix index 79aae6b..a58eb0b 100644 --- a/hosts/krypton/programs.nix +++ b/hosts/krypton/programs.nix @@ -29,6 +29,8 @@ chromium-incognito print-afra + + factorio-launcher ]; # Wireshark diff --git a/hosts/zinc/programs.nix b/hosts/zinc/programs.nix index edf86ea..34808b1 100644 --- a/hosts/zinc/programs.nix +++ b/hosts/zinc/programs.nix @@ -9,6 +9,8 @@ #cura # libarcus library is currently broken, required for curaengine mumble + + factorio-launcher ]; } diff --git a/pkgs/factorio-launcher/default.nix b/pkgs/factorio-launcher/default.nix new file mode 100644 index 0000000..958882b --- /dev/null +++ b/pkgs/factorio-launcher/default.nix @@ -0,0 +1,25 @@ +{ pkgs, lib, ... }: + +pkgs.buildFHSEnv { + name = "factorio-launcher"; + targetPkgs = pkgs: (with pkgs; [ + alsa-lib + libGL + libpulseaudio + libxkbcommon + wayland + ]) ++ (with pkgs.xorg; [ + libICE + libSM + libX11 + libXcursor + libXext + libXi + libXinerama + libXrandr + ]); + runScript = lib.getExe (pkgs.writeShellApplication { + name = "launch-factorio"; + text = builtins.readFile ./launch-factorio.sh; + }); +} diff --git a/pkgs/factorio-launcher/launch-factorio.sh b/pkgs/factorio-launcher/launch-factorio.sh new file mode 100644 index 0000000..a331c7f --- /dev/null +++ b/pkgs/factorio-launcher/launch-factorio.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [[ $# -eq 0 ]]; then + echo "Pass path to factorio install directory as first argument" + exit 1 +fi + +FACTORIO_BINARY_PATH="" + +for suffix in "" "/factorio" "/x64/factorio" "/bin/x64/factorio" "/factorio/bin/x64/factorio"; do + if [[ -f "$1${suffix}" && -x "$1${suffix}" ]]; then + FACTORIO_BINARY_PATH="$1${suffix}" + break + fi +done + +if [[ -z $FACTORIO_BINARY_PATH ]]; then + echo "No factorio executable found below $1" + exit 1 +fi + +shift + +set -- "${FACTORIO_BINARY_PATH}" "$@" + +exec "$@" diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index d4bf798..3bc8eb6 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -7,6 +7,7 @@ final: prev: { clerie-sops-edit = final.callPackage ./clerie-sops/clerie-sops-edit.nix {}; clerie-update-nixfiles = final.callPackage ./clerie-update-nixfiles/clerie-update-nixfiles.nix {}; chromium-incognito = final.callPackage ./chromium-incognito {}; + factorio-launcher = final.callPackage ./factorio-launcher {}; git-checkout-github-pr = final.callPackage ./git-checkout-github-pr {}; git-diff-word = final.callPackage ./git-diff-word {}; git-pp = final.callPackage ./git-pp {}; From d307c72f3c75af8c83155d55de202cb320c16819 Mon Sep 17 00:00:00 2001 From: Flake Update Bot Date: Tue, 10 Dec 2024 03:03:03 +0100 Subject: [PATCH 4/4] Update nixpkgs 2024-12-10-02-03 --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 98cf1d2..ffaf61a 100644 --- a/flake.lock +++ b/flake.lock @@ -288,11 +288,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1732521221, - "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", + "lastModified": 1733581040, + "narHash": "sha256-Qn3nPMSopRQJgmvHzVqPcE3I03zJyl8cSbgnnltfFDY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d", + "rev": "22c3f2cf41a0e70184334a958e6b124fb0ce3e01", "type": "github" }, "original": {