about summary refs log tree commit diff
path: root/nixos
AgeCommit message (Collapse)AuthorFilesLines
2020-03-19 Update COVID-19 webpageWilliam Carroll1-2/+2
- Prefer hosting on sandbox.wpcarro.dev; I would prefer to host it at sandbox.wpcarro.dev/covid-19, but I haven't figure out how to use Nginx to do serve locations like /covid-19 yet. - Splice the src directory: When I develop locally and index.html exists within ./src, I cannot access ./node_modules because ./node_modules is in a parent directory. I could fix this if I used a bundler like Parcel or Webpack, but I do not want to set that up at this time. - Introduce Tailwind for CSS. This complicates my build a bit as well. For now, I'm including output.css even though ideally I should not version-control this file. I haven't figured out how to `yarn install` and run commands like `npx tailwindcss build styles.css -o output.css` in a Nix derivation yet. Hopefully I will learn and refactor this. - Add some content about why I made this chart - Add some content about some of my covid-19 predictions - Add a footer to the webpage - Delete timeseries.json and prefer fetching the published data instead
2020-03-18 Remove git.wpcarro.dev entry fron Nginx configWilliam Carroll1-7/+0
This is not currently working and it is causing Nginx to enter a retry loop. I am removing it until I choose to focus on it.
2020-03-18 Create line chart of UK confirmed corona virus casesWilliam Carroll1-0/+5
I was having trouble tracking the growth of corona virus cases in the UK. Thankfully someone is publishing some daily COVID data as JSON. I downloaded that data manually and plotted it using the chart.js library as a programming exercise with Mimi. Now I'm attempting to deploy to https://wpcarro.dev/covid-uk. TODO(wpcarro): Prefer the live API data instead my soon-to-be-stale downloaded.
2020-03-16 Create derivation for learn.wpcarro.devWilliam Carroll1-3/+1
Creating a derivation to abstract over the build process for learn.wpcarro.dev.
2020-03-10 Attempt to support gogsWilliam Carroll1-0/+17
Gogs claims to be an easy-to-use Git server and web frontend written in golang. I'm eager to try it as an alternative to cgit.
2020-03-09 Nixify hugo deploymentWilliam Carroll1-1/+1
Create a derivation for building the static files of my blog.
2020-03-08 Replace ~ with /home/wpcarroWilliam Carroll1-1/+1
Nix runs the `rebuild` command as root, so ~ resolves to /root, which is not what I want.
2020-03-08 Use static directory path as root for learn.wpcarro.devWilliam Carroll1-1/+3
With this simple change, Nix should copy the static directory and all of its contents to /nix/store and return the path to that directory. See TODO for more what I would have liked to do ideally.
2020-03-07 Rename socrates/default.nix -> socrates/configuration.nixWilliam Carroll2-1/+1
readTree uses the output attribute set of default.nix as the value for nixos.socrates, which disables me from resolving nixos.socrates.rebuild since there is no rebuild attribute in the output attribute set from default.nix. If I rename default.nix -> configuration.nix, I can resolve nixos.socrates.{configuration,hardware,rebuild}.
2020-03-07 Ensure socrates/default.nix is a functionWilliam Carroll1-0/+2
Nix complains that `nixos.socrates` is not a function but a set. By adding `{ ... }:` to the top of the file, I'm hoping to change it from a set to a function.
2020-03-07 Attempt to serve {learn,blog}.wpcarro.devWilliam Carroll1-10/+12
Reading an Nginx tutorial and trying to port the information over to NixOS.
2020-03-07 Remove fix-point recursion from socrates/default.nixWilliam Carroll1-2/+2
The fixed-point recursion isn't necessary.
2020-03-01 Manually require dependencies for <nixpkgs>, <briefcase>William Carroll1-2/+8
When I build socrates using `sudo nixos-rebuild [...] switch`, my `nixos-config` (i.e. <briefcase/nixos/socrates/default.nix>) is a simple Nix anonymous function. Typically readTree populates my pkgs, briefcase, depot function parameters with <nixpkgs>, <briefcase>, <depot>, but `nixos-rebuild` is unaware of `readTree`. For now I'm manually importing these dependencies, and I'm leaving a TODO to reconsider switching to the `{ pkgs, briefcase, ... }` style when I better understand NixOS.
2020-03-01 Removing unused parameters in installer.nixWilliam Carroll1-1/+1
I'm neither using config nor pkgs, so I'm deleteing them.
2020-03-01 Nest configuration beneath socrates directoryWilliam Carroll3-10/+5
Create a socrates directory to store configuration for socrates.
2020-02-23 Expose depot and briefcase to rebuild scriptWilliam Carroll1-0/+2
At the moment, I don't think nixos-rebuild is reading $NIX_PATH, which appropriately sets the paths for depot and briefcase. I'm going to explicitly expose these values in the rebuild script for now.
2020-02-23 Define monzo-token-server as a root systemd serviceWilliam Carroll1-4/+10
After I considered the security implications of calling `systemctl --user cat monzo-token-server`, I realized that monzo-token-server should be a root service instead of a user service. This service unit now also explicitly depends on briefcase.monzo_ynab.tokens, which is a big improvement.
2020-02-23 Consume updated kv moduleWilliam Carroll1-0/+1
Exposing store_path to the tokens module to support the newly updated kv module, which requires an explicit storePath parameter.
2020-02-23 Change systemd unit type: oneshot -> simpleWilliam Carroll1-1/+1
"oneshot", according to `man systemd.service`, "will consider the unit up after the main process exits". Since I designed token-server to run continuously, it will not intentionally exit; therefore, systemd awaits its exit, which never comes. "simple", on the other hand, does what I want.
2020-02-23 Expose secrets to Monzo / YNAB serviceWilliam Carroll1-3/+12
Here is my first attempt to manage secrets when I deploy onto a NixOS machine. Background: When I develop, I use direnv, which reads an .envrc file in which I define my secrets. My secrets are read from `pass` using a pattern like this... ```shell secret_value="$(pass show path/to/secret)" ``` ...Thus far, I've found this pattern convenient. `pass show` invokes GPG, which asks me for a password to authenticate. This means that when I cd into a directory with an .envrc file using this pattern, I may be prompted by GPG for a password. When I'm not, it's because gpg-agent is still caching my password. This works for development, but I currently do not know how to use direnv for deployments. Here is what I'm using until I find a more convenient solution: - Store the secrets in /etc/secrets on socrates. Ensure that the /etc/secrets directory and its contents are only readable by root. - Use systemd's Environment and NixOS's builtins.readFile to read the files in /etc/secrets when I can `sudo nixos-rebuild`. Ideally I could call a function like `builtins.readFromPasswordStore` within configuration.nix. This would allow me to skip the step where I run... ```shell > ssh socrates > pass show finance/monzo/client-id | sudo tee /etc/secrets/monzo-client-id > pass show finance/monzo/client-secret | sudo tee /etc/secrets/monzo-client-secret > # etc ``` ...I don't know how to manage secrets using NixOS, but at least this is one answer.
2020-02-22 Incorporate NixOS configurationWilliam Carroll4-20/+165
TL;DR: - Move /etc/nixos/configuration.nix -> //nixos/configuration.nix - Move /etc/nixos/hardware-configuration.nix -> //nixos/harware.nix - Document installer.nix - Create rebuild.nix wrapper around `sudo nixos-rebuild switch` Previously I sketched ideas for the configuration.nix for socrates -- also known as flattop -- the inexpensive Acer laptop residing in my flat and stored that configuration.nix file in briefcase. Now, however, I have successfully installed NixOS onto socrates. By default NixOS saves the configuration.nix and hardware-configuration.nix files to /etc/nixos/. I'm moving both of these files into briefcase. Because the command `nixos-rebuild` looks for the NixOS configuration file in /etc/nixos, I wrote rebuild.nix, which creates a program to call `nixos-rebuild` with the new location of my configuration.nix.
2020-02-20 Support installer.nixWilliam Carroll1-0/+11
The command... nix-build -A config.system.build.isoImage -I nixos-config=installer.nix nixos ...creates an .iso file in the ./result directory. You can then copy this onto a USB and use it a custom installer... cp ./result/iso/*-linux.iso /dev/sda I needed an installer that used a version of the Linux kernel higher than the one distributed on NixOS's website: 4.19.? -> 5.4.20+. My Acer laptop needed a version of the kernel that supported its network controller: Intel 3168NGW. TODO(wpcarro): Pin the nixpkgs git commit SHA inside of installer.nix.
2020-02-20 Support basic nixos/configuration.nixWilliam Carroll1-0/+35
I'm attempting to configure an old Acer laptop that I bought at a used electronics store in Shepherd's Bush (~100GBP) as my server. I'd like to install NixOS on it. The configuration.nix herein defines a starting point for the configuration for that machine. It isn't currently working. Troubleshooting and solutions forthcoming...