blah blah blah

This commit is contained in:
Bit Borealis 2023-11-18 01:52:18 +00:00
commit 47b45febaf
Signed by: theotheroracle
GPG key ID: 2D816A2DCA6E5649
9 changed files with 558 additions and 0 deletions

5
configuration.nix Normal file
View file

@ -0,0 +1,5 @@
# symlinkg this file to your /etc/nixos/ and make sure the directory is correct !
{...}:
{
imports = [ ./hardware-configuration.nix ./saturnOS ];
}

135
configuration.nix.baka Normal file
View file

@ -0,0 +1,135 @@
# 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, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
# Setup keyfile
boot.initrd.secrets = {
"/crypto_keyfile.bin" = null;
};
networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Atlantic/Reykjavik";
# Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_CA.UTF-8";
LC_IDENTIFICATION = "en_CA.UTF-8";
LC_MEASUREMENT = "en_CA.UTF-8";
LC_MONETARY = "en_CA.UTF-8";
LC_NAME = "en_CA.UTF-8";
LC_NUMERIC = "en_CA.UTF-8";
LC_PAPER = "en_CA.UTF-8";
LC_TELEPHONE = "en_CA.UTF-8";
LC_TIME = "en_CA.UTF-8";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "us";
xkbVariant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.hive = {
isNormalUser = true;
description = "The Hive";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
firefox
# thunderbird
];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
}

View file

@ -0,0 +1,42 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "sd_mod" "sr_mod" "rtsx_pci_sdmmc" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" "wl" ];
boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/bdad9443-41e0-4a8f-b5b3-a93f51dc3a2a";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-1e816279-2666-41a6-bcb9-f97c2f7b3102".device = "/dev/disk/by-uuid/1e816279-2666-41a6-bcb9-f97c2f7b3102";
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/993B-1245";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/88df1fd4-ec87-450d-a5d5-038590d61dcf"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp8s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp10s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

62
saturnOS/default.nix Normal file
View file

@ -0,0 +1,62 @@
# welcome to saturnOS config, run nixos-help if you need it .
{ config, pkgs, lib, ... }:
{
imports = [
./modules
./system
];
# nix options
nix.settings = {
experimental-features = "nix-command flakes";
auto-optimise-store = true;
trusted-users = [ "root" "@wheel" ];
trusted-public-keys = [
"sol.gg.lan-1:Ithqh5H+QslaHf9UPgLS1BVIkpV1Ab7bAEFFBEpTYtE="
];
};
# enable gnome
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# enable dconf configuration for gnome and other supported applications
programs.dconf.enable = true;
# configure pipewire
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
# install packages
# `nix search` to add more
nixpkgs.config.allowUnfree = true;
nixpkgs.config.nvidia.acceptLicense = true;
nixpkgs.config.permittedInsecurePackages = [ "electron-24.8.6" ];
environment.systemPackages = with pkgs; [
];
# set fish as default shell for all users
users.defaultUserShell = pkgs.fish;
# suid wrapper ( for things which need privelidged acccess, or additional configuration )
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryFlavor = "gnome3";
};
programs.fish.enable = true;
# enable configure services
services.printing.enable = true; # printing
services.openssh.enable = true; # remote shell
}

View file

@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./saturnConfig.nix
./machineInfo.nix
];
}

View file

@ -0,0 +1,119 @@
{ config, pkgs, lib, ... }@nixpkgs: with lib; {
options.environment.machineInfo = mkOption {
description = lib.mdDoc ''
Machine metadata, including stylized hostname, computer icon, etc.
This module controls the options written to `/etc/machine-info`. For more
information, see [the freedesktop documentation][1].
[1]: https://www.freedesktop.org/software/systemd/man/machine-info.html
'';
default = {};
type = types.submodule { options = {
prettyHostname = mkOption {
description = lib.mdDoc ''
A pretty, human-readable hostname for this machine, potentially including
spaces, unicode, and emoji. If unset, this falls back to the network hostname
set in `networking.hostName`.
'';
type = with types; nullOr str;
default = null;
defaultText = literalExpression "null";
example = literalExpression "\"Jade's Laptop 💎\"";
};
iconName = mkOption {
description = lib.mdDoc ''
An XDG icon which should be associated with this machine. Some common choices
include: `"computer"`, `"phone"`, but a complete list of icons can be found in
the [XDG Icon Naming Spec][1].
If left unset, applications will typically default to `"computer"`.
[1]: https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
'';
type = with types; nullOr str;
default = null;
defaultText = literalExpression "null";
example = literalExpression "\"computer\"";
};
chassis = mkOption {
description = lib.mdDoc ''
The type of chassis this machine resides within. This is typically detected
automatically, but can be manually overridden here.
'';
type = with types; nullOr (enum [
"desktop"
"laptop"
"convertible"
"server"
"tablet"
"handset"
"watch"
"embedded"
"vm"
"container"
]);
default = null;
defaultText = literalExpression "null";
example = literalExpression "\"server\"";
};
deployment = mkOption {
description = lib.mdDoc ''
If this machine is part of a deployment environment / pipeline, this option can
be used to specify what environment/pipeline stage it manages.
Typically, but not necessarily, set to something like `"development"`,
`"integration"`, `"staging"`, or `"production"`.
'';
type = with types; nullOr str;
default = null;
defaultText = literalExpression "null";
example = literalExpression "\"production\"";
};
location = mkOption {
description = lib.mdDoc ''
A human-readable short description of the location of this machine.
This can be set to whatever has the most meaning for you, for example "Living
Room", "Left Rack, 2nd Shelf", or "Parishville, NY".
'';
type = with types; nullOr str;
default = null;
defaultText = literalExpression "null";
example = literalExpression "\"Bedroom\"";
};
extraOptions = mkOption {
description = lib.mdDoc ''
Extra variables to put in `/etc/machine-info`
'';
type = with types; attrsOf str;
default = {};
defaultText = literalExpression "{ }";
example = literalExpression "{ HARDWARE_VENDOR = \"Intel Corp.\" }";
};
};};
};
config.environment.etc.machine-info =
with config.environment.machineInfo;
let
rawShellVars = {
PRETTY_HOSTNAME = prettyHostname;
ICON_NAME = iconName;
CHASSIS = chassis;
DEPLOYMENT = deployment;
LOCATION = location;
} // extraOptions;
nonNullShellVars = attrsets.filterAttrs (k: v: v != null) rawShellVars;
in rec {
text = strings.toShellVars nonNullShellVars;
enable = builtins.stringLength text > 0;
};
}

