Files
laptop-config/configuration.nix
T

217 lines
4.8 KiB
Nix
Raw Normal View History

2025-06-06 11:12:31 -05:00
{ config, lib, pkgs, ... }:
{
2025-06-06 11:55:59 -05:00
imports = [ ];
2025-06-06 11:12:31 -05:00
# Use the systemd-boot EFI boot loader.
# boot.loader.systemd-boot.enable = true;
# boot.loader.efi.canTouchEfiVariables = true;
# Grub Boot Loader Setup
boot.loader.grub = {
enable = true;
zfsSupport = true;
efiSupport = true;
efiInstallAsRemovable = true;
mirroredBoots = [
2025-06-07 15:31:09 -05:00
{
devices = [ "nodev" ];
path = "/boot";
}
2025-06-06 11:12:31 -05:00
];
};
2025-06-07 16:41:04 -05:00
fileSystems."/persist".neededForBoot = true;
2025-06-07 17:17:59 -05:00
environment.persistence."/persist" = {
2025-06-07 17:17:47 -05:00
directories = [
"/etc/nixos"
"/var/log"
"/var/db/sudo/lectured"
2025-06-07 17:21:16 -05:00
"/var/lib/nixos"
2025-09-07 17:01:17 -05:00
"/var/lib/bluetooth"
2025-06-07 17:17:47 -05:00
];
};
2025-06-10 11:18:18 -05:00
# SOPS config
sops = {
2025-06-10 13:21:42 -05:00
age.sshKeyPaths = [ "/persist/etc/ssh/ssh_host_ed25519_key" ];
2025-06-10 13:36:11 -05:00
# deleted and generated every boot
2025-06-10 11:18:18 -05:00
age.keyFile = "/var/lib/sops-nix/key.txt";
age.generateKey = true;
defaultSopsFormat = "json";
# test secrets
secrets = {
2025-06-10 12:07:05 -05:00
"networkPasswords" = {
2025-06-10 11:50:28 -05:00
sopsFile = ./secrets/networking.yaml;
2025-06-10 12:07:05 -05:00
key = "networkPasswords";
2025-06-10 12:17:41 -05:00
format = "yaml";
2025-06-10 11:50:28 -05:00
};
2025-06-10 11:18:18 -05:00
};
};
networking.hostName = "roy-laptop";
2025-06-06 11:12:31 -05:00
networking.hostId = "4cb9fc76";
2025-07-07 11:03:18 -05:00
networking = {
useDHCP = true;
networkmanager.enable = false;
wireless = {
userControlled.enable = true;
enable = true;
secretsFile = config.sops.secrets."networkPasswords".path;
networks = {
"NU-Guest" = {
priority = -1;
};
2025-10-27 07:41:32 -05:00
"Intelligentsia Public" = {
2025-10-12 15:23:44 -05:00
priority = -1;
};
2025-07-07 11:03:18 -05:00
"mojo dojo casa house" = {
pskRaw = "ext:homeNetwork";
};
2025-11-12 08:00:35 -06:00
"Galaxy S6 2279" = {
pskRaw = "ext:mobileHotspot";
};
2025-07-07 10:06:11 -05:00
};
2025-06-06 11:12:31 -05:00
};
2025-07-07 11:03:18 -05:00
};
2025-06-06 11:12:31 -05:00
# Set your time zone.
time.timeZone = "America/Chicago";
# Enable CUPS to print documents.
services.printing = {
enable = true;
browsed.enable = true;
browsing = true;
};
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
2025-07-07 11:03:18 -05:00
2025-09-07 17:11:27 -05:00
# Graphical bluetooth
services.blueman.enable = true;
2025-06-06 11:12:31 -05:00
# Enable sound.
# hardware.pulseaudio.enable = true;
# OR
# services.pipewire = {
# enable = true;
# pulse.enable = true;
# };
# Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true;
2025-06-07 16:41:04 -05:00
# Define users
users.mutableUsers = false;
2025-06-06 11:12:31 -05:00
users.users.roy = {
isNormalUser = true;
2025-06-07 15:32:52 -05:00
hashedPassword = "$y$j9T$4yOAv6R7Xtn23XmhSSC8g.$T1CckfWgxjEyZshjBzcaMO9WidP.q..OG7LwtXFTw12";
2025-07-07 11:03:18 -05:00
extraGroups = [ "wheel" "networkmanager" ];
2025-07-05 12:25:50 -05:00
shell = pkgs.fish;
2025-06-06 11:12:31 -05:00
};
2025-06-07 16:41:04 -05:00
# Delete root on reboot
2025-06-07 15:36:21 -05:00
boot.initrd.postMountCommands = lib.mkAfter ''
zfs rollback -r zroot/root@blank
'';
2025-06-06 11:12:31 -05:00
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.config.allowUnfree = true;
2025-06-07 16:41:04 -05:00
# Declare system wide pkgs
2025-06-06 11:12:31 -05:00
environment.systemPackages = with pkgs; [
gimp
2025-07-05 12:53:40 -05:00
alacritty
2025-06-06 11:12:31 -05:00
rose-pine-hyprcursor
vim
wget
];
fonts.packages = with pkgs; [
nerd-fonts.mononoki
2025-08-16 12:55:16 -05:00
nerd-fonts.ubuntu-mono
2025-06-06 11:12:31 -05:00
];
2025-07-05 12:25:50 -05:00
# List services that to enable:
programs = {
hyprland = {
enable = true;
xwayland.enable = true;
};
waybar.enable = true;
fish.enable = true;
2025-08-22 23:24:59 -05:00
# needed to allowOther in home.nix
fuse.userAllowOther = true;
2025-09-07 15:04:14 -05:00
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
};
2025-06-06 11:12:31 -05:00
};
2025-09-07 17:01:17 -05:00
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
# Shows battery charge of connected devices on supported
# Bluetooth adapters. Defaults to 'false'.
Experimental = true;
};
Policy = {
# Enable all controllers when they are found. This includes
# adapters present on start as well as adapters that are plugged
# in later on.
AutoEnable = true;
};
};
};
2025-06-06 11:12:31 -05:00
environment.sessionVariables.NIXOS_OZONE_WL = "1";
environment.variables = {
EDITOR = "nvim";
};
# Enable the OpenSSH daemon.
2025-06-10 11:18:18 -05:00
services.openssh = {
enable = true;
hostKeys = [
{
type = "ed25519";
path = "/persist/etc/ssh/ssh_host_ed25519_key";
}
];
};
2025-06-06 11:12:31 -05:00
2025-11-15 22:51:40 -06:00
services.postgresql.enable = true;
2025-06-06 11:12:31 -05:00
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = true;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# INITIAL system version
# CURRENT nixpkgs version = 25.05
system.stateVersion = "24.11";
}