From 5dd97993d2dfa0ba1183ab4ae9fffc70b3c2d255 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sun, 8 Sep 2024 19:12:08 -0400 Subject: [PATCH 01/17] added hardware config --- modules/nixos/hardware-configuration.nix | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 modules/nixos/hardware-configuration.nix diff --git a/modules/nixos/hardware-configuration.nix b/modules/nixos/hardware-configuration.nix new file mode 100644 index 0000000..91c6803 --- /dev/null +++ b/modules/nixos/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-label/COMPUTER"; + fsType = "xfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-label/BOOT"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/6d6bcc02-20a9-4ae8-9c1e-5124fb2b2634"; } + ]; + + # 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.enp9s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp8s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} -- 2.45.2 From 414420f3ce6ba289541f82aa844681d8dcd63b84 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sun, 8 Sep 2024 19:13:11 -0400 Subject: [PATCH 02/17] modified nix flake root --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index fb5c50b..ae00629 100644 --- a/flake.nix +++ b/flake.nix @@ -52,14 +52,14 @@ }; # Primary desktop computer - nixosConfiguration."cloud" = nixpkgs.lib.nixosSystem { + nixosConfigurations."cloud" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { inherit userName userEmail; hostname = "cloud"; }; modules = [ - /etc/nixos/configuration.nix + ./modules/nixos/hardware-configuration.nix ./modules/nix-core.nix ./modules/nixos/configuration.nix ./modules/host-users.nix -- 2.45.2 From fc8c44c02617b2f35aea5cc3430e78263eebb170 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Mon, 9 Sep 2024 09:27:52 -0400 Subject: [PATCH 03/17] modified nix files tailored for nixos, must make modular to merge into master --- flake.lock | 24 +++++++------- flake.nix | 2 +- home/core.nix | 5 +-- home/flatpak.nix | 8 +---- home/shell.nix | 15 +++++++++ home/sway.nix | 9 +++--- modules/host-users.nix | 7 +++-- modules/nix-core.nix | 2 +- modules/nixos/configuration.nix | 55 +++++++++++++++++++++++---------- 9 files changed, 82 insertions(+), 45 deletions(-) diff --git a/flake.lock b/flake.lock index 7e3367e..f86ca1d 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1722082646, - "narHash": "sha256-od8dBWVP/ngg0cuoyEl/w9D+TCNDj6Kh4tr151Aax7w=", + "lastModified": 1725628909, + "narHash": "sha256-xI0OSqPHcs/c/utJsU0Zvcp1VhejMI9mgwr68uHHlPs=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "0413754b3cdb879ba14f6e96915e5fdf06c6aab6", + "rev": "76559183801030451e200c90a1627c1d82bb4910", "type": "github" }, "original": { @@ -27,11 +27,11 @@ ] }, "locked": { - "lastModified": 1720042825, - "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", + "lastModified": 1725703823, + "narHash": "sha256-tDgM4d8mLK0Hd6YMB2w1BqMto1XBXADOzPEaLl10VI4=", "owner": "nix-community", "repo": "home-manager", - "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", + "rev": "208df2e558b73b6a1f0faec98493cb59a25f62ba", "type": "github" }, "original": { @@ -59,11 +59,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1725407940, - "narHash": "sha256-tiN5Rlg/jiY0tyky+soJZoRzLKbPyIdlQ77xVgREDNM=", + "lastModified": 1725693463, + "narHash": "sha256-ZPzhebbWBOr0zRWW10FfqfbJlan3G96/h3uqhiFqmwg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6f6c45b5134a8ee2e465164811e451dcb5ad86e3", + "rev": "68e7dce0a6532e876980764167ad158174402c6f", "type": "github" }, "original": { @@ -75,11 +75,11 @@ }, "nixpkgs-darwin": { "locked": { - "lastModified": 1725498621, - "narHash": "sha256-m12se55InZz03onhRji85deKJp4i0jrw980aDdxT0IM=", + "lastModified": 1725784148, + "narHash": "sha256-kZQbAtu+HSIU186Y4sXL+YJNnVpAo6sb+qowxv8MwaQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0409a1b650bb50c225485f2ca21c325eb33f45c7", + "rev": "075d83b556ad70f12f82bbd54eb019f5657dd371", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index ae00629..11613f9 100644 --- a/flake.nix +++ b/flake.nix @@ -59,6 +59,7 @@ hostname = "cloud"; }; modules = [ + nix-flatpak.nixosModules.nix-flatpak ./modules/nixos/hardware-configuration.nix ./modules/nix-core.nix ./modules/nixos/configuration.nix @@ -70,7 +71,6 @@ home-manager.useUserPackages = true; home-manager.extraSpecialArgs = extraSpecialArgs; home-manager.users.${userName}.imports = [ - nix-flatpak.homeManagerModules.nix-flatpak ./home ]; } diff --git a/home/core.nix b/home/core.nix index 64ac322..dd4e491 100644 --- a/home/core.nix +++ b/home/core.nix @@ -21,6 +21,7 @@ fh aria2 yt-dlp + imv # misc cowsay @@ -45,13 +46,13 @@ statix # productivity - iterm2 + # iterm2 discord obsidian vscode weechat # iamb - ollama + # ollama # games? # prismlauncher diff --git a/home/flatpak.nix b/home/flatpak.nix index 933e61a..6b4a586 100644 --- a/home/flatpak.nix +++ b/home/flatpak.nix @@ -1,12 +1,6 @@ {...}: { services.flatpak = { - remotes = [ - { - name = "flathub"; - location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; - } - ]; - + enable = true; packages = [ "com.github.tchx84.Flatseal" "com.slack.Slack" diff --git a/home/shell.nix b/home/shell.nix index 559e7c6..0704c2f 100644 --- a/home/shell.nix +++ b/home/shell.nix @@ -69,4 +69,19 @@ fi ''; }; + + + programs.bash = { + enable = true; + initExtra = '' + if [[ -z "$BASH_EXECUTION_STRING" ]]; then + if [[ -n "$ZSH_VERSION" ]]; then + LOGIN_OPTION="--login" + else + LOGIN_OPTION="" + fi + exec ${pkgs.fish}/bin/fish $LOGIN_OPTION + fi + ''; + }; } diff --git a/home/sway.nix b/home/sway.nix index d698b69..271b023 100644 --- a/home/sway.nix +++ b/home/sway.nix @@ -1,6 +1,6 @@ -{pkgs, ...}: let +{lib, pkgs, ...}: let dirs = { - defaults = ./defaults; + defaults = ../defaults; }; in { wayland.windowManager.sway = { @@ -13,8 +13,9 @@ in { gtk = true; }; }; - - programs.wofi.enable = pkgs.stdenv.isLinux; + xdg.configFile."sway/config".source = lib.mkForce (dirs.defaults + /sway/config); + xdg.configFile."waybar/config".source = lib.mkForce (dirs.defaults + /waybar/config); + programs.rofi.enable = pkgs.stdenv.isLinux; programs.mako.enable = pkgs.stdenv.isLinux; # programs.cliphist.enable = pkgs.stdenv.isLinux; programs.waybar = { diff --git a/modules/host-users.nix b/modules/host-users.nix index bc78d23..0878644 100644 --- a/modules/host-users.nix +++ b/modules/host-users.nix @@ -6,12 +6,12 @@ } @ args: { # Set up networking configuration networking.hostName = hostname; - networking.computerName = hostname; + # networking.computerName = hostname; # networking.firewall.enable = true; # VERY important, do not touch # networking.firewall.allowedTCPPorts = []; # networking.firewall.allowedUDPPorts = []; # networking.networkmanager.enable = pkgs.stdenv.isLinux; # Linux tool for managing network connections - system.defaults.smb.NetBIOSName = hostname; + # system.defaults.smb.NetBIOSName = hostname; # Set up user accounts # Don't forget to set a password with ‘passwd’! @@ -21,7 +21,10 @@ then "/Users/${userName}" else "/home/${userName}"; description = userName; + group = "wyatt"; + isNormalUser = true; }; + users.groups.wyatt = {}; nix.settings.trusted-users = [userName]; } diff --git a/modules/nix-core.nix b/modules/nix-core.nix index c908c6e..12fb051 100644 --- a/modules/nix-core.nix +++ b/modules/nix-core.nix @@ -9,7 +9,7 @@ nixpkgs.config.allowUnfree = true; # Auto upgrade nix package and the daemon service. - services.nix-daemon.enable = true; + # services.nix-daemon.enable = true; # Use this instead of services.nix-daemon.enable if you # don't wan't the daemon service to be managed for you. # nix.useDaemon = true; diff --git a/modules/nixos/configuration.nix b/modules/nixos/configuration.nix index 0c06960..0722456 100644 --- a/modules/nixos/configuration.nix +++ b/modules/nixos/configuration.nix @@ -6,11 +6,6 @@ userName, ... }: { - # Bring in the hardware configuration - imports = [ - /etc/nixos/hardware-configuration.nix - ]; - # Enable flakes for NixOS nix.settings.experimental-features = ["nix-command" "flakes"]; @@ -34,17 +29,17 @@ # For systems with AMD graphics, this enables Vulkan on 32-bit applications # For 64-bit application, however, Vulkan is enabled by default - hardware.graphics.driSupport32Bit = true; + # hardware.graphics.driSupport32Bit = true; # For systems with AMD graphics, enable AMDVLK - hardware.hardware = { - extraPackages = with pkgs; [ - amdvlk - ]; - extraPackages32 = with pkgs; [ - driversi686Linux - ]; - }; + #hardware.graphics = { + # extraPackages = with pkgs; [ + # amdvlk + # ]; + # extraPackages32 = with pkgs; [ + # driversi686Linux + # ]; + #}; # Enable Bluetooth if present hardware.bluetooth.enable = true; @@ -74,6 +69,7 @@ playerctl light brightnessctl + firefox wttrbar cliphist ]; @@ -120,9 +116,12 @@ programs.steam = { enable = true; remotePlay.openFirewall = true; - localNetworkGameTransfers = true; + localNetworkGameTransfers.openFirewall = true; }; + # Enable gamescope (compositor) when needed + programs.gamescope.enable = true; + # Add username to groups "wheel" and "video" - more may be added here later users.users.${userName}.extraGroups = ["wheel" "video"]; @@ -144,5 +143,29 @@ networking.networkmanager.enable = true; # Linux tool for managing network connections # Enable Flatpak (app containerization) - services.flatpak.enable = true; + # services.flatpak.enable = true; + services.flatpak = { + enable = true; + remotes = [{ + name = "flathub"; location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; + }]; + packages = [ + "com.github.tchx84.Flatseal" + "com.slack.Slack" + "dev.goats.xivlauncher" + "info.beyondallreason.bar" + "io.dbeaver.DBeaverCommunity" + "io.openrct2.OpenRCT2" + "md.obsidian.Obsidian" + "org.prismlauncher.PrismLauncher" + "sh.cider.Cider" + ]; + + update = { + auto = { + enable = true; + onCalendar = "weekly"; + }; + }; + }; } -- 2.45.2 From 929355fbca2789b79164c57ccdc101fd980286fe Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 14 Sep 2024 15:30:50 -0400 Subject: [PATCH 04/17] wip: added packages, modified portals, configuration --- home/core.nix | 2 + home/default.nix | 9 +++ home/sway.nix | 86 +++--------------------- modules/nixos/configuration.nix | 24 +++++-- modules/nixos/hardware-configuration.nix | 46 +++++++------ 5 files changed, 61 insertions(+), 106 deletions(-) diff --git a/home/core.nix b/home/core.nix index dd4e491..a483bf2 100644 --- a/home/core.nix +++ b/home/core.nix @@ -48,6 +48,8 @@ # productivity # iterm2 discord + betterdiscordctl + vesktop obsidian vscode weechat diff --git a/home/default.nix b/home/default.nix index a06fb8d..7686b73 100644 --- a/home/default.nix +++ b/home/default.nix @@ -25,9 +25,18 @@ if pkgs.stdenv.isDarwin then "/Users/${userName}" else "/home/${userName}"; + sessionVariables = { XDG_CURRENT_DESKTOP = "sway"; }; + + pointerCursor = { + gtk.enable = true; + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Classic"; + size = 22; + }; + stateVersion = "24.05"; }; diff --git a/home/sway.nix b/home/sway.nix index 271b023..5b9f88e 100644 --- a/home/sway.nix +++ b/home/sway.nix @@ -1,4 +1,8 @@ -{lib, pkgs, ...}: let +{ + lib, + pkgs, + ... +}: let dirs = { defaults = ../defaults; }; @@ -13,89 +17,15 @@ in { gtk = true; }; }; + xdg.configFile."sway/config".source = lib.mkForce (dirs.defaults + /sway/config); xdg.configFile."waybar/config".source = lib.mkForce (dirs.defaults + /waybar/config); + xdg.configFile."waybar/style.css".source = lib.mkForce (dirs.defaults + /waybar/style.css); programs.rofi.enable = pkgs.stdenv.isLinux; - programs.mako.enable = pkgs.stdenv.isLinux; + services.mako.enable = pkgs.stdenv.isLinux; # programs.cliphist.enable = pkgs.stdenv.isLinux; programs.waybar = { enable = pkgs.stdenv.isLinux; systemd.enable = true; - style = '' - * { - border: none; - border-radius: 0; - font-family: "Monaspace Krypton"; - font-size: 13px; - min-height: 0; - } - - window#waybar { - background: #1f2335; - border-bottom: 1px solid #24283b; - color: #c0caf5; - opacity: 0.808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808; - } - - #workspaces button { - padding: 5px; - padding-left: 12px; - padding-right: 12px; - background: transparent; - color: #c0caf5; - border-bottom: 1px solid transparent; - } - - #workspaces button.focused { - background: #c0caf5; - color: #1d2021; - border-bottom: 1px solid #c0caf5; - } - - #cpu, - #memory, - #pulseaudio, - #network, - #battery, - #clock, - #custom-playerctl { - padding: 0 10px; - margin: 0 5px; - } - - #battery.charging { - color: #9ece6a; - } - - #battery.warning:not(.charging) { - color: #ff9e64; - } - - @keyframes blink { - to { - background-color: #1d2021; - color: #ebdbb2; - } - } - - #battery.critical:not(.charging) { - background: #f7768e; - color: #ebdbb2; - border-bottom: 1px solid #ebdbb2; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } - - #network.disconnected { - color: #cc241d; - } - - #pulseaudio.muted { - color: #cc241d; - } - ''; }; } diff --git a/modules/nixos/configuration.nix b/modules/nixos/configuration.nix index 0722456..e5aaa08 100644 --- a/modules/nixos/configuration.nix +++ b/modules/nixos/configuration.nix @@ -72,6 +72,7 @@ firefox wttrbar cliphist + xivlauncher # run with this: gamescope -f -w 2560 -h 1440 -b -- gamemoderun %command% ]; # Install system-wide fonts @@ -119,16 +120,22 @@ localNetworkGameTransfers.openFirewall = true; }; + # Enable gamemode (gamemode, gamemoded, gamemoderun) when needed + programs.gamemode.enable = true; + # Enable gamescope (compositor) when needed programs.gamescope.enable = true; # Add username to groups "wheel" and "video" - more may be added here later - users.users.${userName}.extraGroups = ["wheel" "video"]; + users.users.${userName}.extraGroups = ["wheel" "video" "gamemode"]; # XDG stuff xdg = { portal = { enable = true; + wlr.enable = true; + config = {}; + xdgOpenUsePortal = true; extraPortals = with pkgs; [ xdg-desktop-portal-wlr xdg-desktop-portal-gtk @@ -145,14 +152,16 @@ # Enable Flatpak (app containerization) # services.flatpak.enable = true; services.flatpak = { - enable = true; - remotes = [{ - name = "flathub"; location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; - }]; + enable = true; + remotes = [ + { + name = "flathub"; + location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; + } + ]; packages = [ "com.github.tchx84.Flatseal" "com.slack.Slack" - "dev.goats.xivlauncher" "info.beyondallreason.bar" "io.dbeaver.DBeaverCommunity" "io.openrct2.OpenRCT2" @@ -160,7 +169,6 @@ "org.prismlauncher.PrismLauncher" "sh.cider.Cider" ]; - update = { auto = { enable = true; @@ -168,4 +176,6 @@ }; }; }; + + system.stateVersion = "24.05"; } diff --git a/modules/nixos/hardware-configuration.nix b/modules/nixos/hardware-configuration.nix index 91c6803..5c77f62 100644 --- a/modules/nixos/hardware-configuration.nix +++ b/modules/nixos/hardware-configuration.nix @@ -1,32 +1,36 @@ # 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" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-label/COMPUTER"; - fsType = "xfs"; - }; + fileSystems."/" = { + device = "/dev/disk/by-label/COMPUTER"; + fsType = "xfs"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-label/BOOT"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-label/BOOT"; + fsType = "vfat"; + options = ["fmask=0022" "dmask=0022"]; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/6d6bcc02-20a9-4ae8-9c1e-5124fb2b2634"; } - ]; + swapDevices = [ + {device = "/dev/disk/by-label/SWAP";} + ]; # 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 -- 2.45.2 From 33876f6bc92c5e2ee1435faf26577585f53e687c Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Tue, 29 Oct 2024 13:29:34 -0400 Subject: [PATCH 05/17] added shairport --- home/shairport.nix | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 home/shairport.nix diff --git a/home/shairport.nix b/home/shairport.nix new file mode 100644 index 0000000..e92b3ce --- /dev/null +++ b/home/shairport.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: { + services.shairport-sync = { + enable = pkgs.stdenv.isLinux; + openFirewall = pkgs.stdenv.isLinux; + }; +} -- 2.45.2 From fbaa38c1a50cc405f63a509246f620136b34e4cb Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Wed, 30 Oct 2024 22:41:37 -0400 Subject: [PATCH 06/17] modularized into machine --- modules/common/README.md | 9 +++++ modules/{ => common}/host-users.nix | 0 modules/{ => common}/nix-core.nix | 0 modules/machine/cloud/README.md | 9 +++++ .../cloud}/configuration.nix | 39 +++++++++++++++---- .../cloud}/hardware-configuration.nix | 0 modules/machine/ixion/README.md | 9 +++++ modules/machine/sephiroth/README.md | 9 +++++ .../{darwin => machine/sephiroth}/apps.nix | 0 .../sephiroth}/configuration.nix | 10 ++++- modules/machine/valefor/README.md | 9 +++++ 11 files changed, 85 insertions(+), 9 deletions(-) create mode 100644 modules/common/README.md rename modules/{ => common}/host-users.nix (100%) rename modules/{ => common}/nix-core.nix (100%) create mode 100644 modules/machine/cloud/README.md rename modules/{nixos => machine/cloud}/configuration.nix (87%) rename modules/{nixos => machine/cloud}/hardware-configuration.nix (100%) create mode 100644 modules/machine/ixion/README.md create mode 100644 modules/machine/sephiroth/README.md rename modules/{darwin => machine/sephiroth}/apps.nix (100%) rename modules/{darwin => machine/sephiroth}/configuration.nix (95%) create mode 100644 modules/machine/valefor/README.md diff --git a/modules/common/README.md b/modules/common/README.md new file mode 100644 index 0000000..42bc1c6 --- /dev/null +++ b/modules/common/README.md @@ -0,0 +1,9 @@ +# Shared configurations + +Developed and designed by Wyatt J. Miller, 2024 + +Licensed by the Mozilla Public License v2 + +## Synopsis + +This is the directory that holds shared configuration files amongst computers that I own. They are called by the root `flake.nix` file. diff --git a/modules/host-users.nix b/modules/common/host-users.nix similarity index 100% rename from modules/host-users.nix rename to modules/common/host-users.nix diff --git a/modules/nix-core.nix b/modules/common/nix-core.nix similarity index 100% rename from modules/nix-core.nix rename to modules/common/nix-core.nix diff --git a/modules/machine/cloud/README.md b/modules/machine/cloud/README.md new file mode 100644 index 0000000..6650285 --- /dev/null +++ b/modules/machine/cloud/README.md @@ -0,0 +1,9 @@ +# Machine specific configuration - cloud + +Designed and developed by Wyatt J. Miller, 2024 + +Licensed by the Mozilla Public License v2 + +## Synopsis + +This directory is where the machine-specific configuration files for hostname `cloud` live, my primary desktop. These files get called by the root `flake.nix` file. diff --git a/modules/nixos/configuration.nix b/modules/machine/cloud/configuration.nix similarity index 87% rename from modules/nixos/configuration.nix rename to modules/machine/cloud/configuration.nix index e5aaa08..95fb6e2 100644 --- a/modules/nixos/configuration.nix +++ b/modules/machine/cloud/configuration.nix @@ -1,7 +1,4 @@ { - inputs, - config, - lib, pkgs, userName, ... @@ -15,9 +12,9 @@ # Install and enable common graphics drivers hardware.opengl = { - driSupport = true; + # driSupport = true; extraPackages = with pkgs; [ - mesa_drivers + mesa libvdpau-va-gl libva libva-utils @@ -63,6 +60,10 @@ git wireguard-tools podman + buildah + podman-tui + podman-compose + podman-desktop toolbox grim slurp @@ -72,7 +73,8 @@ firefox wttrbar cliphist - xivlauncher # run with this: gamescope -f -w 2560 -h 1440 -b -- gamemoderun %command% + xivlauncher + patchelf ]; # Install system-wide fonts @@ -127,14 +129,20 @@ programs.gamescope.enable = true; # Add username to groups "wheel" and "video" - more may be added here later - users.users.${userName}.extraGroups = ["wheel" "video" "gamemode"]; + users.users.${userName}.extraGroups = ["wheel" "video" "gamemode" "podman" "network"]; # XDG stuff xdg = { portal = { enable = true; wlr.enable = true; - config = {}; + config = { + common = { + default = [ + "wlr" + ]; + }; + }; xdgOpenUsePortal = true; extraPortals = with pkgs; [ xdg-desktop-portal-wlr @@ -143,6 +151,8 @@ }; }; + # environment. + # Firewall stuff not allowed in common user and network creation networking.firewall.enable = true; # VERY important, do not touch # networking.firewall.allowedTCPPorts = []; @@ -177,5 +187,18 @@ }; }; + # Enable Podman (OCI containers) + virtualisation.podman = { + enable = true; + dockerSocket.enable = true; + defaultNetwork.settings.dns_enabled = true; + }; + + services.shairport-sync = { + enable = pkgs.stdenv.isLinux; + openFirewall = pkgs.stdenv.isLinux; + arguments = "-v -o pw"; + }; + system.stateVersion = "24.05"; } diff --git a/modules/nixos/hardware-configuration.nix b/modules/machine/cloud/hardware-configuration.nix similarity index 100% rename from modules/nixos/hardware-configuration.nix rename to modules/machine/cloud/hardware-configuration.nix diff --git a/modules/machine/ixion/README.md b/modules/machine/ixion/README.md new file mode 100644 index 0000000..c8e7023 --- /dev/null +++ b/modules/machine/ixion/README.md @@ -0,0 +1,9 @@ +# Machine specific configuration - ixion + +Designed and developed by Wyatt J. Miller, 2024 + +Licensed by the Mozilla Public License v2 + +## Synopsis + +This directory is currently empty so, currently, there's nothing to see! However, this is where the machine-specific configuration files for hostname `ixion` live, my storage, status, game, and media server. These files get called by the root `flake.nix` file. diff --git a/modules/machine/sephiroth/README.md b/modules/machine/sephiroth/README.md new file mode 100644 index 0000000..d1d7b2a --- /dev/null +++ b/modules/machine/sephiroth/README.md @@ -0,0 +1,9 @@ +# Machine specific configuration - sephiroth + +Designed and developed by Wyatt J. Miller, 2024 + +Licensed by the Mozilla Public License v2 + +## Synopsis + +This directory is where the machine-specific configuration files for hostname `sephiroth` live, my primary laptop. These files get called by the root `flake.nix` file. diff --git a/modules/darwin/apps.nix b/modules/machine/sephiroth/apps.nix similarity index 100% rename from modules/darwin/apps.nix rename to modules/machine/sephiroth/apps.nix diff --git a/modules/darwin/configuration.nix b/modules/machine/sephiroth/configuration.nix similarity index 95% rename from modules/darwin/configuration.nix rename to modules/machine/sephiroth/configuration.nix index b394f80..cce0ded 100644 --- a/modules/darwin/configuration.nix +++ b/modules/machine/sephiroth/configuration.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: { +{pkgs, hostname, ...}: { system = { # activationScripts are executed every time you boot the system or run `nixos-rebuild` / `darwin-rebuild`. activationScripts.postUserActivation.text = '' @@ -145,6 +145,14 @@ # }; }; + + networking.hostName = hostname; + networking.computerName = hostname; + networking.firewall.enable = true; # VERY important, do not touch + networking.firewall.allowedTCPPorts = []; + networking.firewall.allowedUDPPorts = []; + system.defaults.smb.NetBIOSName = hostname; + # Add ability to used TouchID for sudo authentication security.pam.enableSudoTouchIdAuth = true; diff --git a/modules/machine/valefor/README.md b/modules/machine/valefor/README.md new file mode 100644 index 0000000..1f2e918 --- /dev/null +++ b/modules/machine/valefor/README.md @@ -0,0 +1,9 @@ +# Machine specific configuration - valefor + +Designed and developed by Wyatt J. Miller, 2024 + +Licensed by the Mozilla Public License v2 + +## Synopsis + +This directory is currently empty so, currently, there's nothing to see! However, this is where the machine-specific configuration files for hostname `valefor` live, my apartment appliance server. These files get called by the root `flake.nix` file. -- 2.45.2 From 50d37c0e6b8170fd20a6422df3e07927c9dad04b Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Wed, 30 Oct 2024 22:41:50 -0400 Subject: [PATCH 07/17] some stuff --- flake.lock | 53 ++++++++++++++++++++++++++------ flake.nix | 76 +++++++++++++++++++++++++++++++++++++++------- home/core.nix | 1 + home/default.nix | 9 ++++-- home/git.nix | 3 +- home/shairport.nix | 6 ---- 6 files changed, 119 insertions(+), 29 deletions(-) delete mode 100644 home/shairport.nix diff --git a/flake.lock b/flake.lock index f86ca1d..50051a5 100644 --- a/flake.lock +++ b/flake.lock @@ -57,18 +57,36 @@ "type": "github" } }, - "nixpkgs": { + "nix-ld": { + "inputs": { + "nixpkgs": "nixpkgs" + }, "locked": { - "lastModified": 1725693463, - "narHash": "sha256-ZPzhebbWBOr0zRWW10FfqfbJlan3G96/h3uqhiFqmwg=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "68e7dce0a6532e876980764167ad158174402c6f", + "lastModified": 1728031945, + "narHash": "sha256-NRkLjdMtVfC6dD1gEbYZWFEtbmC2xfD6ft1IP7l76Vw=", + "owner": "Mic92", + "repo": "nix-ld", + "rev": "4524c512e8729ccb5a1b9239d01e1474cbf074a2", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-24.05", + "owner": "Mic92", + "repo": "nix-ld", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1727634051, + "narHash": "sha256-S5kVU7U82LfpEukbn/ihcyNt2+EvG7Z5unsKW9H/yFA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "06cf0e1da4208d3766d898b7fdab6513366d45b9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -89,12 +107,29 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1726243404, + "narHash": "sha256-sjiGsMh+1cWXb53Tecsm4skyFNag33GPbVgCdfj3n9I=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "345c263f2f53a3710abe117f28a5cb86d0ba4059", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "darwin": "darwin", "home-manager": "home-manager", "nix-flatpak": "nix-flatpak", - "nixpkgs": "nixpkgs", + "nix-ld": "nix-ld", + "nixpkgs": "nixpkgs_2", "nixpkgs-darwin": "nixpkgs-darwin" } } diff --git a/flake.nix b/flake.nix index 11613f9..02bac2b 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,10 @@ { description = "Wyatt's nix configuration suite"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1"; nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-24.05-darwin"; + nix-ld.url = "github:Mic92/nix-ld"; home-manager = { url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; @@ -18,6 +19,7 @@ self, nixpkgs, nix-flatpak, + nix-ld, darwin, home-manager, ... @@ -25,7 +27,7 @@ userName = "wyatt"; userEmail = "wyatt@wyattjmiller.com"; extraSpecialArgs = { - inherit userName userEmail; + inherit userName userEmail ; }; in { # Primary laptop - MacBook Pro (2023, M3) @@ -36,10 +38,10 @@ hostname = "sephiroth"; }; modules = [ - ./modules/nix-core.nix - ./modules/darwin/configuration.nix - ./modules/darwin/apps.nix - ./modules/host-users.nix + ./modules/common/nix-core.nix + ./modules/common/host-users.nix + ./modules/machine/sephiroth/configuration.nix + ./modules/machine/sephiroth/apps.nix home-manager.darwinModules.home-manager { @@ -59,11 +61,12 @@ hostname = "cloud"; }; modules = [ - nix-flatpak.nixosModules.nix-flatpak - ./modules/nixos/hardware-configuration.nix - ./modules/nix-core.nix - ./modules/nixos/configuration.nix - ./modules/host-users.nix + nix-flatpak.nixosModules.nix-flatpak + nix-ld.nixosModules.nix-ld + ./modules/common/nix-core.nix + ./modules/common/host-users.nix + ./modules/machine/cloud/hardware-configuration.nix + ./modules/machine/cloud/configuration.nix home-manager.nixosModules.home-manager { @@ -76,5 +79,56 @@ } ]; }; + + # Apartment appliance server + nixosConfigurations."valefor" = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + inherit userName userEmail; + hostname = "valefor"; + }; + # modules = [ + # nix-ld.nixosModules.nix-ld + # ./modules/nix-core.nix + # ./modules/host-users.nix + # + # home-manager.nixosModules.home-manager + # { + # home-manager.useGlobalPkgs = true; + # home-manager.useUserPackages = true; + # home-manager.extraSpecialArgs = extraSpecialArgs; + # home-manager.users.${userName}.imports = [ + # ./home + # ]; + # } + # ]; + }; + + # Storage, status, game, and media server + nixosConfigurations."ixion" = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + inherit userName userEmail; + hostname = "ixion"; + }; + # modules = [ + # nix-flatpak.nixosModules.nix-flatpak + # nix-ld.nixosModules.nix-ld + # ./modules/nixos/hardware-configuration.nix + # ./modules/nix-core.nix + # ./modules/nixos/configuration.nix + # ./modules/host-users.nix + # + # home-manager.nixosModules.home-manager + # { + # home-manager.useGlobalPkgs = true; + # home-manager.useUserPackages = true; + # home-manager.extraSpecialArgs = extraSpecialArgs; + # home-manager.users.${userName}.imports = [ + # ./home + # ]; + # } + # ]; + }; }; } diff --git a/home/core.nix b/home/core.nix index a483bf2..9cfbd15 100644 --- a/home/core.nix +++ b/home/core.nix @@ -22,6 +22,7 @@ aria2 yt-dlp imv + xdg-utils # misc cowsay diff --git a/home/default.nix b/home/default.nix index 6506390..b9fc959 100644 --- a/home/default.nix +++ b/home/default.nix @@ -36,12 +36,17 @@ in { sessionVariables = { XDG_CURRENT_DESKTOP = "sway"; + XDG_SESSION_TYPE = "wayland"; + XDG_CONFIG_HOME = "$HOME/.config"; + XDG_CACHE_HOME = "$HOME/.cache"; + XDG_DATA_HOME = "$HOME/.local/share"; + XDG_STATE_HOME = "$HOME/.local/state"; }; pointerCursor = { gtk.enable = true; - package = pkgs.bibata-cursors; - name = "Bibata-Modern-Classic"; + package = pkgs.catppuccin-cursors.mochaDark; + name = "catppuccin-mocha-dark-cursors"; size = 22; }; diff --git a/home/git.nix b/home/git.nix index 43bbe6e..532edb6 100644 --- a/home/git.nix +++ b/home/git.nix @@ -32,7 +32,8 @@ # common aliases br = "branch"; co = "checkout"; - st = "status"; + st = "status -sb"; + status = "status -sb"; ls = "log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate"; ll = "log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate --numstat"; cm = "commit -m"; diff --git a/home/shairport.nix b/home/shairport.nix deleted file mode 100644 index e92b3ce..0000000 --- a/home/shairport.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: { - services.shairport-sync = { - enable = pkgs.stdenv.isLinux; - openFirewall = pkgs.stdenv.isLinux; - }; -} -- 2.45.2 From 3e47cee38207ecaf63fdf3985098926244511905 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Wed, 30 Oct 2024 23:35:43 -0400 Subject: [PATCH 08/17] added readme for machine module --- modules/machine/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 modules/machine/README.md diff --git a/modules/machine/README.md b/modules/machine/README.md new file mode 100644 index 0000000..e8a01a1 --- /dev/null +++ b/modules/machine/README.md @@ -0,0 +1,13 @@ +# Machine specific configuration directories + +These are where the machine specific configurations live. + +I like Final Fantasy, alright? Isn't everyone supposed to have a hobby? + +## Desktops, Laptops, and Workstations + +These are named after Final Fantasy VII characters. + +## Servers/Network Infrastructure + +These are named after Final Fantasy summons. -- 2.45.2 From b5beb52de1520801ea733a93d8a27f567ad3171a Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Wed, 30 Oct 2024 23:35:48 -0400 Subject: [PATCH 09/17] added root readme --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/README.md b/README.md index c15328d..4ab558b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,54 @@ # Wyatt's Nix configuration Designed and developed by Wyatt J. Miller, 2024 + +Licensed by the Mozilla Public License v2 + +## What is this?? + +This repository is my multi-machine Nix configuration, written in a Nix flake! + +## How do I get this? + +Make sure the following is installed: + +- `git` (most operating systems come with git already installed) +- `nix` (if you are on macOS or a non-NixOS system) + +If you don't have `git` installed and are running macOS, run the following command: + +```bash +sudo xcode-select +``` + +If you don't have `nix` installed and are running Linux, use the Determinate Nix Installer! + +```bash +curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install +``` + +If you don't have `nix` installed and are running macOS, use the Determinate Nix Installer! + +```bash +curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install +``` + +There's a separate installer Determinate System's + +## How do I run this? + +For NixOS systems: + +```bash +sudo nixos-rebuild switch --flake .# +``` + +For macOS systems: + +```bash +nix run nix-darwin --extra-experimental-features nix-command --extra-experimental-features flakes -- switch --flake .# +``` + +where `` is the particular configuration you would like to run. + +Non-NixOS Linux systems should be coming soon! -- 2.45.2 From 92a92700df69c23cc87da57a49f7176edfbf10d5 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Wed, 30 Oct 2024 23:37:13 -0400 Subject: [PATCH 10/17] modified root readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ab558b..e1ee965 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ If you don't have `nix` installed and are running macOS, use the Determinate Nix curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install ``` -There's a separate installer Determinate System's +There's a separate installer Determinate Systems releases (and feel free to try it) but that's not on the install list here. ## How do I run this? -- 2.45.2 From fcd11e512779db57a9ad14155f949d82a4ec0075 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Wed, 30 Oct 2024 23:45:47 -0400 Subject: [PATCH 11/17] modified readme to be more descriptive --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index e1ee965..1265ad7 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,14 @@ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix There's a separate installer Determinate Systems releases (and feel free to try it) but that's not on the install list here. +Once you got everything required, it's clonin' time! + +```bash +git clone https://scm.wyattjmiller.com/wymiller/nix-config-v2 +``` + +Once that's done, head to the next section. + ## How do I run this? For NixOS systems: -- 2.45.2 From 9a435da5e3402a5bd8d85df2255f6e00caa96dc1 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Thu, 31 Oct 2024 22:56:43 -0400 Subject: [PATCH 12/17] modularized home packages --- home/packages/common.nix | 52 +++++++++++++++++++++++++++++++++++++++ home/packages/darwin.nix | 11 +++++++++ home/packages/default.nix | 11 +++++++++ home/packages/linux.nix | 11 +++++++++ 4 files changed, 85 insertions(+) create mode 100644 home/packages/common.nix create mode 100644 home/packages/darwin.nix create mode 100644 home/packages/default.nix create mode 100644 home/packages/linux.nix diff --git a/home/packages/common.nix b/home/packages/common.nix new file mode 100644 index 0000000..43cc268 --- /dev/null +++ b/home/packages/common.nix @@ -0,0 +1,52 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + nnn # terminal file manager + + # archives + zip + xz + unzip + p7zip + + # utils + zellij + tmux + bat + lazygit + bottom + ripgrep + jq + yq-go + fzf + fh + aria2 + yt-dlp + imv + xdg-utils + obsidian + vscode + weechat + + # misc + cowsay + file + which + tree + gnutar + gnupg + nerdfonts + zoxide + babelfish + + # language-specific package managers + nodejs + cargo + python3 + + # nix specific stuff + nixd + deadnix + alejandra + statix + ]; +} diff --git a/home/packages/darwin.nix b/home/packages/darwin.nix new file mode 100644 index 0000000..19e825b --- /dev/null +++ b/home/packages/darwin.nix @@ -0,0 +1,11 @@ +{ + pkgs, + lib, + ... +}: { + home.packages = lib.mkIf pkgs.stdenv.isDarwin (with pkgs; [ + iterm2 + discord + ollama + ]); +} diff --git a/home/packages/default.nix b/home/packages/default.nix new file mode 100644 index 0000000..58789ec --- /dev/null +++ b/home/packages/default.nix @@ -0,0 +1,11 @@ +{ + pkgs, + lib, + ... +}: { + imports = [ + ./common.nix + ./darwin.nix + ./linux.nix + ]; +} diff --git a/home/packages/linux.nix b/home/packages/linux.nix new file mode 100644 index 0000000..3208b8e --- /dev/null +++ b/home/packages/linux.nix @@ -0,0 +1,11 @@ +{ + pkgs, + lib, + ... +}: { + home.packages = lib.mkIf pkgs.stdenv.isLinux (with pkgs; [ + imv + betterdiscordctl + vesktop + ]); +} -- 2.45.2 From ea90e55cbbf771f90a20293f20db346ede27533c Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sun, 3 Nov 2024 22:44:23 -0500 Subject: [PATCH 13/17] compatibility modifications for sephiroth --- flake.lock | 35 +++--------- flake.nix | 9 ++- home/core.nix | 63 --------------------- home/default.nix | 4 +- home/packages/common.nix | 2 - home/packages/darwin.nix | 1 - home/packages/linux.nix | 1 + modules/common/host-users.nix | 2 - modules/common/nix-core.nix | 10 ++-- modules/machine/README.md | 6 +- modules/machine/cloud/configuration.nix | 9 ++- modules/machine/sephiroth/apps.nix | 5 +- modules/machine/sephiroth/configuration.nix | 15 +++-- 13 files changed, 45 insertions(+), 117 deletions(-) delete mode 100644 home/core.nix diff --git a/flake.lock b/flake.lock index 50051a5..087431b 100644 --- a/flake.lock +++ b/flake.lock @@ -3,19 +3,20 @@ "darwin": { "inputs": { "nixpkgs": [ - "nixpkgs-darwin" + "nixpkgs" ] }, "locked": { - "lastModified": 1725628909, - "narHash": "sha256-xI0OSqPHcs/c/utJsU0Zvcp1VhejMI9mgwr68uHHlPs=", + "lastModified": 1730448474, + "narHash": "sha256-qE/cYKBhzxHMtKtLK3hlSR3uzO1pWPGLrBuQK7r0CHc=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "76559183801030451e200c90a1627c1d82bb4910", + "rev": "683d0c4cd1102dcccfa3f835565378c7f3cbe05e", "type": "github" }, "original": { "owner": "lnl7", + "ref": "master", "repo": "nix-darwin", "type": "github" } @@ -27,16 +28,15 @@ ] }, "locked": { - "lastModified": 1725703823, - "narHash": "sha256-tDgM4d8mLK0Hd6YMB2w1BqMto1XBXADOzPEaLl10VI4=", + "lastModified": 1730490306, + "narHash": "sha256-AvCVDswOUM9D368HxYD25RsSKp+5o0L0/JHADjLoD38=", "owner": "nix-community", "repo": "home-manager", - "rev": "208df2e558b73b6a1f0faec98493cb59a25f62ba", + "rev": "1743615b61c7285976f85b303a36cdf88a556503", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-24.05", "repo": "home-manager", "type": "github" } @@ -91,22 +91,6 @@ "type": "github" } }, - "nixpkgs-darwin": { - "locked": { - "lastModified": 1725784148, - "narHash": "sha256-kZQbAtu+HSIU186Y4sXL+YJNnVpAo6sb+qowxv8MwaQ=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "075d83b556ad70f12f82bbd54eb019f5657dd371", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-24.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1726243404, @@ -129,8 +113,7 @@ "home-manager": "home-manager", "nix-flatpak": "nix-flatpak", "nix-ld": "nix-ld", - "nixpkgs": "nixpkgs_2", - "nixpkgs-darwin": "nixpkgs-darwin" + "nixpkgs": "nixpkgs_2" } } }, diff --git a/flake.nix b/flake.nix index 02bac2b..88b90ce 100644 --- a/flake.nix +++ b/flake.nix @@ -3,15 +3,14 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1"; - nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-24.05-darwin"; nix-ld.url = "github:Mic92/nix-ld"; home-manager = { - url = "github:nix-community/home-manager/release-24.05"; + url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; darwin = { - url = "github:lnl7/nix-darwin"; - inputs.nixpkgs.follows = "nixpkgs-darwin"; + url = "github:lnl7/nix-darwin/master"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -27,7 +26,7 @@ userName = "wyatt"; userEmail = "wyatt@wyattjmiller.com"; extraSpecialArgs = { - inherit userName userEmail ; + inherit userName userEmail; }; in { # Primary laptop - MacBook Pro (2023, M3) diff --git a/home/core.nix b/home/core.nix deleted file mode 100644 index 9cfbd15..0000000 --- a/home/core.nix +++ /dev/null @@ -1,63 +0,0 @@ -{pkgs, ...}: { - home.packages = with pkgs; [ - nnn # terminal file manager - - # archives - zip - xz - unzip - p7zip - - # utils - zellij - tmux - bat - lazygit - bottom - ripgrep - jq - yq-go - fzf - fh - aria2 - yt-dlp - imv - xdg-utils - - # misc - cowsay - file - which - tree - gnutar - gnupg - nerdfonts - zoxide - babelfish - - # language-specific package managers - nodejs - cargo - python3 - - # nix specific stuff - nixd - deadnix - alejandra - statix - - # productivity - # iterm2 - discord - betterdiscordctl - vesktop - obsidian - vscode - weechat - # iamb - # ollama - - # games? - # prismlauncher - ]; -} diff --git a/home/default.nix b/home/default.nix index b9fc959..84f605a 100644 --- a/home/default.nix +++ b/home/default.nix @@ -15,7 +15,7 @@ in { imports = map (module: import module {inherit lib pkgs dirs userName userEmail;}) [ ./atuin.nix ./shell.nix - ./core.nix + ./packages ./git.nix ./starship.nix ./eza.nix @@ -43,7 +43,7 @@ in { XDG_STATE_HOME = "$HOME/.local/state"; }; - pointerCursor = { + pointerCursor = lib.mkIf pkgs.stdenv.isLinux { gtk.enable = true; package = pkgs.catppuccin-cursors.mochaDark; name = "catppuccin-mocha-dark-cursors"; diff --git a/home/packages/common.nix b/home/packages/common.nix index 43cc268..ea7a501 100644 --- a/home/packages/common.nix +++ b/home/packages/common.nix @@ -21,8 +21,6 @@ fh aria2 yt-dlp - imv - xdg-utils obsidian vscode weechat diff --git a/home/packages/darwin.nix b/home/packages/darwin.nix index 19e825b..4306b58 100644 --- a/home/packages/darwin.nix +++ b/home/packages/darwin.nix @@ -4,7 +4,6 @@ ... }: { home.packages = lib.mkIf pkgs.stdenv.isDarwin (with pkgs; [ - iterm2 discord ollama ]); diff --git a/home/packages/linux.nix b/home/packages/linux.nix index 3208b8e..af40187 100644 --- a/home/packages/linux.nix +++ b/home/packages/linux.nix @@ -7,5 +7,6 @@ imv betterdiscordctl vesktop + xdg-utils ]); } diff --git a/modules/common/host-users.nix b/modules/common/host-users.nix index 0878644..4d8d4df 100644 --- a/modules/common/host-users.nix +++ b/modules/common/host-users.nix @@ -21,8 +21,6 @@ then "/Users/${userName}" else "/home/${userName}"; description = userName; - group = "wyatt"; - isNormalUser = true; }; users.groups.wyatt = {}; diff --git a/modules/common/nix-core.nix b/modules/common/nix-core.nix index 12fb051..7cf35df 100644 --- a/modules/common/nix-core.nix +++ b/modules/common/nix-core.nix @@ -1,9 +1,10 @@ - -{ pkgs, lib, ... }: - { + pkgs, + lib, + ... +}: { # enable flakes globally - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = ["nix-command" "flakes"]; # Allow unfree packages nixpkgs.config.allowUnfree = true; @@ -13,6 +14,7 @@ # Use this instead of services.nix-daemon.enable if you # don't wan't the daemon service to be managed for you. # nix.useDaemon = true; + services.nix-daemon.enable = true; nix.package = pkgs.nix; diff --git a/modules/machine/README.md b/modules/machine/README.md index e8a01a1..66b8967 100644 --- a/modules/machine/README.md +++ b/modules/machine/README.md @@ -4,10 +4,12 @@ These are where the machine specific configurations live. I like Final Fantasy, alright? Isn't everyone supposed to have a hobby? -## Desktops, Laptops, and Workstations +## Naming schemes + +### Desktops, Laptops, and Workstations These are named after Final Fantasy VII characters. -## Servers/Network Infrastructure +### Servers/Network Infrastructure These are named after Final Fantasy summons. diff --git a/modules/machine/cloud/configuration.nix b/modules/machine/cloud/configuration.nix index 95fb6e2..dd59431 100644 --- a/modules/machine/cloud/configuration.nix +++ b/modules/machine/cloud/configuration.nix @@ -155,8 +155,8 @@ # Firewall stuff not allowed in common user and network creation networking.firewall.enable = true; # VERY important, do not touch - # networking.firewall.allowedTCPPorts = []; - # networking.firewall.allowedUDPPorts = []; + networking.firewall.allowedTCPPorts = []; + networking.firewall.allowedUDPPorts = []; networking.networkmanager.enable = true; # Linux tool for managing network connections # Enable Flatpak (app containerization) @@ -200,5 +200,10 @@ arguments = "-v -o pw"; }; + users.users."${userName}" = { + group = "${userName}"; + isNormalUser = true; + }; + system.stateVersion = "24.05"; } diff --git a/modules/machine/sephiroth/apps.nix b/modules/machine/sephiroth/apps.nix index 4ccbd86..6cfb65e 100644 --- a/modules/machine/sephiroth/apps.nix +++ b/modules/machine/sephiroth/apps.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: { - +{pkgs, ...}: { environment.systemPackages = with pkgs; [ neovim git @@ -19,7 +18,7 @@ # Applications to install from Mac App Store using mas. # You need to install all these Apps manually first so that your apple account have records for them. # otherwise Apple Store will refuse to install them. - # For details, see https://github.com/mas-cli/mas + # For details, see https://github.com/mas-cli/mas masApps = { Xcode = 497799835; "Reeder 5." = 1529448980; diff --git a/modules/machine/sephiroth/configuration.nix b/modules/machine/sephiroth/configuration.nix index cce0ded..ec82bb5 100644 --- a/modules/machine/sephiroth/configuration.nix +++ b/modules/machine/sephiroth/configuration.nix @@ -1,4 +1,8 @@ -{pkgs, hostname, ...}: { +{ + pkgs, + hostname, + ... +}: { system = { # activationScripts are executed every time you boot the system or run `nixos-rebuild` / `darwin-rebuild`. activationScripts.postUserActivation.text = '' @@ -145,12 +149,11 @@ # }; }; - networking.hostName = hostname; networking.computerName = hostname; - networking.firewall.enable = true; # VERY important, do not touch - networking.firewall.allowedTCPPorts = []; - networking.firewall.allowedUDPPorts = []; + # networking.firewall.enable = true; # VERY important, do not touch + # networking.firewall.allowedTCPPorts = []; + # networking.firewall.allowedUDPPorts = []; system.defaults.smb.NetBIOSName = hostname; # Add ability to used TouchID for sudo authentication @@ -165,6 +168,8 @@ pkgs.bash ]; + system.stateVersion = 5; + # Set your time zone. time.timeZone = "America/Detroit"; } -- 2.45.2 From e19f24b5dd94c4399109d1a45cec4cc368bbcb70 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sun, 17 Nov 2024 17:15:46 -0500 Subject: [PATCH 14/17] added brew casks raycast, ice (menu bar hider) --- modules/machine/sephiroth/apps.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/machine/sephiroth/apps.nix b/modules/machine/sephiroth/apps.nix index 6cfb65e..e603b34 100644 --- a/modules/machine/sephiroth/apps.nix +++ b/modules/machine/sephiroth/apps.nix @@ -34,6 +34,8 @@ ]; casks = [ + "raycast" + "jordanbaird-ice" ]; }; } -- 2.45.2 From 55d5cea59f028ad4145d9ccfff6e226425edab0b Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Tue, 5 Nov 2024 19:46:59 -0500 Subject: [PATCH 15/17] modified user to be modular, separated machine specific configs --- flake.nix | 8 +++---- modules/common/{nix-core.nix => core.nix} | 7 ------ modules/common/{host-users.nix => users.nix} | 23 ++++++++++++++------ modules/machine/cloud/configuration.nix | 8 +++---- modules/machine/sephiroth/configuration.nix | 6 +++++ 5 files changed, 30 insertions(+), 22 deletions(-) rename modules/common/{nix-core.nix => core.nix} (70%) rename modules/common/{host-users.nix => users.nix} (66%) diff --git a/flake.nix b/flake.nix index 88b90ce..5abd142 100644 --- a/flake.nix +++ b/flake.nix @@ -37,8 +37,8 @@ hostname = "sephiroth"; }; modules = [ - ./modules/common/nix-core.nix - ./modules/common/host-users.nix + ./modules/common/core.nix + ./modules/common/users.nix ./modules/machine/sephiroth/configuration.nix ./modules/machine/sephiroth/apps.nix @@ -62,8 +62,8 @@ modules = [ nix-flatpak.nixosModules.nix-flatpak nix-ld.nixosModules.nix-ld - ./modules/common/nix-core.nix - ./modules/common/host-users.nix + ./modules/common/core.nix + ./modules/common/users.nix ./modules/machine/cloud/hardware-configuration.nix ./modules/machine/cloud/configuration.nix diff --git a/modules/common/nix-core.nix b/modules/common/core.nix similarity index 70% rename from modules/common/nix-core.nix rename to modules/common/core.nix index 7cf35df..1bd62c9 100644 --- a/modules/common/nix-core.nix +++ b/modules/common/core.nix @@ -9,13 +9,6 @@ # Allow unfree packages nixpkgs.config.allowUnfree = true; - # Auto upgrade nix package and the daemon service. - # services.nix-daemon.enable = true; - # Use this instead of services.nix-daemon.enable if you - # don't wan't the daemon service to be managed for you. - # nix.useDaemon = true; - services.nix-daemon.enable = true; - nix.package = pkgs.nix; # do garbage collection weekly to keep disk usage low diff --git a/modules/common/host-users.nix b/modules/common/users.nix similarity index 66% rename from modules/common/host-users.nix rename to modules/common/users.nix index 4d8d4df..d8185d8 100644 --- a/modules/common/host-users.nix +++ b/modules/common/users.nix @@ -1,4 +1,5 @@ { + lib, pkgs, userName, hostname, @@ -15,13 +16,21 @@ # Set up user accounts # Don't forget to set a password with ‘passwd’! - users.users."${userName}" = { - home = - if pkgs.stdenv.isDarwin - then "/Users/${userName}" - else "/home/${userName}"; - description = userName; - }; + users.users."${userName}" = lib.mkMerge [ + { + home = + if pkgs.stdenv.isDarwin + then "/Users/${userName}" + else "/home/${userName}"; + description = userName; + } + + (lib.mkIf (pkgs.stdenv.isLinux) { + group = "${userName}"; + isNormalUser = true; + }) + ]; + users.groups.wyatt = {}; nix.settings.trusted-users = [userName]; diff --git a/modules/machine/cloud/configuration.nix b/modules/machine/cloud/configuration.nix index dd59431..e9df964 100644 --- a/modules/machine/cloud/configuration.nix +++ b/modules/machine/cloud/configuration.nix @@ -200,10 +200,10 @@ arguments = "-v -o pw"; }; - users.users."${userName}" = { - group = "${userName}"; - isNormalUser = true; - }; + # users.users."${userName}" = { + # group = "${userName}"; + # isNormalUser = true; + # }; system.stateVersion = "24.05"; } diff --git a/modules/machine/sephiroth/configuration.nix b/modules/machine/sephiroth/configuration.nix index ec82bb5..f2adfad 100644 --- a/modules/machine/sephiroth/configuration.nix +++ b/modules/machine/sephiroth/configuration.nix @@ -168,6 +168,12 @@ pkgs.bash ]; + # Auto upgrade nix package and the daemon service. + # services.nix-daemon.enable = true; + # Use this instead of services.nix-daemon.enable if you + # don't wan't the daemon service to be managed for you. + services.nix-daemon.enable = true; + system.stateVersion = 5; # Set your time zone. -- 2.45.2 From 17da032af011ae75c3bb5321163753a069180d70 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sun, 17 Nov 2024 18:14:29 -0500 Subject: [PATCH 16/17] removed comment --- modules/machine/cloud/configuration.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/machine/cloud/configuration.nix b/modules/machine/cloud/configuration.nix index e9df964..ea02bb2 100644 --- a/modules/machine/cloud/configuration.nix +++ b/modules/machine/cloud/configuration.nix @@ -151,8 +151,6 @@ }; }; - # environment. - # Firewall stuff not allowed in common user and network creation networking.firewall.enable = true; # VERY important, do not touch networking.firewall.allowedTCPPorts = []; -- 2.45.2 From 97818fbaf943f43fd0135a312182f4252a7ff5c2 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sun, 17 Nov 2024 18:21:00 -0500 Subject: [PATCH 17/17] added additional install command --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1265ad7..3faefc5 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Make sure the following is installed: If you don't have `git` installed and are running macOS, run the following command: ```bash -sudo xcode-select +sudo xcode-select --install ``` If you don't have `nix` installed and are running Linux, use the Determinate Nix Installer! @@ -57,6 +57,12 @@ For macOS systems: nix run nix-darwin --extra-experimental-features nix-command --extra-experimental-features flakes -- switch --flake .# ``` +_or_ + +```bash +darwin-rebuild switch --flake .# +``` + where `` is the particular configuration you would like to run. Non-NixOS Linux systems should be coming soon! -- 2.45.2