View file

@ -0,0 +1,25 @@
{ config, lib, ... }: with lib;
{
options.saturn = {
user = mkOption {
type = types.str;
default = "saturn";
description = mdDoc "The name of the user of the system.";
};
hostname = mkOption {
type = types.strMatching
"[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?";
default = "saturnOS-device";
description = mdDoc "The network hostname of the system, which must only contain letters,
numbers, and dashes, and cannot start or end with a dash.";
};
prettyHostname = mkOption {
type = types.str;
default = "🪐 saturnOS";
description = mdDoc "The pretty hostname is used for things like bluetooth pairing,
device sharing, and is fully unicode.";
};
};
config.networking.hostName = config.saturn.hostname;
config.environment.machineInfo.prettyHostname = config.saturn.prettyHostname;
}

View file

@ -0,0 +1,60 @@
# this is for options not managed bysaturnConfig, added by the user
# again this is an example template not meant to be used
{ pkgs, ... } :
# . + . . . . . .
# . . . *
# . * . . . . . . + .
# . . + . . .
# . . . . . . .
# . . . +. + .
# . . . .
# . . . * . . . . + .
# + . . . +
# . . + .+. .. *
# .   。   •   ゚  。   . +
#   .     .    。   。 . . . . .
# .  。     ඞ 。 .   • . . + +
#   ゚  Hive was an Impostor + .
#  '   2 Impostors remain + .+.    • 
#  ゚   .  . ,   .  . , +   . 
# . . . + . . . + .+. .
# . . . . . . . . ! /
# * . . . + . . - O -
# . . . + . . * . . / |
# . + . . . .. + .
# . . . . * . * . +.. . *
# . . . . . . . . + . . +
{
boot.binfmt.emulatedSystems = [ "aarch64-linux" "riscv64-linux" ];
virtualisation = {
waydroid.enable = true;
podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
};
libvirtd = {
enable = true;
};
spiceUSBRedirection.enable = true;
};
programs.steam.enable = true;
programs.darling.enable = true;
environment.systemPackages = with pkgs; [
heimdall-gui
protontricks
];
networking.firewall.enable = false;
networking.firewall.allowedTCPPortRanges = [{from = 1714; to = 1764;}];
networking.firewall.allowedUDPPortRanges = [{from = 1714; to = 1764;}];
services.cockpit.enable = true;
services.syncthing = {
enable = true;
user = "hive";
configDir = "/home/hive/.config/syncthing";
};
services.openssh.enable = true;
}

103
saturnOS/system/default.nix Normal file
View file

@ -0,0 +1,103 @@
#this is a template, but would be auto-generated by saturnConfig, when the system is first created and on later modification to the system options
# it is not reccomended to use this file, as it should be generated by the script only
{ config, pkgs, lib, ... }:
{
# importing custom user config
imports = [ ./custom.nix <home-manager/nixos> ];
# settings hostname
saturn.hostname = "uranus";
saturn.prettyHostname = "🪐 uranus";
# efi bootloader
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.initrd.systemd.enable = true;
boot.plymouth.enable = true;
boot.kernelParams = ["quiet"];
boot.supportedFilesystems = [ "bcachefs" ];
# configure networking
networking.networkmanager.enable = true;
# configure locale
time.timeZone = "Etc/UTC";
i18n.defaultLocale = "en_CA.UTF-8";
# enable the gnome browser extension
services.gnome.gnome-browser-connector.enable = true;
services.openssh.enable = true;
# configure x11
services.xserver = {
videoDrivers = [ "nvidia" ];
layout = "us";
xkbVariant = "";
};
# enable opengl
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
vaapiVdpau
libvdpau-va-gl
nvidia-vaapi-driver
];
};
hardware.nvidia = {
# Prime is needed for optimus GPU
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
# Modesetting is needed for most Wayland compositors
modesetting.enable = true;
# Use the open source version of the kernel module
# Only available on driver 515.43.04+
open = false;
# Enable the nvidia settings menu
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidia_x11_legacy470;
};
programs.gamemode = {
enable = true;
enableRenice = true;
settings = {
general.renice = 10;
gpu = {
apply_gpu_optimizations="accept-responsibility";
nv_powermizer_mode=2;
gpu_device=1;
};
};
};
# add and configure users
users.users.hive = {
initialPassword = "";
isNormalUser = true;
description = "The Hive";
extraGroups = [ "networkmanager" "wheel" "libvirtd" "vboxusers" ];
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.hive = import /home/hive/.config/home-manager/home.nix;
system.stateVersion = "23.05";
}