From de96d883c3ac34f560ac891f3751d105ad5c1338 Mon Sep 17 00:00:00 2001 From: meml0rz Date: Sun, 10 Nov 2024 15:27:02 +0100 Subject: [PATCH] add nvim --- configuration.nix | 40 ++++++++++++++++++++------------------ flake.lock | 18 ++++++++++++++++- flake.nix | 12 ++++++++++-- hardware-configuration.nix | 14 ++++++------- modules/home.nix | 8 ++------ modules/nix/nvim.nix | 9 +++++++++ modules/nix/sway.nix | 2 +- 7 files changed, 66 insertions(+), 37 deletions(-) create mode 100644 modules/nix/nvim.nix diff --git a/configuration.nix b/configuration.nix index cc91110..7e9fee5 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, pkgs-stable,... }: let home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; in @@ -14,15 +14,6 @@ in nix.settings.experimental-features = [ "nix-command" "flakes" ]; boot.loader.systemd-boot.enable = true; - #boot.loader = { - # grub = { - # enable = true; - # useOSProber = true; - # device = "nodev"; - # efiSupport = true; - # }; - #}; - networking.hostName = "poggers"; networking.networkmanager.enable = true; @@ -54,8 +45,8 @@ in bluetooth = { enable = true; }; - graphics = { - enable = true; + opengl = { + enable = true; }; rtl-sdr = { enable = true; @@ -78,7 +69,8 @@ in extraGroups = [ "wheel" "docker" "audio" "video" "dialout" "plugdev" ]; }; - environment.systemPackages = with pkgs; [ + environment.systemPackages = + (with pkgs; [ # sys unzip yt-dlp @@ -88,12 +80,12 @@ in curl dosfstools ntfs3g - + waybar + # cli neofetch fastfetch onefetch - neovim vim weechat ranger @@ -127,11 +119,21 @@ in libimobiledevice usbmuxd pulseaudio + + ]) + ++ + (with pkgs-stable; [ + wezterm + ]); + + - ]; - - networking.firewall.allowedTCPPorts = [ 80 1337 8080 ]; - networking.firewall.enable = false; + networking = { + firewall = { + enable = true; + allowedTCPPorts = [ 80 1337 8080 ]; + }; + }; security = { doas = { diff --git a/flake.lock b/flake.lock index e7ab21c..3356e33 100644 --- a/flake.lock +++ b/flake.lock @@ -15,9 +15,25 @@ "type": "indirect" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1730963269, + "narHash": "sha256-rz30HrFYCHiWEBCKHMffHbMdWJ35hEkcRVU0h7ms3x0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "83fb6c028368e465cd19bb127b86f971a5e41ebc", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-24.05", + "type": "indirect" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable" } } }, diff --git a/flake.nix b/flake.nix index fcec9f4..16c98ef 100644 --- a/flake.nix +++ b/flake.nix @@ -1,18 +1,26 @@ { - description = "My first flake!"; + description = "My NixOS Configuration"; inputs = { + nixpkgs-stable.url = "nixpkgs/nixos-24.05"; nixpkgs.url = "nixpkgs/nixos-unstable"; }; - outputs = { self, nixpkgs, ... }: + outputs = { self, nixpkgs, nixpkgs-stable, ... }: let + system = "x86_64-linux"; lib = nixpkgs.lib; + pkgs = nixpkgs.legacyPackages.${system}; + pkgs-stable = nixpkgs-stable.legacyPackages.${system}; + in { nixosConfigurations = { default = lib.nixosSystem { system = "x86_64-linux"; modules = [ ./configuration.nix ]; + specialArgs = { + inherit pkgs-stable; + }; }; }; }; diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 1b15fd5..8083356 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -8,18 +8,18 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; + boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-label/NIXROOT"; + { device = "/dev/disk/by-uuid/0869359e-4c7e-4410-aab0-55bc72a45e0b"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-label/ESP"; + { device = "/dev/disk/by-uuid/7C74-E1AE"; fsType = "vfat"; options = [ "fmask=0022" "dmask=0022" ]; }; @@ -31,10 +31,8 @@ # 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.enp0s31f6.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wwp0s20f0u3i12.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; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/modules/home.nix b/modules/home.nix index d002d5e..5595449 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -4,15 +4,11 @@ [ ./nix/sway.nix ./nix/user.nix - ]; + ./nix/nvim.nix + ]; home.enableNixpkgsReleaseCheck = false; home.stateVersion = "24.05"; - - home.packages = with pkgs; [ - waybar - - ]; home.file = { # WEZTERM diff --git a/modules/nix/nvim.nix b/modules/nix/nvim.nix new file mode 100644 index 0000000..cd0b803 --- /dev/null +++ b/modules/nix/nvim.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: +{ + programs.neovim = { + enable = true; + plugins = with pkgs.vimPlugins; [ + vimsence + ] + }; +} diff --git a/modules/nix/sway.nix b/modules/nix/sway.nix index 1ce936a..66e79ae 100644 --- a/modules/nix/sway.nix +++ b/modules/nix/sway.nix @@ -11,7 +11,7 @@ config = rec { modifier = "Mod4"; - terminal = "${pkgs.wezterm}/bin/wezterm"; + terminal = "wezterm"; menu = "${pkgs.rofi}/bin/rofi -show drun -c .config/rofi/config.rasi"; startup = [ {command = "${pkgs.swaybg}/bin/swaybg -i $HOME/.wp/skull_purple.png";}