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 = lib.mkIf (!config.eilean.acme-eon) true;
47 security.acme-eon.acceptTerms = lib.mkIf config.eilean.acme-eon true;
48
49 # TODO select internationalisation properties
50 i18n.defaultLocale = "en_GB.UTF-8";
51 time.timeZone = "Europe/London";
52 console.keyMap = "uk";
53
54 eilean = {
55 # TODO replace these values
56 # serverIpv4 = "203.0.113.0";
57 # serverIpv6 = "2001:DB8:0:0:0:0:0:0";
58 # publicInterface = "enp1s0";
59
60 # TODO replace with your desired username
61 # username = "user";
62
63 # TODO enable desired services
64 # mailserver.enable = true;
65 # matrix.enable = true;
66 # mastodon.enable = true;
67 # gitea.enable = true;
68 # headscale.enable = true;
69 };
70
71 # This value determines the NixOS release from which the default
72 # settings for stateful data, like file locations and database versions
73 # on your system were taken. It's perfectly fine and recommended to leave
74 # this value at the release version of the first install of this system.
75 # Before changing this value read the documentation for this option
76 # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
77 system.stateVersion = "23.05"; # Did you read the comment?
78}