about summary refs log tree commit diff
path: root/nixos/kompakt/configuration.nix
blob: 4d4c0079467d302f6bfca43f3ba0804e0ca40728 (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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{ config, lib, pkgs, ... }:

{
  imports =
    [
      ./hardware-configuration.nix
      ../modules/apple-silicon-support
    ];

  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = false;

  # Specify path to peripheral firmware files.
  # This lets the flake stay pure.
  hardware.asahi.peripheralFirmwareDirectory = ./asahi_firmware;
  # Or completely disable extraction and managemement of them completely:
  # hardware.asahi.extractPeripheralFirmware = false;

  boot.kernelParams = [
    "console=tty1"
  ];

  boot.supportedFilesystems = [ "zfs" ];

  networking.hostName = "kompakt";
  networking.hostId = "9c8c0140";

  boot.initrd.postDeviceCommands = lib.mkAfter ''
    zfs rollback -r rpool/local/root@blank
  '';

  networking.wireless.iwd.enable = true;

  time.timeZone = "Asia/Seoul";

  i18n.defaultLocale = "en_US.UTF-8";
  console = {
    font = "ter-v32n";
    packages = with pkgs; [ terminus_font ];
  };

  services.printing.enable = true;

  sound.enable = true;

  fonts = {
    fontDir.enable = true;

    fonts = with pkgs; [
      dina-font
      jetbrains-mono
      sarasa-gothic
      siji
      emacs-all-the-icons-fonts
      twemoji-color-font
      (nerdfonts.override { fonts = [ "Iosevka" "JetBrainsMono" ]; })
    ];

    fontconfig = {
      enable = true;

      defaultFonts = {
        serif = [
          "Sarasa Gothic C"
          "Sarasa Gothic J"
          "Sarasa Gothic K"
        ];

        sansSerif = [
          "Sarasa Gothic C"
          "Sarasa Gothic J"
          "Sarasa Gothic K"
        ];

        monospace = [
          "Dina"
          "Iosevka Nerd Font"
          "JetBrainsMono Nerd Font"
        ];

        emoji = [
          "Siji"
          "Twitter Color Emoji"
        ];
      };
    };
  };

  services.greetd = {
    enable = true;
    vt = 2;

    settings.default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet -t -c sway";
  };

  programs = {
    sway.enable = true;
    sway.extraPackages = lib.mkForce [ ];

    zsh.enable = true;
    zsh.enableCompletion = false;
  };

  xdg.portal = {
    enable = true;
    extraPortals = with pkgs; [
      xdg-desktop-portal-gtk
      xdg-desktop-portal-wlr
    ];
  };

  sops.defaultSopsFile = ./secrets/secrets.yaml;
  sops.secrets.root-password.neededForUsers = true;
  sops.secrets.sefidel-password.neededForUsers = true;

  users.mutableUsers = false;

  users.users = {
    root.passwordFile = config.sops.secrets.root-password.path;
    sefidel = {
      isNormalUser = true;
      shell = pkgs.zsh;
      passwordFile = config.sops.secrets.sefidel-password.path;

      extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
    };
  };

  services.openssh.enable = true;

  environment.systemPackages = with pkgs; [
    git
  ];

  environment.persistence."/persist".directories = [
    "/etc/ssh"
    "/etc/nixos"
  ];

  fileSystems."/persist".neededForBoot = true;

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "23.05"; # Did you read the comment?

}