Welcome to my dotfiles. This is a mess of NixOS and Home-Manager
- Install NixOS on your device.
- Clone this repository:
git clone https://github.com/your-username/nix-dots.git
- Deploy the repository:
- Local deployment:
sudo nixos-rebuild switch --flake .#nixosConfiguration
- Remote deployment:
nixos-rebuild --target-host [email protected] --use-remote-sudo switch --flake .#klipperpi
- Local deployment:
Some pain points when configuring the raspberry pi and building the image to flash it.
Agenix requires the public key of the host that you are deploying the secret to. Specifically a pubkey from /etc/ssh
. This is configured on first boot. So how do you flash the pi and have the wifi configuration baked in as I have it setup in the configuration.nix. Before I can do that I have to do the following:
- hard code the wifi password
- build the image
- flash the sd card
- deploy the pi
- ssh into the pi and get the pubkey
- build the secret with agenix
- update the configuration to consume the secret
This is all a pain in the ass and exposes the wifi secret in your local /nix/store.(nix-collect-garbage -d
is your friend after this).
Possible Option: Thanks Blades
Flash the sd for the pi as an access point. Fetch the pubkey and then proceed with agenix to set up and configure the wifi network. Router AP Example
- Get the pubkey for the device that will consume the secret from /etc/ssh
- Add that pubkey to secrets.nix
- I think you can use a different secret for things that are specific to the user. But I haven't had a need yet.
- Create the secret
cd secrets/
or make the directory and cd therenix run github:ryantm/agenix -- -e klipperpi.age
< This should point at thesecretName.age
you just added- A text editor will pop up and you add your secret in whatever format you need (k:v, rsa, env, string)
- Save the file and it will populate as
secrets/secretName.age
- Consume the secret
- Wherever you need to consume the secret add a file reference to it
age.secrets.klipperpi.file = ../../secrets/klipperpi.age;
- Then add a path reference to whatever consumes it.
-
wireless.environmentFile = config.age.secrets.klipperpi.path;
-
- Wherever you need to consume the secret add a file reference to it
wireless.environmentFile reference
In here I've set some basic sane settings for configuring firefox based on ffprofiles.com. You can create multiple profiles and override the defaultSettings with the //
construct.
{
programs.firefox.profiles.NAME.settings = defaultSettings // {
"app.update.auto" = false;
"browser.startup.homepage" = "https://lobste.rs";
};
}
This is actually configured in a few places:
- Package install
- Firewall Rules This won't work without some TCP and UDP ports open
Then you install KDE Connect on your phone. And follow the instructions to set it up.
{ networking.firewall = { allowedTCPPortRanges = [ # KDE Connect { from = 1714; to = 1764; } ]; allowedUDPPortRanges = [ # KDE Connect { from = 1714; to = 1764; } ]; }; }