hosts/sini/configuration.nix (view raw)
1{ config, pkgs, lib, ... }:
2
3{
4 imports =
5 [
6 ./hardware-configuration.nix
7 ../ssh.nix
8 ];
9
10 boot.loader.systemd-boot.enable = true;
11 boot.loader.efi.canTouchEfiVariables = true;
12
13 networking.hostName = "sini"; # Define your hostname.
14
15 networking.networkmanager.enable = true;
16
17 time.timeZone = "Europe/Helsinki";
18
19 i18n.defaultLocale = "en_US.UTF-8";
20
21 i18n.extraLocaleSettings = {
22 LC_ADDRESS = "en_US.UTF-8";
23 LC_IDENTIFICATION = "en_US.UTF-8";
24 LC_MEASUREMENT = "en_US.UTF-8";
25 LC_MONETARY = "en_US.UTF-8";
26 LC_NAME = "en_US.UTF-8";
27 LC_NUMERIC = "en_US.UTF-8";
28 LC_PAPER = "en_US.UTF-8";
29 LC_TELEPHONE = "en_US.UTF-8";
30 LC_TIME = "en_US.UTF-8";
31 };
32
33 sound.enable = true;
34 hardware.pulseaudio.enable = true;
35 hardware.opengl = {
36 enable = true;
37 extraPackages = with pkgs; [
38 intel-media-driver
39 vaapiIntel
40 vaapiVdpau
41 libvdpau-va-gl
42 intel-compute-runtime
43 ];
44 };
45
46 security = {
47 doas.enable = true;
48 sudo.enable = true;
49 doas.extraConfig = ''
50 permit nopass :wheel
51 '';
52 doas.extraRules = [{
53 users = [ "icy" ];
54 }];
55 };
56
57 users.users.icy = {
58 isNormalUser = true;
59 description = "icy";
60 extraGroups = [ "networkmanager" "wheel" "docker" ];
61 packages = with pkgs; [ ];
62 };
63
64 users.users.git = {
65 isNormalUser = true;
66 description = "git";
67 extraGroups = [ "networkmanager" "wheel" ];
68 homeMode = "755";
69 packages = with pkgs; [ ];
70 };
71
72
73 nixpkgs.config.allowUnfree = true;
74 environment.systemPackages = with pkgs; [
75 vim
76 wget
77 git
78 ];
79
80 services = {
81 openssh.enable = true;
82 tailscale.enable = true;
83 # nix-snapshotter.enable = true;
84 };
85
86 services.pixelfed = {
87 enable = true;
88 domain = "ani.place";
89 secretFile = "/home/icy/svc/pixelfed/.env";
90 nginx.listen = [
91 {
92 addr = "0.0.0.0";
93 port = 3535;
94 }
95 ];
96 };
97
98 # building only
99 virtualisation.docker.enable = true;
100
101 services.k3s = let address = "100.85.88.64"; in {
102 enable = true;
103 extraFlags = "--disable=traefik --disable=servicelb --disable=metrics-server --bind-address=${address} --node-ip=${address} --node-external-ip=${address} --flannel-external-ip=true --flannel-iface=tailscale0";
104 };
105
106 environment.etc = {
107 "rancher/k3s/registries.yaml" = {
108 text = ''
109 mirrors:
110 sini:5000:
111 endpoint:
112 - "http://sini:5000"
113 '';
114 };
115 };
116
117 services.openiscsi = {
118 enable = true;
119 name = config.networking.hostName;
120 };
121
122 systemd.tmpfiles.rules = [
123 "L+ /usr/local/bin - - - - /run/current-system/sw/bin/"
124 ];
125
126 services.dockerRegistry = {
127 enable = true;
128 listenAddress = "0.0.0.0";
129 port = 5000;
130 enableGarbageCollect = true;
131 };
132
133 nix.settings.experimental-features = [ "nix-command" "flakes" ];
134 system.stateVersion = "24.05";
135}
136