This commit is contained in:
Casper V. Kristensen 2023-10-07 02:18:22 +02:00
parent 335b22df93
commit 10d1e4917c
4 changed files with 98 additions and 0 deletions

View file

@ -42,6 +42,12 @@
specialArgs = inputs; # pass flake inputs to modules
modules = [ ./hosts/zeta ];
};
# Work laptop
mu = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs; # pass flake inputs to modules
modules = [ ./hosts/mu ];
};
# Tor relay
tor = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";

36
hosts/mu/default.nix Normal file
View file

@ -0,0 +1,36 @@
{ ... }: {
imports = [
./hardware.nix
./sway.nix
../../overlays
../../modules/base
../../modules/desktop
];
networking.hostName = "mu";
boot = {
loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
};
initrd.luks.devices.crypted.device = "/dev/disk/by-label/crypted";
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# 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 = "23.05"; # Did you read the comment?
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home-manager.users.caspervk.home.stateVersion = "23.05"; # Did you read the comment?
}

41
hosts/mu/hardware.nix Normal file
View file

@ -0,0 +1,41 @@
{ config, lib, pkgs, modulesPath, ... }: {
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
# https://elis.nu/blog/2020/05/nixos-tmpfs-as-root/
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = [ "defaults" "size=2G" "mode=755" ]; # mode=755 so only root can write to those files
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/nix";
fsType = "ext4";
};
swapDevices = [
{
device = "/nix/persist/swapfile";
size = 32 * 1024; # 32 GiB
}
];
# Enables DHCP on all ethernet and wireless LAN interfaces.
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

15
hosts/mu/sway.nix Normal file
View file

@ -0,0 +1,15 @@
{ home-manager, ... }: {
home-manager.users.caspervk = {
wayland.windowManager.sway = {
config = {
# swaymsg -t get_outputs
output = {
"AU Optronics 0xE48D Unknown" = {
mode = "1920x1080@60.052Hz";
position = "0,0";
};
};
};
};
};
}