From db651698ca739add59b433d4fb18984cd9a00b69 Mon Sep 17 00:00:00 2001 From: David Lick Date: Fri, 22 Dec 2023 18:58:23 -0500 Subject: [PATCH] adds rustup, bisq, keet, libreoffice --- machines/configuration.nix | 16 ++++++++ machines/home.nix | 1 + machines/laptop/default.nix | 6 +-- machines/server/default.nix | 44 ++++++++++++++++++++++ machines/server/hardware-configuration.nix | 40 ++++++++++++++++++++ machines/server/home.nix | 13 +++++++ machines/server/services.nix | 5 +++ 7 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 machines/server/default.nix create mode 100644 machines/server/hardware-configuration.nix create mode 100644 machines/server/home.nix create mode 100644 machines/server/services.nix diff --git a/machines/configuration.nix b/machines/configuration.nix index cb716fa..a22646d 100644 --- a/machines/configuration.nix +++ b/machines/configuration.nix @@ -7,17 +7,33 @@ programs.zsh.enable = true; + boot.binfmt.registrations.appimage = { + wrapInterpreterInShell = false; + interpreter = "${pkgs.appimage-run}/bin/appimage-run"; + recognitionType = "magic"; + offset = 0; + mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff''; + magicOrExtension = ''\x7fELF....AI\x02''; + }; + users.users.${username} = { isNormalUser = true; extraGroups = [ "networkmanager" "wheel" ]; shell = pkgs.zsh; packages = with pkgs; [ + bisq-desktop + cargo cura dig element-desktop firefox freecad + gcc + keet + libreoffice nmap + rustc + rustup sparrow sublime-music thunderbird diff --git a/machines/home.nix b/machines/home.nix index 3dc3f83..2d0f3b0 100644 --- a/machines/home.nix +++ b/machines/home.nix @@ -24,6 +24,7 @@ "$HOME/go/bin" "$HOME/.local/bin" "$HOME/bin" + "$HOME/.cargo/bin" ]; }; } diff --git a/machines/laptop/default.nix b/machines/laptop/default.nix index e0d59dc..8e0c60c 100644 --- a/machines/laptop/default.nix +++ b/machines/laptop/default.nix @@ -29,14 +29,14 @@ services.tlp = { enable = true; settings = { - CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_AC = "powersave"; CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; - CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + CPU_ENERGY_PERF_POLICY_ON_AC = "power"; CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; CPU_MIN_PERF_ON_AC = 0; - CPU_MAX_PERF_ON_AC = 100; + CPU_MAX_PERF_ON_AC = 40; CPU_MIN_PERF_ON_BAT = 0; CPU_MAX_PERF_ON_BAT = 40; }; diff --git a/machines/server/default.nix b/machines/server/default.nix new file mode 100644 index 0000000..e0d59dc --- /dev/null +++ b/machines/server/default.nix @@ -0,0 +1,44 @@ +{ pkgs, lib, username, ... }: + +{ + imports = [ ./hardware-configuration.nix ./services.nix ]; + + networking.hostName = "laptop"; + networking.networkmanager.enable = true; + + networking.firewall.enable = true; + networking.firewall.allowedTCPPorts = [ ]; + networking.firewall.allowedUDPPorts = [ 51820 ]; + + security.pki.certificateFiles = [ "/root/ominous-law.local.crt" ]; + + hardware.bluetooth.enable = true; + + boot.loader = { + systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; + }; + + boot.initrd.secrets."/crypto_keyfile.bin" = null; + + services.power-profiles-daemon.enable = false; + services.thermald.enable = true; + services.tlp = { + enable = true; + settings = { + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + + CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + + CPU_MIN_PERF_ON_AC = 0; + CPU_MAX_PERF_ON_AC = 100; + CPU_MIN_PERF_ON_BAT = 0; + CPU_MAX_PERF_ON_BAT = 40; + }; + }; +} diff --git a/machines/server/hardware-configuration.nix b/machines/server/hardware-configuration.nix new file mode 100644 index 0000000..bb18b1b --- /dev/null +++ b/machines/server/hardware-configuration.nix @@ -0,0 +1,40 @@ +# 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" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/99ac3f1e-e178-4e52-be17-4669476ed652"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-300dbb06-4573-4a20-9842-e83d572fd003".device = "/dev/disk/by-uuid/300dbb06-4573-4a20-9842-e83d572fd003"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/43E8-BD26"; + fsType = "vfat"; + }; + + 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..useDHCP`. + networking.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; +} diff --git a/machines/server/home.nix b/machines/server/home.nix new file mode 100644 index 0000000..5275dc0 --- /dev/null +++ b/machines/server/home.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: + +{ + imports = [ + ../../modules/home/git.nix + ../../modules/home/vim.nix + ../../modules/home/zsh.nix + ]; + + modules.git.enable = true; + modules.vim.enable = true; + modules.zsh.enable = true; +} diff --git a/machines/server/services.nix b/machines/server/services.nix new file mode 100644 index 0000000..89f16ea --- /dev/null +++ b/machines/server/services.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: + +{ + imports = []; +}