hopefully the last complete restructure of this repo

This commit is contained in:
2024-10-24 15:34:23 -05:00
parent 8316336e0d
commit 77b7c16edc
123 changed files with 994 additions and 1313 deletions

View File

@@ -1,8 +0,0 @@
# NixOS System Configs
This is a repo for all of my nixos system configurations and isos
# Goal:
>- to define configs for all my nixos machines
>- to create a **100% reproduceable** system that can be deployed **offline** and **unattended**

655
flake.lock generated

File diff suppressed because it is too large Load Diff

159
flake.nix
View File

@@ -1,159 +1,40 @@
{
description = "Build Entire System";
description = "Nixos config flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = {
url = "github:nix-community/impermanence";
};
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nathan.url = "./home";
system.url = "./system-config";
system.url = "./system";
#system.inputs.diskoConfig.inputs.nixpkgs.follows = "nixpkgs";
nixvim.url = "/ssd1/Projects/Nixvim";
nathan.url = "./home-manager";
};
outputs = { self, nixpkgs, ... }@core_inputs: let
system = "x86_64-linux";
iso_system = "x86_64-linux";
host = "homebox";
username = "nathan";
devices = {
main = "/dev/nvme0n1";
bonus.disk1 = "/dev/nvme1n1";
};
in {
inputs.home-manager.useGlobalPkgs = true;
nixosConfigurations.${host} = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
core_inputs = (core_inputs // {inherit host;});
};
modules = [
core_inputs.system.nixosModule
core_inputs.home-manager.nixosModules.home-manager
({ lib, ... }: {
sysconfig = {
${host}.enable = true;
opts = {
firstBoot = true;
inherit host username devices;
};
};
disko = {
enable = true;
impermanent = true;
};
})
];
};
nixosConfigurations.iso = nixpkgs.lib.nixosSystem {
#inherit iso_system;
specialArgs = {
core_inputs = (core_inputs // {host = "installer";});
};
modules = [
({ lib, pkgs, modulesPath, ... }: {
imports = [
(modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix")
];
home-manager.users.${username}.homeconfig = {
minimal = true;
externalPackages.enable = false;
calcurse.enable = false;
wayvnc.enable = true;
rofi.enable = true;
mpd.enable = false;
wal.enable = true;
ags.enable = true;
hyprland.enable = true;
swaylock.enable = true;
};
sysconfig = {
opts = {
firstBoot = true;
host = "installer";
inherit username;
openssh.enable = true;
hyprland.enable = true;
ags.enable = true;
pipewire.enable = true;
git.enable = true;
steam.enable = false;
nh.enable = false;
};
};
disko.enable = lib.mkForce false;
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
};
networking = {
hostName = "installer";
firewall.allowedTCPPorts = [ 22 ];
};
nixpkgs.hostPlatform = iso_system;
})
core_inputs.system.nixosModule
core_inputs.home-manager.nixosModules.home-manager
];
};
packages.${iso_system}.default = self.nixosConfigurations.iso.config.system.build.isoImage;
homeConfigurations."nathan" = core_inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
extraSpecialArgs = { inherit core_inputs; };
modules = [
core_inputs.nathan.homeManagerModule
outputs = {nixpkgs, ...} @ inputs:
{
nixosConfigurations.homebox = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
modules = [
./system-config/configuration/homebox
homeconfig = {
minimal = false;
externalPackages.enable = true;
calcurse.enable = true;
wayvnc.enable = true;
rofi.enable = true;
mpd.enable = true;
wal.enable = true;
ags.enable = true;
hyprland.enable = true;
swaylock.enable = true;
};
}
];
};
};
}

8
home-manager/default.nix Normal file
View File

@@ -0,0 +1,8 @@
{ ... }: {
imports = [
./dotfiles
./impermanence
./services
];
}

View File

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

Before

Width:  |  Height:  |  Size: 1007 KiB

After

