summaryrefslogtreecommitdiff
path: root/configuration/default.nix
blob: 1e5cefdf255984dcedf81318c7d3d754c4fa8682 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{ lib, pkgs, ... }: {

  imports = [
    ./hardware.nix
    ./services/jellyfin
    ./desktop
  ];

  nixpkgs.overlays = [
    (final: prev: {
      inherit (prev.lixPackageSets.stable) nixpkgs-review nix-eval-jobs nix-fast-build colmena;
    })
  ];

  nix.package = pkgs.lixPackageSets.stable.lix;

  boot.kernelPackages = pkgs.linuxPackages_latest;
  boot.initrd.compressor = "zstd";
  boot.loader.systemd-boot.enable = true;
  boot.loader.systemd-boot.editor = false;
  boot.loader.systemd-boot.configurationLimit = 25;
  boot.loader.efi.canTouchEfiVariables = true;

  fileSystems."/media/drive".device = "/dev/disk/by-uuid/facf5a78-8872-437c-4345-50a28c894aca";
  fileSystems."/media/drive".fsType = "btrfs";

  hardware.graphics.enable = true;
  hardware.graphics.enable32Bit = true;

  networking.hostName = "unix";
  networking.networkmanager.enable = true;
  networking.wireguard.enable = true;
  networking.firewall.enable = false;
  networking.firewall.allowedTCPPorts = [ 2080 ];

  time.timeZone = "Asia/Tehran";

  services.printing.enable = false;
  services.pipewire.enable = true;
  services.pipewire.pulse.enable = true;
  services.libinput.enable = true;
  services.flatpak.enable = true;
  services.openssh.enable = true;

  xdg.portal.enable = true;
  programs.nano.enable = false;
  programs.firefox.enable = true;
  programs.throne.enable = true;
  programs.throne.tunMode.enable = true;
  programs.nix-ld.enable = true;
  programs.appimage.enable = true;
  programs.nm-applet.enable = true;
  programs.neovim.enable = true;
  programs.neovim.viAlias = true;
  programs.neovim.vimAlias = true;
  programs.steam.enable = true;
  programs.git.enable = true;
  programs.zsh.enable = true;
  programs.zsh.autosuggestions.enable = true;
  programs.zsh.interactiveShellInit = ''
    zmodload zsh/zprof
    autoload -Uz compinit
    if [[ -n ~/.zcompdump(#qN.mh+24) ]]; then
    	compinit
    else
    	compinit -C
    fi
    source ${pkgs.zsh-fast-syntax-highlighting}/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
  '';

  virtualisation.waydroid.enable = true;
  virtualisation.waydroid.package = pkgs.waydroid-nftables;
  virtualisation.docker.enable = true;

  environment.shells = with pkgs; [ zsh ];
  environment.systemPackages = with pkgs; [
    wineWow64Packages.stable
    wget
    adwaita-icon-theme
    rofi
    iptables
    mesa-demos
    wl-clipboard
    wireguard-tools
  ];

  users.users.coast.isNormalUser = true;
  users.users.coast.extraGroups = [ "wheel" "docker" "input" "video" "audio" "usb" ];
  users.users.coast.shell = pkgs.zsh;

  fonts.packages = builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts);

  security.sudo.enable = false;
  security.doas.enable = true;
  security.doas.extraRules = [
    {
      users = [ "coast" ];
      keepEnv = true;
      persist = true;
    }
  ];
  security.polkit.enable = true;

  system.stateVersion = "25.11";
  nix.settings.experimental-features = [ "nix-command" "flakes" ];
  nixpkgs.config.allowUnfree = true;
}