mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 13:03:28 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c3238a177 |
No files matched your search
@@ -14,7 +14,7 @@ jobs:
|
||||
with:
|
||||
extra_nix_config: |
|
||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: actions/create-github-app-token@v3
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
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
|
||||
# system has fewer cores.
|
||||
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
|
||||
''
|
||||
|
||||
@@ -91,14 +91,12 @@
|
||||
updateOptions = builtins.removeAttrs createOptions onetimeProperties;
|
||||
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
|
||||
''
|
||||
zfs create -up "${config._name}" \
|
||||
${lib.concatStringsSep " " (
|
||||
lib.mapAttrsToList (n: v: "-o ${n}=${lib.escapeShellArg v}") (createOptions)
|
||||
)}
|
||||
zfs create -up ${config._name} \
|
||||
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") (createOptions))}
|
||||
''
|
||||
else
|
||||
''
|
||||
@@ -109,8 +107,8 @@
|
||||
${lib.optionalString (updateOptions != { }) ''
|
||||
else
|
||||
zfs set -u ${
|
||||
lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "${n}=${lib.escapeShellArg v}") updateOptions)
|
||||
} "${config._name}"
|
||||
lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "${n}=${v}") updateOptions)
|
||||
} ${config._name}
|
||||
''}
|
||||
fi
|
||||
'';
|
||||
|
||||
@@ -63,11 +63,7 @@
|
||||
default = ''
|
||||
if ! zfs get type "${config._parent.name}/${config.name}" >/dev/null 2>&1; then
|
||||
zfs create "${config._parent.name}/${config.name}" \
|
||||
${
|
||||
lib.concatStringsSep " " (
|
||||
lib.mapAttrsToList (n: v: "-o ${n}=${lib.escapeShellArg v}") config.options
|
||||
)
|
||||
} \
|
||||
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") config.options)} \
|
||||
-V ${config.size} ${toString (builtins.map lib.escapeShellArg config.extraArgs)}
|
||||
zvol_wait
|
||||
partprobe "/dev/zvol/${config._parent.name}/${config.name}"
|
||||
|
||||
+2
-10
@@ -377,16 +377,8 @@ in
|
||||
else
|
||||
""
|
||||
} \
|
||||
${
|
||||
lib.concatStringsSep " " (
|
||||
lib.mapAttrsToList (n: v: "-o ${n}=${lib.escapeShellArg v}") config.options
|
||||
)
|
||||
} \
|
||||
${
|
||||
lib.concatStringsSep " " (
|
||||
lib.mapAttrsToList (n: v: "-O ${n}=${lib.escapeShellArg v}") config.rootFsOptions
|
||||
)
|
||||
} \
|
||||
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") config.options)} \
|
||||
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-O ${n}=${v}") config.rootFsOptions)} \
|
||||
''${topology:+ $topology}
|
||||
if [[ $(zfs get -H mounted "${config.name}" | cut -f3) == "yes" ]]; then
|
||||
zfs unmount "${config.name}"
|
||||
|
||||
Reference in new issue
Block a user