2021-12-16 13:05:07 -08:00
|
|
|
# This is your system's configuration file.
|
2021-12-16 13:36:16 -08:00
|
|
|
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
|
2021-12-16 13:05:07 -08:00
|
|
|
|
|
|
|
{ inputs, lib, config, pkgs, ... }: {
|
2021-12-16 12:48:46 -08:00
|
|
|
imports = [
|
2021-12-16 13:05:07 -08:00
|
|
|
# If you want to use modules from other flakes (such as nixos-hardware), use something like:
|
2021-12-16 12:48:46 -08:00
|
|
|
# inputs.hardware.nixosModules.common-cpu-amd
|
2021-12-16 13:05:07 -08:00
|
|
|
# inputs.hardware.nixosModules.common-ssd
|
2021-12-16 13:36:16 -08:00
|
|
|
# It's strongly recommended you take a look at
|
|
|
|
# https://github.com/nixos/nixos-hardware
|
|
|
|
# and import modules relevant to your hardware.
|
2021-12-16 13:05:07 -08:00
|
|
|
|
|
|
|
# Import your generated hardware configuration
|
2021-12-16 12:48:46 -08:00
|
|
|
./hardware-configuration.nix
|
2021-12-16 13:05:07 -08:00
|
|
|
|
|
|
|
# Feel free to split up your configuration and import pieces of it here.
|
2021-12-16 12:48:46 -08:00
|
|
|
];
|
|
|
|
|
2021-12-16 13:36:16 -08:00
|
|
|
# TODO: Set your hostname
|
2021-12-16 13:05:07 -08:00
|
|
|
networking.hostName = "cool-computer";
|
|
|
|
|
2021-12-17 06:32:24 -08:00
|
|
|
# TODO: This is just an example, be sure to use whatever bootloader you prefer
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
|
2021-12-18 05:16:16 -08:00
|
|
|
# TODO: Configure your system-wide user settings (stuff on the user
|
|
|
|
# environment should instead go to home.nix)
|
2021-12-17 06:32:24 -08:00
|
|
|
users.users = {
|
2021-12-17 06:39:02 -08:00
|
|
|
# TODO: Replace with your username
|
2021-12-17 06:32:24 -08:00
|
|
|
you = {
|
|
|
|
isNormalUser = true;
|
|
|
|
openssh.authorizedKeys.keys = [
|
2021-12-17 06:39:02 -08:00
|
|
|
# TODO: Add your SSH public key(s) here, if you plan on using SSH to connect
|
2021-12-17 06:32:24 -08:00
|
|
|
];
|
2021-12-18 05:16:16 -08:00
|
|
|
# Be sure to add any other groups you need
|
|
|
|
extraGroups = [ "wheel" ];
|
2021-12-17 06:32:24 -08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# This setups SSH for the system (with SSH keys ONLY). Feel free to remove if you don't need it.
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
passwordAuthentication = false;
|
|
|
|
permitRootLogin = "no";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Remove if you wish to disable unfree packages for your system
|
2021-12-16 13:05:07 -08:00
|
|
|
nixpkgs.config.allowUnfree = true;
|
2021-12-16 12:28:43 -08:00
|
|
|
|
2021-12-17 06:32:24 -08:00
|
|
|
# Enable flakes and new 'nix' command
|
2021-12-16 14:12:15 -08:00
|
|
|
nix = {
|
|
|
|
package = pkgs.nixFlakes;
|
|
|
|
extraOptions = ''
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
'';
|
2021-12-18 05:16:16 -08:00
|
|
|
autoOptimiseStore = true;
|
2021-12-16 14:12:15 -08:00
|
|
|
};
|
|
|
|
|
2021-12-18 05:16:16 -08:00
|
|
|
# This will make all users activate their home-manager profile upon login, if
|
|
|
|
# it exists and is not activated yet. This is useful for setups with opt-in
|
|
|
|
# persistance, avoiding having to manually activate every reboot.
|
2021-12-16 12:28:43 -08:00
|
|
|
environment.loginShellInit = ''
|
|
|
|
[ -d "$HOME/.nix-profile" ] || /nix/var/nix/profiles/per-user/$USER/home-manager/activate &> /dev/null
|
|
|
|
'';
|
2021-12-16 13:05:07 -08:00
|
|
|
|
|
|
|
# This will add your inputs as registries, making operations with them
|
|
|
|
# consistent with your flake inputs.
|
|
|
|
nix.registry = lib.mapAttrs' (n: v:
|
2021-12-18 05:16:16 -08:00
|
|
|
lib.nameValuePair (n) ({ flake = v; })
|
2021-12-16 13:05:07 -08:00
|
|
|
) inputs;
|
2021-12-16 12:28:43 -08:00
|
|
|
}
|