Kieran's opinionated (and probably slightly dumb) nix config
1
2# This is your system's configuration file.
3# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
4{
5 inputs,
6 lib,
7 config,
8 pkgs,
9 ...
10}: {
11 # You can import other NixOS modules here
12 imports = [
13 # If you want to use modules from other flakes (such as nixos-hardware):
14 inputs.hardware.nixosModules.framework-11th-gen-intel
15
16 # Import your generated (nixos-generate-config) hardware configuration
17 ./hardware-configuration.nix
18
19 # Import home-manager's configuration
20 ./home-manager.nix
21
22 # Import disko's configuration
23 ./disk-config.nix
24
25 # hpyrland config
26 #./hyprland
27 ];
28
29 nixpkgs = {
30 # Configure your nixpkgs instance
31 config = {
32 # Disable if you don't want unfree packages
33 allowUnfree = true;
34 };
35 };
36
37 nix = let
38 flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
39 in {
40 settings = {
41 # Enable flakes and new 'nix' command
42 experimental-features = "nix-command flakes";
43 # Opinionated: disable global registry
44 flake-registry = "";
45 # Workaround for https://github.com/NixOS/nix/issues/9574
46 nix-path = config.nix.nixPath;
47 };
48 # Opinionated: disable channels
49 channel.enable = false;
50
51 # Opinionated: make flake registry and nix path match flake inputs
52 registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
53 nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
54 };
55
56 time = {
57 timeZone = "America/New_York";
58 hardwareClockInLocalTime = true;
59 };
60
61 services.automatic-timezoned.enable = true;
62
63 environment.systemPackages = map lib.lowPrio [
64 pkgs.curl
65 inputs.agenix.packages.x86_64-linux.default
66 pkgs.wpa_supplicant_gui
67 pkgs.alacritty
68 pkgs.zsh
69 pkgs.swww
70 pkgs.sunwait
71 pkgs.wluma
72 pkgs.brightnessctl
73 pkgs.playerctl
74 pkgs.firefox
75 pkgs.slack
76 pkgs.gnome.nautilus
77 pkgs.gnome.file-roller
78 pkgs.fprintd
79 pkgs.gitMinimal
80 (pkgs.vscode-with-extensions.override {
81 vscodeExtensions = with pkgs.vscode-extensions; [
82 bbenoist.nix
83 ];
84 })
85 pkgs.github-desktop
86 ];
87
88 services.fprintd.enable = true;
89
90 fonts.packages = with pkgs; [
91 nerdfonts
92 ];
93
94 programs.hyprland.enable = true;
95
96 environment.sessionVariables = {
97 XDG_CACHE_HOME = "$HOME/.cache";
98 XDG_CONFIG_HOME = "$HOME/.config";
99 XDG_DATA_HOME = "$HOME/.local/share";
100 XDG_STATE_HOME = "$HOME/.local/state";
101 NIXOS_OZONE_WL = "1";
102 };
103
104 # import the secret
105 age.identityPaths = [ "/home/kierank/.ssh/id_rsa" "/etc/ssh/id_rsa" "/mnt/etc/ssh/id_rsa" ];
106 age.secrets.wifi = {
107 file = ../secrets/wifi.age;
108 owner = "kierank";
109 };
110
111 # setup the network
112 networking = {
113 hostName = "moonlark";
114 wireless = {
115 environmentFile = config.age.secrets.wifi.path;
116 userControlled.enable = true;
117 enable = true;
118 networks = {
119 "KlukasNet".psk = "@PSK_HOME@";
120 "Everseen".psk = "@PSK_HOTSPOT@";
121 };
122 };
123 };
124 # TODO: Configure your system-wide user settings (groups, etc), add more users as needed.
125 users.users = {
126 kierank = {
127 # You can skip setting a root password by passing '--no-root-passwd' to nixos-install.
128 # Be sure to change it (using passwd) after rebooting!
129 initialPassword = "lolzthisaintsecure!";
130 isNormalUser = true;
131 openssh.authorizedKeys.keys = [
132 "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCzEEjvbL/ttqmYoDjxYQmDIq36BabROJoXgQKeh9liBxApwp+2PmgxROzTg42UrRc9pyrkq5kVfxG5hvkqCinhL1fMiowCSEs2L2/Cwi40g5ZU+QwdcwI8a4969kkI46PyB19RHkxg54OUORiIiso/WHGmqQsP+5wbV0+4riSnxwn/JXN4pmnE//stnyAyoiEZkPvBtwJjKb3Ni9n3eNLNs6gnaXrCtaygEZdebikr9kS2g9mM696HvIFgM6cdR/wZ7DcLbG3IdTXuHN7PC3xxL+Y4ek5iMreQIPmuvs4qslbthPGYoYbYLUQiRa9XO5s/ksIj5Z14f7anHE6cuTQVpvNWdGDOigyIVS5qU+4ZF7j+rifzOXVL48gmcAvw/uV68m5Wl/p0qsC/d8vI3GYwEsWG/EzpAlc07l8BU2LxWgN+d7uwBFaJV9VtmUDs5dcslsh8IbzmtC9gq3OLGjklxTfIl6qPiL8U33oc/UwqzvZUrI2BlbagvIZYy6rP+q0= kierank@mockingjay"
133 ];
134 extraGroups = ["wheel" "networkmanager" "audio" "video" "docker" "plugdev"];
135 };
136 root.openssh.authorizedKeys.keys = [
137 "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCzEEjvbL/ttqmYoDjxYQmDIq36BabROJoXgQKeh9liBxApwp+2PmgxROzTg42UrRc9pyrkq5kVfxG5hvkqCinhL1fMiowCSEs2L2/Cwi40g5ZU+QwdcwI8a4969kkI46PyB19RHkxg54OUORiIiso/WHGmqQsP+5wbV0+4riSnxwn/JXN4pmnE//stnyAyoiEZkPvBtwJjKb3Ni9n3eNLNs6gnaXrCtaygEZdebikr9kS2g9mM696HvIFgM6cdR/wZ7DcLbG3IdTXuHN7PC3xxL+Y4ek5iMreQIPmuvs4qslbthPGYoYbYLUQiRa9XO5s/ksIj5Z14f7anHE6cuTQVpvNWdGDOigyIVS5qU+4ZF7j+rifzOXVL48gmcAvw/uV68m5Wl/p0qsC/d8vI3GYwEsWG/EzpAlc07l8BU2LxWgN+d7uwBFaJV9VtmUDs5dcslsh8IbzmtC9gq3OLGjklxTfIl6qPiL8U33oc/UwqzvZUrI2BlbagvIZYy6rP+q0= kierank@mockingjay"
138 ];
139 };
140
141 programs.hyprland.enable = true;
142
143 # enable cups
144 services.printing.enable = true;
145
146 # enable bluetooth
147 hardware.bluetooth.enable = true;
148
149 # enable pipewire
150 # rtkit is optional but recommended
151 security.rtkit.enable = true;
152 services.pipewire = {
153 enable = true;
154 alsa.enable = true;
155 alsa.support32Bit = true;
156 pulse.enable = true;
157 # If you want to use JACK applications, uncomment this
158 jack.enable = true;
159 };
160
161 # This setups a SSH server. Very important if you're setting up a headless system.
162 # Feel free to remove if you don't need it.
163 services.openssh = {
164 enable = true;
165 settings = {
166 # Opinionated: forbid root login through SSH.
167 PermitRootLogin = "no";
168 # Opinionated: use keys only.
169 # Remove if you want to SSH using passwords
170 PasswordAuthentication = false;
171 };
172 };
173
174 # Requires at least 5.16 for working wi-fi and bluetooth.
175 # https://community.frame.work/t/using-the-ax210-with-linux-on-the-framework-laptop/1844/89
176 boot = {
177 kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") (lib.mkDefault pkgs.linuxPackages_latest);
178 loader.grub = {
179 # no need to set devices, disko will add all devices that have a EF02 partition to the list already
180 device = "nodev";
181 efiSupport = true;
182 efiInstallAsRemovable = true;
183 };
184 };
185
186 # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
187 system.stateVersion = "23.05";
188}