Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-03-10 03:26:40 +09:00
parent 7fb42ba49d
commit 48cdf8bf85
6 changed files with 30 additions and 26 deletions

View File

@@ -64,7 +64,7 @@ const (
) )
var _ encoding.TextMarshaler = _SCHED_LAST var _ encoding.TextMarshaler = _SCHED_LAST
var _ encoding.TextUnmarshaler = new(SchedPolicy) var _ encoding.TextUnmarshaler = new(_SCHED_LAST)
// String returns a unique representation of policy, also used in encoding. // String returns a unique representation of policy, also used in encoding.
func (policy SchedPolicy) String() string { func (policy SchedPolicy) String() string {

12
flake.lock generated
View File

@@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1765384171, "lastModified": 1772985280,
"narHash": "sha256-FuFtkJrW1Z7u+3lhzPRau69E0CNjADku1mLQQflUORo=", "narHash": "sha256-FdrNykOoY9VStevU4zjSUdvsL9SzJTcXt4omdEDZDLk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "44777152652bc9eacf8876976fa72cc77ca8b9d8", "rev": "8f736f007139d7f70752657dff6a401a585d6cbc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -23,11 +23,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1765311797, "lastModified": 1772822230,
"narHash": "sha256-mSD5Ob7a+T2RNjvPvOA1dkJHGVrNVl8ZOrAwBjKBDQo=", "narHash": "sha256-yf3iYLGbGVlIthlQIk5/4/EQDZNNEmuqKZkQssMljuw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "09eb77e94fa25202af8f3e81ddc7353d9970ac1b", "rev": "71caefce12ba78d84fe618cf61644dce01cf3a96",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -99,7 +99,7 @@
hakurei = pkgs.pkgsStatic.callPackage ./package.nix { hakurei = pkgs.pkgsStatic.callPackage ./package.nix {
inherit (pkgs) inherit (pkgs)
# passthru.buildInputs # passthru.buildInputs
go go_1_26
clang clang
# nativeBuildInputs # nativeBuildInputs
@@ -182,7 +182,7 @@
let let
# this is used for interactive vm testing during development, where tests might be broken # this is used for interactive vm testing during development, where tests might be broken
package = self.packages.${pkgs.stdenv.hostPlatform.system}.hakurei.override { package = self.packages.${pkgs.stdenv.hostPlatform.system}.hakurei.override {
buildGoModule = previousArgs: pkgs.pkgsStatic.buildGoModule (previousArgs // { doCheck = false; }); buildGo126Module = previousArgs: pkgs.pkgsStatic.buildGo126Module (previousArgs // { doCheck = false; });
}; };
in in
{ {

2
go.mod
View File

@@ -1,3 +1,3 @@
module hakurei.app module hakurei.app
go 1.25 go 1.26

View File

@@ -1,7 +1,7 @@
{ {
lib, lib,
stdenv, stdenv,
buildGoModule, buildGo126Module,
makeBinaryWrapper, makeBinaryWrapper,
xdg-dbus-proxy, xdg-dbus-proxy,
pkg-config, pkg-config,
@@ -17,7 +17,7 @@
fuse3, fuse3,
# for passthru.buildInputs # for passthru.buildInputs
go, go_1_26,
clang, clang,
# for check # for check
@@ -28,7 +28,7 @@
withStatic ? stdenv.hostPlatform.isStatic, withStatic ? stdenv.hostPlatform.isStatic,
}: }:
buildGoModule rec { buildGo126Module rec {
pname = "hakurei"; pname = "hakurei";
version = "0.3.6"; version = "0.3.6";
@@ -51,7 +51,7 @@ buildGoModule rec {
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
go go_1_26
pkg-config pkg-config
wayland-scanner wayland-scanner
]; ];
@@ -125,8 +125,11 @@ buildGoModule rec {
--inherit-argv0 --prefix PATH : ${lib.makeBinPath appPackages} --inherit-argv0 --prefix PATH : ${lib.makeBinPath appPackages}
''; '';
passthru.targetPkgs = [ passthru = {
go go = go_1_26;
targetPkgs = [
go_1_26
clang clang
xorg.xorgproto xorg.xorgproto
util-linux util-linux
@@ -137,4 +140,5 @@ buildGoModule rec {
] ]
++ buildInputs ++ buildInputs
++ nativeBuildInputs; ++ nativeBuildInputs;
};
} }

View File

@@ -34,7 +34,7 @@ testers.nixosTest {
(writeShellScriptBin "hakurei-test" '' (writeShellScriptBin "hakurei-test" ''
# Assert hst CGO_ENABLED=0: ${ # Assert hst CGO_ENABLED=0: ${
with pkgs; with pkgs;
runCommand "hakurei-hst-cgo" { nativeBuildInputs = [ go ]; } '' runCommand "hakurei-hst-cgo" { nativeBuildInputs = [ self.packages.${system}.hakurei.go ]; } ''
cp -r ${options.environment.hakurei.package.default.src} "$out" cp -r ${options.environment.hakurei.package.default.src} "$out"
chmod -R +w "$out" chmod -R +w "$out"
cp ${writeText "hst_cgo_test.go" ''package hakurei_test;import("testing";"hakurei.app/hst");func TestTemplate(t *testing.T){hst.Template()}''} "$out/hst_cgo_test.go" cp ${writeText "hst_cgo_test.go" ''package hakurei_test;import("testing";"hakurei.app/hst");func TestTemplate(t *testing.T){hst.Template()}''} "$out/hst_cgo_test.go"