Width:  |  Height:  |  Size: 1007 KiB

View File

Before

Width:  |  Height:  |  Size: 110 MiB

After

Width:  |  Height:  |  Size: 110 MiB

View File

Before

Width:  |  Height:  |  Size: 191 KiB

After

Width:  |  Height:  |  Size: 191 KiB

View File

Before

Width:  |  Height:  |  Size: 874 KiB

After

Width:  |  Height:  |  Size: 874 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

Before

Width:  |  Height:  |  Size: 48 MiB

After

Width:  |  Height:  |  Size: 48 MiB

View File

Before

Width:  |  Height:  |  Size: 203 MiB

After

Width:  |  Height:  |  Size: 203 MiB

View File

Before

Width:  |  Height:  |  Size: 670 KiB

After

Width:  |  Height:  |  Size: 670 KiB

View File

Before

Width:  |  Height:  |  Size: 273 KiB

After

Width:  |  Height:  |  Size: 273 KiB

View File

Before

Width:  |  Height:  |  Size: 140 MiB

After

Width:  |  Height:  |  Size: 140 MiB

View File

Before

Width:  |  Height:  |  Size: 3.1 MiB

After

Width:  |  Height:  |  Size: 3.1 MiB

View File

Before

Width:  |  Height:  |  Size: 2.8 MiB

After

Width:  |  Height:  |  Size: 2.8 MiB

View File

Before

Width:  |  Height:  |  Size: 36 MiB

After

Width:  |  Height:  |  Size: 36 MiB

View File

@@ -0,0 +1,26 @@
{ config, lib, ... }: {
config = lib.mkMerge [
(lib.mkIf config.homeconfig.ags.enable {
home.file."ags" = { source = ./ags; target = ".config/ags"; recursive = true; };
})
(lib.mkIf config.homeconfig.hyprland.enable {
home.file = {
"Wallpaper" = { source = ./Wallpaper; target = "Pictures/Wallpaper"; recursive = true; };
"hyprland" = { source = ./hypr; target = ".config/hypr"; recursive = true; };
};
})
(lib.mkIf config.homeconfig.swaylock.enable {
home.file."swaylock" = { source = ./swaylock; target = ".config/swaylock"; recursive = true; };
})
(lib.mkIf config.homeconfig.wal.enable {
home.file."wal" = { source = ./wal/templates; target = ".config/wal/templates"; recursive = true; };
})
];
}

View File

@@ -0,0 +1,6 @@
use_relative_paths=true
address=0.0.0.0
enable_auth=true
username=nathan
password=//falconAdjacent42
rsa_private_key_file=rsa_key.pem

View File

@@ -0,0 +1,39 @@
-----BEGIN RSA PRIVATE KEY-----
MIIG4gIBAAKCAYEAskZTWfnj4uUDsPq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9sUrs8xz5ynePXUYFzUCKYFQaHjiRJcHf
ni0NtEogmyz6skw7ZV+Gzc1p2OqxwazzXfOrpOwFXCCDaqiFzfEO7jfC89XbzlOZ
it0zuMS0fp5prmGBg7bdhZ9MkBny+YjRAgma5zkvh2S99B89ZpTeplNUqssV0JLx
LcN0moCV2RdiSSkOFhanD+r+iAJnMOxBcYVKJL4hp2vK3P339CY=
-----END RSA PRIVATE KEY-----

View File

