8000 GitHub - Samasaur1/polytopia: The Nix config for Polytopia
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on May 11, 2025. It is now read-only.

Samasaur1/polytopia

Repository files navigation

Polytopia

Warning

This repository has been archived in favor of https://github.com/Reed-CSTAR/reednet


This repository provides a couple things:

Nix dev shells

These are premade environments that provide all the software used in CS classes. On the CS department machines, you can access them via

nix develop polytopia#cs221

On your own machine (if Nix is installed), you can access them via

nix develop github:Samasaur1/polytopia#cs384

At the time of writing, there are three dev shells:

  • cs221
  • cs378
  • cs384

You can check the dev shells that exist now either by looking in the devShells directory or running nix flake show polytopia.

Upgrades
nix flake update --commit-lock-file

There is a GitHub Action set up that automatically updates the flake inputs weekly, so the only action necessary is to merge this PR.

Perhaps we only want to update dev shells in between semesters, so that they are consistent throughout a class?

Ansible configuration

Running the playbook
  1. Install Ansible (you can launch a subshell that provides Ansible via nix develop)

  2. Run the playbook

    ansible-playbook -i inventory.ini playbook.yaml -K

    If you're using the dev shell:

    poly-run-ansible

    Note that you need SSH host configurations for all machines, since they are defined in the inventory without their FQDNs

Adding users
  1. Generate a temporary password (let's say it's correct horse battery staple)

  2. Install mkpasswd (you can launch a subshell that provides mkpasswd via nix develop)

  3. Hash the temporary password:

    mkpasswd --method=sha-512

    If you're using the dev shell:

    poly-hash-password

    Using our example, this gives $6$e0A7MR6aAnL3r9Y5$WevmaiUlUo6p67OErBd8.krTCTg/36EnNrpj8zUJKNWwIn3L7MqSmc3rOPupmajxJQ9z3N9Hsg7x9GaZfeVZr.

  4. Add user and group entries to users.yaml

    - name: Synchronize group 'sam'
      become: true
      ansible.builtin.group:
        name: sam
        state: present
        system: false
    - name: Synchronize user 'sam'
      become: true
      ansible.builtin.user:
        append: false
        comment: Samasaur1,,,
        create_home: true
        generate_ssh_key: false
        group: sam
        groups: users
        name: sam
        password: '$6$e0A7MR6aAnL3r9Y5$WevmaiUlUo6p67OErBd8.krTCTg/36EnNrpj8zUJKNWwIn3L7MqSmc3rOPupmajxJQ9z3N9Hsg7x9GaZfeVZr.'
        shell: '/usr/bin/bash'
        state: present
        system: false
        update_password: on_create
  5. Run the Ansible playbook

About

The Nix config for Polytopia

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages

0