diff options
| author | Mel <einebeere@gmail.com> | 2023-09-24 20:35:09 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2023-09-24 20:35:09 +0200 |
| commit | 06900b906fb64df473a5955b21c64ede4616d378 (patch) | |
| tree | a9aa19a2c206cba4634e590c8bf300584ef14803 /configuration.nix | |
| parent | 04b8ac189c5f7d403d4b59b5d2cbabe689922f89 (diff) | |
| download | rnrd-06900b906fb64df473a5955b21c64ede4616d378.tar.zst rnrd-06900b906fb64df473a5955b21c64ede4616d378.zip | |
Create base config from lapin
Diffstat (limited to 'configuration.nix')
| -rw-r--r-- | configuration.nix | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..24ae7e3 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,75 @@ +{ pkgs, ... }: + +let + util = import ./util.nix; + + me = import ./me.nix { inherit util; }; + security = import ./security.nix; +in +{ + system.stateVersion = "23.05"; + + imports = [ + (./hardware + "/${me.name}.nix") + (./machine + "/${me.name}.nix") + ]; + + boot.loader.systemd-boot.enable = true; + + users.mutableUsers = false; + users.users.mel = { + isNormalUser = true; + home = "/home/mel"; + shell = pkgs.fish; + extraGroups = [ "wheel" "docker" ]; + + openssh.authorizedKeys.keys = security.keys; + hashedPassword = security.password; + }; + + networking = { + hostName = me.name; + + firewall = { + enable = true; + allowedTCPPorts = [ 80 443 ]; + trustedInterfaces = [ "tailscale0" ]; + }; + }; + + services = { + openssh = { + enable = true; + openFirewall = false; + settings = { + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + PermitRootLogin = "no"; + }; + }; + nginx.enable = true; + tailscale.enable = true; + }; + + virtualisation = { + docker = { + enable = true; + enableOnBoot = true; + }; + }; + + programs = { + fish.enable = true; + }; + + services.nginx.virtualHosts = { + default = { default = true; }; + "${me.name}.rnrd.eu" = { root = "/var/www/html"; }; + }; + + environment.variables = { EDITOR = "vim"; }; + environment.systemPackages = with pkgs; [ + vim + ]; +} + |
