aboutsummaryrefslogtreecommitdiff
path: root/nixos/configuration.nix
blob: 2690c28121c11c3249dca67e5a48414e053b6057 (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
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
	inputs,
		lib,
		config,
		pkgs,
		...
}: 
let
	globals = import ./globals.nix;
in
{
	imports = [
		./hardware-configuration.nix
	];
	boot.loader = {
		efi.canTouchEfiVariables = true;
		grub = {
			enable = true;
			useOSProber = true;
			efiSupport = true;
			fsIdentifier = "label";
			devices = [ "nodev" ];
			extraEntries = ''
				menuentry "Reboot" {
					reboot
				}
			menuentry "Poweroff" {
				halt
			}
			'';
		};
	};
	security.polkit.enable = true;
	services.gnome.gnome-keyring.enable = true;
	programs.sway = {
		enable = true;
		wrapperFeatures.gtk = true;
	};
	nixpkgs = {
		overlays = [
		];
		config = {
			allowUnfree = true;
		};
	};

	nix = let
		flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
	in {
		settings = {
			experimental-features = "nix-command flakes";
			flake-registry = "";
			nix-path = config.nix.nixPath;
		};
		registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
		nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
	};
	networking = {
		hostName = "${globals.myHostName}";
		networkmanager.enable = true;
	};
	users.users = {
		"${globals.myUserName}" = {
			initialPassword = "stevenpassword";
			isNormalUser = true;
			openssh.authorizedKeys.keys = [
			];
			packages = with pkgs; [
					nh
				];
			extraGroups = ["wheel"];
		};
	};
	services.openssh = {
		enable = true;
		settings = {
			PermitRootLogin = "no";
			PasswordAuthentication = false;
		};
	};
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
	system.stateVersion = "24.05";
}