Restructed directories; added second config for nixos-dev vm.
This commit is contained in:
58
config/darwin.nix
Normal file
58
config/darwin.nix
Normal file
@@ -0,0 +1,58 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
|
||||
# Path fix for GUI applications.
|
||||
launchd.user.envVariables.PATH = config.environment.systemPath;
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
];
|
||||
|
||||
homebrew = {
|
||||
enable = true;
|
||||
onActivation.cleanup = "zap";
|
||||
brews = [
|
||||
"coreutils"
|
||||
];
|
||||
casks = [
|
||||
"google-chrome"
|
||||
"scroll-reverser"
|
||||
"instantview"
|
||||
"bitwarden"
|
||||
"tailscale"
|
||||
"nextcloud"
|
||||
"discord"
|
||||
"nordvpn"
|
||||
"docker"
|
||||
"iterm2"
|
||||
"vlc"
|
||||
|
||||
"obs"
|
||||
"obs-backgroundremoval"
|
||||
];
|
||||
};
|
||||
|
||||
# Auto upgrade nix package and the daemon service.
|
||||
services.nix-daemon.enable = true;
|
||||
nix.package = pkgs.nix;
|
||||
|
||||
# Keyboard and Mouse
|
||||
system.keyboard = {
|
||||
enableKeyMapping = true;
|
||||
remapCapsLockToEscape = true;
|
||||
swapLeftCommandAndLeftAlt = true;
|
||||
};
|
||||
|
||||
# Create /etc/zshrc that loads the nix-darwin environment.
|
||||
programs.zsh.enable = true;
|
||||
|
||||
users.users.jadenmaxwell = {
|
||||
name = "jadenmaxwell";
|
||||
home = "/Users/jadenmaxwell";
|
||||
};
|
||||
|
||||
# Used for backwards compatibility.
|
||||
|
||||
system.stateVersion = 4;
|
||||
}
|
||||
50
config/omen.nix
Normal file
50
config/omen.nix
Normal file
@@ -0,0 +1,50 @@
|
||||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../hardware/omen.nix
|
||||
];
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Set hostname
|
||||
networking.hostName = "randomctf";
|
||||
|
||||
# Enable Nvidia drivers
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
|
||||
# Power management is experimental and known to cause issues.
|
||||
powerManagement.enable = false;
|
||||
powerManagement.finegrained = false;
|
||||
open = false; # Don't use open source kernel.
|
||||
nvidiaSettings = true;
|
||||
|
||||
prime = {
|
||||
|
||||
offload = {
|
||||
enable = true;
|
||||
enableOffloadCmd = true;
|
||||
};
|
||||
|
||||
intelBusId = "PCI:0:2:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
};
|
||||
|
||||
# Fix issue with Nvidia display scaling.
|
||||
services.xserver.dpi = 96;
|
||||
environment.variables.GDK_SCALE = "0.5";
|
||||
|
||||
# Enable VMWare Workstation
|
||||
virtualisation.vmware.host.enable = true;
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
}
|
||||
98
config/shared.nix
Normal file
98
config/shared.nix
Normal file
@@ -0,0 +1,98 @@
|
||||
{ config, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
# Enable experimental nix features.
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
# Networking
|
||||
networking.wireless.iwd.enable = true;
|
||||
networking.networkmanager = {
|
||||
enable = true;
|
||||
wifi.backend = "iwd";
|
||||
};
|
||||
|
||||
# General setup
|
||||
time.timeZone = "America/Los_Angeles";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_US.UTF-8";
|
||||
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||
LC_MEASUREMENT = "en_US.UTF-8";
|
||||
LC_MONETARY = "en_US.UTF-8";
|
||||
LC_NAME = "en_US.UTF-8";
|
||||
LC_NUMERIC = "en_US.UTF-8";
|
||||
LC_PAPER = "en_US.UTF-8";
|
||||
LC_TELEPHONE = "en_US.UTF-8";
|
||||
LC_TIME = "en_US.UTF-8";
|
||||
};
|
||||
|
||||
# Enable the X11 windowing system and i3 window manager.
|
||||
environment.pathsToLink = [ "/libexec" ];
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
windowManager.i3 = {
|
||||
enable = true;
|
||||
package = pkgs.i3-gaps;
|
||||
extraPackages = with pkgs; [
|
||||
rofi
|
||||
polybar
|
||||
rxvt-unicode
|
||||
arandr
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Configure keymap in X11
|
||||
services.xserver.xkb = {
|
||||
layout = "us";
|
||||
variant = "";
|
||||
options = "caps:escape";
|
||||
};
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
services.printing.enable = true;
|
||||
|
||||
# Enable sound with
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = true;
|
||||
|
||||
# Change default shell to zsh.
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
autosuggestions.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
};
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users.random = {
|
||||
isNormalUser = true;
|
||||
useDefaultShell = true;
|
||||
description = "random";
|
||||
extraGroups = [ "networkmanager" "wheel" "docker" ];
|
||||
packages = with pkgs; [];
|
||||
};
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# List packages installed in system profile.
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
git
|
||||
picom
|
||||
killall
|
||||
];
|
||||
|
||||
# Install additional programs
|
||||
programs.thunar.enable = true;
|
||||
|
||||
# Enable services.
|
||||
services.openssh.enable = true;
|
||||
services.tailscale.enable = true;
|
||||
|
||||
# Enable docker service.
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
}
|
||||
21
config/vm.nix
Normal file
21
config/vm.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../hardware/vm.nix
|
||||
];
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
boot.loader.grub.useOSProber = true;
|
||||
|
||||
# Set hostname
|
||||
networking.hostName = "nixos-dev";
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
}
|
||||
Reference in New Issue
Block a user