mirror of
https://github.com/srid/nixos-config.git
synced 2026-05-11 17:36:07 +08:00
add digitalocean image
This commit is contained in:
parent
c17d5c4f12
commit
cba5d487a0
6 changed files with 44 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -0,0 +1 @@
|
|||
result
|
||||
2
Makefile
2
Makefile
|
|
@ -1,5 +1,5 @@
|
|||
all:
|
||||
sudo nixos-rebuild switch && systemctl restart --user emanote
|
||||
sudo nixos-rebuild switch -j auto && systemctl restart --user emanote
|
||||
|
||||
|
||||
freeupboot:
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ in
|
|||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
# TODO: replace this with https://github.com/jD91mZM2/xidlehook
|
||||
#
|
||||
# A script to disable auto-suspend until unlocking the computer the next
|
||||
# time. The idea is to leave this running on desktop, whilst taking my
|
||||
# laptop to another room and ssh to the desktop.
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@
|
|||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "networkmanager" "audio" ];
|
||||
};
|
||||
users.users.srid.openssh.authorizedKeys.keys = import ./sshkeys.nix;
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
|
|
|
|||
32
images/digitalocean.nix
Normal file
32
images/digitalocean.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
let
|
||||
nixpkgs =
|
||||
(
|
||||
let
|
||||
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
|
||||
in
|
||||
fetchTarball {
|
||||
url = "https://github.com/NixOS/nixpkgs/archive/${lock.nodes.nixpkgs.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.nixpkgs.locked.narHash;
|
||||
}
|
||||
);
|
||||
pkgs = import nixpkgs { };
|
||||
config = {
|
||||
imports =
|
||||
[ "${nixpkgs}/nixos/modules/virtualisation/digital-ocean-image.nix" ];
|
||||
|
||||
# Headless - don't start a tty on the serial consoles.
|
||||
systemd.services."serial-getty@ttyS0".enable = false;
|
||||
systemd.services."serial-getty@hvc0".enable = false;
|
||||
systemd.services."getty@tty1".enable = false;
|
||||
systemd.services."autovt@".enable = false;
|
||||
|
||||
# Make sure that SSH is available
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
services.sshd.enable = true;
|
||||
users.users.root.openssh.authorizedKeys.keys = import ../sshkeys.nix;
|
||||
|
||||
# Use more aggressive compression then the default.
|
||||
virtualisation.digitalOceanImage.compressionMethod = "bzip2";
|
||||
};
|
||||
in
|
||||
(pkgs.nixos config).digitalOceanImage
|
||||
7
sshkeys.nix
Normal file
7
sshkeys.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCYQ003p7fB5ICQehLwhDBomY9WzkNBeijkSw9ADGU+EC
|
||||
rPakeIH3pntUWRJH1W93vKnLqpkn6HLGEXD9MCR0s98uhh8hT7uAYCxQTbEeKT3PYkfz3oe7XaR8rE601s
|
||||
ds0ZyFwH7l8cvK97pGr+uhFXAaohiV6VqmLVXhManEjZZ8GfYWBD9BCmIJk43G3OGa5QYFeHqztprXaJNU
|
||||
5dFPv2Uq2C+L6EvfCfkK2OO1BLZgL+Rai5jjyy6k0fcfsxxd9BdGUwqDhcBeyTIzX9rePMugf/xD+6uNRx
|
||||
TU+vjVpGUtFOw6rpgmVyFv9mn3QMNdQBc5hYKVbIQwMNGTzGgcQv srid@nixos"
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue