mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 21:13:28 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c3238a177 |
No files matched your search
@@ -14,7 +14,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
extra_nix_config: |
|
extra_nix_config: |
|
||||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
- uses: actions/create-github-app-token@v3
|
- uses: actions/create-github-app-token@v1
|
||||||
id: app-token
|
id: app-token
|
||||||
with:
|
with:
|
||||||
app-id: ${{ vars.APP_ID }}
|
app-id: ${{ vars.APP_ID }}
|
||||||
|
|||||||
@@ -155,6 +155,13 @@ let
|
|||||||
# systems, while -P 4 is ~30% slower. Cap at 8 but use fewer workers if the
|
# systems, while -P 4 is ~30% slower. Cap at 8 but use fewer workers if the
|
||||||
# system has fewer cores.
|
# system has fewer cores.
|
||||||
mkdir -p "$rootMountPoint"/nix/store
|
mkdir -p "$rootMountPoint"/nix/store
|
||||||
|
# Limit dirty page accumulation to prevent OOM in the VM.
|
||||||
|
# The kernel evicts clean page cache under memory pressure, but dirty
|
||||||
|
# pages must be written back first. Low thresholds force early writeback
|
||||||
|
# so dirty pages never pile up enough to trigger the OOM killer,
|
||||||
|
# even when copying files larger than available RAM.
|
||||||
|
echo 10000000 > /proc/sys/vm/dirty_bytes
|
||||||
|
echo 5000000 > /proc/sys/vm/dirty_background_bytes
|
||||||
${
|
${
|
||||||
if cfg.copyNixStoreThreads == "auto" then
|
if cfg.copyNixStoreThreads == "auto" then
|
||||||
''
|
''
|
||||||
|
|||||||
@@ -91,14 +91,12 @@
|
|||||||
updateOptions = builtins.removeAttrs createOptions onetimeProperties;
|
updateOptions = builtins.removeAttrs createOptions onetimeProperties;
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
if ! zfs get type "${config._name}" >/dev/null 2>&1; then
|
if ! zfs get type ${config._name} >/dev/null 2>&1; then
|
||||||
${
|
${
|
||||||
if config._createFilesystem then
|
if config._createFilesystem then
|
||||||
''
|
''
|
||||||
zfs create -up "${config._name}" \
|
zfs create -up ${config._name} \
|
||||||
${lib.concatStringsSep " " (
|
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") (createOptions))}
|
||||||
lib.mapAttrsToList (n: v: "-o ${n}=${lib.escapeShellArg v}") (createOptions)
|
|
||||||
)}
|
|
||||||
''
|
''
|
||||||
else
|
else
|
||||||
''
|
''
|
||||||
@@ -109,8 +107,8 @@
|
|||||||
${lib.optionalString (updateOptions != { }) ''
|
${lib.optionalString (updateOptions != { }) ''
|
||||||
else
|
else
|
||||||
zfs set -u ${
|
zfs set -u ${
|
||||||
lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "${n}=${lib.escapeShellArg v}") updateOptions)
|
lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "${n}=${v}") updateOptions)
|
||||||
} "${config._name}"
|
} ${config._name}
|
||||||
''}
|
''}
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -63,11 +63,7 @@
|
|||||||
default = ''
|
default = ''
|
||||||
if ! zfs get type "${config._parent.name}/${config.name}" >/dev/null 2>&1; then
|
if ! zfs get type "${config._parent.name}/${config.name}" >/dev/null 2>&1; then
|
||||||
zfs create "${config._parent.name}/${config.name}" \
|
zfs create "${config._parent.name}/${config.name}" \
|
||||||
${
|
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") config.options)} \
|
||||||
lib.concatStringsSep " " (
|
|
||||||
lib.mapAttrsToList (n: v: "-o ${n}=${lib.escapeShellArg v}") config.options
|
|
||||||
)
|
|
||||||
} \
|
|
||||||
-V ${config.size} ${toString (builtins.map lib.escapeShellArg config.extraArgs)}
|
-V ${config.size} ${toString (builtins.map lib.escapeShellArg config.extraArgs)}
|
||||||
zvol_wait
|
zvol_wait
|
||||||
partprobe "/dev/zvol/${config._parent.name}/${config.name}"
|
partprobe "/dev/zvol/${config._parent.name}/${config.name}"
|
||||||
|
|||||||
+2
-10
@@ -377,16 +377,8 @@ in
|
|||||||
else
|
else
|
||||||
""
|
""
|
||||||
} \
|
} \
|
||||||
${
|
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") config.options)} \
|
||||||
lib.concatStringsSep " " (
|
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-O ${n}=${v}") config.rootFsOptions)} \
|
||||||
lib.mapAttrsToList (n: v: "-o ${n}=${lib.escapeShellArg v}") config.options
|
|
||||||
)
|
|
||||||
} \
|
|
||||||
${
|
|
||||||
lib.concatStringsSep " " (
|
|
||||||
lib.mapAttrsToList (n: v: "-O ${n}=${lib.escapeShellArg v}") config.rootFsOptions
|
|
||||||
)
|
|
||||||
} \
|
|
||||||
''${topology:+ $topology}
|
''${topology:+ $topology}
|
||||||
if [[ $(zfs get -H mounted "${config.name}" | cut -f3) == "yes" ]]; then
|
if [[ $(zfs get -H mounted "${config.name}" | cut -f3) == "yes" ]]; then
|
||||||
zfs unmount "${config.name}"
|
zfs unmount "${config.name}"
|
||||||
|
|||||||
Reference in new issue
Block a user