refactor: moved stuff around
This commit is contained in:
parent
8c237b9604
commit
7d5e25bdfe
11 changed files with 124 additions and 169 deletions
13
flake.nix
13
flake.nix
|
@ -9,12 +9,19 @@
|
||||||
name = "${hostname}";
|
name = "${hostname}";
|
||||||
value =
|
value =
|
||||||
let
|
let
|
||||||
args = { inherit self inputs type; };
|
args = {
|
||||||
|
inherit
|
||||||
|
self
|
||||||
|
inputs
|
||||||
|
type
|
||||||
|
hostname
|
||||||
|
;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
inputs.nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = args;
|
specialArgs = args;
|
||||||
modules = [
|
modules = [
|
||||||
./systems/${hostname}.nix
|
./systems
|
||||||
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
|
@ -32,10 +39,8 @@
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# System Configurations
|
|
||||||
nixosConfigurations = builtins.listToAttrs [
|
nixosConfigurations = builtins.listToAttrs [
|
||||||
(mkSystem "desktop" "nemesis")
|
(mkSystem "desktop" "nemesis")
|
||||||
(mkSystem "desktop" "mellinoe")
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,93 @@
|
||||||
{
|
{
|
||||||
|
lib,
|
||||||
|
hostname,
|
||||||
|
pkgs,
|
||||||
|
type,
|
||||||
|
modulesPath,
|
||||||
inputs,
|
inputs,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = builtins.concatLists [
|
||||||
./modules/programs/tailscale.nix
|
[
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
./modules/bootloaders/systemd-boot.nix
|
./modules/bootloaders/systemd-boot.nix
|
||||||
|
./modules/programs/tailscale.nix
|
||||||
./modules/programs/zsh.nix
|
./modules/programs/zsh.nix
|
||||||
inputs.nix-index-database.nixosModules.nix-index
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
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.mutableUsers = false; # Always reset users on system activation
|
||||||
users.users.rafiq = {
|
users.users.rafiq = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
|
@ -57,34 +133,6 @@
|
||||||
|
|
||||||
i18n.defaultLocale = "en_SG.UTF-8";
|
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;
|
services.openssh.enable = true;
|
||||||
|
|
||||||
sops = {
|
sops = {
|
|
@ -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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -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;
|
|
||||||
}
|
|
|
@ -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."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-uuid/e5005ea6-6c5a-4ab3-9767-ce7772582024";
|
device = "/dev/disk/by-uuid/e5005ea6-6c5a-4ab3-9767-ce7772582024";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
|
@ -25,19 +7,9 @@
|
||||||
fileSystems."/boot" = {
|
fileSystems."/boot" = {
|
||||||
device = "/dev/disk/by-uuid/6BBE-0E70";
|
device = "/dev/disk/by-uuid/6BBE-0E70";
|
||||||
fsType = "vfat";
|
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;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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";
|
|
||||||
}
|
|
13
systems/modules/hardware/audio.nix
Normal file
13
systems/modules/hardware/audio.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
systems/modules/hardware/cpu_amd.nix
Normal file
6
systems/modules/hardware/cpu_amd.nix
Normal 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;
|
||||||
|
}
|
|
@ -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;
|
|
||||||
}
|
|
9
users/modules/programs/comma.nix
Normal file
9
users/modules/programs/comma.nix
Normal 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;
|
||||||
|
}
|
|
@ -15,6 +15,7 @@
|
||||||
./programs/zoxide.nix
|
./programs/zoxide.nix
|
||||||
./programs/thefuck.nix
|
./programs/thefuck.nix
|
||||||
./programs/clipse.nix
|
./programs/clipse.nix
|
||||||
|
./programs/comma.nix
|
||||||
./scripts
|
./scripts
|
||||||
];
|
];
|
||||||
home.shell.enableShellIntegration = true;
|
home.shell.enableShellIntegration = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue