Files
laptop-config/configuration.nix
T

214 lines
5.0 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-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 = {
"testKey" = {
sopsFile = ./secrets/roy.json;
key = "testKey";
};
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
};
};
2025-06-07 15:31:09 -05:00
# needed to allowOther in home.nix
programs.fuse.userAllowOther = true;
networking.hostName = "roy-laptop";
2025-06-06 11:12:31 -05:00
networking.hostId = "4cb9fc76";
networking.wireless = {
enable = true;
2025-06-10 12:07:05 -05:00
secretsFile = config.sops.secrets."networkPasswords".path;
2025-06-10 11:50:28 -05:00
networks = {
2025-06-10 11:59:08 -05:00
"flooper" = {
2025-06-10 12:17:41 -05:00
pskRaw = "ext:flooperPsk";
2025-06-10 11:50:28 -05:00
};
"NU-Guest" = {
priority = -1;
};
2025-06-20 20:19:30 -05:00
"d fam google" = {
pskRaw = "ext:ancestralGrounds";
};
2025-06-29 22:09:09 -05:00
"mojo dojo casa house" = {
pskRaw = "ext:homeNetwork";
};
2025-06-06 11:12:31 -05:00
};
};
networking.wireless.userControlled.enable = true; # Enable user to edit wpa_supplicant.
networking.networkmanager.enable = false; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "America/Chicago";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
# i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
# Enable the X11 windowing system.
# services.xserver.enable = true;
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
services.printing = {
enable = true;
browsed.enable = true;
browsing = true;
};
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
# 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-06-06 11:12:31 -05:00
extraGroups = [ "wheel" ];
};
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
kitty
rose-pine-hyprcursor
vim
wget
];
fonts.packages = with pkgs; [
nerd-fonts.mononoki
];
# List services that you want to enable:
programs.hyprland = {
enable = true;
xwayland.enable = true;
};
programs.waybar.enable = true;
programs.firefox = {
enable = true;
policies = {
ExtensionSettings = {
"*".installation_mode = "blocked";
"uBlock0@raymondhill.net" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed";
};
};
};
};
2025-06-07 16:41:04 -05:00
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
# 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";
}