astora: virtiofs

This commit is contained in:
L-Nafaryus 2024-11-24 23:08:58 +05:00
parent 3e7c3c7764
commit 4e6b146e9a
Signed by: L-Nafaryus
GPG Key ID: 553C97999B363D38
10 changed files with 200 additions and 13 deletions

View File

@ -1,9 +1,14 @@
{pkgs, ...}:
{
pkgs,
drift,
...
}:
pkgs.mkShellNoCC {
packages = with pkgs; [
sops
mkpasswd
jq
cachix
drift
];
}

View File

@ -18,6 +18,8 @@ in
crane = self.inputs.crane;
crane-lib = self.inputs.crane.mkLib pkgs;
drift = self.inputs.drift.packages.${system}.drift;
};
in {
default = import ./bonfire.nix environment;

145
flake.lock generated
View File

@ -121,6 +121,28 @@
"type": "github"
}
},
"drift": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"snowfall-lib": "snowfall-lib",
"unstable": "unstable"
},
"locked": {
"lastModified": 1716675566,
"narHash": "sha256-H1f5LI1pKogcv+S4pjHjGWwC4286wuQxfjp9Poc+sTg=",
"owner": "snowfallorg",
"repo": "drift",
"rev": "b0c929d645040abb01d5faff63e07caade0ce8e4",
"type": "github"
},
"original": {
"owner": "snowfallorg",
"repo": "drift",
"type": "github"
}
},
"elnafo-radio": {
"inputs": {
"advisory-db": "advisory-db",
@ -192,6 +214,22 @@
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@ -207,7 +245,7 @@
"type": "github"
}
},
"flake-compat_2": {
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@ -248,6 +286,43 @@
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils-plus": {
"inputs": {
"flake-utils": "flake-utils"
},
"locked": {
"lastModified": 1715533576,
"narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
@ -262,9 +337,9 @@
"type": "github"
}
},
"flake-utils_2": {
"flake-utils_3": {
"inputs": {
"systems": "systems_3"
"systems": "systems_4"
},
"locked": {
"lastModified": 1710146030,
@ -412,7 +487,7 @@
"nixos-mailserver": {
"inputs": {
"blobs": "blobs",
"flake-compat": "flake-compat_2",
"flake-compat": "flake-compat_3",
"nixpkgs": [
"nixpkgs"
],
@ -525,7 +600,7 @@
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils",
"flake-utils": "flake-utils_2",
"ixx": "ixx",
"nixpkgs": [
"nixvim",
@ -589,7 +664,7 @@
},
"purescript-overlay": {
"inputs": {
"flake-compat": "flake-compat",
"flake-compat": "flake-compat_2",
"nixpkgs": [
"elnafo-radio",
"dream2nix",
@ -633,6 +708,7 @@
"ags": "ags",
"catppuccin": "catppuccin",
"crane": "crane",
"drift": "drift",
"elnafo-radio": "elnafo-radio",
"fenix": "fenix_2",
"home-manager": "home-manager",
@ -690,6 +766,30 @@
"type": "github"
}
},
"snowfall-lib": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils-plus": "flake-utils-plus",
"nixpkgs": [
"drift",
"nixpkgs"
]
},
"locked": {
"lastModified": 1716675292,
"narHash": "sha256-7TFvVE4HR/b65/0AAhewYHEJzUXxIEJn82ow5bCkrDo=",
"owner": "snowfallorg",
"repo": "lib",
"rev": "5d6e9f235735393c28e1145bec919610b172a20f",
"type": "github"
},
"original": {
"owner": "snowfallorg",
"ref": "v3.0.2",
"repo": "lib",
"type": "github"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
@ -756,9 +856,40 @@
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"unstable": {
"locked": {
"lastModified": 1705856552,
"narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"wezterm": {
"inputs": {
"flake-utils": "flake-utils_2",
"flake-utils": "flake-utils_3",
"freetype2": "freetype2",
"harfbuzz": "harfbuzz",
"libpng": "libpng",

View File

@ -70,6 +70,10 @@
inputs.nixpkgs.follows = "nixpkgs";
};
nix-std.url = "github:chessai/nix-std";
drift = {
url = "github:snowfallorg/drift";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {self, ...} @ inputs: let

View File

@ -91,6 +91,8 @@
'';
};
services.cockpit.enable = true;
#services.blueman.enable = true;
services.btrfs.autoScrub = {
@ -118,7 +120,10 @@
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
};
libvirtd.enable = true;
libvirtd = {
enable = true;
qemu.vhostUserPackages = with pkgs; [virtiofsd];
};
test-share = {
source = "/home/l-nafaryus/vms/shared";
target = "/mnt/shared";

View File

@ -1,6 +1,7 @@
{
config,
lib,
pkgs,
...
}: {
# Boot
@ -48,6 +49,7 @@
networkmanager = {
enable = true;
enableStrongSwan = true;
plugins = with pkgs; [networkmanager-l2tp];
};
};
}

View File

@ -118,7 +118,7 @@ in {
picard
podman-desktop
virtiofsd
# virtiofsd
];
xdg.portal = {

View File

@ -30,6 +30,16 @@
zlib
];
passthru = {
update = pkgs.writeShellScriptBin "update-spoofdpi" ''
set -euo pipefail
latest="$(${pkgs.curl}/bin/curl -s "https://api.github.com/repos/shuttle-hq/shuttle/tags?per_page=1" | ${pkgs.jq}/bin/jq -r ".[0].name" | ${pkgs.gnused}/bin/sed 's/^v//')"
drift rewrite --auto-hash --new-version "$latest"
'';
};
meta = with lib; {
description = "A cargo command for the shuttle platform";
license = licenses.asl20;

View File

@ -2,8 +2,9 @@
bonLib,
stdenv,
pkgs,
version ? "6.2.2404",
version ? "6.2.2405",
sha256 ? "sha256-SZPZT49BqUzssPcOo/5yAkjqAHDErC86xCUFL88Iew4=",
lib,
...
}:
stdenv.mkDerivation {
@ -61,6 +62,26 @@ stdenv.mkDerivation {
export PYTHONPATH="${python3}/${python3.sitePackages}"
export PYTHONPATH="$PYTHONPATH:${pkg}/${python3.sitePackages}"
'';
update = pkgs.writeShellScriptBin "update-spoofdpi" ''
set -euo pipefail
new_version=$(${lib.getExe pkgs.curl} -s "https://api.github.com/repos/NGSolve/netgen/tags?per_page=1" | ${lib.getExe pkgs.jq} -r ".[0].name")
new_hash=$(nix flake prefetch --json https://github.com/NGSolve/netgen/archive/refs/tags/$new_version.tar.gz | ${lib.getExe pkgs.jq} -r ".hash")
old_version=$(nix eval --impure --json --expr "(builtins.getFlake (toString ./.)).packages.${builtins.currentSystem}.netgen.version")
old_hash=$(nix eval --impure --json --expr "(builtins.getFlake (toString ./.)).packages.${builtins.currentSystem}.netgen.src.outputHash")
nixpath=$(nix eval --impure --json --expr "(builtins.getFlake (toString ./.)).packages.${builtins.currentSystem}.netgen.src.meta.position")
relpath=$(echo $nixpath | ${lib.getExe pkgs.ripgrep} "\/nix\/store\/[\w\d]{32}-[^\/]+/" -r "" | ${lib.getExe pkgs.ripgrep} "[:\d]" -r "")
#echo "./$relpath" | ${lib.getExe pkgs.gnused} -i "s/$old_version/$new_version/g"
#echo "./$relpath" | ${lib.getExe pkgs.gnused} -i "s/$old_hash/$new_hash/g"
content=$(${lib.getExe pkgs.ripgrep} $old_version --passthru -r $new_version $relpath)
content=$(echo $content | ${lib.getExe pkgs.ripgrep} $old_version --passthru -r $new_version $relpath)
echo $content > $relpath
# TODO: убрать все кавычки
'';
};
meta = with pkgs.lib; {

View File

@ -4,7 +4,6 @@
pkgs,
version ? "v0.10.0",
hash ? "sha256-e6TPklWp5rvNypnI0VHqOjzZhkYsZcp+jkXUlYxMBlU=",
vendorHash ? "sha256-kmp+8MMV1AHaSvLnvYL17USuv7xa3NnsCyCbqq9TvYE=",
...
}:
pkgs.buildGoModule {
@ -18,12 +17,20 @@ pkgs.buildGoModule {
hash = hash;
};
inherit vendorHash;
vendorHash = "sha256-kmp+8MMV1AHaSvLnvYL17USuv7xa3NnsCyCbqq9TvYE=";
doCheck = false;
ldflags = ["-s" "-w" "-X main.version=${version}" "-X main.builtBy=nixpkgs"];
passthru.update = pkgs.writeShellScriptBin "update-spoofdpi" ''
set -euo pipefail
latest="$(${pkgs.curl}/bin/curl -s "https://api.github.com/repos/xvzc/SpoofDPI/releases?per_page=1" | ${pkgs.jq}/bin/jq -r ".[0].tag_name" | ${pkgs.gnused}/bin/sed 's/^v//')"
drift rewrite --auto-hash --new-version "$latest"
'';
meta = with lib; {
homepage = "https://github.com/xvzc/SpoofDPI";
description = "A simple and fast anti-censorship tool written in Go";