How to share nix store among multiple aws instances?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I am using nixops and want to reduce disk space consumption by sharing nix store among instances.
Possible implementation:
- share
/nix/store
store through elastic file system. - make cron job on random machine inside network that runs
nix-collect-garbage -d
. This will remove all packages that are not linked with first machine: actually stale packages and packages of other machines inside network. To restore them first machine triggersnixos-rebuild switch
on other machines inside network.
Can this be done better/does this make sense?
aws nixos nix
add a comment |Â
up vote
0
down vote
favorite
I am using nixops and want to reduce disk space consumption by sharing nix store among instances.
Possible implementation:
- share
/nix/store
store through elastic file system. - make cron job on random machine inside network that runs
nix-collect-garbage -d
. This will remove all packages that are not linked with first machine: actually stale packages and packages of other machines inside network. To restore them first machine triggersnixos-rebuild switch
on other machines inside network.
Can this be done better/does this make sense?
aws nixos nix
1
Not sure if this works for NixOS, but I once shared the nix store via NFS: nixos.wiki/wiki/NFS#Nix_store_on_NFS You could probably put overlayfs on top of NFS to allow local modifications.
â Mic92
May 22 at 15:13
The nixos iso also shows how readonly and read-write layers can be overlayed: github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/â¦
â Mic92
May 22 at 15:17
Only having a single read-only /nix/store has it caveats as the nix store also store configuration files. Sharing the same elastic filesystem could work so, if your network storage implements posix file locking.nix-collect-garbage
usually relies on seeing other processes using files - in a distributed settings it might delete files in use.
â Mic92
May 22 at 15:21
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am using nixops and want to reduce disk space consumption by sharing nix store among instances.
Possible implementation:
- share
/nix/store
store through elastic file system. - make cron job on random machine inside network that runs
nix-collect-garbage -d
. This will remove all packages that are not linked with first machine: actually stale packages and packages of other machines inside network. To restore them first machine triggersnixos-rebuild switch
on other machines inside network.
Can this be done better/does this make sense?
aws nixos nix
I am using nixops and want to reduce disk space consumption by sharing nix store among instances.
Possible implementation:
- share
/nix/store
store through elastic file system. - make cron job on random machine inside network that runs
nix-collect-garbage -d
. This will remove all packages that are not linked with first machine: actually stale packages and packages of other machines inside network. To restore them first machine triggersnixos-rebuild switch
on other machines inside network.
Can this be done better/does this make sense?
aws nixos nix
edited Jan 3 at 20:45
Jeff Schaller
31.8k848109
31.8k848109
asked Jan 3 at 20:23
srghma
1296
1296
1
Not sure if this works for NixOS, but I once shared the nix store via NFS: nixos.wiki/wiki/NFS#Nix_store_on_NFS You could probably put overlayfs on top of NFS to allow local modifications.
â Mic92
May 22 at 15:13
The nixos iso also shows how readonly and read-write layers can be overlayed: github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/â¦
â Mic92
May 22 at 15:17
Only having a single read-only /nix/store has it caveats as the nix store also store configuration files. Sharing the same elastic filesystem could work so, if your network storage implements posix file locking.nix-collect-garbage
usually relies on seeing other processes using files - in a distributed settings it might delete files in use.
â Mic92
May 22 at 15:21
add a comment |Â
1
Not sure if this works for NixOS, but I once shared the nix store via NFS: nixos.wiki/wiki/NFS#Nix_store_on_NFS You could probably put overlayfs on top of NFS to allow local modifications.
â Mic92
May 22 at 15:13
The nixos iso also shows how readonly and read-write layers can be overlayed: github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/â¦
â Mic92
May 22 at 15:17
Only having a single read-only /nix/store has it caveats as the nix store also store configuration files. Sharing the same elastic filesystem could work so, if your network storage implements posix file locking.nix-collect-garbage
usually relies on seeing other processes using files - in a distributed settings it might delete files in use.
â Mic92
May 22 at 15:21
1
1
Not sure if this works for NixOS, but I once shared the nix store via NFS: nixos.wiki/wiki/NFS#Nix_store_on_NFS You could probably put overlayfs on top of NFS to allow local modifications.
â Mic92
May 22 at 15:13
Not sure if this works for NixOS, but I once shared the nix store via NFS: nixos.wiki/wiki/NFS#Nix_store_on_NFS You could probably put overlayfs on top of NFS to allow local modifications.
â Mic92
May 22 at 15:13
The nixos iso also shows how readonly and read-write layers can be overlayed: github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/â¦
â Mic92
May 22 at 15:17
The nixos iso also shows how readonly and read-write layers can be overlayed: github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/â¦
â Mic92
May 22 at 15:17
Only having a single read-only /nix/store has it caveats as the nix store also store configuration files. Sharing the same elastic filesystem could work so, if your network storage implements posix file locking.
nix-collect-garbage
usually relies on seeing other processes using files - in a distributed settings it might delete files in use.â Mic92
May 22 at 15:21
Only having a single read-only /nix/store has it caveats as the nix store also store configuration files. Sharing the same elastic filesystem could work so, if your network storage implements posix file locking.
nix-collect-garbage
usually relies on seeing other processes using files - in a distributed settings it might delete files in use.â Mic92
May 22 at 15:21
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Â
draft saved
draft discarded
Â
draft saved
draft discarded
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414625%2fhow-to-share-nix-store-among-multiple-aws-instances%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Not sure if this works for NixOS, but I once shared the nix store via NFS: nixos.wiki/wiki/NFS#Nix_store_on_NFS You could probably put overlayfs on top of NFS to allow local modifications.
â Mic92
May 22 at 15:13
The nixos iso also shows how readonly and read-write layers can be overlayed: github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/â¦
â Mic92
May 22 at 15:17
Only having a single read-only /nix/store has it caveats as the nix store also store configuration files. Sharing the same elastic filesystem could work so, if your network storage implements posix file locking.
nix-collect-garbage
usually relies on seeing other processes using files - in a distributed settings it might delete files in use.â Mic92
May 22 at 15:21