diff --git a/flake.nix b/flake.nix index 4cf3735..20f9121 100644 --- a/flake.nix +++ b/flake.nix @@ -35,25 +35,7 @@ } { name = "orpheus"; - value = nixpkgs.lib.nixosSystem { - specialArgs = args; - modules = [ - inputs.nixos-hardware.nixosModules.raspberry-pi-4 - "${nixpkgs}/nixos/modules/profiles/minimal.nix" - ./systems/orpheus.nix - - home-manager.nixosModules.home-manager - { - home-manager = { - useUserPackages = true; - extraSpecialArgs = args; - users.rafiq.imports = [ - ./users/rafiq.nix - ]; - }; - } - ]; - }; + value = mkSystem "orpheus"; } ]; }; @@ -61,19 +43,14 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixos-hardware.url = "github:nixos/nixos-hardware"; - home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; - hyprland.url = "github:hyprwm/Hyprland"; - yazi.url = "github:sxyazi/yazi"; - nvf.url = "github:notashelf/nvf"; nixvim.url = "github:nix-community/nixvim"; nixvim.inputs.nixpkgs.follows = "nixpkgs"; nixd.url = "github:nix-community/nixd"; - stylix.url = "github:danth/stylix"; }; } diff --git a/systems/hw-nemesis.nix b/systems/hw-nemesis.nix index 21a3e4f..b78add1 100644 --- a/systems/hw-nemesis.nix +++ b/systems/hw-nemesis.nix @@ -1,30 +1,34 @@ # 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") - ]; + 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 = [ ]; + 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/e5005ea6-6c5a-4ab3-9767-ce7772582024"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/e5005ea6-6c5a-4ab3-9767-ce7772582024"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/6BBE-0E70"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/6BBE-0E70"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; - swapDevices = [ ]; + 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 diff --git a/systems/modules/bootloaders/extlinux.nix b/systems/modules/bootloaders/extlinux.nix new file mode 100644 index 0000000..ebc62e8 --- /dev/null +++ b/systems/modules/bootloaders/extlinux.nix @@ -0,0 +1,6 @@ +{ + # Use the extlinux boot loader. (NixOS wants to enable GRUB by default) + boot.loader.grub.enable = false; + # Enables the generation of /boot/extlinux/extlinux.conf + boot.loader.generic-extlinux-compatible.enable = true; +} diff --git a/systems/modules/common.nix b/systems/modules/common.nix index 3f60ea7..17fa940 100644 --- a/systems/modules/common.nix +++ b/systems/modules/common.nix @@ -5,12 +5,11 @@ extraGroups = ["networkmanager" "wheel"]; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILv8HqazE294YdyGaXK6q2EniDlTpGaUL071kk9+W0GJ rafiq@nemesis" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICbZfOYt6zydLyO4f9JAsxb1i6kHAjYzqa0SOqef6MKM rafiq@orpheus" ]; }; - security.sudo = { - wheelNeedsPassword = false; - }; + security.sudo.wheelNeedsPassword = false; # Enable basic fonts for reasonable Unicode coverage fonts.enableDefaultPackages = true; diff --git a/systems/modules/fonts/terminess.nix b/systems/modules/fonts/terminess.nix index 88095db..078395b 100644 --- a/systems/modules/fonts/terminess.nix +++ b/systems/modules/fonts/terminess.nix @@ -1,6 +1,10 @@ -{ pkgs, config, ... }: { +{ + pkgs, + config, + ... +}: { fonts.packages = with pkgs; [ - nerd-fonts.terminess-ttf + nerd-fonts.terminess-ttf ]; stylix.fonts = { serif = config.stylix.fonts.monospace; diff --git a/systems/modules/hardware/nvidia.nix b/systems/modules/hardware/nvidia.nix index 9d2a45d..bb5d746 100644 --- a/systems/modules/hardware/nvidia.nix +++ b/systems/modules/hardware/nvidia.nix @@ -1,5 +1,5 @@ -{ pkgs, ... }: { - services.xserver.videoDrivers = [ "nvidia" ]; +{pkgs, ...}: { + services.xserver.videoDrivers = ["nvidia"]; hardware.graphics = { enable = true; extraPackages = with pkgs; [ diff --git a/systems/modules/networking.nix b/systems/modules/networking.nix index 0230138..3fab80b 100644 --- a/systems/modules/networking.nix +++ b/systems/modules/networking.nix @@ -6,17 +6,15 @@ imports = [ ./programs/tailscale.nix ]; - + networking = { - # Enable networkManager - # TODO: Look into the networkManager options. networkmanager.enable = true; # Configures a simple stateful firewall. # By default, it doesn't allow any incoming connections. firewall = { - enable = true; - allowedTCPPorts = [ + enable = true; + allowedTCPPorts = [ 22 # SSH ]; allowedUDPPorts = []; @@ -26,17 +24,16 @@ # Add binary caches to avoid having to compile them nix.settings = { substituters = [ - "https://hyprland.cachix.org" - "https://cuda-maintainers.cachix.org" - "https://nix-community.cachix.org" + "https://hyprland.cachix.org" + "https://cuda-maintainers.cachix.org" + "https://nix-community.cachix.org" ]; trusted-public-keys = [ - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; }; - # TODO: look into openssh and tailscale settings. services.openssh.enable = true; } diff --git a/systems/modules/programs/hyprland.nix b/systems/modules/programs/hyprland.nix index 2bfc526..fec90a8 100644 --- a/systems/modules/programs/hyprland.nix +++ b/systems/modules/programs/hyprland.nix @@ -1,4 +1,8 @@ -{ inputs, pkgs, ... }: { +{ + inputs, + pkgs, + ... +}: { programs.uwsm = { enable = false; }; diff --git a/systems/modules/stylix.nix b/systems/modules/stylix.nix index d091bbc..0036445 100644 --- a/systems/modules/stylix.nix +++ b/systems/modules/stylix.nix @@ -1,5 +1,5 @@ -{ inputs, ... }: { - imports = [ +{inputs, ...}: { + imports = [ inputs.stylix.nixosModules.stylix ./themes/catppuccin.nix ./fonts/terminess.nix diff --git a/systems/modules/themes/catppuccin.nix b/systems/modules/themes/catppuccin.nix index 0184e83..40112fc 100644 --- a/systems/modules/themes/catppuccin.nix +++ b/systems/modules/themes/catppuccin.nix @@ -1,3 +1,3 @@ -{ pkgs, ... }: { +{pkgs, ...}: { stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; } diff --git a/systems/nemesis.nix b/systems/nemesis.nix index 9f04347..f29c440 100644 --- a/systems/nemesis.nix +++ b/systems/nemesis.nix @@ -3,15 +3,13 @@ ./hw-nemesis.nix ./modules/bootloaders/systemd-boot.nix ./modules/common.nix + ./modules/desktop.nix ./modules/hardware/nvidia.nix ./modules/networking.nix - ./modules/desktop.nix ./modules/stylix.nix ]; networking.hostName = "nemesis"; - - boot.binfmt.emulatedSystems = ["wasm32-wasi" "x86_64-windows" "aarch64-linux"]; - system.stateVersion = "24.11"; + boot.binfmt.emulatedSystems = ["wasm32-wasi" "x86_64-windows" "aarch64-linux"]; } diff --git a/systems/orpheus.nix b/systems/orpheus.nix index b0eca32..e6f7140 100644 --- a/systems/orpheus.nix +++ b/systems/orpheus.nix @@ -1,25 +1,14 @@ -{ - config, - lib, - pkgs, - ... -}: { +{inputs, ...}: { imports = [ - # Include the results of the hardware scan. ./hw-orpheus.nix + ./modules/bootloaders/extlinux.nix ./modules/common.nix + ./modules/networking.nix + ./modules/stylix.nix + inputs.nixos-hardware.nixosModules.raspberry-pi-4 + "${inputs.nixpkgs}/nixos/modules/profiles/minimal.nix" ]; - # Use the extlinux boot loader. (NixOS wants to enable GRUB by default) - boot.loader.grub.enable = false; - # Enables the generation of /boot/extlinux/extlinux.conf - boot.loader.generic-extlinux-compatible.enable = true; - - networking.hostName = "orpheus"; # Define your hostname. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - - services.openssh.enable = true; - networking.firewall.enable = false; - + networking.hostName = "orpheus"; system.stateVersion = "25.05"; } diff --git a/users/modules/programs/direnv.nix b/users/modules/programs/direnv.nix index 8726325..4af2e38 100644 --- a/users/modules/programs/direnv.nix +++ b/users/modules/programs/direnv.nix @@ -1,9 +1,9 @@ { - # direnv lets us declare a .envrc in each project directory - # and updates the shell with the packages specified. - programs.direnv = { - enable = true; - enableBashIntegration = true; - nix-direnv.enable = true; - }; + # direnv lets us declare a .envrc in each project directory + # and updates the shell with the packages specified. + programs.direnv = { + enable = true; + enableBashIntegration = true; + nix-direnv.enable = true; + }; } diff --git a/users/modules/programs/font-terminess.nix b/users/modules/programs/font-terminess.nix index 20d7055..a0cafa8 100644 --- a/users/modules/programs/font-terminess.nix +++ b/users/modules/programs/font-terminess.nix @@ -2,10 +2,10 @@ fonts = { fontconfig = { enable = true; - defaultFonts.emoji = [ "Terminess Nerd Font" ]; - defaultFonts.monospace = [ "Terminess Nerd Font Mono" ]; - defaultFonts.sansSerif = [ "Terminess Nerd Font" ]; - defaultFonts.serif = [ "Terminess Nerd Font" ]; + defaultFonts.emoji = ["Terminess Nerd Font"]; + defaultFonts.monospace = ["Terminess Nerd Font Mono"]; + defaultFonts.sansSerif = ["Terminess Nerd Font"]; + defaultFonts.serif = ["Terminess Nerd Font"]; }; }; } diff --git a/users/modules/programs/hyprland.nix b/users/modules/programs/hyprland.nix index cd5085f..bad2477 100644 --- a/users/modules/programs/hyprland.nix +++ b/users/modules/programs/hyprland.nix @@ -1,4 +1,8 @@ -{ config, lib, ... }: { +{ + config, + lib, + ... +}: { home.sessionVariables.NIXOS_OZONE_WL = "1"; wayland.windowManager.hyprland = { enable = true; @@ -6,19 +10,19 @@ portalPackage = null; settings = { env = [ - "XCURSOR_SIZE,32" + "XCURSOR_SIZE,32" - # Nvidia Settings - "LIBVA_DRIVER_NAME,nvidia" - "__GLX_VENDOR_LIBRARY_NAME,nvidia" - "NVD_BACKEND,direct # needed for running vaapi-driver on later drivers" + # Nvidia Settings + "LIBVA_DRIVER_NAME,nvidia" + "__GLX_VENDOR_LIBRARY_NAME,nvidia" + "NVD_BACKEND,direct # needed for running vaapi-driver on later drivers" ]; # Monitors monitor = [ - "HDMI-A-2, 3840x2160@60, 0x0, 2.5" - "DP-4, 1920x1080@60, -1280x0, 1.5" - ", preferred, auto, 1" + "HDMI-A-2, 3840x2160@60, 0x0, 2.5" + "DP-4, 1920x1080@60, -1280x0, 1.5" + ", preferred, auto, 1" ]; # Switching to the current workspace will switch to the previous @@ -27,17 +31,17 @@ # Windows general = { - # Make there be no gaps in between windows or edges - border_size = 5; - gaps_in = 0; - gaps_out = 0; + # Make there be no gaps in between windows or edges + border_size = 5; + gaps_in = 0; + gaps_out = 0; - resize_on_border = true; + resize_on_border = true; }; - + # Programs exec-once = [ - "waybar" + "waybar" ]; # Keybinds @@ -46,32 +50,32 @@ "$browser" = "firefox"; bind = [ - "$mainMod, Q, exec, $terminal" - "$mainMod, W, killactive" - "$mainMod, E, exec, $browser" - "$mainMod, M, exit" + "$mainMod, Q, exec, $terminal" + "$mainMod, W, killactive" + "$mainMod, E, exec, $browser" + "$mainMod, M, exit" - # HJKL to move between windows - "$mainMod, H, cyclenext, visible" - "$mainMod, L, cyclenext, visible prev" + # HJKL to move between windows + "$mainMod, H, cyclenext, visible" + "$mainMod, L, cyclenext, visible prev" - # HJKL to move a window - "$mainMod_ALT, H, movewindow, l" - "$mainMod_ALT, J, movewindow, d" - "$mainMod_ALT, K, movewindow, u" - "$mainMod_ALT, L, movewindow, r" - - # HJKL to resize a window - "ALT_SHIFT, H, resizeactive, -10% 0" - "ALT_SHIFT, J, resizeactive, 0 -10%" - "ALT_SHIFT, K, resizeactive, 0 10%" - "ALT_SHIFT, L, resizeactive, 10% 0" + # HJKL to move a window + "$mainMod_ALT, H, movewindow, l" + "$mainMod_ALT, J, movewindow, d" + "$mainMod_ALT, K, movewindow, u" + "$mainMod_ALT, L, movewindow, r" - # H and L to move between workspaces on the current monitor including creation - "$mainMod_CTRL, H, workspace, r-1" - "$mainMod_CTRL, L, workspace, r+1" + # HJKL to resize a window + "ALT_SHIFT, H, resizeactive, -10% 0" + "ALT_SHIFT, J, resizeactive, 0 -10%" + "ALT_SHIFT, K, resizeactive, 0 10%" + "ALT_SHIFT, L, resizeactive, 10% 0" - "$mainMod, V, togglefloating" + # H and L to move between workspaces on the current monitor including creation + "$mainMod_CTRL, H, workspace, r-1" + "$mainMod_CTRL, L, workspace, r+1" + + "$mainMod, V, togglefloating" ]; bindm = [ @@ -79,8 +83,8 @@ ]; input = { - numlock_by_default = true; - follow_mouse = 2; # Click on a window to change focus + numlock_by_default = true; + follow_mouse = 2; # Click on a window to change focus }; }; }; diff --git a/users/modules/programs/nixvim.nix b/users/modules/programs/nixvim.nix index 4631ee9..42b3df3 100644 --- a/users/modules/programs/nixvim.nix +++ b/users/modules/programs/nixvim.nix @@ -1,6 +1,6 @@ -{ inputs, ... }: { - imports = [ - inputs.nixvim.homeManagerModules.nixvim +{inputs, ...}: { + imports = [ + inputs.nixvim.homeManagerModules.nixvim ./nixvim/conform-nvim.nix # formatter ./nixvim/lualine.nix # custom statusline ./nixvim/noice.nix # custom CMDLINE @@ -45,17 +45,16 @@ }; keymaps = [ - { - # make gf create the file if it doesnt exist - # cd to the working directory to handle relative file paths - key = "gf"; - action = ":cd %:p:h:e "; - options = { - silent = true; - }; - } -]; - + { + # make gf create the file if it doesnt exist + # cd to the working directory to handle relative file paths + key = "gf"; + action = ":cd %:p:h:e "; + options = { + silent = true; + }; + } + ]; clipboard.providers.wl-copy.enable = true; }; diff --git a/users/modules/programs/nixvim/nvim-tree.nix b/users/modules/programs/nixvim/nvim-tree.nix index c2e752e..cef2e14 100644 --- a/users/modules/programs/nixvim/nvim-tree.nix +++ b/users/modules/programs/nixvim/nvim-tree.nix @@ -2,28 +2,28 @@ programs.nixvim = { keymaps = [ { - mode = "n"; - key = "t"; - action = ":NvimTreeToggle"; - options = { - silent = true; - }; + mode = "n"; + key = "t"; + action = ":NvimTreeToggle"; + options = { + silent = true; + }; } ]; plugins = { web-devicons.enable = true; nvim-tree = { - enable = true; - autoClose = true; - disableNetrw = true; - hijackNetrw = true; - hijackCursor = true; - view = { - cursorline = true; - side = "right"; - width = "25%"; - }; + enable = true; + autoClose = true; + disableNetrw = true; + hijackNetrw = true; + hijackCursor = true; + view = { + cursorline = true; + side = "right"; + width = "25%"; + }; }; }; }; diff --git a/users/modules/programs/nvf/nvim-tree.nix b/users/modules/programs/nvf/nvim-tree.nix index 83e060a..84b9d1a 100644 --- a/users/modules/programs/nvf/nvim-tree.nix +++ b/users/modules/programs/nvf/nvim-tree.nix @@ -19,7 +19,10 @@ view = { cursorline = true; side = "right"; - width = { min = "25%"; max = "25%"; }; + width = { + min = "25%"; + max = "25%"; + }; }; }; }; diff --git a/users/modules/programs/tealdeer.nix b/users/modules/programs/tealdeer.nix index b4f7386..7cda930 100644 --- a/users/modules/programs/tealdeer.nix +++ b/users/modules/programs/tealdeer.nix @@ -1,7 +1,7 @@ { - # man page summaries (activate with tldr ) - programs.tealdeer = { - enable = true; - enableAutoUpdates = true; - }; + # man page summaries (activate with tldr ) + programs.tealdeer = { + enable = true; + enableAutoUpdates = true; + }; } diff --git a/users/modules/programs/tmux.nix b/users/modules/programs/tmux.nix index 5b1b9d1..b948a75 100644 --- a/users/modules/programs/tmux.nix +++ b/users/modules/programs/tmux.nix @@ -1,32 +1,32 @@ -{ pkgs, ... }: { - # Terminal Multiplexing - programs.tmux = { - enable = true; - plugins = with pkgs.tmuxPlugins; [ - catppuccin +{pkgs, ...}: { + # Terminal Multiplexing + programs.tmux = { + enable = true; + plugins = with pkgs.tmuxPlugins; [ + catppuccin - # Session Management between Reboots - { - plugin = resurrect; - extraConfig = '' - set -g @resurrect-strategy-nvim 'session' - ''; - } - { - plugin = continuum; - extraConfig = '' - set -g @continuum-restore 'on' - ''; - } - ]; - extraConfig = '' - set -g default-terminal "tmux-256color" - set -ag terminal-overrides ",tmux-256color:RGB" - set -as terminal-features ",tmux-256color:RGB" - - # inherit environment variables from outside so that we can use wl-copy etc - setenv -g WAYLAND_DISPLAY "$WAYLAND_DISPLAY" -setenv -g XDG_RUNTIME_DIR "$XDG_RUNTIME_DIR" - ''; - }; + # Session Management between Reboots + { + plugin = resurrect; + extraConfig = '' + set -g @resurrect-strategy-nvim 'session' + ''; + } + { + plugin = continuum; + extraConfig = '' + set -g @continuum-restore 'on' + ''; + } + ]; + extraConfig = '' + set -g default-terminal "tmux-256color" + set -ag terminal-overrides ",tmux-256color:RGB" + set -as terminal-features ",tmux-256color:RGB" + + # inherit environment variables from outside so that we can use wl-copy etc + setenv -g WAYLAND_DISPLAY "$WAYLAND_DISPLAY" + setenv -g XDG_RUNTIME_DIR "$XDG_RUNTIME_DIR" + ''; + }; } diff --git a/users/modules/programs/waybar.nix b/users/modules/programs/waybar.nix index c8aaca4..90438fa 100644 --- a/users/modules/programs/waybar.nix +++ b/users/modules/programs/waybar.nix @@ -3,7 +3,7 @@ enable = true; settings = { mainBar = { - layer = "top"; + layer = "top"; }; }; style = '' diff --git a/users/modules/programs/yazi.nix b/users/modules/programs/yazi.nix index 7fe2546..f5d7cc4 100644 --- a/users/modules/programs/yazi.nix +++ b/users/modules/programs/yazi.nix @@ -1,4 +1,8 @@ -{ inputs, pkgs, ... }: { +{ + inputs, + pkgs, + ... +}: { programs.yazi = { enable = true; package = inputs.yazi.packages.${pkgs.system}.default; diff --git a/users/modules/scripts/default.nix b/users/modules/scripts/default.nix index b6a0118..94fb9b9 100644 --- a/users/modules/scripts/default.nix +++ b/users/modules/scripts/default.nix @@ -1,12 +1,10 @@ -{ pkgs, ... }: { +{pkgs, ...}: { home.packages = [ (pkgs.writers.writePython3Bin "git-extract" { - libraries = with pkgs.python3Packages; [ magic chardet ]; - } (builtins.readFile ./git-extract.py)) (pkgs.writeShellScriptBin "rebuild" (builtins.readFile ./rebuild.sh)) diff --git a/users/modules/utils.nix b/users/modules/utils.nix index 1907442..89877ac 100644 --- a/users/modules/utils.nix +++ b/users/modules/utils.nix @@ -1,5 +1,4 @@ {pkgs, ...}: { - home.packages = with pkgs; [ fastfetch # system info wl-clipboard # provides cli copy and paste commands diff --git a/users/rafiq.nix b/users/rafiq.nix index f53b80e..a30a46c 100644 --- a/users/rafiq.nix +++ b/users/rafiq.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { imports = [ ./modules/sh.nix ./modules/de.nix