thelio76: factor out system conf

This commit is contained in:
Alex 2024-07-26 19:59:54 -04:00
parent 7fa61945ef
commit b2cb274c0d
6 changed files with 49 additions and 90 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
result

View File

@ -1,8 +1,6 @@
# 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`).
# This file merged the original configuration.nix and hardware-configuration.nix files, refactoring common system config out
{ config, pkgs, ... }:
{ config, lib, pkgs, modulesPath, ... }:
{
imports =

View File

@ -1,37 +1,61 @@
# 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, pkgs, ... }:
# This file merged the original configuration.nix and hardware-configuration.nix files, refactoring common system config out
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[
# Include the results of the hardware scan.
./hardware-configuration.nix
(modulesPath + "/installer/scan/not-detected.nix")
../../modules/system76-pc.nix
];
networking.hostName = "thelio76"; # Define your hostname.
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
# List services that you want to enable:
boot.initrd.luks.devices."luks-b748a776-5e2c-4809-927e-1f4c051b9460".device = "/dev/disk/by-uuid/b748a776-5e2c-4809-927e-1f4c051b9460";
boot.initrd.luks.devices."luks-7d758c82-9079-46a6-8bb2-05d5016ed623".device = "/dev/disk/by-uuid/7d758c82-9079-46a6-8bb2-05d5016ed623";
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
environment.etc.crypttab.text = ''
luks-9870176e-53f3-493e-94d8-560994fa8f35 UUID=9870176e-53f3-493e-94d8-560994fa8f35 /luks-9870176e-53f3-493e-94d8-560994fa8f35 nofail
'';
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/5b17c208-6c1b-4317-b59c-6596b1857f1f";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/EB52-074B";
fsType = "vfat";
};
"/run/media/alex/External" = {
device = "/dev/disk/by-uuid/5057a0e6-649f-487f-a17c-11e379f9af19";
fsType = "auto";
};
"/home/alex/Documents" = {
device = "/run/media/alex/External/Documents";
options = [ "bind" ];
};
};
swapDevices =
[{ device = "/dev/disk/by-uuid/19de8142-e695-4425-a8cc-27e062204882"; }];
# 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;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
@ -40,5 +64,4 @@
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
}

View File

@ -1,49 +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 = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/5b17c208-6c1b-4317-b59c-6596b1857f1f";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-b748a776-5e2c-4809-927e-1f4c051b9460".device = "/dev/disk/by-uuid/b748a776-5e2c-4809-927e-1f4c051b9460";
fileSystems."/boot" =
{
device = "/dev/disk/by-uuid/EB52-074B";
fsType = "vfat";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/19de8142-e695-4425-a8cc-27e062204882"; }];
fileSystems."/run/media/alex/External" =
{
device = "/dev/disk/by-uuid/5057a0e6-649f-487f-a17c-11e379f9af19";
fsType = "auto";
};
# 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.enp9s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp7s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -19,19 +19,6 @@
boot.plymouth.enable = true;
boot.plymouth.theme = "fade-in";
boot.initrd.luks.devices."luks-7d758c82-9079-46a6-8bb2-05d5016ed623".device = "/dev/disk/by-uuid/7d758c82-9079-46a6-8bb2-05d5016ed623";
environment.etc.crypttab.text = ''
luks-9870176e-53f3-493e-94d8-560994fa8f35 UUID=9870176e-53f3-493e-94d8-560994fa8f35 /luks-9870176e-53f3-493e-94d8-560994fa8f35 nofail
'';
fileSystems."/home/alex/Documents" = {
device = "/run/media/alex/External/Documents";
options = [ "bind" ];
};
# networking.hostName = "thelio76"; # Define your hostname.
# Enable networking
networking.networkmanager.enable = true;

1
result
View File

@ -1 +0,0 @@
/nix/store/pxvalw02c9k1jmr43d6xk12wqyriqn72-nixos-system-thelio76-24.11.20240716.ad0b5ee