beginning a lot of reorganizing stuff

This commit is contained in:
mjallen18
2025-05-30 10:39:27 -05:00
parent 705220a704
commit 77272fb931
24 changed files with 401 additions and 149 deletions

View File

@@ -0,0 +1,4 @@
{ ... }:
{
imports = [ ./services.nix ];
}

View File

@@ -0,0 +1,15 @@
{ lib, ... }:
{
services = {
# configure pipewire
pipewire = {
enable = lib.mkDefault true;
alsa.enable = lib.mkDefault true;
alsa.support32Bit = lib.mkDefault true;
pulse.enable = lib.mkDefault true;
};
# Enable CUPS to print documents.
printing.enable = lib.mkDefault true;
};
}

14
base/base-nogui/boot.nix Normal file
View File

@@ -0,0 +1,14 @@
{ lib, pkgs, ... }:
{
boot = {
# Enable AppImage
binfmt.registrations.appimage = {
wrapInterpreterInShell = lib.mkDefault false;
interpreter = "${pkgs.appimage-run}/bin/appimage-run";
recognitionType = "magic";
offset = 0;
mask = "\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\xff\\xff\\xff";
magicOrExtension = "\\x7fELF....AI\\x02";
};
};
}

View File

@@ -0,0 +1,45 @@
{ lib, ... }:
let
timezone = "America/Chicago";
in
{
imports = [
./boot.nix
./environment.nix
./nix-settings.nix
./security.nix
./services.nix
../../share
];
# Hardware configs
hardware = {
# Bluetooth
bluetooth.enable = lib.mkDefault true;
# Enable all firmware
enableAllFirmware = lib.mkForce true;
};
# Time config
time = {
# Set your time zone.
timeZone = timezone;
};
programs = {
zsh.enable = lib.mkDefault true;
gnupg.agent = {
enable = lib.mkDefault true;
enableSSHSupport = lib.mkDefault true;
};
command-not-found.enable = lib.mkForce false;
nix-index = {
enable = true;
enableBashIntegration = false;
enableZshIntegration = true;
};
};
system.stateVersion = "23.11";
}

View File

@@ -0,0 +1,12 @@
{ pkgs, ... }:
{
environment = {
systemPackages = with pkgs; [
uutils-coreutils
uutils-diffutils
uutils-findutils
coreutils
nixd
];
};
}

View File

@@ -0,0 +1,41 @@
{ lib, outputs, ... }:
{
nix = {
settings = {
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
warn-dirty = lib.mkForce false;
experimental-features = lib.mkForce [
"nix-command"
"flakes"
];
trusted-users = [ "@wheel" ];
};
# Garbage collect automatically every week
gc.automatic = lib.mkDefault true;
gc.options = lib.mkDefault "--delete-older-than 30d";
optimise.automatic = lib.mkDefault true;
};
# Nixpkgs configuration
nixpkgs = {
# add unstable and stable overlays
overlays = [
outputs.overlays.nixpkgs-unstable
outputs.overlays.nixpkgs-stable
];
config = {
allowUnfree = lib.mkForce true;
permittedInsecurePackages = [
# ...
];
};
};
}

View File

@@ -0,0 +1,31 @@
{ lib, pkgs, ... }:
{
security = {
rtkit.enable = lib.mkDefault true;
# configure sudo
sudo.enable = lib.mkDefault false;
sudo-rs = {
enable = lib.mkDefault true;
extraRules = [
{
commands = [
{
command = "${pkgs.systemd}/bin/systemctl suspend";
options = [ "NOPASSWD" ];
}
{
command = "${pkgs.systemd}/bin/reboot";
options = [ "NOPASSWD" ];
}
{
command = "${pkgs.systemd}/bin/poweroff";
options = [ "NOPASSWD" ];
}
];
groups = [ "wheel" ];
}
];
};
};
}

View File

