Add lime configuration #10

Merged
riley merged 10 commits from add-lime into mistress 2023-06-17 13:40:14 +02:00
5 changed files with 118 additions and 53 deletions
Showing only changes of commit 0dab2619f2 - Show all commits

View file

@ -112,6 +112,21 @@
"type": "github" "type": "github"
} }
}, },
"nixos-hardware": {
"locked": {
"lastModified": 1686838567,
"narHash": "sha256-aqKCUD126dRlVSKV6vWuDCitfjFrZlkwNuvj5LtjRRU=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "429f232fe1dc398c5afea19a51aad6931ee0fb89",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1677676435, "lastModified": 1677676435,
@ -203,6 +218,7 @@
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_3",
"pwnix": "pwnix" "pwnix": "pwnix"
} }

View file

@ -8,9 +8,10 @@
url = git+https://im.badat.dev/bad/pwnix.git; url = git+https://im.badat.dev/bad/pwnix.git;
}; };
agenix.url = github:ryantm/agenix; agenix.url = github:ryantm/agenix;
nixos-hardware.url = github:NixOS/nixos-hardware;
}; };
outputs = args@{ home-manager, nixpkgs, agenix, ... }: with nixpkgs; { outputs = args@{ home-manager, nixpkgs, agenix, nixos-hardware, ... }: with nixpkgs; {
# Configurations for NixOS machines. # Configurations for NixOS machines.
nixosConfigurations = nixosConfigurations =
@ -47,6 +48,7 @@
modules = [ modules = [
(mkUserConfig ./system/lime) (mkUserConfig ./system/lime)
agenix.nixosModules.default agenix.nixosModules.default
nixos-hardware.nixosModules.lenovo-thinkpad-x390
./system/lime/core.nix ./system/lime/core.nix
./shared/core ./shared/core
./shared/secrets.nix ./shared/secrets.nix

View file

@ -0,0 +1,33 @@
# 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, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Use the systemd-boot EFI boot loader.
services.xserver.enable = true;
services.xserver.desktopManager.lxqt.enable = true;
services.xserver.displayManager.gdm.enable = true;
programs.firefox.enable = true;
networking.hostName = "lime";
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
# Enable touchpad support (enabled default in most desktopManager).
services.xserver.libinput.enable = true;
system.stateVersion = "22.11"; # Did you read the comment?
programs.git.enable = true;
nix.settings.experimental-features = ["nix-command" "flakes"];
}

View file

@ -1,59 +1,13 @@
{ lib, ... }: { { lib, modulesPath, ... }: {
imports = [./configuration.nix];
custom = { custom = {
gui.enable = true; gui.enable = true;
backups.enable = true; backups.enable = true;
}; };
system.stateVersion = "22.11"; home-manager.users."riley".home.stateVersion = "22.11";
home-manager.users.riley.home.stateVersion = "22.11";
networking = {
hostName = "lime";
interfaces."wlp0s20f3".useDHCP = true;
interfaces."enp0s31f6".useDHCP = true;
};
boot = {
initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"usbhid"
"usb_storage"
"sd_mod"
"sdhci_pci"
];
kernelModules = [ "kvm-intel" ];
loader.grub = {
enable = true;
efiSupport = true;
device = "nodev";
};
loader.efi.canTouchEfiVariables = true;
initrd.luks.devices.root.device = "/dev/disk/by-uuid/bd5edcc6-35b7-4829-901f-8593c16f0324";
resumeDevice = "/dev/disk/by-label/NIXOS-ROOT";
kernelParams = [
# btrfs inspect-internal map-swapfile -r /swap/swapfile
"resume_offset=2630912"
];
};
fileSystems."/" = {
device = "/dev/disk/by-label/NIXOS-ROOT";
fsType = "btrfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/2745-1284";
fsType = "vfat";
};
swapDevices = [{
device = "/swap/swapfile";
size = 16 * 1024;
}];
nixpkgs.hostPlatform = "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
} }

View file

@ -0,0 +1,60 @@
# 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" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.loader.grub = {
efiSupport = true;
device = "nodev";
enable = true;
};
boot.loader.efi.canTouchEfiVariables = true;
fileSystems."/" =
{ device = "/dev/disk/by-label/NIXOS-ROOT";
fsType = "btrfs";
};
boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/bd5edcc6-35b7-4829-901f-8593c16f0324";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/2745-1284";
fsType = "vfat";
};
swapDevices = [
{
device = "/swap/swapfile";
size = 16*1024;
}
];
# Hibernation
# https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file
boot.resumeDevice = "/dev/disk/by-label/NIXOS-ROOT";
boot.kernelParams = [
# btrfs inspect-internal map-swapfile -r /swap/swapfile
"resume_offset=2630912"
];
# 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.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}