build please?

This commit is contained in:
2024-10-18 07:40:46 -05:00
parent 57732d6d8c
commit 20b5622296
65 changed files with 2388 additions and 1416 deletions

View File

@@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: {
{ lib, pkgs, core_inputs, ... }: {
imports = [
./generic
@@ -9,4 +9,28 @@
sysconfig.laptop.enable = lib.mkDefault false;
sysconfig.homebox.enable = lib.mkDefault false;
sysconfig.generic.enable = lib.mkDefault true;
networking = {
hostName = core_inputs.host;
nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ];
networkmanager.enable = true;
};
xdg.portal = {
enable = true;
config.common.default = "*";
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
};
environment.systemPackages = with pkgs; [
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-ugly
home-manager
];
fonts.packages = with pkgs; [ nerdfonts ];
}

View File

@@ -1 +1,71 @@
{}
# 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, lib, pkgs, core_inputs, ... }:
{
options = {
sysconfig.homebox.enable = lib.mkEnableOption "uses homebox config";
};
config = lib.mkIf config.sysconfig.homebox.enable {
assertions = [
{
assertion = !config.sysconfig.laptop.enable;
message = "sysconfig homebox conflicts with laptop";
}
];
sysconfig.generic.enable = lib.mkForce false;
imports = [];
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
kernelParams = [ "initcall_blacklist=simpledrm_platform_driver_init" ];
};
hardware = {
opengl = {
enable = true;
driSupport = true;
extraPackages = with pkgs; [
nvidia-vaapi-driver
];
};
nvidia = {
modesetting.enable = true;
open = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.beta;
};
bluetooth.enable = true;
pulseaudio.enable = false;
};
services = {
xserver = {
enable = true;
videoDrivers = [ "nvidia" ];
};
displayManager.enable = true;
};
environment = {
sessionVariables = {
WLR_BACKENDS = "headless";
WLR_LIBINPUT_NO_DEVICES="1";
};
};
};
}

View File

