From cd92b28dc647e1ae871ec0e25513c32eac56fd61 Mon Sep 17 00:00:00 2001 From: Jimbo Date: Sat, 12 Oct 2024 20:44:05 -0400 Subject: [PATCH] ''infinite recursion encountered.'' --- flake.nix | 152 ++++++++---------- hosts/cyberspark/home/default.nix | 14 ++ hosts/cyberspark/system/default.nix | 18 +++ .../cyberspark/system/hardware}/default.nix | 0 hosts/firefly/home/default.nix | 13 ++ hosts/firefly/system/default.nix | 24 +++ .../firefly/system/hardware}/default.nix | 0 .../shuttleworth/system/hardware}/default.nix | 0 modules/profiles/pc/home/default.nix | 12 -- modules/profiles/pc/system/default.nix | 17 -- modules/profiles/server/home/default.nix | 14 -- modules/profiles/server/system/default.nix | 17 -- modules/system/desktop/default.nix | 1 - modules/system/devices/default.nix | 1 - modules/system/programs/security/default.nix | 2 - modules/system/services/pc/default.nix | 2 + .../pc}/gnome-keyring/default.nix | 0 .../pc}/polkit/default.nix | 0 overlays/default.nix | 8 + overlays/unstable/default.nix | 7 + 20 files changed, 152 insertions(+), 150 deletions(-) create mode 100644 hosts/cyberspark/home/default.nix create mode 100644 hosts/cyberspark/system/default.nix rename {modules/system/hardware/cyberspark => hosts/cyberspark/system/hardware}/default.nix (100%) create mode 100644 hosts/firefly/home/default.nix create mode 100644 hosts/firefly/system/default.nix rename {modules/system/hardware/firefly => hosts/firefly/system/hardware}/default.nix (100%) rename {modules/system/hardware/shuttleworth => hosts/shuttleworth/system/hardware}/default.nix (100%) delete mode 100644 modules/profiles/pc/home/default.nix delete mode 100644 modules/profiles/pc/system/default.nix delete mode 100644 modules/profiles/server/home/default.nix delete mode 100644 modules/profiles/server/system/default.nix rename modules/system/{programs/security => services/pc}/gnome-keyring/default.nix (100%) rename modules/system/{programs/security => services/pc}/polkit/default.nix (100%) create mode 100644 overlays/default.nix create mode 100644 overlays/unstable/default.nix diff --git a/flake.nix b/flake.nix index 83278e3..f28a8fa 100644 --- a/flake.nix +++ b/flake.nix @@ -28,105 +28,85 @@ nur, mailserver, blender-bin, - minecraft, hardware, lanzaboote, home-manager, ... - } @inputs: - let - channels = { - stable = import nixpkgs { - inherit (flake) system overlays; - config.allowUnfree = true; - }; - unstable = import unstable { inherit (flake) system; }; - nur = import nur { nurpkgs = import nixpkgs { inherit (flake) system; }; }; - }; + } @inputs: let + inherit (self) outputs; + forAllSystems = nixpkgs.lib.genAttrs [ + "aarch64-linux" + "x86_64-linux" + ]; + in rec { + packages = forAllSystems (system: import ./packages nixpkgs.legacyPackages.${system}); - flake = { - overlays = [ - nur.overlay - minecraft.overlay - (import ./overlays/mpv { inherit (self) inputs channels; }) - ]; - packages = import ./packages/default.nix { inherit (nix) pkgs; }; - }; - - nix = rec { - pkgs = channels.stable // flake.packages; - inherit (pkgs) lib; - inherit (flake) channels-config; - }; - - mkNixos = modules: nixpkgs.lib.nixosSystem { - inherit (nix) pkgs; - system = "x86_64-linux"; - specialArgs = { - inherit - inputs - ; - }; - }; - - mkHome = modules: pkgs: home-manager.lib.homeManagerConfiguration { - inherit (nix) pkgs; - }; - in { - # Variables defined globally - secrets = import ./extras/secrets.nix; - cmd = import ./extras/cmd.nix; - displays = import ./extras/displays.nix; - ips = import ./extras/ips.nix; - look = import ./extras/look.nix; - ws = import ./extras/workspaces.nix; + # Variables defined so they can be accessed globally + secrets = import ./variables/secrets; + cmd = import ./variables/cmd; + displays = import ./variables/displays; + ips = import ./variables/ips; + look = import ./variables/look; + ws = import ./variables/workspaces; # NixOS config entrypoint, use 'nixos-rebuild --flake .#your-hostname' nixosConfigurations = { - firefly = mkNixos [ - ./modules/system/hardware/firefly - ./modules/system - ./modules/system/desktop - ./modules/system/devices - ./modules/system/programs - ./modules/system/services/ssh - ./modules/system/services/sunshine - ./modules/system/services/networkfs - ./modules/system/services/virtualization - lanzaboote.nixosModules.lanzaboote - ]; - JimServer = mkNixos [ - ./system/hosts/JimServer/configuration.nix - mailserver.nixosModule - ]; - JimPine = mkNixos [ - ./system/hosts/JimPine/configuration.nix - hardware.nixosModules.pine64-pinebook-pro - ]; + firefly = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs outputs;}; + modules = [ + ./hosts/firefly/system + lanzaboote.nixosModules.lanzaboote + ]; + }; + cyberspark = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs outputs;}; + modules = [ + ./system/hosts/JimServer/configuration.nix + mailserver.nixosModule + ]; + }; + shuttleworth = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs outputs;}; + modules = [ + ./system/hosts/JimPine/configuration.nix + hardware.nixosModules.pine64-pinebook-pro + ]; + }; }; # Home-manager configuration, use 'home-manager --flake .#your-username@your-hostname' homeConfigurations = { - "jimbo@JimDesktop" = mkHome [ - ./modules/home - ./modules/home/files - ./modules/home/programs - ./modules/home/settings - ./modules/home/sway - ./modules/home/utils - nur.nixosModules.nur - ]; - "jimbo@JimServer" = mkHome [ - ./home/hosts/JimServer/home.nix - ]; - "jimbo@JimPine" = mkHome [ - ./home/hosts/JimPine/home.nix - nur.nixosModules.nur - ]; + "jimbo@firefly" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = {inherit inputs outputs;}; + modules = [ + ./home/hosts/JimDesktop/home.nix + nur.nixosModules.nur + ]; + }; + "jimbo@cyberspark" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = {inherit inputs outputs;}; + modules = [ + ./home/hosts/JimServer/home.nix + ]; + }; + "jimbo@shuttleworth" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.aarch64-linux; + extraSpecialArgs = {inherit inputs outputs;}; + modules = [ + ./home/hosts/JimPine/home.nix + nur.nixosModules.nur + ]; + }; # Derivation for ssh envrionments on other people's servers - "jimbo@JimTerminal" = mkHome [ - ./home/hosts/JimTerminal/home.nix - ]; + "jimbo@JimTerminal" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = {inherit inputs outputs;}; + modules = [ + ./home/hosts/JimTerminal/home.nix + ]; + }; }; }; } diff --git a/hosts/cyberspark/home/default.nix b/hosts/cyberspark/home/default.nix new file mode 100644 index 0000000..fa95c6f --- /dev/null +++ b/hosts/cyberspark/home/default.nix @@ -0,0 +1,14 @@ +{ ... }: +{ + imports = [ + ../../../modules/home + ../../../modules/home/users + ../../../modules/home/programs/fastfetch + ../../../modules/home/programs/git + ../../../modules/home/programs/ncmpcpp + ../../../modules/home/programs/neovim + ../../../modules/home/programs/ranger + ../../../modules/home/programs/tmux + ../../../modules/home/utils/zsh + ]; +} diff --git a/hosts/cyberspark/system/default.nix b/hosts/cyberspark/system/default.nix new file mode 100644 index 0000000..ccc189a --- /dev/null +++ b/hosts/cyberspark/system/default.nix @@ -0,0 +1,18 @@ +{ ... }: +{ + imports = [ + ./hardware + ../../../modules/system + ../../../modules/system/accounts + ../../../modules/system/devices/filesystems + ../../../modules/system/devices/networking + ../../../modules/system/devices/networking/firewall/server + ../../../modules/system/devices/networking/wireguard/server + ../../../modules/system/programs/git + ../../../modules/system/programs/security + ../../../modules/system/services/common + ../../../modules/system/services/server + ]; + + networking.hostName = "cyberspark"; +} diff --git a/modules/system/hardware/cyberspark/default.nix b/hosts/cyberspark/system/hardware/default.nix similarity index 100% rename from modules/system/hardware/cyberspark/default.nix rename to hosts/cyberspark/system/hardware/default.nix diff --git a/hosts/firefly/home/default.nix b/hosts/firefly/home/default.nix new file mode 100644 index 0000000..bcf34d2 --- /dev/null +++ b/hosts/firefly/home/default.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + imports = [ + ../../../overlays + ../../../modules/home + ../../../modules/home/users + ../../../modules/home/files + ../../../modules/home/settings + ../../../modules/home/programs + ../../../modules/home/sway + ../../../modules/home/utils + ]; +} diff --git a/hosts/firefly/system/default.nix b/hosts/firefly/system/default.nix new file mode 100644 index 0000000..e738cec --- /dev/null +++ b/hosts/firefly/system/default.nix @@ -0,0 +1,24 @@ +{ ... }: +{ + imports = [ + # Apps and programs + ../../../overlays + ../../../modules/system + ../../../modules/system/accounts + ../../../modules/system/desktop + ../../../modules/system/programs + ../../../modules/system/services + + # Devices and hardware + ./hardware + ../../../modules/system/devices + ../../../modules/system/devices/boot/lanzaboote + ../../../modules/system/devices/video/nvidia + ../../../modules/system/devices/networking/firewall/server + ]; + + networking.hostName = "firefly"; + + # Force Electron to use Wayland + environment.sessionVariables.NIXOS_OZONE_WL = "1"; +} diff --git a/modules/system/hardware/firefly/default.nix b/hosts/firefly/system/hardware/default.nix similarity index 100% rename from modules/system/hardware/firefly/default.nix rename to hosts/firefly/system/hardware/default.nix diff --git a/modules/system/hardware/shuttleworth/default.nix b/hosts/shuttleworth/system/hardware/default.nix similarity index 100% rename from modules/system/hardware/shuttleworth/default.nix rename to hosts/shuttleworth/system/hardware/default.nix diff --git a/modules/profiles/pc/home/default.nix b/modules/profiles/pc/home/default.nix deleted file mode 100644 index 548a355..0000000 --- a/modules/profiles/pc/home/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: -{ - imports = [ - ../../../home - ../../../home/users - ../../../home/files - ../../../home/settings - ../../../home/programs - ../../../home/sway - ../../../home/utils - ]; -} diff --git a/modules/profiles/pc/system/default.nix b/modules/profiles/pc/system/default.nix deleted file mode 100644 index 8cd65bc..0000000 --- a/modules/profiles/pc/system/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ ... }: -{ - imports = [ - ../../../system - ../../../system/accounts - ../../../system/desktop - ../../../system/devices - ../../../system/devices/networking/firewall/server - ../../../system/programs - ../../../system/services - ]; - - networking.hostName = "firefly"; - - # Force Electron to use Wayland - environment.sessionVariables.NIXOS_OZONE_WL = "1"; -} diff --git a/modules/profiles/server/home/default.nix b/modules/profiles/server/home/default.nix deleted file mode 100644 index ceff00b..0000000 --- a/modules/profiles/server/home/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ ... }: -{ - imports = [ - ../../../home - ../../../home/users - ../../../home/programs/fastfetch - ../../../home/programs/git - ../../../home/programs/ncmpcpp - ../../../home/programs/neovim - ../../../home/programs/ranger - ../../../home/programs/tmux - ../../../home/utils/zsh - ]; -} diff --git a/modules/profiles/server/system/default.nix b/modules/profiles/server/system/default.nix deleted file mode 100644 index c3d5a03..0000000 --- a/modules/profiles/server/system/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ ... }: -{ - imports = [ - ../../../system - ../../../system/accounts - ../../../system/devices/filesystems - ../../../system/devices/networking - ../../../system/devices/networking/firewall/server - ../../../system/devices/networking/wireguard/server - ../../../system/programs/git - ../../../system/programs/security - ../../../system/services/common - ../../../system/services/server - ]; - - networking.hostName = "cyberspark"; -} diff --git a/modules/system/desktop/default.nix b/modules/system/desktop/default.nix index 8cf5d39..e413a8c 100644 --- a/modules/system/desktop/default.nix +++ b/modules/system/desktop/default.nix @@ -4,6 +4,5 @@ ./qt ./wayland ./sway - ./fonts ]; } diff --git a/modules/system/devices/default.nix b/modules/system/devices/default.nix index 6e6ad7a..64ae809 100644 --- a/modules/system/devices/default.nix +++ b/modules/system/devices/default.nix @@ -6,7 +6,6 @@ ./networking ./pipewire ./printing - ./security ./udev ./video ]; diff --git a/modules/system/programs/security/default.nix b/modules/system/programs/security/default.nix index 5815e87..d9e1871 100644 --- a/modules/system/programs/security/default.nix +++ b/modules/system/programs/security/default.nix @@ -3,7 +3,5 @@ imports = [ ./apparmor ./doas - ./gnome-keyring - ./polkit ]; } diff --git a/modules/system/services/pc/default.nix b/modules/system/services/pc/default.nix index 0e07249..070fbe0 100644 --- a/modules/system/services/pc/default.nix +++ b/modules/system/services/pc/default.nix @@ -1,8 +1,10 @@ { ... }: { imports = [ + ./gnome-keyring ./mpd ./networkfs + ./polkit ./school ./sunshine ./virtualization/qemu diff --git a/modules/system/programs/security/gnome-keyring/default.nix b/modules/system/services/pc/gnome-keyring/default.nix similarity index 100% rename from modules/system/programs/security/gnome-keyring/default.nix rename to modules/system/services/pc/gnome-keyring/default.nix diff --git a/modules/system/programs/security/polkit/default.nix b/modules/system/services/pc/polkit/default.nix similarity index 100% rename from modules/system/programs/security/polkit/default.nix rename to modules/system/services/pc/polkit/default.nix diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..88a592c --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,8 @@ +{ outputs, inputs, ... }: +{ + nixpkgs.overlays = [ + inputs.blender-bin.overlays.default + (import ./mpv) + (import ./unstable) + ]; +} diff --git a/overlays/unstable/default.nix b/overlays/unstable/default.nix new file mode 100644 index 0000000..da19bb8 --- /dev/null +++ b/overlays/unstable/default.nix @@ -0,0 +1,7 @@ +{ config, inputs, ... }: +(final: prev: { + unstable = import inputs.nixpkgs-unstable { + system = final.system; + config.allowUnfree = true; + }; +})