From 537dbf0b8299948a804065f0ac19b5223a5a5cb8 Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Wed, 4 Dec 2024 06:58:43 -0500 Subject: [PATCH] Some playground bits for trying restructuring --- 2024-12-rework/.gitignore | 2 + 2024-12-rework/configuration.nix | 25 +++ 2024-12-rework/flake.lock | 183 ++++++++++++++++++++++ 2024-12-rework/flake.nix | 30 ++++ 2024-12-rework/hardware-configuration.nix | 44 ++++++ 2024-12-rework/nixpkgs-settings.nix | 9 ++ 6 files changed, 293 insertions(+) create mode 100644 2024-12-rework/.gitignore create mode 100644 2024-12-rework/configuration.nix create mode 100644 2024-12-rework/flake.lock create mode 100644 2024-12-rework/flake.nix create mode 100644 2024-12-rework/hardware-configuration.nix create mode 100644 2024-12-rework/nixpkgs-settings.nix diff --git a/2024-12-rework/.gitignore b/2024-12-rework/.gitignore new file mode 100644 index 0000000..e370078 --- /dev/null +++ b/2024-12-rework/.gitignore @@ -0,0 +1,2 @@ +result/ +result diff --git a/2024-12-rework/configuration.nix b/2024-12-rework/configuration.nix new file mode 100644 index 0000000..5d52004 --- /dev/null +++ b/2024-12-rework/configuration.nix @@ -0,0 +1,25 @@ +{ inputs, pkgs, ... }: { + imports = [ + ./hardware-configuration.nix + ]; + + system.stateVersion = "23.05"; + + boot = { + initrd.systemd = { + enable = true; + network.wait-online.enable = false; # Handled by NetworkManager + }; + loader = { + efi.canTouchEfiVariables = true; + systemd-boot= { + enable = true; + consoleMode = "1"; + }; + }; + }; + + environment.systemPackages = with pkgs; [ + olm + ]; +} \ No newline at end of file diff --git a/2024-12-rework/flake.lock b/2024-12-rework/flake.lock new file mode 100644 index 0000000..49ad4fd --- /dev/null +++ b/2024-12-rework/flake.lock @@ -0,0 +1,183 @@ +{ + "nodes": { + "config": { + "locked": { + "dir": "templates/config", + "lastModified": 1719931926, + "narHash": "sha256-B8j9lHX0LqWlZkm8JxZRN6919RQjJEu/1J1SR8pU/ww=", + "owner": "stackbuilders", + "repo": "nixpkgs-terraform", + "rev": "034287ee462c87dadc14a94d4b53a48ed66c7b3d", + "type": "github" + }, + "original": { + "dir": "templates/config", + "owner": "stackbuilders", + "repo": "nixpkgs-terraform", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733050161, + "narHash": "sha256-lYnT+EYE47f5yY3KS/Kd4pJ6CO9fhCqumkYYkQ3TK20=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "62d536255879be574ebfe9b87c4ac194febf47c5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1733120037, + "narHash": "sha256-En+gSoVJ3iQKPDU1FHrR6zIxSLXKjzKY+pnh9tt+Yts=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f9f0d5c5380be0a599b1fb54641fa99af8281539", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-1_0": { + "locked": { + "lastModified": 1699291058, + "narHash": "sha256-5ggduoaAMPHUy4riL+OrlAZE14Kh7JWX4oLEs22ZqfU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "41de143fda10e33be0f47eab2bfe08a50f234267", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "41de143fda10e33be0f47eab2bfe08a50f234267", + "type": "github" + } + }, + "nixpkgs-1_6": { + "locked": { + "lastModified": 1712757991, + "narHash": "sha256-kR7C7Fqt3JP40h0mzmSZeWI5pk1iwqj4CSeGjnUbVHc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "d6b3ddd253c578a7ab98f8011e59990f21dc3932", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "d6b3ddd253c578a7ab98f8011e59990f21dc3932", + "type": "github" + } + }, + "nixpkgs-1_9": { + "locked": { + "lastModified": 1732617236, + "narHash": "sha256-PYkz6U0bSEaEB1al7O1XsqVNeSNS+s3NVclJw7YC43w=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "af51545ec9a44eadf3fe3547610a5cdd882bc34e", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "af51545ec9a44eadf3fe3547610a5cdd882bc34e", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1722555339, + "narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" + } + }, + "nixpkgs-terraform": { + "inputs": { + "config": "config", + "flake-parts": "flake-parts", + "nixpkgs-1_0": "nixpkgs-1_0", + "nixpkgs-1_6": "nixpkgs-1_6", + "nixpkgs-1_9": "nixpkgs-1_9", + "systems": "systems" + }, + "locked": { + "lastModified": 1732844581, + "narHash": "sha256-BwHD1d6Bl5LL/HciTf+mQmBN3I3S6nYqcB+5BXVozNk=", + "owner": "stackbuilders", + "repo": "nixpkgs-terraform", + "rev": "b4db1b59d8f62cd37b6f9540e368d0e2627c4a2d", + "type": "github" + }, + "original": { + "owner": "stackbuilders", + "repo": "nixpkgs-terraform", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "nixpkgs-terraform": "nixpkgs-terraform" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/2024-12-rework/flake.nix b/2024-12-rework/flake.nix new file mode 100644 index 0000000..394abbb --- /dev/null +++ b/2024-12-rework/flake.nix @@ -0,0 +1,30 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + + home-manager = { + url = "github:nix-community/home-manager/release-24.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixpkgs-terraform = { + url = "github:stackbuilders/nixpkgs-terraform"; + # inputs.nixpkgs-1_6.follows = "nixpkgs"; + # inputs.nixpkgs-1_9.follows = "nixpkgs-unstable"; + }; + }; + + outputs = inputs: { + nixosConfigurations = { + rainbow-planet = inputs.nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + system = "x86_64-linux"; + modules = [ + ./configuration.nix + ./nixpkgs-settings.nix + inputs.home-manager.nixosModules.home-manager + ]; + }; + }; + }; +} diff --git a/2024-12-rework/hardware-configuration.nix b/2024-12-rework/hardware-configuration.nix new file mode 100644 index 0000000..d3c51fe --- /dev/null +++ b/2024-12-rework/hardware-configuration.nix @@ -0,0 +1,44 @@ +# 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, 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.kernelParams = [ + "i915.enable_fbc=1" + "i915.enable_psr=2" + ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/eb9a2c7e-ae61-4d06-9464-49b98d576f7c"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/924D-E7A4"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/166d24ca-401c-492e-845d-bb1d0d6d7d86"; } + ]; + + # 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.wlp58s0.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/2024-12-rework/nixpkgs-settings.nix b/2024-12-rework/nixpkgs-settings.nix new file mode 100644 index 0000000..ec86e08 --- /dev/null +++ b/2024-12-rework/nixpkgs-settings.nix @@ -0,0 +1,9 @@ +{ inputs, ... }: { + nixpkgs = { + config = { + allowUnfree = true; + permittedInsecurePackages = [ "olm-3.2.16" "electron-27.3.11" ]; + }; + overlays = [ inputs.nixpkgs-terraform.overlays.default ]; + }; +} \ No newline at end of file