From 18debedc0f2ad943b25a68e97e06f684f0b17cad Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Wed, 16 Oct 2024 23:51:31 +0200 Subject: [PATCH] Working configuration --- tongfang/.bash_aliases | 2 +- tongfang/flake.nix | 3 -- tongfang/{ => nixos}/configuration.nix | 16 +++++----- tongfang/nixos/hardware-configuration.nix | 38 +++++++++++++++++++++++ 4 files changed, 48 insertions(+), 11 deletions(-) delete mode 100644 tongfang/flake.nix rename tongfang/{ => nixos}/configuration.nix (83%) create mode 100644 tongfang/nixos/hardware-configuration.nix diff --git a/tongfang/.bash_aliases b/tongfang/.bash_aliases index b262e8a..de98074 100644 --- a/tongfang/.bash_aliases +++ b/tongfang/.bash_aliases @@ -1,3 +1,3 @@ alias ll='ls -la' alias lt='ls --human-readable --size -1 -S --classify' -alias nrebuild="nixos-rebuild --flake ~/ --override-input nixpkgs ~/nixpkgs --use-remote-sudo switch" +alias nrebuild="nixos-rebuild -I /etc/nixos/configuration.nix --flake /etc/nixos/flake.nix --use-remote-sudo switch" diff --git a/tongfang/flake.nix b/tongfang/flake.nix deleted file mode 100644 index 01718e9..0000000 --- a/tongfang/flake.nix +++ /dev/null @@ -1,3 +0,0 @@ -inputs = { - zen-browser.url = "github:MarceColl/zen-browser-flake"; -} diff --git a/tongfang/configuration.nix b/tongfang/nixos/configuration.nix similarity index 83% rename from tongfang/configuration.nix rename to tongfang/nixos/configuration.nix index daa00d5..e164ce0 100644 --- a/tongfang/configuration.nix +++ b/tongfang/nixos/configuration.nix @@ -2,7 +2,7 @@ { imports = [ - /etc/nixos/hardware-configuration.nix + ./hardware-configuration.nix ]; boot.loader.systemd-boot.enable = true; @@ -29,6 +29,7 @@ services.xserver.enable = false; services.displayManager.sddm.enable = true; + services.displayManager.sddm.wayland.enable = true; services.desktopManager.plasma6.enable = true; services.xserver.xkb = { @@ -48,7 +49,9 @@ pulse.enable = true; }; - services.xserver.libinput.enable = true; + services.libinput.enable = true; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; users.users.bart = { isNormalUser = true; @@ -56,20 +59,19 @@ extraGroups = [ "networkmanager" "wheel" ]; packages = with pkgs; [ kdePackages.kate - codium + vscodium-fhs git thunderbird fastfetch ]; }; - nixpkgs.config.allowUnfree = true; environment.systemPackages = with pkgs; [ - inputs.zen-browser.packages."${system}".specific - nvim + vim wget ]; + environment.variables.EDITOR = "vim"; - system.stateVersion = "24.05"; # Did you read the comment? + system.stateVersion = "24.05"; } diff --git a/tongfang/nixos/hardware-configuration.nix b/tongfang/nixos/hardware-configuration.nix new file mode 100644 index 0000000..f10dad2 --- /dev/null +++ b/tongfang/nixos/hardware-configuration.nix @@ -0,0 +1,38 @@ +# 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" "thunderbolt" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/c7cf28c3-5744-45cc-8a81-456d24e44b7a"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/CEF6-7DAA"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + 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.wlp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}