Skip to content

Instantly share code, notes, and snippets.

@offlinehacker
Created September 8, 2023 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save offlinehacker/a509d112dfbe693d3673e44feb48064b to your computer and use it in GitHub Desktop.
Save offlinehacker/a509d112dfbe693d3673e44feb48064b to your computer and use it in GitHub Desktop.
Ubuntu dev lxc profile with cloud-init
config:
user.user-data: |
#cloud-config
package_upgrade: true
packages:
- vim
- nano
- git
- curl
- wget
- nix-bin
- direnv
- openssh-server
- docker.io
# add code user
users:
- name: default
- name: code
ssh-authorized-keys:
- 'ssh-rsa ....'
sudo: ALL=(ALL) NOPASSWD:ALL
groups: users
shell: /bin/bash
locale: en_US.UTF-8
timezone: Europe/Ljubljana
write_files:
- path: /etc/nix/nix.conf
content: |
# see https://nixos.org/nix/manual/#sec-conf-file
sandbox = true
experimental-features = nix-command flakes
runcmd:
- usermod -a -G nix-users,docker code
- systemctl enable nix-daemon.service nix-daemon.socket ssh.service
- systemctl start nix-daemon.socket ssh.service
- cp /usr/share/doc/nix-bin/examples/nix-profile-daemon.sh /etc/profile.d/nix-profile-daemon.sh
description: Default LXD profile
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
name: ubuntu-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment