CMCDragonkai / .dotfiles

Personal Configuration Management
MIT License
2 stars 0 forks source link

config.nix pinning #1

Open CMCDragonkai opened 6 years ago

CMCDragonkai commented 6 years ago

It stands to reason that we should be using config.nix pinning in order to make our user profile reproducible regardless of the host OS.

Right now the config.nix is using whatever packages exist in the host environment, but it doesn't make sense to do so.

However if we are intending to work on NixOS, we may later need to make changes to our own nixpkgs environment. To do this we need our /nix/nixpkgs repository inside our NixOS system.

Alternatively what we do is always refer to a URL based Nix Path (which is then cached), that ideally would be an IPFS path. And then we can do development by changing things in the nixpkgs, pushing it up, and then switching to a different URI later. It also makes to put the pinning embedded into the configuration.nix somehow. But right now the NIX_PATH must be set, or else things like nix-env won't know what to use.

Here's what we should do. The system's nix package path should be pinned. We should then set the NIX_PATH as well to point to the pinned path. But the pinning should be coupled with the configuration.nix, not a separate Git repository. If it is a separate Git repository, the pinned nixpkgs should then be a submodule of the /etc/nixos repository.

  1. Create a group on gitlab for NixOS systems. Each NixOS system maintains its own history.
  2. Each NixOS repository has its own submodule of nixpkgs. This ensures that we combine the benefits of directly working on NixOS with pinning.
  3. Make sure we are propagating the nix path appropriately when we do this.

Note that we can use:

sudo dmidecode --string=system-manufacturer
sudo dmidecode --string=system-product-name

But basically we need to create unique repositories to represent our computers. One issue is if we have multiple computers of the same type. If we want to cluster them, or treat them specifically.

Eventually we need to create multiple possible profiles inside Nix. So we are only installing what we need.

CMCDragonkai commented 6 years ago

We need to propagate the SSH keys first. If we had Polykey, that would be the first application we need, and then we need to create it to the network, and we would then propagate it then during some sort of authorisation.

CMCDragonkai commented 6 years ago

NixOS pinning is now done in: https://gitlab.com/MatrixAI/Platforms

CMCDragonkai commented 6 years ago

I need to separate out the packages into different profiles.

And allow separate profiles to pin differently. Especially since non-free apps tend to have their sources fail more often, they require going with the master more often! Like skype and masterpdfeditor currently doesn't work on 18.03, only on master do they work.

CMCDragonkai commented 6 years ago

The proprietary applications are now pinned to master always. This should solve most of the problem, and I'm too lazy to pin the normal applications for now instead inheriting from the root system. This is OK since I use this mainly on 1 system.