mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
Merge pull request #102354 from erikarvstedt/extra-container
extra-container: init at 0.8
This commit is contained in:
commit
1b94d11c92
4 changed files with 57 additions and 0 deletions
|
@ -135,6 +135,7 @@
|
|||
./programs/droidcam.nix
|
||||
./programs/environment.nix
|
||||
./programs/evince.nix
|
||||
./programs/extra-container.nix
|
||||
./programs/feedbackd.nix
|
||||
./programs/file-roller.nix
|
||||
./programs/firejail.nix
|
||||
|
|
17
nixos/modules/programs/extra-container.nix
Normal file
17
nixos/modules/programs/extra-container.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.extra-container;
|
||||
in {
|
||||
options = {
|
||||
programs.extra-container.enable = mkEnableOption ''
|
||||
extra-container, a tool for running declarative NixOS containers
|
||||
without host system rebuilds
|
||||
'';
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.extra-container ];
|
||||
boot.extraSystemdUnitPaths = [ "/etc/systemd-mutable/system" ];
|
||||
};
|
||||
}
|
37
pkgs/tools/virtualization/extra-container/default.nix
Normal file
37
pkgs/tools/virtualization/extra-container/default.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ stdenv, lib, nixos-container, openssh, glibcLocales, fetchFromGitHub }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "extra-container";
|
||||
version = "0.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "erikarvstedt";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
hash = "sha256-/AetqDPkz32JMdjbSdzZCBVmGbvzjeAb8Wv82iTgHFE=";
|
||||
};
|
||||
|
||||
buildCommand = ''
|
||||
install -D $src/extra-container $out/bin/extra-container
|
||||
patchShebangs $out/bin
|
||||
share=$out/share/extra-container
|
||||
install $src/eval-config.nix -Dt $share
|
||||
|
||||
# Use existing PATH for systemctl and machinectl
|
||||
scriptPath="export PATH=${lib.makeBinPath [ nixos-container openssh ]}:\$PATH"
|
||||
|
||||
sed -i \
|
||||
-e "s|evalConfig=.*|evalConfig=$share/eval-config.nix|" \
|
||||
-e "s|LOCALE_ARCHIVE=.*|LOCALE_ARCHIVE=${glibcLocales}/lib/locale/locale-archive|" \
|
||||
-e "2i$scriptPath" \
|
||||
$out/bin/extra-container
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Run declarative containers without full system rebuilds";
|
||||
homepage = https://github.com/erikarvstedt/extra-container;
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
maintainers = [ maintainers.earvstedt ];
|
||||
};
|
||||
}
|
|
@ -31942,6 +31942,8 @@ with pkgs;
|
|||
|
||||
nixos-rebuild = callPackage ../os-specific/linux/nixos-rebuild { };
|
||||
|
||||
extra-container = callPackage ../tools/virtualization/extra-container { };
|
||||
|
||||
norwester-font = callPackage ../data/fonts/norwester {};
|
||||
|
||||
nut = callPackage ../applications/misc/nut { };
|
||||
|
|
Loading…
Reference in a new issue