nix

configuration files that power my machines
Log | Files | Refs | README | LICENSE

base.nix (1186B)


      1 {
      2   inputs,
      3   pkgs,
      4   username,
      5   configData,
      6   ...
      7 }: {
      8   nix = {
      9     settings = {
     10       experimental-features = ["nix-command" "flakes"];
     11       auto-optimise-store = true;
     12       trusted-users = ["root" "@wheel"];
     13       inherit (import ../../lib/nix-cache.nix) substituters trusted-public-keys;
     14     };
     15     gc = {
     16       automatic = true;
     17       dates = "weekly";
     18       options = "--delete-older-than 30d";
     19     };
     20     registry.nixpkgs.flake = inputs.nixpkgs;
     21   };
     22 
     23   services.openssh = {
     24     enable = true;
     25     openFirewall = true;
     26     settings = {
     27       PermitRootLogin = "prohibit-password";
     28       PasswordAuthentication = false;
     29     };
     30   };
     31 
     32   users.users.${username} = {
     33     isNormalUser = true;
     34     shell = pkgs.zsh;
     35     extraGroups = ["wheel" "networkmanager"];
     36     openssh.authorizedKeys.keys = configData.users.${username}.authorizedKeys or [];
     37   };
     38 
     39   programs.zsh.enable = true;
     40 
     41   security.sudo.wheelNeedsPassword = false;
     42 
     43   time.timeZone = "UTC";
     44   i18n.defaultLocale = "en_US.UTF-8";
     45 
     46   environment.systemPackages = with pkgs; [
     47     vim
     48     curl
     49     wget
     50     htop
     51     git
     52   ];
     53 
     54   virtualisation.podman.enable = true;
     55   networking.firewall.trustedInterfaces = ["podman0"];
     56 }