Initial Commit

This commit is contained in:
recursive_recursion 2024-02-28 19:08:27 -07:00
parent 30188c5707
commit d458e14da7
3 changed files with 251 additions and 0 deletions

203
nixos/configuration.nix Normal file
View File

@ -0,0 +1,203 @@
{ config, lib, pkgs, ... }:
## 'configuration.nix' is primarily where you'll install packages and manage system configurations.
let
secrets = import ./secrets.nix;
# Needed for installing unstable channel packages.
unstableTarball =
fetchTarball
https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz;
in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nixpkgs.config =
{
# Enable unfree packages.
allowUnfree = true;
# Needed for installing unstable channel packages.
packageOverrides = pkgs:
{
unstable = import unstableTarball
{
config = config.nixpkgs.config;
};
};
};
nix = {
# Specifying the Nix daemon is allowed by anyone with sudo privileges.
settings.allowed-users = [ "@wheel" ];
# Enable flakes.
settings.experimental-features = [ "nix-command" "flakes" ];
};
# Set your time zone.
time.timeZone = "America/Edmonton";
boot =
{
supportedFilesystems = ["vfat" "btrfs"];
loader =
{
timeout = 5;
efi =
{
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
# Use the GRUB boot loader.
# Uses GRUB 2 by default.
grub = {
enable = true;
# "nodev" for efi only
device = "nodev";
efiSupport = true;
# Set grub resolution to 1920x1080px.
gfxmodeEfi = "1920x1080";
};
};
};
users =
{
mutableUsers = false;
users =
{
root.hashedPassword = "!";
${secrets.systemUsername} =
{
hashedPassword = "${secrets.hashedPassword}";
isNormalUser = true;
# description = "Your User";
extraGroups = ["wheel" "storage" "networkmanager"];
packages = with pkgs;
[
## Browsers
firefox
librewolf
## Coding/programming.
git
(vscode-with-extensions.override
{
vscode = vscodium;
vscodeExtensions = with vscode-extensions;
[
## Extension examples:
# dracula-theme.theme-dracula
# ms-python.python
# rust-lang.rust-analyzer
];
}
)
];
};
};
};
environment =
{
systemPackages = with pkgs;
[
# nano
];
## Hyprland required environment variables.
sessionVariables =
{
## If your cursor becomes invisible
WLR_NO_HARDWARE_CURSORS = "1";
## Hint electron apps to use wayland.
## Required to run VSCodium with wayland.
NIXOS_OZONE_WL = "1";
};
};
security = {
## require a password for all sudo usage
sudo.wheelNeedsPassword = true;
};
networking = {
## Set your hostname.
hostName = "${secrets.hostName}";
## Enable networking
networkmanager.enable = true;
};
programs =
{
## Fixes GTK theming in Wayland applications.
dconf.enable = true;
# network diagnostics tool.
# mtr.enable = true;
# gnupg.agent =
# {
# enable = true;
# };
};
services =
{
## Disable CUPS print dameon.
printing.enable = false;
## xserver configurations.
xserver =
{
## Enable the X11 windowing system.
enable = true;
## Enable the KDE Plasma Desktop Environment.
desktopManager.plasma5.enable = true;
## Uncomment to enable touchpad support.
# libinput.enable = true;
## Configure keymap in X11.
layout = "us";
xkbVariant = "";
displayManager =
{
## Uncomment to set default session as plasma wayland during login.
# defaultSession = "plasmawayland";
sddm =
{
## Enable SDDM.
enable = true;
## Enable numlock at login.
autoNumlock = true;
};
};
};
};
system.stateVersion = "23.11";
}

30
nixos/flake.nix Normal file
View File

@ -0,0 +1,30 @@
{
## `flake.nix` is used to pin the version of your chosen package and helps your system become reproducible.
inputs =
{
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
};
outputs = { self, nixpkgs, nixos-hardware }:
{
# NOTE: 'nixos' is the default hostname set by the installer.
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem
{
# system = "x86_64-linux";
system = "x86_64-linux";
modules =
[
./configuration.nix
# nixos-hardware.nixosModules.framework-13-inch-7040-amd
# nixos-hardware.nixosModules.system76-darp6
# nixos-hardware.nixosModules.tuxedo-infinitybook-pro14-gen7
## additional hardware options can be found: [nixos-hardware](https://github.com/NixOS/nixos-hardware).
];
};
};
}

18
nixos/secrets.nix Normal file
View File

@ -0,0 +1,18 @@
{
## This file passes in your secrets/passwords into your system's `configuration.nix` file.
## Add "secrets.nix" to your `.gitignore` file and hash all passwords and secrets for best practices.
## Replace with your system username.
systemUsername = "sarracenia_purpurea";
## Replace with your domain name.
## hostName = "mydomain.tld";
hostName = "spaghetticode";
## Manually hash password with `mkpasswd` then replace below.
##
## For example after hashing your password: "correcthorsebatterystaple" with `mkpasswd`
## it becomes something like: hashedPassword = "$y$j9T$JiToouWQ2LIo3Pz1/b1S8.$tpNSJnokDfyfsdVgSboVk/STNnIf7R42HJToIFr1Gq7".
##
hashedPassword = "replace_this_with_your_hashed_password";
}