@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCyRlNZ+ePi5QOw+rnV4BeTFd64d7FPYfhDewUuCc/4HXO/2Z5iBB4Mry1I3Tz0q6TPqNgD9Z3xTrqKrRMocayCP8Ci0vTQpqf4nvmG6+c75psaOQii+Xv7P4T3CeqWbFsULyvnEPmdpBvAv5MqMabqNwjok+nf4YjYwycLphhQ7xmuezorqZv9ME2Ny0efcMZEv1AXSf8siU6FW/5WQGIyO9qdrbOjth0Q+YQ0bwc8hHq1FAj+AjxQTGWAvh3o7tHElMCiAgSetnGwcAA6ebMNVcinedK6Dimx6IdsBz05U2ifmI1nehEr9JBZ2RVL/gdn9f4xkuHbrv7as5kQDzyJzDc4h523TiXfeXxkBSUnj84qk96yi1RG92Rhg8IftRyD1MEtEnF6Ri4nEZXmKHiKZYVGQbOgYoETkPuJimmMNbBVSZyTdI8xpcgDGM13FKBiHzhiy+6G3acGgjez4PjKgGp9fvp87Po6xAcg67Fjc8oznsSDDi74jvN/PbuWC3U= root@homebox

View File

@@ -13,6 +13,7 @@
prgms.url = "./programs";
packages.url = "./packages";
};
outputs = { self, ... }@inputs: {
@@ -23,11 +24,20 @@
inputs.prgms.hmModule
./services
inputs.packages.hmModule
./dotfiles
# ./dotfiles
./impermanence
];
home.stateVersion = "23.11";
home.file = {
".config/ags" = { source = ./dotfiles/ags; recursive = true; };
".config/hypr" = { source = ./dotfiles/hypr; recursive = true; };
".config/swaylock" = { source = ./dotfiles/swaylock; recursive = true; };
".config/wal/templates" = { source = ./dotfiles/wal/templates; recursive = true; };
".config/wayvnc" = { source = ./dotfiles/wayvnc; recursive = true; };
"Pictures/Wallpaper" = { source = ./dotfiles/Wallpaper; recursive = true; };
};
home.username = "nathan";
home.homeDirectory = "/home/nathan";
@@ -50,18 +60,6 @@
programs.ssh.enable = true;
programs.home-manager.enable = true;
};
homeConfigurations."nathan" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
imports = [ self.homeManagerModule ];
};
};
}

View File

@@ -0,0 +1,21 @@
{ inputs, ... }: {
imports = [
inputs.impermanence.nixosModules.home-manager.impermanence
];
home.persistence."/persist/home/nathan" = {
directories = [
"Documents"
"Music"
"Pictures/Photos"
"Projects"
"Videos"
".ssh"
];
files = [
];
allowOther = true;
};
}

View File

@@ -75,13 +75,14 @@
'')
(pkgs.writeShellScriptBin "onSystemStart" ''
randWallpaper &
ags &
pypr &
setWallpaper &
lxqt-policykit-agent &
nmcli device wifi connect EagleNet password '~?C#@ZiH' &
hyprctl setcursor Bibata-Modern-Classic 16 &
wayvnc &
hyprctl reload &
'')
(pkgs.writeShellScriptBin "colorPrefix" ''

View File

@@ -5,9 +5,7 @@
ags.url = "./ags";
nixvim.url = "/home/nathan/Projects/Nixvim";
terminal.url = "./terminal"; #home manager only
nixvim.url = "/ssd1/Projects/Nixvim";
rofi.url = "./rofi";
@@ -23,7 +21,7 @@
imports = [
inputs.ags.hmModule
inputs.hyprland.hmModule
inputs.terminal.hmModule
./terminal
inputs.rofi.hmModule
inputs.pywal.hmModule
./swaylock

View File

@@ -31,7 +31,7 @@
systemd.variables = [ "--all" ];
extraConfig = ''
source = ./main.conf
source = /home/nathan/.config/hypr/main.conf
'';
};

View File

@@ -74,6 +74,7 @@
vesktop
pkgs-us.pywal16
imagemagick
pywalfox-native
];

View File

@@ -0,0 +1,12 @@
{ ... }: {
imports = [
./bat
./eza
./fzf
./tmux
./kitty
./zoxide
./zsh
];
}

View File