@@ -19,6 +19,8 @@
}
];
sysconfig.generic.enable = lib.mkForce false;
imports = [];
boot = {
@@ -58,13 +60,7 @@
pulseaudio.enable = false;
};
networking = {
hostName = "laptop";
nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ];
networkmanager.enable = true;
};
services = {
xserver = {
enable = true;

View File

@@ -1,4 +1,4 @@
{ config, lib, devices, ... }: {
{ config, lib, ... }: {
options = {
disko = {
@@ -17,13 +17,13 @@
{
imports = [
./disko.nix { device = devices.main; }
./disko.nix { device = config.sysconfig.opts.devices.main; }
];
}
(lib.mkIf (devices.bonus != null) {
(lib.mkIf (config.sysconfig.opts.devices.bonus != null) {
imports = [
(./disko_bonus.nix { devices = devices.bonus; })
(./disko_bonus.nix { devices = config.sysconfig.opts.devices.bonus; })
];
})

View File

@@ -9,9 +9,9 @@
outputs = { self, ... }@inputs: {
module = { config, lib, pkgs, devices, ... }: {
module = { config, lib, pkgs, ... }: {
imports = [
(import ./default.nix { inherit config lib pkgs devices; })
(import ./default.nix { inherit config lib pkgs; })
inputs.disko.nixosModules.default
];
};

View File

@@ -1,4 +1,4 @@
{ config, lib, ... }: {
{ lib, ... }: {
boot.initrd.postDeviceCommands = lib.mkAfter ''
mkdir /btrfs_tmp

View File

@@ -0,0 +1,23 @@
{ config, lib, core_inputs, ... }: {
options.sysconfig.firstBoot = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.sysconfig.firstBoot {
users.users.${core_inputs.user} = {
initialPassword = "7567";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAsU69CxfQk58CvItPN426h5Alnpb60SH37wet97Vb57 nathan@laptop"
];
};
home-manager.users.${core_inputs.user} = core_inputs.${core_inputs.user}.homeManagerModule;
systemd.services.sshd.wantedBy = lib.mkForce [ "mulit-user.target" ];
sysconfig.opts.openssh.enable = lib.mkForce true;
};
}

View File

@@ -1,36 +1,77 @@
{
description = "Unified System Configuration";
description = "Unified System Configuration";
inputs = {
inputs = {
sddm.url = "./sddm";
srvcs.url = "./services";
srvcs.url = "./services";
pckgs.url = "./packages";
pckgs.url = "./packages";
prgms.url = "./programs";
prgms.url = "./programs";
diskoConfig.url = "./disko";
diskoConfig.url = "./disko";
impermanenceConfig.url = "./impermanence";
impermanenceConfig.url = "./impermanence";
};
outputs = { self, ... }@inputs: {
nixosModule = { config, lib, pkgs, core_inputs, ... }: {
imports = [
./configuration/configuration.nix
# inputs.diskoConfig.module
# inputs.impermanenceConfig.module
inputs.sddm.module
inputs.srvcs.module
inputs.pckgs.module
inputs.prgms.module
];
};
};
outputs = { self, ... }@inputs: {
nixosModule = { config, lib, pkgs, core_inputs, ... }: {
imports = [
./configuration/configuration.nix
# inputs.diskoConfig.module
# inputs.impermanenceConfig.module
inputs.srvcs.module
inputs.pckgs.module
inputs.prgms.module
];
options = {
sysconfig.opts = {
host = lib.options.mkOption {
type = lib.types.str;
default = null;
};
username = lib.options.mkOption {
type = lib.types.str;
default = "nathan";
};
devices = {
main = lib.options.mkOption {
type = lib.types.str;
default = null;
};
bonus = lib.options.mkOption {
type = lib.types.attrsOf lib.types.str;
default = null;
};
};
};
};
config = {
assertions = [
{
assertion = (config.sysconfig.opts.host != null);
message = "host cannot be null";
}
{
assertion = (config.sysconfig.opts.devices.main != null);
message = "devices.main cannot be null";
}
];
networking.hostname = config.sysconfig.opts.host;
users.users.${config.sysconfig.opts.username} = {
};
};
};
};
}

View File

@@ -8,11 +8,16 @@
outputs = { self, ... }: {
module = { config, lib, pkgs, ... }: {
services = {
upower.enable = true;
gvfs.enable = true;
power-profiles-daemon.enable = true;
};
options.sysconfig.opts.ags.enable = lib.options.mkOption {};
config = lib.mkIf config.sysconfig.opts.ags.enable {
services = {
upower.enable = true;
gvfs.enable = true;
power-profiles-daemon.enable = true;
};
};
};
};

View File

@@ -15,6 +15,9 @@
imports = [
inputs.hyprland.module
inputs.ags.module
./git
./nh
./steam
];
};

View File

@@ -0,0 +1,17 @@
{ config, lib, ... }: {
options.sysconfig.opts.git.enable = lib.opions.mkOption {};
config = lib.mkIf config.sysconfig.opts.git.enable {
programs.git = {
enable = true;
config = {
user = {
name = "blaknull";
email = "nathanblunkall5@gmail.com";
};
};
};
};
}

View File

@@ -9,15 +9,25 @@
module = { config, lib, pkgs, ... }: {
programs.hyprland = {
enable = true;
options.sysconfig.opts.hyprland.enable = lib.options.mkOption {};
xwayland.enable = true;
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
config = lib.mkIf config.sysconfig.opts.hyprland.enable {
sysconfig.opts.sddm.enable = lib.mkDefault true;
environment.sessionVariables.NIXOS_OZONE_WL = "1";
programs.hyprland = {
enable = true;
xwayland.enable = true;
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
};
};
portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
};
};

View File

@@ -0,0 +1,21 @@
{ config, lib, ... }: {
options.sysconfig.opts.nh.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.sysconfig.opts.nh.enable {
programs.nh = {
enable = true;
flake = "/home/nathan/Projects/System";
clean = {
enable = true;
dates = "weekly";
extraArgs = "--keep 5 --keep-since 3d";
};
};
};
}

View File

@@ -0,0 +1,14 @@
{ config, lib, ... }: {
options.sysconfig.opts.steam.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.sysconfig.opts.steam.enable {
programs.steam = {
enable = true;
};
};
}

View File

@@ -1,34 +0,0 @@
{
description = "sddm config";
inputs = {
theme.url = "./themes/tokyo-night";
};
outputs = { self, ... }@inputs: {
module = { config, lib, pkgs, ... }: {
imports = [];
qt.enable = true;
services.displayManager.sddm = {
enable = true;
wayland.enable = true;
autoNumlock = true;
theme = "${inputs.theme.theme { inherit pkgs; }}";
enableHidpi = true;
extraPackages = with pkgs; [
libsForQt5.qtsvg
libsForQt5.qtquickcontrols2
libsForQt5.qtgraphicaleffects
];
};
};
};
}

View File

@@ -3,15 +3,17 @@
inputs = {
ollama.url = "./ollama";
sddm.url = "./sddm";
};
outputs = { self, ... }@inputs: {
module = { config, lib, pkgs, ... }: {
imports = [
inputs.ollama.module
inputs.sddm.module
./openssh
./ollama
./pipewire
];
};

View File

@@ -0,0 +1,16 @@
{ config, lib, ... }: {
options = {
sysconfig.opts.ollama.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
};
config = lib.mkIf config.sysconfig.opts.ollama.enable {
services.ollama = {
enable = true;
acceleration = "cuda";
};
};
}

View File

@@ -1,12 +0,0 @@
{
description = "ollama config";
inputs = {
};
outputs = { self, ... }: {
module = import ./ollama.nix;
};
}

View File

@@ -1,7 +0,0 @@
{ config, lib, pkgs, ... }: {
services.ollama = {
enable = true;
acceleration = "cuda";
};
}

View File

@@ -0,0 +1,21 @@
{ config, lib, ... }: {
options = {
sysconfig.opts.openssh.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
};
config = lib.mkIf config.sysconfig.opts.openssh.enable {
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
};
}

View File

@@ -0,0 +1,51 @@
{ config, lib, pkgs, ... }: {
options = {
sysconfig.opts.pipewire.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
};
config = lib.mkIf config.sysconfig.opts.pipewire.enable {
# Enable sound with pipewire.
sound.enable = true;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
package = pkgs.pipewire;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
extraConfig.pipewire-pulse."92-low-latency" = {
context.modules = [
{
name = "libpipewire-module-protocol-pulse";
args = {
pulse.min.req = "32/48000";
pulse.default.req = "32/48000";
pulse.max.req = "32/48000";
pulse.min.quantum = "32/48000";
pulse.max.quantum = "32/48000";
};
}
];
stream.properties = {
node.latency = "32/48000";
resample.quality = 1;
};
};
# 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)
wireplumber.enable = true;
};
};
}

View File

@@ -0,0 +1,40 @@
{
description = "sddm config";
inputs = {
theme.url = "./themes/tokyo-night";
};
outputs = { self, ... }@inputs: {
module = { config, lib, pkgs, ... }: {
options.sysconfig.opts.sddm.enable = lib.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.sysconfig.opts.sddm.enable {
imports = [];
qt.enable = true;
services.displayManager.sddm = {
enable = true;
wayland.enable = true;
autoNumlock = true;
theme = "${inputs.theme.theme { inherit pkgs; }}";
enableHidpi = true;
extraPackages = with pkgs; [
libsForQt5.qtsvg
libsForQt5.qtquickcontrols2
libsForQt5.qtgraphicaleffects
];
};
};
};
};
}