From c88ed8e5edddde79d5a27d09b1b9d914c1e00934 Mon Sep 17 00:00:00 2001 From: HackerNCoder Date: Fri, 20 Sep 2024 14:28:46 +0200 Subject: [PATCH] flakes! --- configuration.nix | 2 +- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 19 +++++++++++++++++++ hardware-configuration.nix | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 hardware-configuration.nix diff --git a/configuration.nix b/configuration.nix index d625ab7..3f2faaf 100644 --- a/configuration.nix +++ b/configuration.nix @@ -7,7 +7,7 @@ { imports = [ # Include the results of the hardware scan. - /etc/nixos/hardware-configuration.nix + ./hardware-configuration.nix ]; # Bootloader. diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8aaa070 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1726447378, + "narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..15a27f3 --- /dev/null +++ b/flake.nix @@ -0,0 +1,19 @@ +{ + description = "A simple NixOS flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + }; + + outputs = { self, nixpkgs, ... }@inputs: { + + nixosConfigurations.ocean-princess = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + # Import old configuration.nix until fully moved to flakes + ./configuration.nix + ]; + }; + + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..7849df5 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,37 @@ +# 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 = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/1f48be0f-3bc7-4aae-bf22-1e99dff778bd"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/46AF-0FD5"; + 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.enp4s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}