refactor: moved stuff around

This commit is contained in:
Mohammad Rafiq 2025-03-27 00:07:35 +08:00
parent 8c237b9604
commit 7d5e25bdfe
No known key found for this signature in database
11 changed files with 124 additions and 169 deletions

View file

@ -9,12 +9,19 @@
name = "${hostname}";
value =
let
args = { inherit self inputs type; };
args = {
inherit
self
inputs
type
hostname
;
};
in
inputs.nixpkgs.lib.nixosSystem {
specialArgs = args;
modules = [
./systems/${hostname}.nix
./systems
inputs.home-manager.nixosModules.home-manager
{
@ -32,10 +39,8 @@
};
in
{
# System Configurations
nixosConfigurations = builtins.listToAttrs [
(mkSystem "desktop" "nemesis")
(mkSystem "desktop" "mellinoe")
];
};

View file

@ -1,17 +1,93 @@
{
lib,
hostname,
pkgs,
type,
modulesPath,
inputs,
config,
...
}:
{
imports = [
./modules/programs/tailscale.nix
./modules/bootloaders/systemd-boot.nix
./modules/programs/zsh.nix
inputs.nix-index-database.nixosModules.nix-index
inputs.sops-nix.nixosModules.sops
imports = builtins.concatLists [
[
(modulesPath + "/installer/scan/not-detected.nix")
./modules/bootloaders/systemd-boot.nix
./modules/programs/tailscale.nix
./modules/programs/zsh.nix
inputs.sops-nix.nixosModules.sops
]
(lib.optionals (type == "desktop") [
../themes/cursors/banana-cursor.nix
../themes/darkviolet.nix
../themes/fonts/sauce-code-pro.nix
./modules/hardware/audio.nix
./modules/hardware/bluetooth.nix
./modules/programs/getty.nix
./modules/programs/hyprland.nix
./modules/programs/hyprlock.nix
inputs.stylix.nixosModules.stylix
{
# Enable basic fonts for reasonable Unicode coverage
fonts.enableDefaultPackages = true;
stylix = {
enable = true;
image = ../../media/wallpaper.jpg;
homeManagerIntegration.autoImport = false;
homeManagerIntegration.followSystem = false;
};
}
])
(lib.optionals (hostname == "nemesis") [
./hw-nemesis.nix
./modules/hardware/nvidia.nix
./modules/hardware/cpu_amd.nix
])
];
boot = {
kernelPackages = pkgs.linuxPackages_latest;
initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
};
system.stateVersion = "24.11";
networking = {
hostName = hostname;
useDHCP = lib.mkDefault true;
networkmanager.enable = true;
networkmanager.wifi.backend = "iwd";
# Configures a simple stateful firewall.
# By default, it doesn't allow any incoming connections.
firewall = {
enable = true;
allowedTCPPorts = [
22 # SSH
];
allowedUDPPorts = [ ];
};
interfaces.enp12s0.wakeOnLan.policy = [
"phy"
"unicast"
"multicast"
"broadcast"
"arp"
"magic"
"secureon"
];
interfaces.enp12s0.wakeOnLan.enable = true;
};
users.mutableUsers = false; # Always reset users on system activation
users.users.rafiq = {
isNormalUser = true;
@ -57,34 +133,6 @@
i18n.defaultLocale = "en_SG.UTF-8";
programs.nix-index-database.comma.enable = true;
networking = {
networkmanager.enable = true;
networkmanager.wifi.backend = "iwd";
# Configures a simple stateful firewall.
# By default, it doesn't allow any incoming connections.
firewall = {
enable = true;
allowedTCPPorts = [
22 # SSH
];
allowedUDPPorts = [ ];
};
interfaces.enp12s0.wakeOnLan.policy = [
"phy"
"unicast"
"multicast"
"broadcast"
"arp"
"magic"
"secureon"
];
interfaces.enp12s0.wakeOnLan.enable = true;
};
services.openssh.enable = true;
sops = {

View file

@ -1,35 +0,0 @@
{ inputs, ... }:
{
imports = [
../themes/cursors/banana-cursor.nix
../themes/darkviolet.nix
../themes/fonts/sauce-code-pro.nix
./modules/programs/getty.nix
./modules/programs/hyprland.nix
./modules/programs/hyprlock.nix
inputs.stylix.nixosModules.stylix
./modules/hardware/bluetooth.nix
];
# Enable basic fonts for reasonable Unicode coverage
fonts.enableDefaultPackages = true;
stylix = {
enable = true;
image = ../../media/wallpaper.jpg;
homeManagerIntegration.autoImport = false;
homeManagerIntegration.followSystem = false;
};
security.rtkit.enable = true;
services.pipewire = {
enable = true;
extraConfig = { };
jack.enable = true;
pulse.enable = true;
alsa = {
enable = true;
support32Bit = true;
};
};
}

View file

@ -1,39 +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,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"xhci_pci"
"nvme"
"usb_storage"
"usbhid"
"sd_mod"
"rtsx_pci_sdmmc"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
# 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.eth0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,22 +1,4 @@
# 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 = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/e5005ea6-6c5a-4ab3-9767-ce7772582024";
fsType = "ext4";
@ -25,19 +7,9 @@
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/6BBE-0E70";
fsType = "vfat";
options = ["fmask=0077" "dmask=0077"];
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices = [];
# 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.enp12s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp13s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,12 +0,0 @@
{
imports = [
./hw-mellinoe.nix
./modules/common.nix
./modules/desktop.nix
./modules/bootloaders/systemd-boot.nix
./modules/hardware/bluetooth.nix
./modules/ephemeral-root.nix
];
networking.hostName = "mellinoe";
system.stateVersion = "24.11";
}

View file

@ -0,0 +1,13 @@
{
security.rtkit.enable = true;
services.pipewire = {
enable = true;
extraConfig = { };
jack.enable = true;
pulse.enable = true;
alsa = {
enable = true;
support32Bit = true;
};
};
}

View file

@ -0,0 +1,6 @@
{ lib, config, ... }:
{
boot.kernelModules = [ "kvm-amd" ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,13 +0,0 @@
{ pkgs, ... }:
{
imports = [
./hw-nemesis.nix
./common.nix
./desktop.nix
./modules/hardware/nvidia.nix
];
networking.hostName = "nemesis";
system.stateVersion = "24.11";
boot.kernelPackages = pkgs.linuxPackages_latest;
}

View file

@ -0,0 +1,9 @@
{ inputs, ... }:
{
imports = [
inputs.nix-index-database.hmModules.nix-index
];
programs.nix-index.enable = true;
programs.nix-index-database.comma.enable = true;
}

View file

@ -15,6 +15,7 @@
./programs/zoxide.nix
./programs/thefuck.nix
./programs/clipse.nix
./programs/comma.nix
./scripts
];
home.shell.enableShellIntegration = true;