@@ -9,14 +9,5 @@
home.packages = with pkgs; [
wayvnc
];
home.file.".config/wayvnc/config".text = ''
use_relative_paths=true
address=0.0.0.0
enable_auth=true
username=nathan
password=//falconAdjacent42
rsa_private_key_file=rsa_key.pem
'';
};
}

View File

@@ -1,71 +0,0 @@
{ config, lib, ... }: {
config = lib.mkMerge [
(lib.mkIf config.homeconfig.ags.enable {
home.file = let
dir = "ags";
in builtins.mapAttrs (
n: v: { source = v.value; target = v.name; }) (
builtins.mapAttrs (
_name: _value: {
name = ".config/${dir}/${_name}"; value = ./${dir}/${_name};
}
) (builtins.readDir ./${dir})
);
})
(lib.mkIf config.homeconfig.hyprland.enable {
home.file = let
dir = "Wallpaper";
in builtins.mapAttrs (
n: v: { source = v.value; target = v.name; }) (
builtins.mapAttrs (
_name: _value: {
name = ".config/${dir}/${_name}"; value = ./${dir}/${_name};
}
) (builtins.readDir ./${dir})
);
})
(lib.mkIf config.homeconfig.hyprland.enable {
home.file = let
dir = "Wallpaper";
in builtins.mapAttrs (
n: v: { source = v.value; target = v.name; }) (
builtins.mapAttrs (
_name: _value: {
name = ".config/${dir}/${_name}"; value = ./${dir}/${_name};
}
) (builtins.readDir ./${dir})
);
})
(lib.mkIf config.homeconfig.swaylock.enable {
home.file = let
dir = "swaylock";
in builtins.mapAttrs (
n: v: { source = v.value; target = v.name; }) (
builtins.mapAttrs (
_name: _value: {
name = ".config/${dir}/${_name}"; value = ./${dir}/${_name};
}
) (builtins.readDir ./${dir})
);
})
(lib.mkIf config.homeconfig.wal.enable {
home.file = let
dir = "wal";
in builtins.mapAttrs (
n: v: { source = v.value; target = v.name; }) (
builtins.mapAttrs (
_name: _value: {
name = ".config/${dir}/${_name}"; value = ./${dir}/${_name};
}
) (builtins.readDir ./${dir})
);
})
];
}

View File

@@ -1,28 +0,0 @@
{ config, lib, self, ... }: {
imports = [
self.inputs.impermanence.nixosModules.home-manager.impermanence
];
config = lib.mkIf config.disko.impermanent {
home.persistence."/persist/home" = {
directories = [
"Documents"
"Music"
"Pictures"
"Videos"
".ssh"
".config"
".local"
".cache/wal"
];
files = [
".cache/bg"
".cache/bga"
];
allowOther = true;
};
};
}

View File

@@ -1,10 +0,0 @@
{
description = "nix impermanence home config";
inputs.impermanence.url = "github:nix-community/impermanence";
outputs = { self, ... }: {
hmModule = import ./. { inherit self; };
};
}

View File

@@ -1,11 +0,0 @@
{
description = "bat config";
inputs = {};
outputs = { self, ... }: {
hmModule = import ./bat.nix;
};
}

View File

@@ -1,11 +0,0 @@
{
description = "eza config";
inputs = {};
outputs = { self, ... }: {
hmModule = import ./eza.nix;
};
}

View File

@@ -1,29 +0,0 @@
{
description = "terminal config";
inputs = {
eza.url = "./eza";
bat.url = "./bat";
fzf.url = "./fzf";
zoxide.url = "./zoxide";
kitty.url = "./kitty";
tmux.url = "./tmux";
zsh.url = "./zsh";
};
outputs = { self, ... }@inputs: {
hmModule = { config, lib, pkgs, ... }: {
imports = [
inputs.eza.hmModule
inputs.bat.hmModule
inputs.fzf.hmModule
inputs.zoxide.hmModule
inputs.kitty.hmModule
inputs.tmux.hmModule
inputs.zsh.hmModule
];
};
};
}