@@ -0,0 +1,25 @@
{ lib, ... }:
{
services = {
openssh.enable = lib.mkDefault true;
# Enable firmware updates
fwupd.enable = lib.mkForce true;
fstrim.enable = lib.mkDefault true;
pcscd.enable = lib.mkDefault true;
# Enable Avahi for .local hostname resolution
avahi = {
enable = lib.mkDefault true;
nssmdns4 = lib.mkDefault true; # For modern systems, use nssmdns4 instead of nssmdns
publish = {
enable = lib.mkDefault true;
addresses = lib.mkDefault true;
domain = lib.mkDefault true;
workstation = lib.mkDefault true;
};
};
};
}

27
base/default.nix Normal file
View File

@@ -0,0 +1,27 @@
# { lib, config, ... }:
# let
# cfg = config.base;
# cosmicPath =
# if cfg.desktopEnvironments.cosmic.enableSpecialisation then
# ../../modules/desktop-environments/cosmic/specialisation.nix
# else
# ../../modules/desktop-environments/cosmic/default.nix;
# hyprlandPath =
# if cfg.desktopEnvironments.hyprland.enableSpecialisation then
# ../../modules/desktop-environments/hyprland/specialisation.nix
# else
# ../../modules/desktop-environments/hyprland/default.nix;
# extraImports = lib.optionals cfg.enable (
# [ ./base-nogui ]
# ++ lib.optional cfg.baseGui.enable ./base-gui
# ++ lib.optional cfg.desktopEnvironments.cosmic.enable cosmicPath
# ++ lib.optional cfg.desktopEnvironments.hyprland.enable hyprlandPath
# );
# in
# {
# imports = [ ./options.nix ] ++ extraImports;
# }

35
base/options.nix Normal file
View File

@@ -0,0 +1,35 @@
{ lib, ... }:
with lib;
{
options.base = {
enable = mkEnableOption "base config";
baseGui.enable = mkOption {
type = types.bool;
default = false;
};
desktopEnvironments = {
cosmic = {
enable = mkOption {
type = types.bool;
default = false;
};
enableSpecialisation = mkOption {
type = types.bool;
default = false;
};
};
hyprland = {
enable = mkOption {
type = types.bool;
default = false;
};
enableSpecialisation = mkOption {
type = types.bool;
default = false;
};
};
};
};
}

View File

@@ -347,11 +347,22 @@
inherit inputs outputs;
};
modules = [
desktop-impermanence.nixosModules.impermanence
desktop-lanzaboote.nixosModules.lanzaboote
./base/base-nogui
./base/base-gui
./hosts/desktop/configuration.nix
./share/impermanence
./modules/desktop-environments/gnome
# Lanzaboote
desktop-lanzaboote.nixosModules.lanzaboote
# Chaotic Nyx
desktop-chaotic.nixosModules.default
# Impermanence
desktop-impermanence.nixosModules.impermanence
./share/impermanence
# Home Manager
desktop-home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
@@ -376,14 +387,13 @@
home-manager.backupFileExtension = "backup";
}
# nixos hardware
desktop-nixos-hardware.nixosModules.common-cpu-amd
desktop-nixos-hardware.nixosModules.common-cpu-amd-pstate
desktop-nixos-hardware.nixosModules.common-cpu-amd-zenpower
desktop-nixos-hardware.nixosModules.common-gpu-amd
desktop-nixos-hardware.nixosModules.common-hidpi
desktop-nixos-hardware.nixosModules.common-pc
desktop-sops-nix.nixosModules.sops
];
};
@@ -394,11 +404,18 @@
inherit inputs outputs;
};
modules = [
nas-impermanence.nixosModules.impermanence
nas-lanzaboote.nixosModules.lanzaboote
nas-cosmic.nixosModules.default
./base/base-nogui
./base/base-gui
./hosts/nas/configuration.nix
./modules/desktop-environments/cosmic
nas-lanzaboote.nixosModules.lanzaboote
nas-impermanence.nixosModules.impermanence
./hosts/nas/impermanence.nix
nas-cosmic.nixosModules.default
nas-home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = false;
@@ -501,15 +518,6 @@
pi4-impermanence.nixosModules.impermanence
pi4-sops-nix.nixosModules.sops
./hosts/pi4/configuration.nix
#{
# # Hardware specific configuration, see section below for a more complete
# # list of modules
# imports = with nixos-raspberrypi.nixosModules; [
# raspberry-pi-4.base
# raspberry-pi-4.display-vc4
# raspberry-pi-4.bluetooth
# ];
#}
pi4-home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;

View File

@@ -3,7 +3,7 @@ let
configLimit = 5;
# default = "@saved";
kernel = pkgs.linuxPackages_cachyos;
pkgsVersion = pkgs.unstable;
pkgsVersion = pkgs; #.unstable;
in
{
# Configure bootloader with lanzaboot and secureboot

View File

@@ -9,7 +9,7 @@
...
}:
let
pkgsVersion = pkgs.unstable;
pkgsVersion = pkgs; #.unstable;
environmentVariables = {
STEAM_FORCE_DESKTOPUI_SCALING = "1.0";
GDK_SCALE = "1";
@@ -158,10 +158,6 @@ in
];
};
coolercontrol.enable = true;
kdeconnect = {
enable = true;
package = pkgs.gnomeExtensions.gsconnect;
};
};
# Common Configuration

