diff --git a/.dotter/global.toml b/.dotter/global.toml index c9cd3bc..544e0e3 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -58,3 +58,4 @@ xmonad = "~/.xmonad" [nix.files] "direnvrc" = "~/.config/direnv/direnvrc" "nix/configuration.nix" = "/etc/nixos/configuration.nix" +"nix/flake.nix" = "/etc/nixos/flake.nix" diff --git a/nix/configuration.nix b/nix/configuration.nix index 2eb6a3d..a215c6d 100644 --- a/nix/configuration.nix +++ b/nix/configuration.nix @@ -6,7 +6,7 @@ { imports = [ # Include the results of the hardware scan. - /etc/nixos/hardware-configuration.nix + ./hardware-configuration.nix ]; # Bootloader. @@ -139,9 +139,9 @@ # Allow unfree packages nixpkgs.config.allowUnfree = true; - nixpkgs.config.packageOverrides = pkgs: { - unstable = import { config = config.nixpkgs.config; }; - }; + # nixpkgs.config.packageOverrides = pkgs: { + # unstable = import { config = config.nixpkgs.config; }; + # }; environment.etc."manual-links/xfce4-notifyd".source = "${pkgs.xfce.xfce4-notifyd}/lib/xfce4/notifyd/xfce4-notifyd"; diff --git a/nix/flake.lock b/nix/flake.lock new file mode 100644 index 0000000..e96e29d --- /dev/null +++ b/nix/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1678872516, + "narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-22.11", + "type": "indirect" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1678898370, + "narHash": "sha256-xTICr1j+uat5hk9FyuPOFGxpWHdJRibwZC+ATi0RbtE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ac718d02867a84b42522a0ece52d841188208f2c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nix/flake.nix b/nix/flake.nix new file mode 100644 index 0000000..d3ee225 --- /dev/null +++ b/nix/flake.nix @@ -0,0 +1,29 @@ + { + inputs.nixpkgs.url = "nixpkgs/nixos-22.11"; + inputs.nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; + + # inputs.home-manager.url = "github:nix-community/home-manager"; + + outputs = { self, nixpkgs, nixpkgs-unstable, ... }@attrs: + let + system = "x86_64-linux"; + overlay-unstable = final: prev: { + unstable = nixpkgs-unstable.legacyPackages.${prev.system}; + # use this variant if unfree packages are needed: + # unstable = import nixpkgs-unstable { + # inherit system; + # config.allowUnfree = true; + # }; + }; + in { + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = attrs; + modules = [ + # Overlays-module makes "pkgs.unstable" available in configuration.nix + ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) + ./configuration.nix + ]; + }; + }; + } diff --git a/nix/hardware-configuration.nix b/nix/hardware-configuration.nix new file mode 100644 index 0000000..ffe2985 --- /dev/null +++ b/nix/hardware-configuration.nix @@ -0,0 +1,42 @@ +# 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 = [ "ehci_pci" "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/7469546c-44d6-44a7-aecd-28aae51c84ca"; + fsType = "ext4"; + }; + + fileSystems."/boot/efi" = + { device = "/dev/disk/by-uuid/5A58-A8EB"; + fsType = "vfat"; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/232d00ae-a844-4b59-97e9-d7248ff179a4"; + fsType = "btrfs"; + }; + + swapDevices = [ { device = "/swapfile"; } ]; + + # 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.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}