View File

@@ -1,11 +0,0 @@
{
description = "fzf config";
inputs = {};
outputs = { self, ... }: {
hmModule = import ./fzf.nix;
};
}

View File

@@ -1,13 +0,0 @@
{
description = "Kitty Config";
inputs = {
};
outputs = { self, ... }: {
hmModule = import ./kitty.nix;
};
}

View File

@@ -1,11 +0,0 @@
{
description = "Tmux config";
inputs = {};
outputs = { self, ... }: {
hmModule = import ./tmux.nix;
};
}

View File

@@ -1,11 +0,0 @@
{
description = "Zoxide config";
inputs = {};
outputs = { self, ... }: {
hmModule = import ./zoxide.nix;
};
}

View File

@@ -1,11 +0,0 @@
{
description = "zsh config";
inputs = {};
outputs = { self, ... }: {
hmModule = import ./zsh.nix;
};
}

View File

@@ -0,0 +1,191 @@
{ config, pkgs, lib, inputs, ... }:
{
imports =
[
./hardware-configuration.nix
inputs.disko.nixosModules.default
(import ./disko.nix { device1 = "/dev/nvme0n1"; device2 = "/dev/nvme1n1"; })
inputs.impermanence.nixosModules.impermanence
inputs.home-manager.nixosModules.default
inputs.system.nixosModule
];
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
hardware = {
opengl = {
enable = true;
driSupport = true;
extraPackages = with pkgs; [
nvidia-vaapi-driver
];
};
nvidia = {
modesetting.enable = true;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.beta;
};
bluetooth.enable = true;
pulseaudio.enable = false;
};
services = {
xserver = {
enable = true;
videoDrivers = ["nvidia"];
};
displayManager.enable = true;
};
sysconfig = {
opts = {
sddm.enable = true;
openssh.enable = true;
pipewire.enable = true;
ags.enable = true;
hyprland.enable = true;
git.enable = true;
nh.enable = true;
steam.enable = false;
};
};
environment.sessionVariables = {
WLR_BACKENDS = "headless";
WLR_LIBINPUT_NO_DEVICES = "1";
};
programs.zsh.enable = true;
environment.shells = with pkgs; [ zsh ];
users.defaultUserShell = pkgs.zsh;
nixpkgs.config.allowUnfree = true;
# Set your time zone.
time.timeZone = "America/Chicago";
# Select internationalisation properties.
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";
};
networking = {
hostName = "homebox";
nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ];
networkmanager.enable = true;
firewall.allowedTCPPorts = [ 22 ];
};
system.stateVersion = "23.05"; # Did you read the comment?
users.users."nathan" = {
isNormalUser = true;
initialPassword = "7567";
extraGroups = [ "wheel" ]; # Enable sudo for the user.
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAsU69CxfQk58CvItPN426h5Alnpb60SH37wet97Vb57 nathan@laptop"
];
};
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
};
boot.initrd.postDeviceCommands = lib.mkAfter ''
mkdir /btrfs_tmp
mount /dev/root_vg/root /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then
mkdir -p /btrfs_tmp/old_roots
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
fi
delete_subvolume_recursively() {
IFS=$'\n'
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
delete_subvolume_recursively "/btrfs_tmp/$i"
done
btrfs subvolume delete "$1"
}
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
delete_subvolume_recursively "$i"
done
btrfs subvolume create /btrfs_tmp/root
umount /btrfs_tmp
'';
fileSystems."/persist".neededForBoot = true;
environment.persistence."/persist/system" = {
hideMounts = true;
directories = [
"/etc/nixos"
"/var/log"
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
{ directory = "/var/lib/colord"; user = "colord"; group = "colord"; mode = "u=rwx,g=rx,o="; }
];
files = [
"/etc/machine-id"
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
{ file = "/var/keys/secret_file"; parentDirectory = { mode = "u=rwx,g=,o="; }; }
];
};
programs.fuse.userAllowOther = true;
home-manager = {
backupFileExtension = ".backup";
extraSpecialArgs = {inherit inputs;};
users = {
"nathan" = lib.mkMerge [
inputs.nathan.homeManagerModule
{
config.homeconfig = {
hyprland.enable = true;
swaylock.enable = true;
wal.enable = true;
wayvnc.enable = true;
mpd.enable = true;
ags.enable = true;
calcurse.enable = true;
rofi.enable = true;
};
}
];
};
};
fonts.packages = with pkgs; [ nerdfonts ];
}

