mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-27 06:10:53 +01:00
Merge
This commit is contained in:
commit
4fc6c701d1
6 changed files with 152 additions and 50 deletions
109
.drone.yml
109
.drone.yml
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: exec
|
||||
name: Build all hosts
|
||||
name: Build all configurations
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
|
@ -38,6 +38,107 @@ trigger:
|
|||
event:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: exec
|
||||
name: Build custom packages
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
|
||||
- name: Build tinystatus
|
||||
commands:
|
||||
- nix build .#tinystatus
|
||||
|
||||
- name: Build mosh
|
||||
commands:
|
||||
- nix build .#mosh
|
||||
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: exec
|
||||
name: Update flake
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
|
||||
- name: create old builds
|
||||
commands:
|
||||
- nix build -v '.#nixosConfigurations.lisa.config.system.build.toplevel' --option binary-caches "https://cache.nixos.org"
|
||||
- mv result lisa-old
|
||||
- nix build -v '.#nixosConfigurations.newton.config.system.build.toplevel' --option binary-caches "https://cache.nixos.org"
|
||||
- mv result newton-old
|
||||
- nix build -v '.#nixosConfigurations.macintosh.config.system.build.toplevel' --option binary-caches "https://cache.nixos.org"
|
||||
- mv result macintosh-old
|
||||
|
||||
|
||||
- name: flake update
|
||||
commands:
|
||||
- nix --experimental-features "nix-command flakes" flake update --inputs-from nixpkgs
|
||||
|
||||
- name: Show git diff
|
||||
commands:
|
||||
- git diff
|
||||
|
||||
- name: Show flake info
|
||||
commands:
|
||||
- nix --experimental-features "nix-command flakes" flake show
|
||||
- nix --experimental-features "nix-command flakes" flake metadata
|
||||
- nix --experimental-features "nix-command flakes" flake check
|
||||
|
||||
- name: Run flake checks
|
||||
commands:
|
||||
- nix --experimental-features "nix-command flakes" flake check --show-trace
|
||||
|
||||
- name: Build lisa
|
||||
commands:
|
||||
- nix build -v '.#nixosConfigurations.lisa.config.system.build.toplevel' --option binary-caches "https://cache.nixos.org"
|
||||
- mv result lisa-new
|
||||
|
||||
- name: Build newton
|
||||
commands:
|
||||
- nix build -v '.#nixosConfigurations.newton.config.system.build.toplevel' --option binary-caches "https://cache.nixos.org"
|
||||
- mv result newton-new
|
||||
|
||||
- name: Build macintosh
|
||||
commands:
|
||||
- nix build -v '.#nixosConfigurations.macintosh.config.system.build.toplevel' --option binary-caches "https://cache.nixos.org"
|
||||
- mv result macintosh-new
|
||||
|
||||
|
||||
- name: Print report
|
||||
commands:
|
||||
- echo "lisa:" && nix store diff-closures $(readlink -f lisa-old) $(readlink -f lisa-new)
|
||||
- echo "newton:" && nix store diff-closures $(readlink -f newton-old) $(readlink -f newton-new)
|
||||
- echo "macintosh:" && nix store diff-closures $(readlink -f macintosh-old) $(readlink -f macintosh-new)
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
- cron
|
||||
|
||||
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
|
@ -82,9 +183,3 @@ steps:
|
|||
status:
|
||||
- failure
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
- cron
|
||||
|
|
|
@ -43,6 +43,9 @@
|
|||
(builtins.attrNames (builtins.readDir ./modules)));
|
||||
|
||||
nixosConfigurations = builtins.mapAttrs (name: value: (mkMachine name value self.nixosModules)) (importConfig ./machines);
|
||||
packages."x86_64-linux".tinystatus = import ./packages/tinystatus { inherit pkgs; };
|
||||
packages."x86_64-linux" = {
|
||||
tinystatus = import ./packages/tinystatus { inherit pkgs; };
|
||||
mosh = pkgs.callPackage ./packages/mosh {};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
20
packages/mosh/bash_completion_datadir.patch
Normal file
20
packages/mosh/bash_completion_datadir.patch
Normal file
|
@ -0,0 +1,20 @@
|
|||
diff --git a/configure.ac b/configure.ac
|
||||
index 3ad983d..ff8ff96 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -476,13 +476,7 @@ AS_IF([echo "$protobuf_LIBS" | grep -q -- -pthread],
|
||||
|
||||
# Bash completion needs to ask where it goes if >= 2.0 is installed.
|
||||
AS_IF([test "$install_completion" != no],
|
||||
- [PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
|
||||
- [if test "$prefix" = "NONE"; then
|
||||
- completions="`pkg-config --variable=completionsdir bash-completion`"
|
||||
- else
|
||||
- completions="`pkg-config --define-variable=prefix=$prefix --variable=completionsdir bash-completion`"
|
||||
- fi],
|
||||
- [completions="${sysconfdir}/bash_completion.d"])
|
||||
+ [completions="`pkg-config --define-variable=datadir=$datadir --variable=completionsdir bash-completion`"]
|
||||
AC_SUBST([completions])])
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
|
|
@ -1,20 +1,20 @@
|
|||
#{ lib, stdenv, fetchFromGithub, fetchpatch, zlib, protobuf, ncurses, pkg-config
|
||||
#, makeWrapper, perlPackages, openssl, autoreconfHook, openssh, bash-completion
|
||||
#, withUtempter ? stdenv.isLinux, libutempter }:
|
||||
{ pkgs, lib, stdenv, fetchFromGithub, fetchpatch, zlib, protobuf, ncurses, pkg-config
|
||||
, makeWrapper, perlPackages, openssl, autoreconfHook, openssh, bash-completion
|
||||
, withUtempter ? stdenv.isLinux, libutempter }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mosh";
|
||||
version = "1.3.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "mobile-shell";
|
||||
repo = pname;
|
||||
rev = "378dfa6aa5778cf168646ada7f52b6f4a8ec8e41";
|
||||
sha256 = "05hjhlp6lk8yjcy59zywpf0r6s0h0b9zxq0lw66dh9x8vxrhaq6s";
|
||||
sha256 = "LJssBMrICVgaZtTvZTO6bYMFO4fQ330lIUkWzDSyf7o=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper ];
|
||||
buildInputs = [ protobuf ncurses zlib openssl bash-completion ]
|
||||
buildInputs = [ protobuf ncurses zlib openssl ]
|
||||
++ (with perlPackages; [ perl IOTty ])
|
||||
++ lib.optional withUtempter libutempter;
|
||||
|
||||
|
@ -22,31 +22,16 @@ stdenv.mkDerivation rec {
|
|||
|
||||
patches = [
|
||||
./ssh_path.patch
|
||||
./mosh-client_path.patch
|
||||
./utempter_path.patch
|
||||
# Fix w/c++17, ::bind vs std::bind
|
||||
(fetchpatch {
|
||||
url = "https://github.com/mobile-shell/mosh/commit/e5f8a826ef9ff5da4cfce3bb8151f9526ec19db0.patch";
|
||||
sha256 = "15518rb0r5w1zn4s6981bf1sz6ins6gpn2saizfzhmr13hw4gmhm";
|
||||
})
|
||||
# Fix build with bash-completion 2.10
|
||||
./bash_completion_datadir.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# Fix build with Xcode 12.5 toolchain/case-insensitive filesystems
|
||||
# Backport of https://github.com/mobile-shell/mosh/commit/12199114fe4234f791ef4c306163901643b40538;
|
||||
# remove on next upstream release.
|
||||
patch -p0 < ${fetchpatch {
|
||||
url = "https://raw.githubusercontent.com/macports/macports-ports/70ca3f65e622c17582fd938602d800157ed951c3/net/mosh/files/patch-version-subdir.diff";
|
||||
sha256 = "1yyh6d07y9zbdx4fb0r56zkq9nd9knwzj22v4dfi55k4k42qxapd";
|
||||
}}
|
||||
|
||||
substituteInPlace scripts/mosh.pl \
|
||||
--subst-var-by ssh "${openssh}/bin/ssh" \
|
||||
--subst-var-by mosh-client "$out/bin/mosh-client"
|
||||
preConfigure = ''
|
||||
./autogen.sh
|
||||
'';
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-O2";
|
||||
|
||||
configureFlags = [ "--enable-completion" ]
|
||||
++ lib.optional withUtempter "--with-utempter";
|
||||
|
||||
|
@ -74,3 +59,4 @@ stdenv.mkDerivation rec {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
|
14
packages/mosh/ssh_path.patch
Normal file
14
packages/mosh/ssh_path.patch
Normal file
|
@ -0,0 +1,14 @@
|
|||
diff --git i/scripts/mosh.pl w/scripts/mosh.pl
|
||||
index c511482..55bf5f3 100755
|
||||
--- i/scripts/mosh.pl
|
||||
+++ w/scripts/mosh.pl
|
||||
@@ -66,7 +66,7 @@ my $use_remote_ip = 'proxy';
|
||||
my $family = 'prefer-inet';
|
||||
my $port_request = undef;
|
||||
|
||||
-my @ssh = ('ssh');
|
||||
+my @ssh = ('@ssh@');
|
||||
|
||||
my $term_init = 1;
|
||||
|
||||
|
18
utils.nix
18
utils.nix
|
@ -26,23 +26,7 @@ in
|
|||
(final: prev:
|
||||
{
|
||||
tinystatus = prev.pkgs.callPackage ./packages/tinystatus {};
|
||||
mosh = prev.mosh.overrideAttrs (old: {
|
||||
patches = (prev.lib.take 1 old.patches) ++ (prev.lib.sublist 4 4 old.patches);
|
||||
postPatch = '''';
|
||||
buildInputs = with prev; [ protobuf ncurses zlib openssl ]
|
||||
++ (with perlPackages; [ perl IOTty ])
|
||||
++ lib.optional true libutempter;
|
||||
preConfigure = ''
|
||||
./autogen.sh
|
||||
'';
|
||||
NIX_CFLAGS_COMPILE = "-O2";
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "mobile-shell";
|
||||
repo = "mosh";
|
||||
rev = "378dfa6aa5778cf168646ada7f52b6f4a8ec8e41";
|
||||
sha256 = "LJssBMrICVgaZtTvZTO6bYMFO4fQ330lIUkWzDSyf7o=";
|
||||
};
|
||||
});
|
||||
mosh = prev.pkgs.callPackage ./packages/mosh {};
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue