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