View File

@@ -1,21 +1,9 @@
{ config, lib, pkgs, ... }:
let
pkgsVersion = pkgs.unstable;
pkgsVersion = pkgs; #.unstable;
in
{
services = {
# Enable Desktop Environment.
xserver = {
desktopManager.gnome.enable = true;
# Enable Desktop Environment.
displayManager = {
gdm.enable = lib.mkDefault true;
gdm.wayland = lib.mkDefault true;
};
};
gnome.gnome-remote-desktop.enable = true;
# Enable Flatpak
flatpak.enable = lib.mkDefault false;

View File

@@ -2,7 +2,7 @@
let
user = "matt";
passwordFile = config.sops.secrets."desktop/matt_password".path;
pkgsVersion = pkgs.unstable;
pkgsVersion = pkgs; #.unstable;
in
{
users.users."${user}" = {

View File

@@ -75,7 +75,7 @@ let
if __name__ == "__main__":
main()
'';
pkgsVersion = pkgs.unstable;
pkgsVersion = pkgs; #.unstable;
in
{
systemd = {

View File

@@ -21,8 +21,6 @@
./samba.nix
./services.nix
./sops.nix
../default.nix
../../modules/desktop-environments/cosmic/default.nix
];
powerManagement.cpuFreqGovernor = "powersave";

View File

@@ -1,9 +1,7 @@
{ ... }:
{
# specialisation.cosmic.configuration = {
services = {
desktopManager.cosmic.enable = true;
displayManager.cosmic-greeter.enable = true;
};
# };
services = {
desktopManager.cosmic.enable = true;
displayManager.cosmic-greeter.enable = true;
};
}

View File

@@ -1,18 +1,6 @@
{ lib, ... }:
{
specialisation.cosmic.configuration = {
services = {
desktopManager.cosmic.enable = lib.mkForce true;
displayManager.cosmic-greeter.enable = lib.mkForce true;
# Disable Gnome
xserver = {
desktopManager.gnome.enable = lib.mkForce false;
# Enable Desktop Environment.
displayManager = {
gdm.enable = lib.mkForce false;
gdm.wayland = lib.mkForce false;
};
};
};
imports = [ ./default.nix ]
};
}

View File

@@ -0,0 +1,23 @@
{ pkgs, ... }:
{
services = {
# Enable Desktop Environment.
xserver = {
desktopManager.gnome.enable = true;
# Enable Desktop Environment.
displayManager = {
gdm.enable = lib.mkDefault true;
gdm.wayland = lib.mkDefault true;
};
};
gnome.gnome-remote-desktop.enable = true;
};
programs = {
kdeconnect = {
enable = true;
package = pkgs.gnomeExtensions.gsconnect;
};
};
}

View File

@@ -3,106 +3,104 @@ let
sddmTheme = "catppuccin-mocha";
in
{
specialisation.hyprland.configuration = {
imports = [
./environment.nix
];
imports = [
./environment.nix
];
home-manager.users.matt = import ./home.nix;
home-manager.users.matt = import ./home.nix;
services = {
displayManager.sddm.enable = true;
displayManager.sddm.package = pkgs.kdePackages.sddm;
displayManager.sddm.theme = sddmTheme;
displayManager.defaultSession = "hyprland";
# disable plasma
desktopManager.plasma6.enable = false;
services = {
displayManager.sddm.enable = true;
displayManager.sddm.package = pkgs.kdePackages.sddm;
displayManager.sddm.theme = sddmTheme;
displayManager.defaultSession = "hyprland";
# disable plasma
desktopManager.plasma6.enable = false;
dbus.enable = true;
dbus.enable = true;
ddccontrol.enable = true;
ddccontrol.enable = true;
blueman.enable = true;
};
blueman.enable = true;
};
programs.hyprland = {
enable = true;
xwayland.enable = true;
portalPackage = pkgs.xdg-desktop-portal-hyprland;
};
programs.hyprland = {
enable = true;
xwayland.enable = true;
portalPackage = pkgs.xdg-desktop-portal-hyprland;
};
programs.nm-applet.enable = true;
programs.nm-applet.enable = true;
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
extraConfig = ''
DefaultTimeoutStopSec=10s
'';
};
extraConfig = ''
DefaultTimeoutStopSec=10s
'';
};
security = {
polkit.enable = true;
security = {
polkit.enable = true;
# configure sudo
sudo.extraRules = [
{
commands = [
{
command = "/run/current-system/sw/bin/waybar-weather";
options = [ "NOPASSWD" ];
}
{
command = "/run/current-system/sw/bin/waybar-updates";
options = [ "NOPASSWD" ];
}
];
groups = [ "wheel" ];
}
];
};
xdg.portal = {
enable = true;
wlr.enable = false;
xdgOpenUsePortal = false;
extraPortals = [
pkgs.xdg-desktop-portal-hyprland
pkgs.xdg-desktop-portal-gtk
];
};
fonts.packages = with pkgs; [
font-awesome
noto-fonts
noto-fonts-color-emoji
nerdfonts
meslo-lgs-nf
];
fonts.fontconfig.defaultFonts = {
emoji = [
"Noto Color Emoji"
];
};
nixpkgs.overlays = [
(self: super: {
waybar = super.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
});
})
# configure sudo
sudo.extraRules = [
{
commands = [
{
command = "/run/current-system/sw/bin/waybar-weather";
options = [ "NOPASSWD" ];
}
{
command = "/run/current-system/sw/bin/waybar-updates";
options = [ "NOPASSWD" ];
}
];
groups = [ "wheel" ];
}
];
};
xdg.portal = {
enable = true;
wlr.enable = false;
xdgOpenUsePortal = false;
extraPortals = [
pkgs.xdg-desktop-portal-hyprland
pkgs.xdg-desktop-portal-gtk
];
};
fonts.packages = with pkgs; [
font-awesome
noto-fonts
noto-fonts-color-emoji
nerdfonts
meslo-lgs-nf
];
fonts.fontconfig.defaultFonts = {
emoji = [
"Noto Color Emoji"
];
};
nixpkgs.overlays = [
(self: super: {
waybar = super.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
});
})
];
}

View File

@@ -0,0 +1,6 @@
{ lib, ... }:
{
specialisation.hyprland.configuration = {
imports = [ ./default.nix ]
};
}

View File

@@ -6,7 +6,7 @@
}:
let
cfg = config.share.hardware.amd;
pkgsVersion = pkgs.unstable;
pkgsVersion = pkgs;#.unstable;
in
{
imports = [ ./options.nix ];

View File

@@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }:
let
cfg = config.share.gaming;
pkgsVersion = pkgs.unstable;
pkgsVersion = pkgs; #.unstable;
in
{
imports = [ ./options.nix ];