summary refs log tree commit diff
path: root/hosts/pc/cfg.nix
blob: 38fb8c61fdb491f03c88791bb6a1a3d3750bce15 (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
{
  config,
  lib,
  pkgs,
  ...
}: {
  imports = [
    ../../profiles/core.nix
    ../../profiles/user.nix
    ../../profiles/ssh.nix
    ../../profiles/graphical.nix
    ../../mixins/tailscale.nix
    ../../mixins/cli.nix
    ../../mixins/greet.nix
    # ../../mixins/hyprland.nix
    ../../mixins/sway.nix
  ];

  config = {
    _module.args.nixinate = {
      host = "pc";
      sshUser = "tzlil";
      buildOn = "remote"; # valid args are "local" or "remote"
      substituteOnTarget = true; # if buildOn is "local" then it will substitute on the target, "-s"
      hermetic = false;
    };
    networking.hostName = "pc";

    boot = {
      initrd = {
        supportedFilesystems = ["btrfs"];
        availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid"];
      };
      kernelModules = ["kvm-amd"];
      kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
      kernelParams = [
        "console=ttyS0"
        "init_on_free=1"
        "page_poison=1"
        "page_alloc.shuffle=1"
        "slab_nomerge"
        "vsyscall=none"
      ];
      cleanTmpDir = true;
      loader = {
        systemd-boot = {
          enable = true;
        };
        efi = {
          canTouchEfiVariables = true;
          efiSysMountPoint = "/boot";
        };
      };
    };

    time.timeZone = lib.mkDefault "Israel";

    fileSystems = {
      "/" = {
        device = "/dev/disk/by-uuid/3fe7d38b-bb95-41ca-afce-1b0b89cbcd8b";
        fsType = "btrfs";
        options = ["subvol=root"];
      };

      "/nix" = {
        device = "/dev/disk/by-uuid/3fe7d38b-bb95-41ca-afce-1b0b89cbcd8b";
        fsType = "btrfs";
        options = ["subvol=nix"];
      };

      "/home" = {
        device = "/dev/disk/by-uuid/3fe7d38b-bb95-41ca-afce-1b0b89cbcd8b";
        fsType = "btrfs";
        options = ["subvol=home"];
      };

      "/swap" = {
        device = "/dev/disk/by-uuid/3fe7d38b-bb95-41ca-afce-1b0b89cbcd8b";
        fsType = "btrfs";
        options = ["subvol=swap"];
      };
      "/boot" = {
        device = "/dev/disk/by-uuid/D999-2D99";
        fsType = "vfat";
      };
    };

    zramSwap = {
      enable = true;
      algorithm = "zstd";
    };

    hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
    # greeter.initialSession = "sh -c hyprland";
  };
}