initial public-cof config
This commit is contained in:
parent
20147f145b
commit
9cb53cb9db
8 changed files with 174 additions and 0 deletions
38
machines/public-cof/configuration.nix
Normal file
38
machines/public-cof/configuration.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[
|
||||||
|
./hardware-configuration.nix
|
||||||
|
./programs.nix
|
||||||
|
./system.nix
|
||||||
|
./networking.nix
|
||||||
|
# TODO monitoring
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
time.timeZone = "Europe/Paris";
|
||||||
|
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
console = {
|
||||||
|
font = "Lat2-Terminus16";
|
||||||
|
keyMap = "us";
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.mtr.enable = true;
|
||||||
|
programs.gnupg.agent = {
|
||||||
|
enable = true;
|
||||||
|
enableSSHSupport = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable the OpenSSH daemon.
|
||||||
|
services.openssh.enable = true;
|
||||||
|
users.users.root.openssh.authorizedKeys.keyFiles = [
|
||||||
|
./pubkeys/gdd.keys
|
||||||
|
./pubkeys/raito.keys
|
||||||
|
];
|
||||||
|
|
||||||
|
system.stateVersion = "21.05";
|
||||||
|
}
|
30
machines/public-cof/hardware-configuration.nix
Normal file
30
machines/public-cof/hardware-configuration.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/9147d97d-66fe-4bde-8535-aa855ebee1a8";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/AEF2-33FE";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices =
|
||||||
|
[ { device = "/dev/disk/by-uuid/bd933d58-5fa1-41c6-a4a1-9c176180f0f6"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
19
machines/public-cof/networking.nix
Normal file
19
machines/public-cof/networking.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
networking = {
|
||||||
|
hostName = "public-cof";
|
||||||
|
|
||||||
|
useDHCP = false;
|
||||||
|
interfaces.ens18 = {
|
||||||
|
useDHCP = true;
|
||||||
|
ipv6.addresses = [{
|
||||||
|
address = "2001:470:1f13:187:c08e:feff:fe4d:f5f5";
|
||||||
|
prefixLength = 64;
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
|
||||||
|
firewall.allowedTCPPorts = [ 22 ];
|
||||||
|
firewall.allowedUDPPorts = [ 22 ];
|
||||||
|
firewall.enable = true;
|
||||||
|
};
|
||||||
|
}
|
27
machines/public-cof/programs.nix
Normal file
27
machines/public-cof/programs.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
let pkgsList = with pkgs; [
|
||||||
|
curl
|
||||||
|
wget
|
||||||
|
|
||||||
|
nix-prefetch-git
|
||||||
|
dnsutils
|
||||||
|
|
||||||
|
unzip
|
||||||
|
zip
|
||||||
|
ripgrep
|
||||||
|
|
||||||
|
niv
|
||||||
|
nixfmt
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./vim.nix
|
||||||
|
];
|
||||||
|
programs = {
|
||||||
|
tmux.enable = true;
|
||||||
|
mosh.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = pkgsList;
|
||||||
|
}
|
2
machines/public-cof/pubkeys/gdd.keys
Normal file
2
machines/public-cof/pubkeys/gdd.keys
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICE7TN5NQKGojNGIeTFiHjLHTDQGT8i05JFqX/zLW2zc
|
||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFbkPWWZzOBaRdx4+7xQUgxDwuncSl2fxAeVuYfVUPZ
|
4
machines/public-cof/pubkeys/raito.keys
Normal file
4
machines/public-cof/pubkeys/raito.keys
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDcEkYM1r8QVNM/G5CxJInEdoBCWjEHHDdHlzDYNSUIdHHsn04QY+XI67AdMCm8w30GZnLUIj5RiJEWXREUApby0GrfxGGcy8otforygfgtmuUKAUEHdU2MMwrQI7RtTZ8oQ0USRGuqvmegxz3l5caVU7qGvBllJ4NUHXrkZSja2/51vq80RF4MKkDGiz7xUTixI2UcBwQBCA/kQedKV9G28EH+1XfvePqmMivZjl+7VyHsgUVj9eRGA1XWFw59UPZG8a7VkxO/Eb3K9NF297HUAcFMcbY6cPFi9AaBgu3VC4eetDnoN/+xT1owiHi7BReQhGAy/6cdf7C/my5ehZwD
|
||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKIIcqryU28FkV+UpiTnGCOfwKO5jFhkdvU7a7Ew2KoZ
|
||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMLf6B8VV//BhOWihYK8Zy1CJ3sg4w2bP0aBO0VPs4hS
|
||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE0xMwWedkKosax9+7D2OlnMxFL/eV4CvFZLsbLptpXr
|
23
machines/public-cof/system.nix
Normal file
23
machines/public-cof/system.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
# # Auto upgrades
|
||||||
|
# system.autoUpgrade = {
|
||||||
|
# enable = false; # TODO(Ryan): do not enable, it will break deployments.
|
||||||
|
# allowReboot = false;
|
||||||
|
# };
|
||||||
|
|
||||||
|
# Auto GC and store optimizations
|
||||||
|
nix = {
|
||||||
|
trustedUsers = [ "root" ];
|
||||||
|
gc = {
|
||||||
|
automatic = true;
|
||||||
|
dates = "weekly";
|
||||||
|
options = "--delete-older-than 90d";
|
||||||
|
};
|
||||||
|
optimise.automatic = true;
|
||||||
|
extraOptions = ''
|
||||||
|
min-free = ${toString (100 * 1024 * 1024)}
|
||||||
|
max-free = ${toString (1024 * 1024 * 1024)}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
31
machines/public-cof/vim.nix
Normal file
31
machines/public-cof/vim.nix
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
environment.variables = { EDITOR = "vim"; };
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
nixfmt
|
||||||
|
git
|
||||||
|
(neovim.override {
|
||||||
|
vimAlias = true;
|
||||||
|
configure = {
|
||||||
|
packages.myPlugins = with pkgs.vimPlugins; {
|
||||||
|
start = [ vim-lastplace vim-nix ];
|
||||||
|
opt = [];
|
||||||
|
};
|
||||||
|
customRC = ''
|
||||||
|
set encoding=utf-8
|
||||||
|
set wildmenu
|
||||||
|
|
||||||
|
set nocompatible
|
||||||
|
set backspace=indent,eol,start
|
||||||
|
set cursorline
|
||||||
|
hi CursorLine term=bold cterm=bold ctermbg=darkgrey
|
||||||
|
set number
|
||||||
|
set relativenumber
|
||||||
|
set tabstop=4
|
||||||
|
set expandtab
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)];
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue