merge: conflict resolved
All checks were successful
Publish packages to Attic / publish (push) Successful in 9m34s
All checks were successful
Publish packages to Attic / publish (push) Successful in 9m34s
This commit is contained in:
8
flake.lock
generated
8
flake.lock
generated
@@ -74,16 +74,16 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1779467186,
|
"lastModified": 1780902259,
|
||||||
"narHash": "sha256-nOesoDCiXcUftqbRBMz9tt4blI5PvljMWbm3kuCA+0s=",
|
"narHash": "sha256-q8yYEC5f1mFlQO9RGna4LTc9QrcvWunX6FYp83munkQ=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b77b3de8775677f84492abe84635f87b0e153f0f",
|
"rev": "bd0ff2d3eac24699c3664d5966b9ef36f388e2ca",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-25.11",
|
"ref": "nixos-26.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
description = "Miller Nix User Repository";
|
description = "Miller Nix User Repository";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
home-manager.url = "github:nix-community/home-manager";
|
home-manager.url = "github:nix-community/home-manager";
|
||||||
darwin.url = "github:LnL7/nix-darwin";
|
darwin.url = "github:LnL7/nix-darwin";
|
||||||
@@ -41,8 +41,7 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
overlays.default = import ./overlays;
|
overlays.default = import ./overlays;
|
||||||
|
homeManagerModules = import ./modules/home-manager self;
|
||||||
homeManagerModules.default = import ./modules/home-manager;
|
|
||||||
nixosModules.default = import ./modules/nixos;
|
nixosModules.default = import ./modules/nixos;
|
||||||
darwinModules.default = import ./modules/darwin;
|
darwinModules.default = import ./modules/darwin;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
self: {
|
||||||
|
# TODO: add more home-manager modules here
|
||||||
|
swaytreesave = import ./swaytreesave.nix self;
|
||||||
|
}
|
||||||
|
|||||||
20
modules/home-manager/swaytreesave.nix
Normal file
20
modules/home-manager/swaytreesave.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
self: { config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.programs.swaytreesave;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.programs.swaytreesave = {
|
||||||
|
enable = lib.mkEnableOption "swaytreesave";
|
||||||
|
|
||||||
|
package = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
default = self.packages.${pkgs.system}.swaytreesave;
|
||||||
|
defaultText = lib.literalExpression "self.packages.\${pkgs.system}.swaytreesave";
|
||||||
|
description = "The swaytreesave package to install.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
{ pkgs }: {
|
{ pkgs }:
|
||||||
|
{
|
||||||
# sable-web = pkgs.callPackage ./common/sable.nix {};
|
# sable-web = pkgs.callPackage ./common/sable.nix {};
|
||||||
swaytreesave = pkgs.callPackage ./linux/swaytreesave.nix {};
|
swaytreesave = pkgs.callPackage ./linux/swaytreesave.nix {};
|
||||||
musicpresence = pkgs.callPackage ./linux/musicpresence.nix {};
|
musicpresence = pkgs.callPackage ./linux/musicpresence.nix {};
|
||||||
vintage-story = pkgs.callPackage ./linux/vintage-story.nix {};
|
vintage-story = pkgs.callPackage ./linux/vintage-story.nix {};
|
||||||
archon = pkgs.callPackage ./linux/archon.nix {};
|
archon = pkgs.callPackage ./linux/archon.nix {};
|
||||||
|
yubilock = pkgs.callPackage ./linux/yubilock/default.nix { };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +1,48 @@
|
|||||||
{ pkgs }:
|
{
|
||||||
let
|
lib,
|
||||||
x11Support = true;
|
stdenv,
|
||||||
waylandSupport = true;
|
fetchurl,
|
||||||
in pkgs.stdenv.mkDerivation (finalAttrs:
|
makeWrapper,
|
||||||
let
|
makeDesktopItem,
|
||||||
inherit (pkgs) lib;
|
copyDesktopItems,
|
||||||
in {
|
versionCheckHook,
|
||||||
pname = "vintagestory";
|
cairo,
|
||||||
version = "1.21.6";
|
libGLU,
|
||||||
|
libglvnd,
|
||||||
|
pipewire,
|
||||||
|
libpulseaudio,
|
||||||
|
dotnet-runtime_10,
|
||||||
|
x11Support ? true,
|
||||||
|
libxi,
|
||||||
|
libxcursor,
|
||||||
|
libx11,
|
||||||
|
waylandSupport ? false,
|
||||||
|
wayland ? null,
|
||||||
|
libxkbcommon ? null,
|
||||||
|
}:
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
assert x11Support || waylandSupport;
|
||||||
|
assert waylandSupport -> wayland != null;
|
||||||
|
assert waylandSupport -> libxkbcommon != null;
|
||||||
|
|
||||||
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
|
pname = "vintagestory";
|
||||||
|
version = "1.22.3";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
url = "https://cdn.vintagestory.at/gamefiles/stable/vs_client_linux-x64_${finalAttrs.version}.tar.gz";
|
url = "https://cdn.vintagestory.at/gamefiles/stable/vs_client_linux-x64_${finalAttrs.version}.tar.gz";
|
||||||
hash = "sha256-LkiL/8W9MKpmJxtK+s5JvqhOza0BLap1SsaDvbLYR0c=";
|
hash = "sha256-sa4Pj1DwT6W6LJCAYznmbyqPtMUTaLSNTkXS1imQp04=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
__structuredAttrs = true;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
makeWrapper
|
makeWrapper
|
||||||
copyDesktopItems
|
copyDesktopItems
|
||||||
];
|
];
|
||||||
|
|
||||||
runtimeLibs = with pkgs; [
|
|
||||||
gtk2
|
|
||||||
sqlite
|
|
||||||
openal
|
|
||||||
cairo
|
|
||||||
libGLU
|
|
||||||
SDL2
|
|
||||||
freealut
|
|
||||||
libglvnd
|
|
||||||
pipewire
|
|
||||||
libpulseaudio
|
|
||||||
]
|
|
||||||
++ lib.optionals x11Support (with pkgs.xorg; [
|
|
||||||
libX11
|
|
||||||
libXi
|
|
||||||
libXcursor
|
|
||||||
])
|
|
||||||
++ lib.optionals waylandSupport (with pkgs; [
|
|
||||||
wayland
|
|
||||||
libxkbcommon
|
|
||||||
]);
|
|
||||||
|
|
||||||
desktopItems = [
|
desktopItems = [
|
||||||
(pkgs.makeDesktopItem {
|
(makeDesktopItem {
|
||||||
name = "vintagestory";
|
name = "vintagestory";
|
||||||
desktopName = "Vintage Story";
|
desktopName = "Vintage Story";
|
||||||
exec = "vintagestory";
|
exec = "vintagestory";
|
||||||
@@ -51,7 +51,7 @@ in pkgs.stdenv.mkDerivation (finalAttrs:
|
|||||||
categories = [ "Game" ];
|
categories = [ "Game" ];
|
||||||
})
|
})
|
||||||
|
|
||||||
(pkgs.makeDesktopItem {
|
(makeDesktopItem {
|
||||||
name = "vsmodinstall-handler";
|
name = "vsmodinstall-handler";
|
||||||
desktopName = "Vintage Story 1-click Mod Install Handler";
|
desktopName = "Vintage Story 1-click Mod Install Handler";
|
||||||
comment = "Handler for vintagestorymodinstall:// URI scheme";
|
comment = "Handler for vintagestorymodinstall:// URI scheme";
|
||||||
@@ -65,30 +65,37 @@ in pkgs.stdenv.mkDerivation (finalAttrs:
|
|||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p $out/share/vintagestory $out/bin $out/share/pixmaps $out/share/fonts/truetype
|
mkdir -p $out/share/vintagestory $out/bin $out/share/icons/hicolor/512x512/apps $out/share/fonts/truetype
|
||||||
cp -r * $out/share/vintagestory
|
cp -r * $out/share/vintagestory
|
||||||
cp $out/share/vintagestory/assets/gameicon.xpm $out/share/pixmaps/vintagestory.xpm
|
install -Dm444 $out/share/vintagestory/assets/gameicon.png $out/share/icons/hicolor/512x512/apps/vintagestory.png
|
||||||
cp $out/share/vintagestory/assets/game/fonts/*.ttf $out/share/fonts/truetype
|
cp $out/share/vintagestory/assets/game/fonts/*.ttf $out/share/fonts/truetype
|
||||||
|
|
||||||
|
rm -rvf $out/share/vintagestory/{install,run,server}.sh
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preFixup =
|
makeWrapperArgs = [
|
||||||
let
|
"--set-default"
|
||||||
runtimeLibs' = lib.strings.makeLibraryPath finalAttrs.runtimeLibs;
|
"mesa_glthread"
|
||||||
in
|
"true"
|
||||||
''
|
]
|
||||||
makeWrapper ${lib.meta.getExe pkgs.dotnet-runtime_8} $out/bin/vintagestory \
|
++ lib.optionals waylandSupport [
|
||||||
--prefix LD_LIBRARY_PATH : "${runtimeLibs'}" \
|
"--set-default"
|
||||||
--set-default mesa_glthread true \
|
"OPENTK_4_USE_WAYLAND"
|
||||||
${lib.strings.optionalString waylandSupport ''
|
"1"
|
||||||
--set-default OPENTK_4_USE_WAYLAND 1 \
|
];
|
||||||
''} \
|
|
||||||
|
runtimeLibraryPath = lib.makeLibraryPath finalAttrs.passthru.runtimeLibs;
|
||||||
|
preFixup = ''
|
||||||
|
makeWrapperArgs+=(--prefix LD_LIBRARY_PATH : "$runtimeLibraryPath")
|
||||||
|
|
||||||
|
makeWrapper ${lib.meta.getExe dotnet-runtime_10} $out/bin/vintagestory \
|
||||||
|
"''${makeWrapperArgs[@]}" \
|
||||||
--add-flags $out/share/vintagestory/Vintagestory.dll
|
--add-flags $out/share/vintagestory/Vintagestory.dll
|
||||||
|
|
||||||
makeWrapper ${lib.meta.getExe pkgs.dotnet-runtime_8} $out/bin/vintagestory-server \
|
makeWrapper ${lib.getExe dotnet-runtime_10} $out/bin/vintagestory-server \
|
||||||
--prefix LD_LIBRARY_PATH : "${runtimeLibs'}" \
|
"''${makeWrapperArgs[@]}" \
|
||||||
--set-default mesa_glthread true \
|
|
||||||
--add-flags $out/share/vintagestory/VintagestoryServer.dll
|
--add-flags $out/share/vintagestory/VintagestoryServer.dll
|
||||||
|
|
||||||
find "$out/share/vintagestory/assets/" -not -path "*/fonts/*" -regex ".*/.*[A-Z].*" | while read -r file; do
|
find "$out/share/vintagestory/assets/" -not -path "*/fonts/*" -regex ".*/.*[A-Z].*" | while read -r file; do
|
||||||
@@ -96,5 +103,27 @@ in pkgs.stdenv.mkDerivation (finalAttrs:
|
|||||||
ln -sf "$filename" "''${file%/*}"/"''${filename,,}"
|
ln -sf "$filename" "''${file%/*}"/"''${filename,,}"
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
}
|
|
||||||
)
|
doInstallCheck = true;
|
||||||
|
installCheckInputs = [ versionCheckHook ];
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
updateScript = ./update.sh;
|
||||||
|
runtimeLibs = [
|
||||||
|
cairo
|
||||||
|
libGLU
|
||||||
|
libglvnd
|
||||||
|
pipewire
|
||||||
|
libpulseaudio
|
||||||
|
]
|
||||||
|
++ lib.optionals x11Support [
|
||||||
|
libx11
|
||||||
|
libxi
|
||||||
|
libxcursor
|
||||||
|
]
|
||||||
|
++ lib.optionals waylandSupport [
|
||||||
|
wayland
|
||||||
|
libxkbcommon
|
||||||
|
];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|||||||
3
pkgs/linux/yubilock/README.md
Normal file
3
pkgs/linux/yubilock/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Yubilock
|
||||||
|
|
||||||
|
A Yubikey unlocking script that allows unlocking of sessions when attached.
|
||||||
21
pkgs/linux/yubilock/default.nix
Normal file
21
pkgs/linux/yubilock/default.nix
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
let
|
||||||
|
name = "yubilock";
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
systemd
|
||||||
|
coreutils
|
||||||
|
yubikey-manager
|
||||||
|
gawk
|
||||||
|
getent
|
||||||
|
logger
|
||||||
|
];
|
||||||
|
yubilock = (pkgs.writeScriptBin name (builtins.readFile ./yubilock.sh)).overrideAttrs (old: {
|
||||||
|
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
||||||
|
});
|
||||||
|
in
|
||||||
|
pkgs.symlinkJoin {
|
||||||
|
inherit name;
|
||||||
|
paths = [ yubilock ] ++ runtimeInputs;
|
||||||
|
buildInputs = [ pkgs.makeWrapper ];
|
||||||
|
postBuild = "wrapProgram $out/bin/${name} --prefix PATH : $out/bin";
|
||||||
|
}
|
||||||
33
pkgs/linux/yubilock/yubilock.sh
Normal file
33
pkgs/linux/yubilock/yubilock.sh
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SESSIONS=($(loginctl list-sessions --no-legend | awk '{ print $1 }'))
|
||||||
|
|
||||||
|
for SESSION_ID in "${SESSIONS[@]}"
|
||||||
|
do
|
||||||
|
USERNAME=$(loginctl show-session ${SESSION_ID} -p Name --value)
|
||||||
|
SESSION_TYPE=$(loginctl show-session ${SESSION_ID} -p Type --value) # should be x11 or wayland
|
||||||
|
SESSION_LOCKED=$(loginctl show-session ${SESSION_ID} -p LockedHint --value) # yes/no
|
||||||
|
USER_DIR=$(getent passwd "$USERNAME" | cut -d: -f6)
|
||||||
|
KEY_FILE="$USER_DIR/.yubikeys"
|
||||||
|
|
||||||
|
if ! [[ "$SESSION_TYPE" == "x11" || "$SESSION_TYPE" == "wayland" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
if ! [ -e "$KEY_FILE" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
MATCHING_KEYS=$(comm -12 <(ykman list --serials | sort) <(sort $KEY_FILE))
|
||||||
|
|
||||||
|
if [[ $MATCHING_KEYS == "" ]]; then
|
||||||
|
if [[ $SESSION_LOCKED == "no" ]]; then
|
||||||
|
logger "All YubiKeys Removed ($USERNAME)"
|
||||||
|
loginctl lock-session ${SESSION_ID}
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ $SESSION_LOCKED == "yes" ]]; then
|
||||||
|
logger "YubiKey Found, Unlocking ($USERNAME)"
|
||||||
|
loginctl activate ${SESSION_ID}
|
||||||
|
loginctl unlock-session ${SESSION_ID}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user