From 4f0961448f203c583166c4fd745285617e854b5b Mon Sep 17 00:00:00 2001 From: Chris Toph Date: Fri, 10 Jan 2025 01:14:12 -0500 Subject: [PATCH] Initial Setup for Rune Added vscode as welll --- common/fastfetch/host/rune.txt | 13 ++ common/home/default.nix | 8 +- common/vscode/default.nix | 10 + flake.nix | 329 +++++++++++++++++----------- host/rune/default.nix | 57 +++++ host/rune/hardware.nix | 67 ++++++ host/rune/home/default.nix | 34 +++ host/rune/modules/gnome/default.nix | 47 ++++ host/rune/modules/gnome/home.nix | 17 ++ host/rune/modules/steam/default.nix | 8 + nix/default.nix | 150 ++++++++----- 11 files changed, 556 insertions(+), 184 deletions(-) create mode 100644 common/fastfetch/host/rune.txt create mode 100644 common/vscode/default.nix create mode 100644 host/rune/default.nix create mode 100644 host/rune/hardware.nix create mode 100644 host/rune/home/default.nix create mode 100644 host/rune/modules/gnome/default.nix create mode 100644 host/rune/modules/gnome/home.nix create mode 100644 host/rune/modules/steam/default.nix diff --git a/common/fastfetch/host/rune.txt b/common/fastfetch/host/rune.txt new file mode 100644 index 0000000..d5c8e8f --- /dev/null +++ b/common/fastfetch/host/rune.txt @@ -0,0 +1,13 @@ + + [?25l ▄▄▄ ▄▄▄ ▄▄▄  + ▄▄▄▄ ▄▄▄▄▄▄▄  + ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄▄  + ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄░▄  + ▄▄▄▄▄ ▄▄▄▄▄▄  + ▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄░ + ▄▄▄▄▄▄ ▄▄▄  + ░▄▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄  + ▄ ▄▄▄▄▄▄▄▄▄░░▄▄▄▄  + ▄▄▄▄▄▄▄ ▄░▄  + ▄▄▄ ▄▄▄▄ ▄▄▄  + [?25h \ No newline at end of file diff --git a/common/home/default.nix b/common/home/default.nix index d1a4919..ad48c29 100644 --- a/common/home/default.nix +++ b/common/home/default.nix @@ -1,10 +1,10 @@ { pkgs, hostName, ... }: -{ +{ # Module imports imports = [ # Common Modules - ../fish - ../fastfetch + ../fish + ../fastfetch ]; home = { @@ -17,7 +17,7 @@ VISUAL = "micro"; XDG_CONFIG_HOME = "$HOME/.config"; }; - }; + }; # Let Home Manager install and manage itself. programs.home-manager.enable = true; diff --git a/common/vscode/default.nix b/common/vscode/default.nix new file mode 100644 index 0000000..70f26b0 --- /dev/null +++ b/common/vscode/default.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: +{ + programs.vscode = { + enable = true; + extensions = with pkgs.vscode-extensions; [ + # bbenoist.Nix + # brettm12345.nixfmt-vscode + ]; + }; +} diff --git a/flake.nix b/flake.nix index 6c38dcd..5127b98 100644 --- a/flake.nix +++ b/flake.nix @@ -7,135 +7,218 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + zen-browser.url = "github:0xc000022070/zen-browser-flake"; }; - outputs = { self, nixpkgs, home-manager, ... }: let + outputs = + { + self, + nixpkgs, + home-manager, + zen-browser, + ... + }: + let ARM = "aarch64-linux"; # ARM systems X86 = "x86_64-linux"; # x86_64 systems lib = nixpkgs.lib; - in { - nixosConfigurations = { - caenus = let - hostName = "caenus"; - default = ./. + "/host/${hostName}"; - in lib.nixosSystem { - specialArgs = { inherit hostName; }; - system = ARM; - modules = [ - ./nix - default - ]; - }; - - cloud = let - hostName = "cloud"; - default = ./. + "/host/${hostName}"; - in lib.nixosSystem { - specialArgs = { inherit hostName; }; - system = X86; - modules = [ - ./nix - default - ]; - }; - - komodo = let - hostName = "komodo"; - default = ./. + "/host/${hostName}"; - in lib.nixosSystem { - specialArgs = { inherit hostName; }; - system = X86; - modules = [ - ./nix - default - ]; - }; - - nix = let - hostName = "nix"; - default = ./. + "/host/${hostName}"; - in lib.nixosSystem { - specialArgs = { inherit hostName; }; - system = X86; - modules = [ - ./nix - default - ]; - }; - - proxy = let - hostName = "proxy"; - default = ./. + "/host/${hostName}"; - in lib.nixosSystem { - specialArgs = { inherit hostName; }; - system = X86; - modules = [ - ./nix - default - ]; - }; - }; + in + { + nixosConfigurations = { + caenus = + let + hostName = "caenus"; + default = ./. + "/host/${hostName}"; + in + lib.nixosSystem { + specialArgs = { + inherit hostName; + }; + system = ARM; + modules = [ + ./nix + default + ]; + }; - homeConfigurations = let - armPkgs = import nixpkgs { - system = ARM; - config.allowUnfree = true; + cloud = + let + hostName = "cloud"; + default = ./. + "/host/${hostName}"; + in + lib.nixosSystem { + specialArgs = { + inherit hostName; + }; + system = X86; + modules = [ + ./nix + default + ]; + }; + + komodo = + let + hostName = "komodo"; + default = ./. + "/host/${hostName}"; + in + lib.nixosSystem { + specialArgs = { + inherit hostName; + }; + system = X86; + modules = [ + ./nix + default + ]; + }; + + nix = + let + hostName = "nix"; + default = ./. + "/host/${hostName}"; + in + lib.nixosSystem { + specialArgs = { + inherit hostName; + }; + system = X86; + modules = [ + ./nix + default + ]; + }; + + proxy = + let + hostName = "proxy"; + default = ./. + "/host/${hostName}"; + in + lib.nixosSystem { + specialArgs = { + inherit hostName; + }; + system = X86; + modules = [ + ./nix + default + ]; + }; + + rune = + let + hostName = "rune"; + default = ./. + "/host/${hostName}"; + in + lib.nixosSystem { + specialArgs = { + inherit hostName; + }; + system = X86; + modules = [ + ./nix + default + ]; + }; + }; + + homeConfigurations = + let + armPkgs = import nixpkgs { + system = ARM; + config.allowUnfree = true; + }; + x86Pkgs = import nixpkgs { + system = X86; + config.allowUnfree = true; + # overlays = [ (import ./nixos/overlays) ]; + }; + in + { + "toph@caenus" = + let + hostName = "caenus"; + pkgs = armPkgs; + home = ./. + "/host/${hostName}/home"; + in + home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = { + inherit hostName; + }; + modules = [ home ]; + }; + + "toph@cloud" = + let + hostName = "cloud"; + pkgs = x86Pkgs; + home = ./. + "/host/${hostName}/home"; + in + home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = { + inherit hostName; + }; + modules = [ home ]; + }; + + "toph@komodo" = + let + hostName = "komodo"; + pkgs = x86Pkgs; + home = ./. + "/host/${hostName}/home"; + in + home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = { + inherit hostName; + }; + modules = [ home ]; + }; + + "toph@nix" = + let + hostName = "nix"; + pkgs = x86Pkgs; + home = ./. + "/host/${hostName}/home"; + in + home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = { + inherit hostName; + }; + modules = [ home ]; + }; + + "toph@proxy" = + let + hostName = "proxy"; + pkgs = x86Pkgs; + home = ./. + "/host/${hostName}/home"; + in + home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = { + inherit hostName; + }; + modules = [ home ]; + }; + + "toph@rune" = + let + hostName = "rune"; + pkgs = x86Pkgs; + home = ./. + "/host/${hostName}/home"; + zen = zen-browser.packages."${X86}".beta; + in + home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = { + inherit hostName zen; + }; + modules = [ home ]; + }; }; - x86Pkgs = import nixpkgs { - system = X86; - config.allowUnfree = true; - # overlays = [ (import ./nixos/overlays) ]; - }; - in { - "toph@caenus" = let - hostName = "caenus"; - pkgs = armPkgs; - home = ./. + "/host/${hostName}/home"; - in home-manager.lib.homeManagerConfiguration { - inherit pkgs; - extraSpecialArgs = { inherit hostName; }; - modules = [ home ]; - }; - - "toph@cloud" = let - hostName = "cloud"; - pkgs = x86Pkgs; - home = ./. + "/host/${hostName}/home"; - in home-manager.lib.homeManagerConfiguration { - inherit pkgs; - extraSpecialArgs = { inherit hostName; }; - modules = [ home ]; - }; - - "toph@komodo" = let - hostName = "komodo"; - pkgs = x86Pkgs; - home = ./. + "/host/${hostName}/home"; - in home-manager.lib.homeManagerConfiguration { - inherit pkgs; - extraSpecialArgs = { inherit hostName; }; - modules = [ home ]; - }; - - "toph@nix" = let - hostName = "nix"; - pkgs = x86Pkgs; - home = ./. + "/host/${hostName}/home"; - in home-manager.lib.homeManagerConfiguration { - inherit pkgs; - extraSpecialArgs = { inherit hostName; }; - modules = [ home ]; - }; - - "toph@proxy" = let - hostName = "proxy"; - pkgs = x86Pkgs; - home = ./. + "/host/${hostName}/home"; - in home-manager.lib.homeManagerConfiguration { - inherit pkgs; - extraSpecialArgs = { inherit hostName; }; - modules = [ home ]; - }; }; - }; } diff --git a/host/rune/default.nix b/host/rune/default.nix new file mode 100644 index 0000000..ab29b8f --- /dev/null +++ b/host/rune/default.nix @@ -0,0 +1,57 @@ +{ + modulesPath, + config, + pkgs, + hostName, + ... +}: +{ + ## MODULES & IMPORTS ## + imports = [ + # Common Modules + ../../common/ssh + + # Import hardware configuration. + ./hardware.nix + + # Modules + ./modules/steam + ./modules/gnome + ]; + + ## NETWORKING ## + networking.networkmanager.enable = true; + + ## ENVIORMENT & PACKAGES ## + environment.systemPackages = with pkgs; [ + git + micro + nixfmt-rfc-style + openssh + ranger + sshfs + wget + ]; + + # Enable CUPS to print documents. + services.printing.enable = 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; + }; + + programs.java = { + enable = true; + package = pkgs.jdk; + }; + + environment.variables = { + HOSTNAME = hostName; + }; +} diff --git a/host/rune/hardware.nix b/host/rune/hardware.nix new file mode 100644 index 0000000..a9995eb --- /dev/null +++ b/host/rune/hardware.nix @@ -0,0 +1,67 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: +{ + + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + # Bootloader + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + programs.fuse.userAllowOther = true; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/28a9ac4d-1e87-4731-9c06-916711d83cb2"; + fsType = "ext4"; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/B182-E50E"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + "/pool" = { + device = "toph@104.40.4.24:/pool"; + fsType = "sshfs"; + options = [ + "defaults" + "reconnect" + "_netdev" + "allow_other" + "identityfile=/home/toph/.ssh/pve" + ]; + }; + + # "/home/toph/git" = { + # fsType = "none"; + # device = "/pool/git"; + # options = ["bind" "nofail"]; + # }; + }; + + swapDevices = [ { device = "/dev/disk/by-uuid/81b6fa27-af94-41d4-9070-8754087a4c26"; } ]; + + networking.useDHCP = lib.mkDefault true; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/host/rune/home/default.nix b/host/rune/home/default.nix new file mode 100644 index 0000000..fdbebd7 --- /dev/null +++ b/host/rune/home/default.nix @@ -0,0 +1,34 @@ +{ pkgs, zen, config, ... }: +{ + # Module imports + imports = [ + # Common Modules + ../../../common/home + ../../../common/git + ../../../common/vscode + + # Modules + ../modules/gnome/home.nix + ]; + + # Enables app shorcuts + targets.genericLinux.enable = true; + xdg.mime.enable = true; + xdg.systemDirs.data = [ "${config.home.homeDirectory}/.nix-profile/share/applications" ]; + + home.packages = with pkgs; [ + chafa + fastfetch + fish + fishPlugins.grc + fishPlugins.tide + grc + nodejs_22 + pnpm + prettierd + spotify + telegram-desktop + vesktop + zen + ]; +} diff --git a/host/rune/modules/gnome/default.nix b/host/rune/modules/gnome/default.nix new file mode 100644 index 0000000..9a86e1e --- /dev/null +++ b/host/rune/modules/gnome/default.nix @@ -0,0 +1,47 @@ +{ pkgs, ... }: +{ + # Enable the X11 windowing system. + services.xserver = { + enable = true; + + # Enable the GNOME Desktop Environment. + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; + + # Configure keymap in X11 + xkb = { + layout = "us"; + variant = ""; + }; + }; + + services.udev.packages = with pkgs; [ gnome-settings-daemon ]; + + environment.systemPackages = with pkgs; [ + gnome-tweaks + gnomeExtensions.appindicator + gnomeExtensions.tiling-shell + gnomeExtensions.dash-to-panel + gnomeExtensions.blur-my-shell + ]; + + environment.gnome.excludePackages = ( + with pkgs; + [ + atomix # puzzle game + epiphany # web browser + evince # document viewer + gedit # text editor + gnome-help + gnome-maps + gnome-music + gnome-photos + gnome-terminal + gnome-tour + hitori # sudoku game + iagno # go game + tali # poker game + ] + ); + +} diff --git a/host/rune/modules/gnome/home.nix b/host/rune/modules/gnome/home.nix new file mode 100644 index 0000000..8162e34 --- /dev/null +++ b/host/rune/modules/gnome/home.nix @@ -0,0 +1,17 @@ +{ pkgs, ... }: +{ + + dconf = { + enable = true; + settings."org/gnome/shell" = { + disable-user-extensions = false; + enabled-extensions = with pkgs.gnomeExtensions; [ + appindicator.extensionUuid + blur-my-shell.extensionUuid + dash-to-panel.extensionUuid + tiling-shell.extensionUuid + ]; + }; + }; + +} diff --git a/host/rune/modules/steam/default.nix b/host/rune/modules/steam/default.nix new file mode 100644 index 0000000..1381b74 --- /dev/null +++ b/host/rune/modules/steam/default.nix @@ -0,0 +1,8 @@ +{ + programs.steam = { + enable = true; + # remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + # dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + # localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers + }; +} diff --git a/nix/default.nix b/nix/default.nix index 3e32101..c819698 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -1,63 +1,99 @@ -{ modulesPath, config, pkgs, hostName, ... }: +{ + modulesPath, + config, + pkgs, + hostName, + ... +}: let - admin = "toph"; - password = "[REDACTED]"; - timeZone = "America/New_York"; - defaultLocale = "en_US.UTF-8"; + admin = "toph"; + password = "[REDACTED]"; + timeZone = "America/New_York"; + defaultLocale = "en_US.UTF-8"; -in { - ## TIMEZONE & LOCALE ## - time.timeZone = timeZone; - i18n.defaultLocale = defaultLocale; +in +{ + ## TIMEZONE & LOCALE ## + time.timeZone = timeZone; + i18n.defaultLocale = defaultLocale; + i18n.extraLocaleSettings = { + LC_ADDRESS = defaultLocale; + LC_IDENTIFICATION = defaultLocale; + LC_MEASUREMENT = defaultLocale; + LC_MONETARY = defaultLocale; + LC_NAME = defaultLocale; + LC_NUMERIC = defaultLocale; + LC_PAPER = defaultLocale; + LC_TELEPHONE = defaultLocale; + LC_TIME = defaultLocale; + }; - ## USERS ## - users.mutableUsers = false; - users.users."${admin}" = { - isNormalUser = true; - createHome = true; - homeMode = "750"; - home = "/home/${admin}"; - password = password; - extraGroups = [ "wheel" ]; - shell = pkgs.fish; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIClZstYoT64zHnGfE7LMYNiQPN5/gmCt382lC+Ji8lrH PVE" - ]; - }; - - # INFO: Enable passwordless sudo. - security.sudo.extraRules = [{ - users = [ admin ]; - commands = [{ - command = "ALL" ; - options = [ "NOPASSWD" ]; - }]; - }]; - - ## PROGRAMS & SERVICES ## - # Shells - environment.shells = with pkgs; [ bash fish ]; - programs.fish.enable = true; - - ## NETWORKING ## - networking = { - dhcpcd.enable = false; - hostName = hostName; - networkmanager.enable = true; - useDHCP = true; - useHostResolvConf = false; - usePredictableInterfaceNames = true; - }; - - ## NIXOS ## - systemd.tmpfiles.rules = [ - "d /home/toph/git 0750 toph users -" + ## USERS ## + users.mutableUsers = false; + users.users."${admin}" = { + isNormalUser = true; + createHome = true; + description = "Toph"; + homeMode = "750"; + home = "/home/${admin}"; + password = password; + extraGroups = [ + "networkmanager" + "wheel" ]; - # forces interfaces to be named predictably - # This value determines the NixOS release with which your system is to be - system.stateVersion = "24.11"; - # Enable Flakes - nix.settings.experimental-features = [ "nix-command" "flakes" ]; -} \ No newline at end of file + shell = pkgs.fish; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIClZstYoT64zHnGfE7LMYNiQPN5/gmCt382lC+Ji8lrH PVE" + ]; + }; + + # INFO: Enable passwordless sudo. + security.sudo.extraRules = [ + { + users = [ admin ]; + commands = [ + { + command = "ALL"; + options = [ "NOPASSWD" ]; + } + ]; + } + ]; + + ## PROGRAMS & SERVICES ## + # Shells + environment.shells = with pkgs; [ + bash + fish + ]; + programs.fish.enable = true; + + ## NETWORKING ## + networking = { + dhcpcd.enable = false; + hostName = hostName; + networkmanager.enable = true; + useDHCP = true; + useHostResolvConf = false; + usePredictableInterfaceNames = true; + }; + + ## NIXOS ## + systemd.tmpfiles.rules = [ + "d /home/toph/git 0750 toph users -" + ]; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # forces interfaces to be named predictably + # This value determines the NixOS release with which your system is to be + system.stateVersion = "24.11"; + # Enable Flakes + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; +}