145 lines
		
	
	
		
			3.1 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			145 lines
		
	
	
		
			3.1 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
{ pkgs, ... }:
 | 
						|
{
 | 
						|
  # Many settings should be handled by home manager. System-wide settings are however managed here.
 | 
						|
  imports = [
 | 
						|
    ./yabai.nix
 | 
						|
  ];
 | 
						|
 | 
						|
  nixpkgs.config.allowUnfree = true;
 | 
						|
 | 
						|
  nix = {
 | 
						|
    enable = true;
 | 
						|
 | 
						|
    # gc = {
 | 
						|
    #   automatic = true;
 | 
						|
    #   options = "--delete-older-than 2d";
 | 
						|
    # };
 | 
						|
 | 
						|
    settings = {
 | 
						|
      allow-dirty = true;
 | 
						|
      experimental-features = [ "nix-command" "flakes" ];
 | 
						|
      builders-use-substitutes = true;
 | 
						|
      extra-platforms = [ "x86_64-darwin" "aarch64-darwin" ];
 | 
						|
      log-lines = 50;
 | 
						|
 | 
						|
      # https://github.com/NixOS/nix/issues/7273
 | 
						|
      # auto-optimise-store = true;
 | 
						|
    };
 | 
						|
 | 
						|
    buildMachines = [
 | 
						|
      {
 | 
						|
        hostName = "defiant.home.feal.no";
 | 
						|
        system = "x86_64-linux";
 | 
						|
 | 
						|
        maxJobs = 6;
 | 
						|
        supportedFeatures = [ "kvm" "big-parallel" "benchmark" "nixos-test" ];
 | 
						|
        mandatoryFeatures = [ ];
 | 
						|
 | 
						|
        sshUser = "felixalb";
 | 
						|
        sshKey = "/var/root/.ssh/nix-builder";
 | 
						|
      }
 | 
						|
      {
 | 
						|
        hostName = "challenger.home.feal.no";
 | 
						|
        system = "x86_64-linux";
 | 
						|
 | 
						|
        maxJobs = 6;
 | 
						|
        supportedFeatures = [ "kvm" "big-parallel" "benchmark" "nixos-test" ];
 | 
						|
        mandatoryFeatures = [ ];
 | 
						|
 | 
						|
        sshUser = "felixalb";
 | 
						|
        sshKey = "/var/root/.ssh/nix-builder";
 | 
						|
      }
 | 
						|
    ];
 | 
						|
 | 
						|
    distributedBuilds = true;
 | 
						|
    extraOptions = "builders-use-substitutes = true";
 | 
						|
  };
 | 
						|
 | 
						|
  # System packages for all users
 | 
						|
  environment = {
 | 
						|
    systemPackages = with pkgs; [
 | 
						|
      eza
 | 
						|
      findutils
 | 
						|
      gnugrep
 | 
						|
      jq
 | 
						|
      nix-output-monitor
 | 
						|
      nixpkgs-review
 | 
						|
      ripgrep
 | 
						|
      skhd
 | 
						|
      sshfs
 | 
						|
      wget
 | 
						|
    ];
 | 
						|
 | 
						|
    variables = {
 | 
						|
      EDITOR = "nvim";
 | 
						|
      VISUAL = "nvim";
 | 
						|
    };
 | 
						|
  };
 | 
						|
 | 
						|
  ids.gids.nixbld = 30000;
 | 
						|
  system.primaryUser = "felixalb";
 | 
						|
  users.users.felixalb = {
 | 
						|
    home = "/Users/felixalb";
 | 
						|
    shell = pkgs.zsh;
 | 
						|
  };
 | 
						|
 | 
						|
  programs.zsh.enable = true;
 | 
						|
  system.activationScripts.postActivation.text = ''sudo chsh -s ${pkgs.zsh}/bin/zsh''; # Since it's not possible to declare default shell, run this command after build
 | 
						|
 | 
						|
 | 
						|
  fonts.packages = with pkgs; [
 | 
						|
    fira-code
 | 
						|
    font-awesome
 | 
						|
    hack-font
 | 
						|
    nerd-fonts.hack
 | 
						|
    noto-fonts
 | 
						|
  ];
 | 
						|
 | 
						|
  system.defaults = {
 | 
						|
    # login window settings
 | 
						|
    loginwindow = {
 | 
						|
      # disable guest account
 | 
						|
      GuestEnabled = false;
 | 
						|
      # show name instead of username
 | 
						|
      SHOWFULLNAME = false;
 | 
						|
    };
 | 
						|
 | 
						|
    finder = {
 | 
						|
      AppleShowAllExtensions = true;
 | 
						|
      FXEnableExtensionChangeWarning = true;
 | 
						|
      _FXShowPosixPathInTitle = true;
 | 
						|
    };
 | 
						|
 | 
						|
 | 
						|
    # firewall settings
 | 
						|
    alf = {
 | 
						|
      # 0 = disabled 1 = enabled 2 = blocks all connections except for essential services
 | 
						|
      globalstate = 1;
 | 
						|
      loggingenabled = 0;
 | 
						|
    };
 | 
						|
 | 
						|
    # dock settings
 | 
						|
    dock = {
 | 
						|
      autohide = true;
 | 
						|
      autohide-delay = 0.0;
 | 
						|
      autohide-time-modifier = 1.0;
 | 
						|
      tilesize = 45;
 | 
						|
      static-only = false;
 | 
						|
      showhidden = false;
 | 
						|
      show-recents = false;
 | 
						|
      show-process-indicators = true;
 | 
						|
      orientation = "bottom";
 | 
						|
      mru-spaces = false;
 | 
						|
    };
 | 
						|
  };
 | 
						|
 | 
						|
  system.keyboard = {
 | 
						|
    enableKeyMapping = true;
 | 
						|
    remapCapsLockToControl = true;
 | 
						|
  };
 | 
						|
 | 
						|
  # nix.package = pkgs.nix;
 | 
						|
 | 
						|
  system.stateVersion = 5;
 | 
						|
}
 |