Self-host your own digital island
1{ pkgs, config, lib, ... }:
2
3{
4 imports = [ ./hardware-configuration.nix ];
5
6 boot.loader = {
7 systemd-boot.enable = true;
8 efi.canTouchEfiVariables = true;
9 };
10
11 nix.settings.experimental-features = [ "nix-command" "flakes" ];
12
13 environment.systemPackages = with pkgs; [
14 git # for nix flakes
15 vim # for editing config files
16 # TODO add any other programs you want to install here
17 ];
18
19 # very simple prompt
20 programs.bash.promptInit = ''
21 PS1='\u@\h:\w \$ '
22 '';
23
24 users.users = rec {
25 # TODO set hashed password from `nix run nixpkgs#mkpasswd`
26 root.initialHashedPassword = "";
27 # TODO change username, if desired
28 eilean = {
29 isNormalUser = true;
30 extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
31 initialHashedPassword = root.initialHashedPassword;
32 # TODO define SSH keys if accessing remotely
33 openssh.authorizedKeys.keys = [
34 # "ssh-ed25519 <key> <name>"
35 ];
36 };
37 };
38
39 services.openssh = {
40 enable = true;
41 settings.PasswordAuthentication = false;
42 };
43
44 # TODO replace this with domain
45 networking.domain = "example.org";
46 security.acme.acceptTerms = true;
47
48 # TODO select internationalisation properties
49 i18n.defaultLocale = "en_GB.UTF-8";
50 time.timeZone = "Europe/London";
51 console.keyMap = "uk";
52
53 eilean = {
54 # TODO replace these values
55 # serverIpv4 = "203.0.113.0";
56 # serverIpv6 = "2001:DB8:0:0:0:0:0:0";
57 # publicInterface = "enp1s0";
58
59 # TODO replace with your desired username
60 # username = "user";
61
62 # TODO enable desired services
63 # mailserver.enable = true;
64 # matrix.enable = true;
65 # mastodon.enable = true;
66 # gitea.enable = true;
67 # headscale.enable = true;
68 };
69
70 # This value determines the NixOS release from which the default
71 # settings for stateful data, like file locations and database versions
72 # on your system were taken. It's perfectly fine and recommended to leave
73 # this value at the release version of the first install of this system.
74 # Before changing this value read the documentation for this option
75 # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
76 system.stateVersion = "23.05"; # Did you read the comment?
77}