View File

@@ -0,0 +1,114 @@
{
device1 ? throw "Set this to your disk device, e.g. /dev/sda",
device2,
...
}: {
disko.devices = {
disk = {
main = {
device = device1;
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
swap = {
size = "4G";
content = {
type = "swap";
resumeDevice = true;
};
};
root = {
name = "root";
size = "100%";
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
};
};
ssd1 = {
device = device2;
type = "disk";
content = {
type = "gpt";
partitions = {
ssd1 = {
name = "ssd1";
size = "100%";
content = {
type = "lvm_pv";
vg = "ssd1_vg";
};
};
};
};
};
};
lvm_vg = {
root_vg = {
type = "lvm_vg";
lvs = {
root = {
size = "100%FREE";
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
};
"/persist" = {
mountOptions = ["subvol=persist" "noatime"];
mountpoint = "/persist";
};
"/nix" = {
mountOptions = ["subvol=nix" "noatime"];
mountpoint = "/nix";
};
};
};
};
};
};
ssd1_vg = {
type = "lvm_vg";
lvs = {
ssd1 = {
size = "100%FREE";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/ssd1" = {
mountOptions = [ "subvol=ssd1" "noatime" ];
mountpoint = "/ssd1";
};
};
};
};
};
};
};
};
}

View File

@@ -8,8 +8,8 @@
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" ];
boot.initrd.kernelModules = [ ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];

38
system-config/flake.nix Executable file
View File

@@ -0,0 +1,38 @@
{
description = "Unified System Configuration";
inputs = {
prgms.url = "./programs";
sddm.url = "./services/sddm";
};
outputs = { self, ... }@attrs: {
nixosModule = { config, lib, pkgs, inputs, ... }: {
imports = [
./services
./packages
attrs.prgms.module
attrs.sddm.module
];
options = {
sysconfig.opts = {
host = lib.options.mkOption {
type = lib.types.str;
default = null;
};
username = lib.options.mkOption {
type = lib.types.str;
default = "nathan";
};
};
};
};
};
}

View File

@@ -0,0 +1 @@
{}

View File

@@ -1,16 +1,11 @@
{
description = "ags dependancies";
{ config, lib, pkgs, ... }: {
inputs = {
options.sysconfig.opts.ags.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
outputs = { self, ... }: {
module = { config, lib, pkgs, ... }: {
options.sysconfig.opts.ags.enable = lib.options.mkOption {};
config = lib.mkIf config.sysconfig.opts.ags.enable {
services = {
upower.enable = true;
@@ -18,7 +13,4 @@
power-profiles-daemon.enable = true;
};
};
};
};
}

View File

@@ -3,8 +3,6 @@
inputs = {
ags.url = "./ags";
hyprland.url = "./hyprland";
};
@@ -14,7 +12,7 @@
imports = [
inputs.hyprland.module
inputs.ags.module
./ags
./git
./nh
./steam

View File

@@ -9,7 +9,11 @@
module = { config, lib, pkgs, ... }: {
options.sysconfig.opts.hyprland.enable = lib.options.mkOption {};
options.sysconfig.opts.hyprland.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.sysconfig.opts.hyprland.enable {

View File

@@ -0,0 +1,8 @@
{ ... }: {
imports = [
./ollama
./openssh
./pipewire
];
}

Some files were not shown because too many files have changed in this diff Show More