diff --git a/.github/workflows/neovim-lua.yml b/.github/workflows/neovim-lua.yml new file mode 100644 index 0000000..6b0af90 --- /dev/null +++ b/.github/workflows/neovim-lua.yml @@ -0,0 +1,19 @@ +name: Neovim checks +on: + push: + paths: + - 'nvim/**' + pull_request: + paths: + - 'nvim/**' +jobs: + stylua: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: JohnnyMorganz/stylua-action@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: latest + args: --check . + diff --git a/.github/workflows/nixos.yml b/.github/workflows/nixos.yml new file mode 100644 index 0000000..f7dbc3c --- /dev/null +++ b/.github/workflows/nixos.yml @@ -0,0 +1,20 @@ +name: NixOS checks +on: + push: + paths: + - 'nixos/**' + pull_request: + paths: + - 'nixos/**' +jobs: + nix: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: cachix/install-nix-action@v31 + with: + nix_path: nixpkgs=channel:nixos-25.11 + - name: nixfmt + run: nix-shell -p nixfmt-tree --command "treefmt --ci nixos" + - name: nix build + run: nix-build '' -I nixos-config=./nixos/configuration.nix --dry-run diff --git a/.gitignore b/.gitignore index 1093752..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +0,0 @@ -nixos/hardware-configuration.nix diff --git a/nixos/configuration.nix b/nixos/configuration.nix index a544447..a204749 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -5,7 +5,8 @@ { config, pkgs, ... }: { - imports = [ # Include the results of the hardware scan. + imports = [ + # Include the results of the hardware scan. ./hardware-configuration.nix # ./network-booting.nix ]; @@ -53,7 +54,10 @@ users.users.dawson = { isNormalUser = true; description = "Dawson Coleman"; - extraGroups = [ "networkmanager" "wheel" ]; + extraGroups = [ + "networkmanager" + "wheel" + ]; packages = with pkgs; [ ]; }; @@ -150,7 +154,9 @@ enable = true; withUWSM = true; }; - hyprlock = { enable = true; }; + hyprlock = { + enable = true; + }; _1password.enable = true; _1password-gui = { enable = true; @@ -165,7 +171,11 @@ }; git = { enable = true; - config = { pull = { ff = "only"; }; }; + config = { + pull = { + ff = "only"; + }; + }; }; steam.enable = true; nix-ld.enable = true; @@ -179,24 +189,32 @@ obs-vkcapture ]; }; - appimage = { enable = true; }; + appimage = { + enable = true; + }; }; - fonts.packages = with pkgs; [ geist-font monaspace font-awesome ]; + fonts.packages = with pkgs; [ + geist-font + monaspace + font-awesome + ]; xdg.portal.xdgOpenUsePortal = true; # Dark mode programs.dconf = { enable = true; - profiles.user.databases = [{ - settings = { - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - gtk-theme = "Adwaita-dark"; + profiles.user.databases = [ + { + settings = { + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + gtk-theme = "Adwaita-dark"; + }; }; - }; - }]; + } + ]; }; security.rtkit.enable = true; @@ -212,7 +230,9 @@ }; services.blueman.enable = true; - services.hypridle = { enable = true; }; + services.hypridle = { + enable = true; + }; # services.greetd = { # enable = true; @@ -230,7 +250,9 @@ automatic = true; options = "--delete-older-than +5"; }; - nix.settings = { experimental-features = [ "nix-command" ]; }; + nix.settings = { + experimental-features = [ "nix-command" ]; + }; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 0000000..d46c0d8 --- /dev/null +++ b/nixos/hardware-configuration.nix @@ -0,0 +1,57 @@ +# 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" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/85e3d557-021b-4669-ab56-e4a6fe7f1978"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/6A92-828C"; + 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.enp5s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + hardware.amdgpu.opencl.enable = true; +} diff --git a/nixos/netboot-gaming.nix b/nixos/netboot-gaming.nix index 7ac7321..49089f4 100644 --- a/nixos/netboot-gaming.nix +++ b/nixos/netboot-gaming.nix @@ -1,4 +1,9 @@ -{ pkgs, modulesPath, lib, ... }: +{ + pkgs, + modulesPath, + lib, + ... +}: { imports = [ @@ -32,7 +37,11 @@ fsType = "ext4"; }; - environment.systemPackages = with pkgs; [ neovim htop fastfetch ]; + environment.systemPackages = with pkgs; [ + neovim + htop + fastfetch + ]; # TODO fix issue with steam library? xdg.portal = { diff --git a/nixos/netboot.nix b/nixos/netboot.nix index 614d58f..54b5fca 100644 --- a/nixos/netboot.nix +++ b/nixos/netboot.nix @@ -1,4 +1,9 @@ -{ pkgs, modulesPath, lib, ... }: +{ + pkgs, + modulesPath, + lib, + ... +}: { imports = [ @@ -10,15 +15,15 @@ networking.hostName = "client-node"; console = { - packages = [pkgs.terminus_font]; - font = "ter-v32b"; + packages = [ pkgs.terminus_font ]; + font = "ter-v32b"; }; - + # Add your custom packages - environment.systemPackages = with pkgs; [ - git - neovim - htop + environment.systemPackages = with pkgs; [ + git + neovim + htop fastfetch ]; @@ -34,5 +39,5 @@ services.getty.autologinUser = lib.mkForce "root"; # This is required for NixOS configurations - system.stateVersion = "25.11"; + system.stateVersion = "25.11"; } diff --git a/nixos/network-booting.nix b/nixos/network-booting.nix index 79e4a98..234b5b5 100644 --- a/nixos/network-booting.nix +++ b/nixos/network-booting.nix @@ -1,48 +1,48 @@ let - # nixKernel = builtins.fetchurl { - # url = "https://github.com/nix-community/nixos-images/releases/download/nixos-25.11/bzImage-x86_64-linux"; - # }; - # nixInitrd = builtins.fetchurl { - # url = "https://github.com/nix-community/nixos-images/releases/download/nixos-25.11/initrd-x86_64-linux"; - # }; + # nixKernel = builtins.fetchurl { + # url = "https://github.com/nix-community/nixos-images/releases/download/nixos-25.11/bzImage-x86_64-linux"; + # }; + # nixInitrd = builtins.fetchurl { + # url = "https://github.com/nix-community/nixos-images/releases/download/nixos-25.11/initrd-x86_64-linux"; + # }; - pkgs = import {}; - - clientSystem = import { -# configuration = ./netboot.nix; - configuration = ./netboot-gaming.nix; - }; - - build = clientSystem.config.system.build; + pkgs = import { }; + + clientSystem = import { + # configuration = ./netboot.nix; + configuration = ./netboot-gaming.nix; + }; + + build = clientSystem.config.system.build; in { - services.pixiecore = { - enable = true; - mode = "boot"; - #mode = "quick"; - #quick = "debian"; - #extraArguments = ["stable"]; - openFirewall = true; - dhcpNoBind = true; - # kernel = nixKernel; - # initrd = nixInitrd; - # cmdLine = "init=/init root=/dev/ram0 boot.shell_on_fail"; - kernel = "${build.kernel}/bzImage"; - initrd = "${build.netbootRamdisk}/initrd"; - cmdLine = "init=${build.toplevel}/init loglevel=4"; - }; - - services.nfs.server = { - enable = true; - exports = '' - /srv/nfs/gaming 192.168.1.0/24(rw) - /srv/nfs/home 192.168.1.0/24(rw) - ''; - }; - networking.firewall.allowedTCPPorts = [ 2049 ]; - systemd.tmpfiles.rules = [ - "d /srv/nfs 0755 root root -" - "d /srv/nfs/gaming 0775 root users -" - "d /srv/nfs/home 0775 root users -" - ]; + services.pixiecore = { + enable = true; + mode = "boot"; + #mode = "quick"; + #quick = "debian"; + #extraArguments = ["stable"]; + openFirewall = true; + dhcpNoBind = true; + # kernel = nixKernel; + # initrd = nixInitrd; + # cmdLine = "init=/init root=/dev/ram0 boot.shell_on_fail"; + kernel = "${build.kernel}/bzImage"; + initrd = "${build.netbootRamdisk}/initrd"; + cmdLine = "init=${build.toplevel}/init loglevel=4"; + }; + + services.nfs.server = { + enable = true; + exports = '' + /srv/nfs/gaming 192.168.1.0/24(rw) + /srv/nfs/home 192.168.1.0/24(rw) + ''; + }; + networking.firewall.allowedTCPPorts = [ 2049 ]; + systemd.tmpfiles.rules = [ + "d /srv/nfs 0755 root root -" + "d /srv/nfs/gaming 0775 root users -" + "d /srv/nfs/home 0775 root users -" + ]; } diff --git a/nvim/lua/statusline.lua b/nvim/lua/statusline.lua index 81a403a..2512294 100644 --- a/nvim/lua/statusline.lua +++ b/nvim/lua/statusline.lua @@ -36,4 +36,4 @@ function ModeName() end vim.opt.statusline = -"%#TermCursor# %{%luaeval('ModeName()')%} %#StatusLine# %f %m%r%h%w%q %= %#TermCursor# %l/%L (%c) %y " + "%#TermCursor# %{%luaeval('ModeName()')%} %#StatusLine# %f %m%r%h%w%q %= %#TermCursor# %l/%L (%c) %y "