Compare commits
3 Commits
7a5ec23cc5
...
8e72ef71d2
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e72ef71d2 | |||
| d6e031efd0 | |||
| 16fa4a641c |
21
.goosehints
Normal file
21
.goosehints
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
This repository contains NixOS configurations for different machines and roles. Here's a brief overview based on the files present:
|
||||||
|
|
||||||
|
- **Secrets:**
|
||||||
|
- `secrets/secrets.yaml`: Contains secret configurations, possibly encrypted or sensitive data.
|
||||||
|
|
||||||
|
- **Packages:**
|
||||||
|
- `packages/`: Nix package definitions.
|
||||||
|
|
||||||
|
- **Flake:**
|
||||||
|
- `flake.nix` and `flake.lock`: Nix Flake configuration files for managing the Nix environment dependencies.
|
||||||
|
|
||||||
|
- **Roles:**
|
||||||
|
- Various directories like `roles/kodi/`, `roles/bluetooth/`, etc., each containing `default.nix` files which possibly define role-specific configurations and modules.
|
||||||
|
|
||||||
|
- **Machines:**
|
||||||
|
- `machines/`: Machine-specific configurations for different machines like `nix-book`, `z790prors`, `boxy`, and `wixos`.
|
||||||
|
- Each machine has `configuration.nix` and `hardware-configuration.nix`, detailing the machine's system and hardware configuration.
|
||||||
|
|
||||||
|
- **Home:**
|
||||||
|
- `home/`: Pertains to user-specific configurations with different modules and home environment setups. Contains files like `home-nix-book.nix`, `home-z790prors.nix`, etc.
|
||||||
|
- Includes specific modules for software like Emacs, tmux, i3+sway, etc.
|
||||||
@@ -14,7 +14,10 @@
|
|||||||
bluetooth.enable = true;
|
bluetooth.enable = true;
|
||||||
desktop = {
|
desktop = {
|
||||||
enable = true;
|
enable = true;
|
||||||
waylandOnly = true;
|
wayland = true;
|
||||||
|
gaming = true;
|
||||||
|
kde = true;
|
||||||
|
sddm = true;
|
||||||
};
|
};
|
||||||
nfs-mounts.enable = true;
|
nfs-mounts.enable = true;
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
|
|||||||
@@ -12,7 +12,10 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
roles = {
|
roles = {
|
||||||
desktop.enable = true;
|
desktop = {
|
||||||
|
enable = true;
|
||||||
|
wayland = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.hostName = "wixos";
|
networking.hostName = "wixos";
|
||||||
|
|||||||
@@ -1,70 +0,0 @@
|
|||||||
# 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’).
|
|
||||||
|
|
||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[ # Include the results of the hardware scan.
|
|
||||||
./hardware-configuration.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
roles = {
|
|
||||||
audio.enable = true;
|
|
||||||
desktop = {
|
|
||||||
enable = true;
|
|
||||||
x11Only = true;
|
|
||||||
};
|
|
||||||
kodi.enable = true;
|
|
||||||
nfs-mounts.enable = true;
|
|
||||||
printing.enable = true;
|
|
||||||
spotifyd.enable = true;
|
|
||||||
users = {
|
|
||||||
enable = true;
|
|
||||||
extraGroups = [ "input" "libvirtd" ];
|
|
||||||
};
|
|
||||||
virtualisation.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
|
||||||
#boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
boot.loader.efi.efiSysMountPoint = "/boot";
|
|
||||||
boot.loader.grub = {
|
|
||||||
enable = true;
|
|
||||||
useOSProber = true;
|
|
||||||
devices = [ "nodev" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
hostName = "z790prors-nix"; # Define your hostname.
|
|
||||||
domain = "oglehome";
|
|
||||||
defaultGateway = "10.0.0.1";
|
|
||||||
nameservers = [ "10.0.0.1" ];
|
|
||||||
|
|
||||||
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
|
|
||||||
# Per-interface useDHCP will be mandatory in the future, so this generated config
|
|
||||||
# replicates the default behaviour.
|
|
||||||
useDHCP = false;
|
|
||||||
|
|
||||||
interfaces.enp3s0.ipv4.addresses = [{
|
|
||||||
address = "10.0.0.37";
|
|
||||||
prefixLength = 24;
|
|
||||||
}];
|
|
||||||
};
|
|
||||||
|
|
||||||
time.timeZone = "America/Los_Angeles";
|
|
||||||
time.hardwareClockInLocalTime = true;
|
|
||||||
|
|
||||||
# TODO: Figure out something with this
|
|
||||||
nix.settings.secret-key-files = /root/cache-priv-key.pem;
|
|
||||||
|
|
||||||
# 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. It‘s 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 = "21.11"; # Did you read the comment?
|
|
||||||
}
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
# 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, modulesPath, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
|
||||||
boot.initrd.kernelModules = [
|
|
||||||
"nvidia"
|
|
||||||
"nvidia_modeset"
|
|
||||||
"nvidia_uvm"
|
|
||||||
"nvidia_drm"
|
|
||||||
];
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
||||||
boot.kernelParams = [
|
|
||||||
"nvidia_drm.fbdev=1"
|
|
||||||
"nvidia_drm.modeset=1"
|
|
||||||
];
|
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
hardware.graphics.enable = true;
|
|
||||||
services.xserver.videoDrivers = ["nvidia"];
|
|
||||||
services.xserver.screenSection = ''Option "metamodes" "3440x1440_165 +0+0"'';
|
|
||||||
services.xserver.enableTearFree = true;
|
|
||||||
hardware.nvidia = {
|
|
||||||
modesetting.enable = true;
|
|
||||||
powerManagement.enable = false;
|
|
||||||
powerManagement.finegrained = false;
|
|
||||||
open = false;
|
|
||||||
nvidiaSettings = true;
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.latest;
|
|
||||||
#package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
|
|
||||||
#version = "555.58";
|
|
||||||
|
|
||||||
#sha256_64bit = "sha256-bXvcXkg2kQZuCNKRZM5QoTaTjF4l2TtrsKUvyicj5ew=";
|
|
||||||
#sha256_aarch64 = lib.fakeSha256;
|
|
||||||
#openSha256 = lib.fakeSha256;
|
|
||||||
#settingsSha256 = "sha256-vWnrXlBCb3K5uVkDFmJDVq51wrCoqgPF03lSjZOuU8M=";
|
|
||||||
#persistencedSha256 = lib.fakeSha256;
|
|
||||||
#};
|
|
||||||
};
|
|
||||||
environment.sessionVariables = {
|
|
||||||
KWIN_DRM_ALLOW_NVIDIA_COLORSPACE = "1";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/" =
|
|
||||||
{ device = "/dev/disk/by-uuid/8d996d13-6d55-4524-83a2-6f6fb47a09ea";
|
|
||||||
fsType = "btrfs";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" =
|
|
||||||
{ device = "/dev/disk/by-uuid/7445-C336";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/steam" =
|
|
||||||
{ device = "/dev/disk/by-uuid/E494DA9A94DA6E94";
|
|
||||||
fsType = "ntfs";
|
|
||||||
options = [
|
|
||||||
"nofail"
|
|
||||||
"rw"
|
|
||||||
"user"
|
|
||||||
"exec" # This needs to go after "user". See https://askubuntu.com/questions/30243/why-does-ubuntu-refuse-to-execute-files-from-an-ntfs-partition
|
|
||||||
"umask=000"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [ ];
|
|
||||||
|
|
||||||
services.beesd.filesystems = {
|
|
||||||
root = {
|
|
||||||
spec = "LABEL=nixos";
|
|
||||||
hashTableSizeMB = 4096;
|
|
||||||
verbosity = "crit";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
}
|
|
||||||
@@ -31,6 +31,12 @@ with lib;
|
|||||||
};
|
};
|
||||||
time.timeZone = "America/Los_Angeles";
|
time.timeZone = "America/Los_Angeles";
|
||||||
|
|
||||||
|
services.xserver.xkb = {
|
||||||
|
layout = "us";
|
||||||
|
variant = "";
|
||||||
|
options = "caps:escape";
|
||||||
|
};
|
||||||
|
|
||||||
# Don't go to emergency mode if we aren't able to mount filesystems.
|
# Don't go to emergency mode if we aren't able to mount filesystems.
|
||||||
# This is silly if you have multiple hard drives or partitions
|
# This is silly if you have multiple hard drives or partitions
|
||||||
# configured on a machine and then one goes away intentionally or
|
# configured on a machine and then one goes away intentionally or
|
||||||
|
|||||||
@@ -4,88 +4,32 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.roles.desktop;
|
cfg = config.roles.desktop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.roles.desktop = {
|
||||||
|
enable = mkEnableOption "Enable the desktop role.";
|
||||||
|
x11 = mkOption { type = types.bool; default = false; description = "Enable X11 support."; };
|
||||||
|
wayland = mkOption { type = types.bool; default = false; description = "Enable Wayland support."; };
|
||||||
|
kde = mkOption { type = types.bool; default = false; description = "Enable KDE."; };
|
||||||
|
gaming = mkOption { type = types.bool; default = false; description = "Enable gaming support."; };
|
||||||
|
sddm = mkOption { type = types.bool; default = false; description = "Enable SDDM greeter."; };
|
||||||
|
};
|
||||||
|
|
||||||
customPackages = pkgs.callPackage ../../packages {};
|
imports = [
|
||||||
|
./x11.nix
|
||||||
|
./wayland.nix
|
||||||
|
./gaming.nix
|
||||||
|
./kde.nix
|
||||||
|
];
|
||||||
|
|
||||||
basePackages = with pkgs; [
|
config = mkIf cfg.enable {
|
||||||
#bambu-studio
|
environment.systemPackages = with pkgs; [
|
||||||
brightnessctl
|
brightnessctl
|
||||||
emacs-nox
|
emacs-nox
|
||||||
];
|
];
|
||||||
|
|
||||||
x11BasePackages = with pkgs; [
|
|
||||||
];
|
|
||||||
|
|
||||||
x11OnlyPackages = with pkgs; [
|
|
||||||
];
|
|
||||||
|
|
||||||
waylandBasePackages = with pkgs; [
|
|
||||||
grim
|
|
||||||
slurp
|
|
||||||
wl-clipboard
|
|
||||||
mako
|
|
||||||
];
|
|
||||||
|
|
||||||
waylandOnlyPackages = with pkgs; [
|
|
||||||
];
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.roles.desktop = {
|
|
||||||
enable = mkEnableOption "Enable the desktop role";
|
|
||||||
x11Only = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
waylandOnly = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable
|
|
||||||
{
|
|
||||||
services.xserver.xkb = {
|
|
||||||
layout = "us";
|
|
||||||
variant = "";
|
|
||||||
options = "caps:escape";
|
|
||||||
};
|
|
||||||
services.xserver.enable = true;
|
|
||||||
|
|
||||||
services.displayManager.sddm = {
|
|
||||||
enable = true;
|
|
||||||
wayland.enable = !cfg.x11Only;
|
|
||||||
};
|
|
||||||
services.desktopManager.plasma6.enable = true;
|
|
||||||
|
|
||||||
services.xserver.windowManager.i3 = {
|
|
||||||
enable = true;
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
dmenu
|
|
||||||
i3status
|
|
||||||
i3lock
|
|
||||||
];
|
|
||||||
};
|
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
services.gnome.gnome-keyring.enable = true;
|
services.gnome.gnome-keyring.enable = true;
|
||||||
|
|
||||||
programs.sway = mkIf (!cfg.x11Only) {
|
|
||||||
enable = true;
|
|
||||||
wrapperFeatures.gtk = true;
|
|
||||||
};
|
|
||||||
programs.light.enable = mkIf (!cfg.x11Only) true;
|
|
||||||
|
|
||||||
programs.kdeconnect.enable = true;
|
programs.kdeconnect.enable = true;
|
||||||
|
|
||||||
virtualisation.docker.enable = true;
|
|
||||||
users.extraGroups.docker.members = [ "johno" ];
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; mkMerge [
|
|
||||||
basePackages
|
|
||||||
(mkIf (!cfg.waylandOnly) x11BasePackages)
|
|
||||||
(mkIf cfg.x11Only x11OnlyPackages)
|
|
||||||
(mkIf (!cfg.x11Only) waylandBasePackages)
|
|
||||||
(mkIf (cfg.waylandOnly) waylandOnlyPackages)
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
17
roles/desktop/gaming.nix
Normal file
17
roles/desktop/gaming.nix
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.desktop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf (cfg.enable && cfg.gaming) {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
steam
|
||||||
|
lutris
|
||||||
|
];
|
||||||
|
|
||||||
|
# Possibly other gaming specific services or settings
|
||||||
|
};
|
||||||
|
}
|
||||||
12
roles/desktop/kde.nix
Normal file
12
roles/desktop/kde.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.desktop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf (cfg.enable && cfg.kde) {
|
||||||
|
services.desktopManager.plasma6.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
16
roles/desktop/programs.nix
Normal file
16
roles/desktop/programs.nix
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
brightnessctl
|
||||||
|
emacs-nox
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.dconf.enable = true;
|
||||||
|
services.gnome.gnome-keyring.enable = true;
|
||||||
|
programs.kdeconnect.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
15
roles/desktop/sddm.nix
Normal file
15
roles/desktop/sddm.nix
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.desktop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf (cfg.enable && cfg.sddm) {
|
||||||
|
services.displayManager.sddm = {
|
||||||
|
enable = true;
|
||||||
|
wayland.enable = (!cfg.x11 && cfg.wayland);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
23
roles/desktop/wayland.nix
Normal file
23
roles/desktop/wayland.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.desktop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf (cfg.enable && cfg.wayland) {
|
||||||
|
programs.sway = {
|
||||||
|
enable = true;
|
||||||
|
wrapperFeatures.gtk = true;
|
||||||
|
};
|
||||||
|
programs.light.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
grim
|
||||||
|
slurp
|
||||||
|
wl-clipboard
|
||||||
|
mako
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
19
roles/desktop/x11.nix
Normal file
19
roles/desktop/x11.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.roles.desktop;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf (cfg.enable && cfg.x11) {
|
||||||
|
services.xserver = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
windowManager.i3 = {
|
||||||
|
enable = true;
|
||||||
|
extraPackages = with pkgs; [ dmenu i3status i3lock ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -14,5 +14,7 @@ in
|
|||||||
{
|
{
|
||||||
virtualisation.libvirtd.enable = true;
|
virtualisation.libvirtd.enable = true;
|
||||||
programs.virt-manager.enable = true;
|
programs.virt-manager.enable = true;
|
||||||
|
virtualisation.docker.enable = true;
|
||||||
|
users.extraGroups.docker.members = [ "johno" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user