commit 3272868b58cfc877427ceb583cd5657923a2dc92 Author: Alfie King Date: Tue Dec 30 03:07:28 2025 +0000 Initial commit of NixOS configuration diff --git a/components/default.nix b/components/default.nix new file mode 100644 index 0000000..c3dca7b --- /dev/null +++ b/components/default.nix @@ -0,0 +1,7 @@ +{lib, ...}: { + imports = [ + ./hyprland + ./utils.nix + ./waybar.nix + ]; +} \ No newline at end of file diff --git a/components/hyprland/default.nix b/components/hyprland/default.nix new file mode 100644 index 0000000..3e2f952 --- /dev/null +++ b/components/hyprland/default.nix @@ -0,0 +1,8 @@ +{lib, ...}: { + imports = [ + ./hyprland.nix + ./hypridle.nix + ./hyprlock.nix + ./hyprpaper.nix + ]; +} \ No newline at end of file diff --git a/components/hyprland/hypridle.nix b/components/hyprland/hypridle.nix new file mode 100644 index 0000000..8dcd932 --- /dev/null +++ b/components/hyprland/hypridle.nix @@ -0,0 +1,8 @@ +{pkgs, ...}: { + services.hypridle = { + enable = true; + settings = { + before_sleep_cmd = "hyprlock"; + }; + }; +} \ No newline at end of file diff --git a/components/hyprland/hyprland.nix b/components/hyprland/hyprland.nix new file mode 100644 index 0000000..8bf533a --- /dev/null +++ b/components/hyprland/hyprland.nix @@ -0,0 +1,163 @@ +{ + lib, + config, + pkgs, + ... +}: let + cfg=config.hyprland; +in { + options = { + hyprland = { + primaryModifier = lib.mkOption { + type = lib.types.str; + default = "SUPER"; + }; + secondaryModifier = lib.mkOption { + type = lib.types.str; + default = "Control_L"; + }; + terminal = lib.mkOption { + type = lib.types.str; + default = "kitty"; + }; + fileManager = lib.mkOption { + type = lib.types.str; + default = "dolphin"; + }; + }; + }; + config = { + wayland.windowManager.hyprland = { + enable = true; + settings = { + monitor = [ + "eDP-1, 2256x1504@60, 0x0, 1" + "desc:HAT Kamvas 12 l56051794302, 1920x1080@60, 0x1504, 1" + ]; + + "$mod1" = cfg.primaryModifier; + "$mod2" = cfg.secondaryModifier; + + exec-once = [ + "waybar" + "hyprpaper" + "nm-applet" + "hypridle" + "wl-paste --watch cliphist store" + "XDG_MENU_PREFIX=arch- kbuildsycoca6" + ]; + + env = [ + "XCURSOR_SIZE,24" + "HYPRCURSOR_SIZE,24" + "XDG_SESSION_TYPE,wayland" + "QT_QPA_PLATFORMTHEME,qt6ct" + "QT_QPA_PLATFORM,wayland" + "GTK_THEME, Adwaita:dark" + "XDG_MENU_PREFIX,plasma-" + ]; + + misc = { + force_default_wallpaper = 1; + }; + + general = { + gaps_in = 5; + gaps_out = 10; + border_size = 2; + "col.active_border" = "rgba(463155ff)"; + "col.inactive_border" = "rgba(251b31aa)"; + resize_on_border = false; + allow_tearing = false; + layout = "dwindle"; + }; + + decoration = { + rounding = 12; + rounding_power = 2; + active_opacity = 1.0; + inactive_opacity = 0.95; + + shadow = { + enabled = true; + range = 4; + render_power = 3; + color = "rgba(1a1a1aee)"; + }; + + blur = { + enabled = true; + size = 5; + passes = 2; + noise = 0.06; + new_optimizations = true; + vibrancy = 0.1696; + }; + }; + + input = { + kb_layout = "gb"; + follow_mouse = 1; + sensitivity = 0; + touchpad = { + natural_scroll = true; + }; + + gesture = [ + "3, horizontal, workspace" + ]; + + bind = [ + "$mod1, Q, exec, ${cfg.terminal}" + "$mod2&Shift_L, Q, killactive" + "$mod2&alt, Q, forcekillactive" + "$mod1, L, exec, hyprlock" + "$mod1&alt, L, exit" + "$mod1, F, exec, ${cfg.fileManager}" + "$mod1&Shift_L, V, togglefloating" + "$mod1, R, exec, rofi -show run" + "alt, space, exec, rofi -show drun" + "$mod1, P, pseudo, " + "$mod1, J, togglesplit, " + "$mod2&Shift_L, F, fullscreen" + "$mod1, left, movefocus, l" + "$mod1, right, movefocus, r" + "$mod1, up, movefocus, u" + "$mod1, down, movefocus, d" + "$mod1&$mod2, right, workspace, +1" + "$mod1&$mod2, left, workspace, -1" + "$mod1&$mod2&Shift_L, right, movetoworkspace, +1" + "$mod1&$mod2&Shift_L, left, movetoworkspace, -1" + "$mod1, mouse_down, workspace, e+1" + "$mod1, mouse_up, workspace, e-1" + ", PRINT, exec, hyprshot -m region --clipboard-only" + "Shift_L, PRINT, exec, hyprshot -m region" + "$mod1, T, exec, hyprctl setprop active opaque toggle" + "$mod1, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy" + ]; + + bindm = [ + "$mod1, mouse:272, movewindow" + "$mod1, mouse:273, resizewindow" + ]; + + bindel = [ + ",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" + ",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ",XF86MonBrightnessUp, exec, brightnessctl s 10%+" + ",XF86MonBrightnessDown, exec, brightnessctl s 10%-" + ]; + + bindl = [ + ", XF86AudioNext, exec, playerctl next" + ", XF86AudioPause, exec, playerctl play-pause" + ", XF86AudioPlay, exec, playerctl play-pause" + ", XF86AudioPrev, exec, playerctl previous" + ", switch:Lid Switch, exec, hyprlock" + ]; + }; + }; + }; + }; +} diff --git a/components/hyprland/hyprlock.nix b/components/hyprland/hyprlock.nix new file mode 100644 index 0000000..bbff4bd --- /dev/null +++ b/components/hyprland/hyprlock.nix @@ -0,0 +1,67 @@ +{pkgs, ...}: { + programs.hyprlock = { + enable = true; + settings = { + background = { + path = "~/.nixos/components/hyprland/wallpaper.png"; + blur_passes = 2; + contrast = 1; + brightness = 0.5; + vibrancy = 0.2; + vibrancy_darkness = 0.2; + }; + + general = { + no_fade_in = true; + no_fade_out = true; + hide_cursor = false; + grace = 0; + disable_loading_bar = true; + }; + + input-field = { + size = "250, 60"; + outline_thickness = 2; + dots_size = 0.2; + dots_spacing = 0.35; + dots_center = true; + outer_color = "rgba(0, 0, 0, 0)"; + inner_color = "rgba(0, 0, 0, 0.2)"; + font_color = "rgba(142, 243, 244, 0.75)"; + fade_on_empty = false; + rounding = -1; + check_color = "rgb(204, 136, 34)"; + placeholder_text = ''Input Password...''; + hide_input = false; + position = "0, -200"; + halign = "center"; + valign = "center"; + }; + + label = [ + { + text = ''cmd[update:1000] echo "$(date +"%-I:%M")"''; + color = "rgba(242, 243, 244, 0.75)"; + font_size = 95; + font_familly = "JetBrains Mono Extrabold"; + position = "0, 200"; + halign = "center"; + valign = "center"; + } + { + text = ''cmd[update:1000] echo "$(date +"%A, %B %d")"''; + color = "rgba(242, 243, 244, 0.75)"; + font_size = 22; + font_familly = "JetBrains Mono"; + position = "0, 300"; + halign = "center"; + valign = "center"; + } + ]; + + auth = { + "fingerprint:enabled" = true; + }; + }; + }; +} \ No newline at end of file diff --git a/components/hyprland/hyprpaper.nix b/components/hyprland/hyprpaper.nix new file mode 100644 index 0000000..220f387 --- /dev/null +++ b/components/hyprland/hyprpaper.nix @@ -0,0 +1,13 @@ +{pkgs, ...}: { + services.hyprpaper = { + enable = true; + settings = { + preload = [ + "~/.nixos/components/hyprland/wallpaper.png" + ]; + wallpaper = [ + ", ~/.nixos/components/hyprland/wallpaper.png" + ]; + }; + }; +} \ No newline at end of file diff --git a/components/hyprland/wallpaper.png b/components/hyprland/wallpaper.png new file mode 100644 index 0000000..04642a3 Binary files /dev/null and b/components/hyprland/wallpaper.png differ diff --git a/components/utils.nix b/components/utils.nix new file mode 100644 index 0000000..6471dad --- /dev/null +++ b/components/utils.nix @@ -0,0 +1,25 @@ +{pkgs, ...}: { + programs.rofi = { + enable = true; + package = pkgs.rofi.override { + plugins = with pkgs; [ + rofi-calc + ]; + }; + extraConfig = { + modi = "drun,calc,run"; + show-icons = true; + drun-display-format = "{icon} {name}"; + disable-history = false; + hide-scrollbar = true; + }; + }; + + home.packages = with pkgs; [ + hyprshot + wl-clipboard + networkmanagerapplet + ]; + + services.hyprpolkitagent.enable = true; +} \ No newline at end of file diff --git a/components/waybar.nix b/components/waybar.nix new file mode 100644 index 0000000..9ea586e --- /dev/null +++ b/components/waybar.nix @@ -0,0 +1,134 @@ +{pkgs, ...}: { + programs.waybar = { + enable = true; + settings = { + mainBar = { + "layer" = "top"; + "position" = "top"; + "mode" = "dock"; + "reload_style_on_change" = true; + "gtk-layer-shell" = true; + + "modules-left" = [ + "hyprland/workspaces" + ]; + + "modules-center" = [ + "clock" + ]; + + "modules-right" = [ + "tray" + "battery" + ]; + + "tray" = { + "icon-size" = 12; + "spacing" = 4; + }; + + "hyprland/workspaces" = { + "persistent-workspaces" = { + "1" = []; + "2" = []; + "3" = []; + "4" = []; + "5" = []; + }; + }; + + # "clock" = { + # "format" = "{ =%m-%d %H =%M}"; + # }; + + "battery" = { + "states" = { + "warning" = 30; + "critical" = 15; + }; + + "format" = "{icon} {capacity}%"; + "format-icons" = ["󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂"]; + "format-warning" = "󰁻 {capacity}%"; + "format-critical" = "󱃍 {capacity}%"; + "format-charging" = "󱘖 {capacity}%"; + + "interval" = 1; + "min-length" = 6; + "max-length" = 6; + }; + }; + }; + style = " + * { + font-family: \"JetBrainsMono Nerd Font\"; + font-weight: bold; + font-size: 12px; + min-height: 0; + padding: 0; + border: none; + margin: 2px; + } + + /* === Main Background === */ + + window#waybar { + background: transparent; + } + + /* === Workspace Buttons === */ + + #workspaces button { + border-radius: 8px; + box-shadow: none; + margin: 2px 0; + padding: 0 2px; + transition: none; + } + #workspaces button:hover { + color: #11111b; + background: #c7a4de; + text-shadow: none; + box-shadow: none; + } + #workspaces button.active { + color: #11111b; + background: #885ab0; + margin: 3px 0; + padding: 0 6px; + } + + /* == Workspaces == */ + + #workspaces { + background: #11111b; + padding: 0 4px; + border-radius: 7px; + } + + /* == Time == */ + + #clock { + background: #11111b; + padding: 0 8px; + border-radius: 7px; + } + + /* == Battery == */ + + #battery { + background: #11111b; + padding: 0 8px; + border-radius: 7px; + } + + /* == Tray == */ + + #tray { + background: #11111b; + padding: 0 4px; + border-radius: 7px; + } + "; + }; +} \ No newline at end of file diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..8ff0f41 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,42 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./system_components + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "framework"; # Define your hostname. + + # Configure network connections interactively with nmcli or nmtui. + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "Europe/London"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_GB.UTF-8"; + + nix.settings.experimental-features = ["nix-command" "flakes"]; + + # Configure keymap in X11 + services.xserver.xkb.layout = "gb"; + + # Enable touchpad support (enabled default in most desktopManager). + services.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.toaster = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + }; + + nixpkgs.config.allowUnfree = true; + services.openssh.enable = true; + system.stateVersion = "25.11"; +} + diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..68cc665 --- /dev/null +++ b/flake.lock @@ -0,0 +1,82 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1766980997, + "narHash": "sha256-oegDNAvyQwaG3GqSi4U5jpKM7SYHGESGVIuKMRV/lbw=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "7a7b43c7231a439d248179ba8d561dd6cd81799b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixos-hardware": { + "locked": { + "lastModified": 1766568855, + "narHash": "sha256-UXVtN77D7pzKmzOotFTStgZBqpOcf8cO95FcupWp4Zo=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "c5db9569ac9cc70929c268ac461f4003e3e5ca80", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1766902085, + "narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixos-hardware": "nixos-hardware", + "nixpkgs": "nixpkgs", + "stable-nixpkgs": "stable-nixpkgs" + } + }, + "stable-nixpkgs": { + "locked": { + "lastModified": 1766736597, + "narHash": "sha256-BASnpCLodmgiVn0M1MU2Pqyoz0aHwar/0qLkp7CjvSQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f560ccec6b1116b22e6ed15f4c510997d99d5852", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ec687b9 --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +{ + description = ":3"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + stable-nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + }; + + outputs = { + nixpkgs, + stable-nixpkgs, + home-manager, + nixos-hardware, + ... + } @ inputs: let + system = "x86_64-linux"; + in { + nixosConfigurations = { + framework = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs; + inherit system; + + pkgs-stable = import stable-nixpkgs { + inherit system; + config.allowUnfree = true; + }; + }; + modules = [ + ./configuration.nix + nixos-hardware.nixosModules.framework-13th-gen-intel + home-manager.nixosModules.home-manager + { + home-manager.users.toaster = ./home.nix; + } + ]; + }; + }; + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..6ae4a79 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,31 @@ +# 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 = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/148f3522-8d5e-4f24-b9e0-282834e1f164"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/FDCD-5ED4"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..74b298d --- /dev/null +++ b/home.nix @@ -0,0 +1,18 @@ +{ + config, + pkgs, + lib, + ... +}: { + imports = [ + ./components + ./programs + ]; + + home.username = "toaster"; + home.homeDirectory = "/home/toaster"; + + nixpkgs.config.allowUnfree = true; + + home.stateVersion = "25.11"; +} diff --git a/programs/default.nix b/programs/default.nix new file mode 100644 index 0000000..6ae82a0 --- /dev/null +++ b/programs/default.nix @@ -0,0 +1,8 @@ +{lib, ...}: { + imports = [ + ./fish.nix + ./kitty.nix + ./unconfigured.nix + ./nh.nix + ]; +} \ No newline at end of file diff --git a/programs/fish.nix b/programs/fish.nix new file mode 100644 index 0000000..d5b2695 --- /dev/null +++ b/programs/fish.nix @@ -0,0 +1,35 @@ +{pkgs, ...}: { + programs.fish = { + enable = true; + interactiveShellInit = " + nix-your-shell fish | source + "; + + shellAliases = { + cd = "z"; + cat = "bat"; + }; + + # plugins = with pkgs.fishPlugins; [ + # tide + # ]; + }; + + programs.zoxide = { + enable = true; + enableFishIntegration = true; + options = []; + }; + + programs.bat = { + enable = true; + }; + + # home.file.".config/mommy/config.sh".text = '' + # MOMMY_SWEETIE="toaster, boy" + # MOMMY_COLOR="lolcat" + # MOMMY_FORBIDDEN_WORDS="fat/," + # ''; + + programs.kitty.shellIntegration.enableFishIntegration = true; +} \ No newline at end of file diff --git a/programs/kitty.nix b/programs/kitty.nix new file mode 100644 index 0000000..bd64757 --- /dev/null +++ b/programs/kitty.nix @@ -0,0 +1,12 @@ +{pkgs, ...}: { + programs.kitty = { + enable = true; + settings = { + font_family = "0xProto Nerd Font Mono"; + background_opacity = 0.5; + font_size = 12.0; + force_ltr = "no"; + single_window_margin_width = 10; + }; + }; +} \ No newline at end of file diff --git a/programs/nh.nix b/programs/nh.nix new file mode 100644 index 0000000..5cf20af --- /dev/null +++ b/programs/nh.nix @@ -0,0 +1,6 @@ +{pkgs, ...}: { + programs.nh = { + enable = true; + flake = "/home/toaster/.nixos"; + }; +} \ No newline at end of file diff --git a/programs/unconfigured.nix b/programs/unconfigured.nix new file mode 100644 index 0000000..c548a58 --- /dev/null +++ b/programs/unconfigured.nix @@ -0,0 +1,16 @@ +{ + pkgs, + ... +}: { + home.packages = with pkgs; [ + firefox + krita + gimp + kdePackages.dolphin + blender + nerd-fonts._0xproto + vesktop + git + vscode + ]; +} \ No newline at end of file diff --git a/system_components/default.nix b/system_components/default.nix new file mode 100644 index 0000000..e157bdd --- /dev/null +++ b/system_components/default.nix @@ -0,0 +1,8 @@ +{lib, ...}: { + imports = [ + ./fish_root.nix + ./sddm.nix + ./hardware.nix + ./tailscale.nix + ]; +} \ No newline at end of file diff --git a/system_components/fish_root.nix b/system_components/fish_root.nix new file mode 100644 index 0000000..8c5c09b --- /dev/null +++ b/system_components/fish_root.nix @@ -0,0 +1,18 @@ +{pkgs, ...}:{ + programs.fish.enable = true; + + environment.systemPackages = with pkgs; [ + nix-your-shell + btop + fastfetch + wget + ]; + + programs.bash.interactiveShellInit = '' + if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] + then + shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" + exec ${pkgs.fish}/bin/fish $LOGIN_OPTION + fi + ''; +} \ No newline at end of file diff --git a/system_components/hardware.nix b/system_components/hardware.nix new file mode 100644 index 0000000..44ebb43 --- /dev/null +++ b/system_components/hardware.nix @@ -0,0 +1,12 @@ +{pkgs, ...}: { + hardware.opentabletdriver.enable = true; + hardware.uinput.enable = true; + boot.kernelModules = [ "uinput" ]; + + hardware.graphics = { + enable = true; + extraPackages = with pkgs; [ + intel-media-driver + ]; + }; +} \ No newline at end of file diff --git a/system_components/pipewire.nix b/system_components/pipewire.nix new file mode 100644 index 0000000..3a8681c --- /dev/null +++ b/system_components/pipewire.nix @@ -0,0 +1,6 @@ +{pkgs, ...}: { + services.pipewire = { + enable = true; + pulse.enable = true; + }; +} \ No newline at end of file diff --git a/system_components/sddm.nix b/system_components/sddm.nix new file mode 100644 index 0000000..246802e --- /dev/null +++ b/system_components/sddm.nix @@ -0,0 +1,9 @@ +{pkgs, ...}: { + programs.hyprland.enable = true; + + services.displayManager.defaultSession = "hyprland"; + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + }; +} \ No newline at end of file diff --git a/system_components/tailscale.nix b/system_components/tailscale.nix new file mode 100644 index 0000000..5366255 --- /dev/null +++ b/system_components/tailscale.nix @@ -0,0 +1,6 @@ +{pkgs, ...}: { + services.tailscale = { + enable = true; + extraSetFlags = [ "--accept-routes" ]; + }; +} \ No newline at end of file