summaryrefslogtreecommitdiffstats
path: root/configuration/default.nix
blob: 5630cf6dd6c580b1e3009e7bdf0dadd58658c361 (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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{ inputs, 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;

  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.pipewire.alsa.enable = true;
  services.pipewire.wireplumber.enable = true;
  services.libinput.enable = true;
  services.openssh.enable = true;
  services.flatpak.enable = true;
  services.gnome.gnome-keyring.enable = true;

  systemd.user.services.polkit-gnome-authentication-agent-1 = {
    description = "polkit-gnome-authentication-agent-1";
    wantedBy = [ "graphical-session.target" ];
    wants = [ "graphical-session.target" ];
    after = [ "graphical-session.target" ];
    serviceConfig = {
      Type = "simple";
      ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
      Restart = "on-failure";
      RestartSec = 1;
      TimeoutStopSec = 10;
    };
  };

  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.steam.extraCompatPackages = [ pkgs.proton-ge-bin ];
  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;

  programs.virt-manager.enable = true;
  users.groups.libvirtd.members = [ "coast" ];
  virtualisation.libvirtd.enable = true;
  virtualisation.spiceUSBRedirection.enable = true;

  environment.shells = with pkgs; [ zsh ];
  environment.systemPackages = with pkgs; [
    wineWow64Packages.stable
    wget
    adwaita-icon-theme
    rofi
    iptables
    mesa-demos
    wl-clipboard
    inputs.fetchit.packages.${pkgs.system}.default
    gparted
    polkit_gnome
    woeusb-ng
    ntfsprogs
    glibc.static
  ];

  users.users.coast.isNormalUser = true;
  users.users.coast.extraGroups = [ "wheel" "docker" "input" "video" "audio" "usb" "libvirtd" ];
  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;
  security.pam.services.login.enableGnomeKeyring = true;

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