From 359a59476d075a2815f3b53046e28c4e8784e14c Mon Sep 17 00:00:00 2001 From: macronova Date: Thu, 19 Dec 2024 20:42:14 -0800 Subject: [PATCH] Update flake --- common/default.nix | 1 + common/nix.nix | 22 ++++++++++++++++++++ flake.lock | 24 +++++++++++----------- flake.nix | 27 ++----------------------- linux/quasar/hardware-configuration.nix | 11 +--------- 5 files changed, 38 insertions(+), 47 deletions(-) create mode 100644 common/nix.nix diff --git a/common/default.nix b/common/default.nix index d331642..22b8b35 100644 --- a/common/default.nix +++ b/common/default.nix @@ -5,6 +5,7 @@ ./constants.nix ./secrets.nix ./users.nix + ./nix.nix ]; home-manager.sharedModules = [inputs.plasma-manager.homeManagerModules.plasma-manager]; diff --git a/common/nix.nix b/common/nix.nix new file mode 100644 index 0000000..496c3e4 --- /dev/null +++ b/common/nix.nix @@ -0,0 +1,22 @@ +{config, ...}: { + nix = { + gc = { + automatic = true; + options = "--delete-older-than 30d"; + }; + settings = { + auto-optimise-store = true; + experimental-features = ["nix-command" "flakes"]; + trusted-users = [config.constants.userName]; + }; + }; + nixpkgs = { + config.allowUnfree = true; + config.permittedInsecurePackages = [ + "aspnetcore-runtime-6.0.36" + "aspnetcore-runtime-wrapped-6.0.36" + "dotnet-sdk-6.0.428" + "dotnet-sdk-wrapped-6.0.428" + ]; + }; +} diff --git a/flake.lock b/flake.lock index 3e19637..fa88ad9 100644 --- a/flake.lock +++ b/flake.lock @@ -159,11 +159,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1734344598, - "narHash": "sha256-wNX3hsScqDdqKWOO87wETUEi7a/QlPVgpC/Lh5rFOuA=", + "lastModified": 1734622215, + "narHash": "sha256-OOfI0XhSJGHblfdNDhfnn8QnZxng63rWk9eeJ2tCbiI=", "owner": "nix-community", "repo": "home-manager", - "rev": "83ecd50915a09dca928971139d3a102377a8d242", + "rev": "1395379a7a36e40f2a76e7b9936cc52950baa1be", "type": "github" }, "original": { @@ -199,11 +199,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1734162608, - "narHash": "sha256-m2AX+3eiVqIK6uO7GbGY7SFnkkYOlR5fQiNI0eRvWOQ=", + "lastModified": 1734591594, + "narHash": "sha256-7Q4hXE+b9A4DebZ5Q+q3WStuMiWR5bMW0ltpzbY/zMQ=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "31bdf4c7c91204d65afbde01146deee0259a8fb7", + "rev": "ce2abe494524cdb389a5d31c11c41834d4362ac5", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1734119587, - "narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=", + "lastModified": 1734424634, + "narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5", + "rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33", "type": "github" }, "original": { @@ -516,11 +516,11 @@ "nixpkgs": "nixpkgs_9" }, "locked": { - "lastModified": 1733965552, - "narHash": "sha256-GZ4YtqkfyTjJFVCub5yAFWsHknG1nS/zfk7MuHht4Fs=", + "lastModified": 1734546875, + "narHash": "sha256-6OvJbqQ6qPpNw3CA+W8Myo5aaLhIJY/nNFDk3zMXLfM=", "owner": "Mic92", "repo": "sops-nix", - "rev": "2d73fc6ac4eba4b9a83d3cb8275096fbb7ab4004", + "rev": "ed091321f4dd88afc28b5b4456e0a15bd8374b4d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 4771830..1bf4d53 100644 --- a/flake.nix +++ b/flake.nix @@ -34,33 +34,10 @@ modules = [ # Import config from folder (linuxCfgDir + "/${instance}") - # Setup Nix + # Common setups ({pkgs, ...}: { networking.hostName = instance; - nix = { - gc = { - automatic = true; - options = "--delete-older-than 30d"; - }; - settings = { - auto-optimise-store = true; - experimental-features = ["nix-command" "flakes"]; - trusted-substituters = ["https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"]; - }; - }; - nixpkgs = { - config.allowUnfree = true; - - # TODO: Remove this when possible - config.permittedInsecurePackages = [ - "aspnetcore-runtime-6.0.36" - "aspnetcore-runtime-wrapped-6.0.36" - "dotnet-sdk-6.0.428" - "dotnet-sdk-wrapped-6.0.428" - ]; - - overlays = [nix-custom.overlays.default]; - }; + nixpkgs.overlays = [nix-custom.overlays.default]; }) ]; specialArgs = {inherit inputs;}; diff --git a/linux/quasar/hardware-configuration.nix b/linux/quasar/hardware-configuration.nix index d0dca6a..0c3be14 100644 --- a/linux/quasar/hardware-configuration.nix +++ b/linux/quasar/hardware-configuration.nix @@ -13,20 +13,11 @@ ]; boot = { - extraModulePackages = [config.boot.kernelPackages.it87]; - extraModprobeConfig = "options it87 force_id=0x8628"; initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "uas" "usbhid" "sd_mod"]; - kernelModules = ["coretemp" "kvm-amd" "it87"]; - kernelParams = ["acpi_enforce_resources=lax"]; + kernelModules = ["coretemp" "kvm-amd"]; }; - # 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.enp10s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp9s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;