diff --git a/configuration.nix b/configuration.nix deleted file mode 100644 index adf3c13..0000000 --- a/configuration.nix +++ /dev/null @@ -1,167 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). -{ - config, - pkgs, - ... -}: -{ - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - boot.initrd.luks.fido2Support = true; - - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - virtualisation.waydroid.enable = true; - networking.hostName = "nixos"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - - # Set your time zone. - time.timeZone = "America/Los_Angeles"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - # Enable the X11 windowing system. - # You can disable this if you're only using the Wayland session. - services.xserver.enable = true; - - # Enable the KDE Plasma Desktop Environment. - services.displayManager.sddm.enable = true; - services.desktopManager.plasma6.enable = true; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; - - # Enable CUPS to print documents. - services.printing.enable = true; - # Fingerprint Driver - services.fprintd.enable = true; - security.pam.services.login.fprintAuth = true; - - # Enable sound with pipewire. - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; - }; - - hardware.bluetooth.enable = true; # enables support for Bluetooth - hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.kaitotlex = { - isNormalUser = true; - description = "KaitoTLex"; - extraGroups = [ - "networkmanager" - "wheel" - ]; - packages = with pkgs; [ - kdePackages.kate - # thunderbird - ]; - }; - - # Install firefox. - programs.firefox.enable = true; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - pkgs.fprintd - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - # wget - ]; - - fonts = { - enableDefaultPackages = true; - fontconfig = { - defaultFonts = { - serif = [ "Noto Serif" ]; - sansSerif = [ "Noto Sans" ]; - }; - }; - packages = with pkgs; [ - noto-fonts - noto-fonts-cjk - noto-fonts-emoji - (nerdfonts.override { fonts = [ "CascadiaCode" ]; }) - ]; - }; - - programs.fish.enable = true; - users.users.kaitotlex.shell = pkgs.fish; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "24.11"; # Did you read the comment? -} diff --git a/flake.nix b/flake.nix index f6cb436..baeb1c3 100644 --- a/flake.nix +++ b/flake.nix @@ -15,36 +15,30 @@ outputs = { - self, nixpkgs, home-manager, ... }@inputs: { - formatter."x86_64-linux" = nixpkgs.legacyPackages.x86_64-linux.alejandra; - nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + formatter."x86_64-linux" = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; + nixosConfigurations.shiroko = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; system = "x86_64-linux"; modules = [ - ./configuration.nix - + ./hosts/shiroko home-manager.nixosModules.home-manager { home-manager = { useGlobalPkgs = true; useUserPackages = true; + backupFileExtension = "backup"; extraSpecialArgs = { inherit inputs; }; users.kaitotlex = { - imports = [ - ./home.nix - ./spicetify.nix - # inputs.nixvim.homeManagerModules.nixvim - #./nixvim.nix - ]; + imports = [ ./users/kaitotlex ]; }; }; } diff --git a/hosts/shiroko/configuration.nix b/hosts/shiroko/configuration.nix new file mode 100644 index 0000000..1243822 --- /dev/null +++ b/hosts/shiroko/configuration.nix @@ -0,0 +1,67 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{ + config, + pkgs, + ... +}: +{ + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + boot.initrd.luks.fido2Support = true; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + virtualisation.waydroid.enable = true; + networking.hostName = "shiroko"; # Define your hostname. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "America/Los_Angeles"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + + # List services that you want to enable: + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.11"; # Did you read the comment? +} diff --git a/hosts/shiroko/default.nix b/hosts/shiroko/default.nix new file mode 100644 index 0000000..416f647 --- /dev/null +++ b/hosts/shiroko/default.nix @@ -0,0 +1,9 @@ +{ + imports = [ + ./configuration.nix + ../../modules/core + ../../modules/wm + ../../modules/security + ../../modules/audio + ]; +} diff --git a/hardware-configuration.nix b/hosts/shiroko/hardware-configuration.nix similarity index 75% rename from hardware-configuration.nix rename to hosts/shiroko/hardware-configuration.nix index 4c5240d..b70bf0f 100644 --- a/hardware-configuration.nix +++ b/hosts/shiroko/hardware-configuration.nix @@ -7,15 +7,21 @@ pkgs, modulesPath, ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; +}: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "nvme" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; fileSystems."/" = { device = "/dev/disk/by-uuid/de53d520-7b49-4353-b88c-b599f8f50fbb"; @@ -27,10 +33,13 @@ fileSystems."/boot" = { device = "/dev/disk/by-uuid/C5E5-09F1"; fsType = "vfat"; - options = ["fmask=0077" "dmask=0077"]; + 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/modules/audio/default.nix b/modules/audio/default.nix new file mode 100644 index 0000000..d292ecd --- /dev/null +++ b/modules/audio/default.nix @@ -0,0 +1,11 @@ +{ + # Enable sound with pipewire. + hardware.pulseaudio.enable = false; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; +} diff --git a/modules/core/default.nix b/modules/core/default.nix new file mode 100644 index 0000000..8e47073 --- /dev/null +++ b/modules/core/default.nix @@ -0,0 +1,75 @@ +{ pkgs, inputs, ... }: +{ + # Enable the X11 windowing system. + # You can disable this if you're only using the Wayland session. + services.xserver.enable = false; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + nix = { + settings.experimental-features = [ + "nix-command" + "flakes" + ]; + optimise.automatic = true; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 14d"; + }; + # Free up to 1GiB when there is less than 100MiB left + extraOptions = '' + min-free = ${toString (100 * 1024 * 1024)} + max-free = ${toString (1024 * 1024 * 1024)} + ''; + }; + + hardware.bluetooth.enable = true; # enables support for Bluetooth + hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + fonts = { + enableDefaultPackages = true; + fontconfig = { + defaultFonts = { + serif = [ "Noto Serif" ]; + sansSerif = [ "Noto Sans" ]; + }; + }; + packages = with pkgs; [ + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + (nerdfonts.override { fonts = [ "CascadiaCode" ]; }) + ]; + }; + + environment.systemPackages = [ + inputs.nixvim.packages.${pkgs.system}.default + ]; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.kaitotlex = { + isNormalUser = true; + description = "KaitoTLex"; + extraGroups = [ + "networkmanager" + "wheel" + ]; + }; + + programs.fish.enable = true; + users.users.kaitotlex.shell = pkgs.fish; +} diff --git a/modules/security/default.nix b/modules/security/default.nix new file mode 100644 index 0000000..2a00e68 --- /dev/null +++ b/modules/security/default.nix @@ -0,0 +1,16 @@ +{ + security.rtkit.enable = true; + # Fingerprint Driver + services.fprintd.enable = true; + security.pam.services.login.fprintAuth = true; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + services.gnome.gnome-keyring.enable = true; +} diff --git a/modules/wm/default.nix b/modules/wm/default.nix new file mode 100644 index 0000000..f623846 --- /dev/null +++ b/modules/wm/default.nix @@ -0,0 +1,11 @@ +{ + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + }; +} diff --git a/users/kaitotlex/de/default.nix b/users/kaitotlex/de/default.nix new file mode 100644 index 0000000..cc0e4db --- /dev/null +++ b/users/kaitotlex/de/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./sway + ./waybar + ]; +} diff --git a/users/kaitotlex/de/sway/default.nix b/users/kaitotlex/de/sway/default.nix new file mode 100644 index 0000000..e7e3846 --- /dev/null +++ b/users/kaitotlex/de/sway/default.nix @@ -0,0 +1,5 @@ +{ + wayland.windowManager.sway = { + enable = true; + }; +} diff --git a/users/kaitotlex/de/waybar/default.nix b/users/kaitotlex/de/waybar/default.nix new file mode 100644 index 0000000..33661b2 --- /dev/null +++ b/users/kaitotlex/de/waybar/default.nix @@ -0,0 +1,173 @@ +{ pkgs, ... }: +{ + programs.waybar = { + enable = true; + style = ./style.css; + systemd.enable = true; + settings = { + mainBar = { + name = "bar0"; + + layer = "top"; + position = "top"; + + height = 28; + # "width" = 1920; + + "margin" = "5px 10px 0px 10px"; + "spacing" = 10; + + "mode" = "top"; + # "exclusive" = true; + + # "output" = "eDP-1"; + + reload_style_on_change = true; + + modules-left = [ + "hyprland/workspaces" + "hyprland/window" + ]; + modules-right = [ + "tray" + "idle_inhibitor" + "backlight" + "wireplumber" + "network" + "battery" + "disk" + "memory" + "cpu" + "temperature" + "clock" + ]; + + idle_inhibitor = { + format = "{icon}"; + format-icons = { + activated = "󰛊 "; + deactivated = "󰾫 "; + }; + }; + + network = { + format = "{ifname}"; + format-wifi = "{icon}{essid}"; + format-ethernet = " {essid}"; + format-disconnected = "󰤯 Disconnected"; + format-icons = [ + "󰤟 " + "󰤢 " + "󰤨 " + ]; + tooltip-format = " {bandwidthUpBits} |  {bandwidthDownBits}"; + tooltip-format-wifi = " {bandwidthUpBits} |  {bandwidthDownBits} | 󱄙 {signalStrength}"; + }; + + backlight = { + interval = 2; + format = "󰖨 {percent}%"; + on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl set +4"; + on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl set 4-"; + }; + + wireplumber = { + format = "{icon} {volume}%"; + format-muted = "󰝟 "; + on-click = "pamixer -t"; + on-scroll-up = "${pkgs.pamixer}/bin/pamixer set 5%+"; + on-scroll-down = "${pkgs.pamixer}/bin/pamixer set 5%-"; + format-icons = [ + "" + "" + "" + "" + "" + ]; + }; + + battery = { + interval = 10; + format = "{icon} {capacity}%"; + format-icons = [ + "󰂎" + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + tooltip = true; + tooltip-format = "{timeTo}"; + }; + + disk = { + intervel = 30; + format = "󰋊 {percentage_used}%"; + tooltip-format = "{used} used out of {total} on \"{path}\" ({percentage_used}%)"; + }; + + memory = { + interval = 10; + format = " {used}"; + tooltip-format = "{used}GiB used of {total}GiB ({percentage}%)"; + }; + + cpu = { + interval = 10; + format = " {usage}%"; + }; + + temperature = { + interval = 10; + }; + + clock = { + interval = 1; + format = "{:%H:%M:%S}"; + }; + + "hyprland/workspaces" = { + show-special = true; + persistent-workspaces = { + "*" = [ + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + ]; + }; + format = "{icon}"; + format-icons = { + active = ""; + empty = ""; + default = ""; + urgent = ""; + special = "󰠱"; + }; + }; + "hyprland/window" = { + icon = true; + icon-size = 20; + max-length = 50; + rewrite = { + "(.*) — LibreWolf" = "$1"; + "(.*) — Zen Browser" = "$1"; + "^$" = "👾"; + }; + }; + }; + }; + }; +} diff --git a/users/kaitotlex/de/waybar/style.css b/users/kaitotlex/de/waybar/style.css new file mode 100644 index 0000000..c4bd23f --- /dev/null +++ b/users/kaitotlex/de/waybar/style.css @@ -0,0 +1,75 @@ +window#waybar { + font-family: "CaskaydiaCove Nerd Font"; + background-color: rgba(0,0,0,0); + font-size: 0.8rem; + border-radius: 0.5rem; +} + +.modules-left { + opacity: 1; + background: linear-gradient(45deg, rgb(214, 39, 200), rgb(5, 83, 252)); + border-radius: 0.5rem; + padding: 2px; +} + +.modules-center { + opacity: 0; +} + +.modules-right { + opacity: 1; + background-color: rgba(0,0,0,0.5); + border-radius: 0.5rem; + padding: 2px 2px 2px 10px +} + +/* label.module { + margin-left: -1px; +} */ + +#workspaces { + background-color: rgba(0,0,0,0.5); + border-radius: 0.5rem; + padding: 0 2px; +} + +#workspaces button { + font-size: 0.6rem; + padding: 0 0.3rem 0 0; +} + +#window { + background-color: rgba(0,0,0,0.5); + border-radius: 0.5rem; + padding: 2px 5px; +} + +#clock { + font-weight: bolder; + border-radius: 0.5rem; + padding: 0 3px 0 0; +} + +#battery { + color: lightgreen; +} + +#memory { + color: lightpink; +} + +#disk { + color: lightskyblue; +} + +#cpu { + color: lightgoldenrodyellow; +} + +#temperature { + color: lightslategray; +} + +#network { + color: lightsteelblue; +} diff --git a/users/kaitotlex/default.nix b/users/kaitotlex/default.nix new file mode 100644 index 0000000..c7c3586 --- /dev/null +++ b/users/kaitotlex/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./home.nix + ./spicetify.nix + ./de + ]; +} diff --git a/home.nix b/users/kaitotlex/home.nix similarity index 84% rename from home.nix rename to users/kaitotlex/home.nix index 036d466..90bc941 100644 --- a/home.nix +++ b/users/kaitotlex/home.nix @@ -1,8 +1,4 @@ -{ - pkgs, - inputs, - ... -}: +{ pkgs, inputs, ... }: { home.username = "kaitotlex"; home.homeDirectory = "/home/kaitotlex"; @@ -26,7 +22,6 @@ home.packages = with pkgs; [ # here is some command line tools I use frequently # feel free to add your own or remove some of them - firefox-devedition neofetch polychromatic openrazer-daemon @@ -52,11 +47,8 @@ p7zip # utils - ripgrep # recursively searches directories for a regex pattern jq # A lightweight and flexible command-line JSON processor yq-go # yaml processor https://github.com/mikefarah/yq - eza # A modern replacement for ‘ls’ - fzf # A command-line fuzzy finder emacs # full featured everything wl-clipboard @@ -91,7 +83,6 @@ # with more details log output nix-output-monitor # productivity - hugo # static site generator glow # markdown previewer in terminal obsidian # markdown previewer thunderbird-unwrapped # Full Feature Email Client @@ -141,8 +132,6 @@ signal-desktop gh - inputs.nixvim.packages.${pkgs.system}.default - #Pentest netcat nmap @@ -168,6 +157,8 @@ }; }; + programs.neovim.defaultEditor = true; + programs.lazygit.enable = true; programs.zoxide = { @@ -188,48 +179,13 @@ }; }; - programs.waybar = { + programs.firefox = { enable = true; - settings = { - mainBar = { - layer = "top"; - position = "top"; - height = 30; - output = [ - "DP-1" - "HDMI-A-1" - ]; - modules-left = [ - "hyprland/workspaces" - "sway/submap" - "wlr/taskbar" - ]; - modules-center = [ - "hyprland/window" - "custom/hello-from-waybar" - ]; - modules-right = [ - "mpd" - "custom/mymodule#with-css-id" - "temperature" - ]; - - "hyprland/workspaces" = { - disable-scroll = true; - all-outputs = true; - }; - "custom/hello-from-waybar" = { - format = "hello {}"; - max-length = 40; - interval = "once"; - exec = pkgs.writeShellScript "hello-from-waybar" '' - echo "from within waybar" - ''; - }; - }; - }; + package = pkgs.firefox-devedition; }; + programs.ripgrep.enable = true; + programs.oh-my-posh = { enable = true; # enableZshIntegration = true; diff --git a/spicetify.nix b/users/kaitotlex/spicetify.nix similarity index 62% rename from spicetify.nix rename to users/kaitotlex/spicetify.nix index ca1dddc..8908f44 100644 --- a/spicetify.nix +++ b/users/kaitotlex/spicetify.nix @@ -1,13 +1,9 @@ -{ - inputs, - pkgs, - ... -}: let +{ inputs, pkgs, ... }: +let spicepkgs = inputs.spicetify.legacyPackages.${pkgs.system}; -in { - imports = [ - inputs.spicetify.homeManagerModules.default - ]; +in +{ + imports = [ inputs.spicetify.homeManagerModules.default ]; programs.spicetify = { enable = true; @@ -17,8 +13,6 @@ in { lastfm fullAppDisplayMod ]; - enabledCustomApps = with spicepkgs.apps; [ - lyricsPlus - ]; + enabledCustomApps = with spicepkgs.apps; [ lyricsPlus ]; }; }